I read the document and I read the wiki examples. However, it doesn't answer the question why it returns wrong signal strengths randomly.
Another related question:
Code:
void CMyWlanEngine::GetIapList( CArrayFix<TIapProperties>& aIapList, TBool WlanOnly )
{
CCommsDatabase* db = CCommsDatabase::NewL();
CleanupStack::PushL( db );
TInt bearerFilter = ( WlanOnly ? EApBearerTypeWLAN : EApBearerTypeAllBearers );
CApSelect* ap = CApSelect::NewLC(
*db,
KEApIspTypeAll,
bearerFilter,
KEApSortNameAscending,
0,
EVpnFilterBoth,
ETrue );
RArray<TUint> availableIaps;
iWlanClient->GetAvailableIaps( availableIaps );
if (! ap->MoveToFirst()) {
CleanupStack::PopAndDestroy(2); // db, ap
return;
}
aIapList.Reset();
for ( TUint i = 0; i < ap->Count(); i++, ap->MoveNext() ) {
TIapProperties iap;
iap.iName.Copy( ap->Name() );
TUint uid = iap.iUid = ap->Uid();
TInt bearer = iap.iBearer = ap->BearerType();
iap.iAvailable = EFalse;
if ( bearer & EApBearerTypeWLAN ) {
// Check whether this WLAN is available
for( TInt j = 0; j < availableIaps.Count(); j++)
if ( uid == availableIaps[j] )
iap.iAvailable = ETrue;
} else {
// GPRS/UMTS always available
iap.iAvailable = ETrue;
}
aIapList.AppendL( iap );
}
CleanupStack::PopAndDestroy( 2 ); // db, ap
}
Again with TIapProperties being a data class:
Code:
class TIapProperties
{
public:
TBuf<40> iName;
TUint32 iUid;
TInt iBearer;
TBool iAvailable;
};
For my newly created 3G connection, it returns ap->Uid()=35. However, when starting the connection with IapId=35 it results in KErrNotFound. I found out that its actual IapId is 54.
So... is this returned Uid() the same as the IapId that is used for defining the access point? If yes, why does it return a different value? If no, how do I obtain the IapId for the phone's stored Access Points.