×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    24

    IP Address of WAP APN

    I use the code below on a nokia 3650 to establish a WSP connection. The problem is that on one phone it works well, but on another one, after selecting the WAP APN in the StartOutgoing, the APN IP address which I read is 0.0.0.0
    It seems that the correct address was not set in commdb. Does anybody know why, or what should I do to get the IP Address of the APN which the user selects?
    Thanks.

    RGenericAgent agent;
    TBool isActive;
    TBuf8<100> RemoteHost;

    User::LeaveIfError(agent.Open());

    agent.NetworkActive(isActive);

    if(!isActive)
    {
    TRequestStatus st;
    //CEikonEnv::InfoWinL(_L("Agent:"),_L("Network is not active"));
    agent.StartOutgoing(st);
    User::WaitForRequest(st);
    }

    wServ.Connect();


    // now try to get the APN:


    CCommsDatabase* comDB=CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(comDB);


    CApDataHandler *datHand=CApDataHandler::NewLC(*comDB);
    CleanupStack::Pop(datHand);
    CApAccessPointItem* ap= CApAccessPointItem::NewLC();
    CleanupStack::Pop(ap);


    TUint32 id;

    comDB->GetGlobalSettingL(TPtrC(WAP_ACCESS_POINT),id);


    TBuf16<100> ms;
    //This code is to read the IP address and all
    datHand->AccessPointDataL(id,*ap);
    ap->ReadTextL(EApWapGatewayAddress,ms); //put appropriate constants to read rest of info like user name...


    CleanupStack::Pop(1);
    delete comDB;


    CnvUtfConverter cnv;
    cnv.ConvertFromUnicodeToUtf8(RemoteHost,ms);

    CEikonEnv::InfoWinL(_L("APN:"),ms);
    Last edited by greenfrog; 2003-10-28 at 11:37.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×