Discussion Board
question about connecting an IAP
2005-01-20, 08:36
#1
Registered User
I would like that my aplication select an GPRS IAP and establishes this connection.
I have got an UId from CommDb and set the UId in bearer.iIapId,but the istatus always return KErrCouldNotConnect. Who can check my code and tell me why not create the connection?
my code:
CCommsDatabase* CommDb = CCommsDatabase::NewL(EDatabaseTypeIAP);
CleanupStack::PushL(CommDb);
CApSelect* ApSelect = CApSelect::NewLC(*CommDb, KEApIspTypeAll ,EApBearerTypeAll ,KEApSortUidAscending);
CApDataHandler* datHand=CApDataHandler::NewLC(*CommDb);
CApAccessPointItem* apItem = CApAccessPointItem::NewLC();
if (ApSelect->MoveToFirst())
{
do
{
TUint uid = ApSelect->Uid();
datHand->AccessPointDataL(uid, *apItem);
TBuf<128> aIAPName;
apItem->ReadTextL(EApWapAccessPointName, aIAPName);
TInt rec = aIAPName.Find(_L("MY GPRS"));
if (rec !=KErrNotFound) {
apItem->ReadUint(EApWapAccessPointID, aIap); //return aIap = 4
break;
}
}
while(ApSelect->MoveNext());
}
CleanupStack::PopAndDestroy(4);
iPref.iRanking = 1;
iPref.iDirection = ECommDbConnectionDirectionOutgoing;
iPref.iDialogPref = ECommDbDialogPrefDoNotPrompt;
CCommsDbConnectionPrefTableView::TCommDbIapBearer bearer;
bearer.iBearerSet = ECommDbBearerGPRS;
bearer.iIapId =aIap;//aIap=4;
iPref.iBearer = bearer;
iStatus = KRequestPending;
iConnect->ConnectL(iPref, iStatus);
SetActive();
in RunL():
the istatus return KErrCouldNotConnect
But "MY GPRS" is the 4th of the iap list.I think the aIap is correct.why could not connect?
somebody help me
2005-01-24, 02:21
#2
Registered User
Regular Contributor
Hi,
This link will solve your problem.
If you have any more issues...can write to me.
http://discussion.forum.nokia.com/fo...threadid=55424
Cheers
Alok Kumar
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules