Indeed there is a problem with the WLAN Info API. I am troubble shooting it for 4 days now. I didn't find a solution yet.
I am using this code:
The line in red is ok, I mean that WLAN Info API retrieves the information without problems, but the problem is in this code somewhere as my phone crashes randomly but always. I mean that it doesn't crash everytime I use the function, but only sometimes. Anyway, if I try to call the function for lets say 10 times it surely crashes. Sometimes it just crashes (without any error) and sometimes the phone gets restarted. I am using Nokia N95.
* Constants for XML representation
_LIT(KXMLWNETTag, "<Network id=\"%d\">");
void CWLANInfo::GetWLANInfo(TDes &infoBuff)
if(iWLANMgmtClient == NULL || iScanInfo == NULL)
TInt i=1, k;
_LIT(KSSIDUnknown, "SSID Unknown");
for(iScanInfo->First(); !iScanInfo->IsDone(); iScanInfo->Next() )
//In general if the least significant bit of the capbility field
//is 1 then the network is of "Infrastructure Type" or else if the
//capability field is 0 then the network is of "Ad-hoc type"
TInt lanType=capability & pad;
iScanInfo->Bssid( bssid );
for(k = 0; k < bssid.Length(); k++)
//remove last :
//Get transmision level
TInt8 rxLevel = iScanInfo->RXLevel();
paipeng, are you using aprox. the same code as me?
If someone knows what is the problem please advice, it would be very helpful. Also... as I posted before, the guys from Nokia forgot to put a Cancel routing for the asynchronous version of GetScanResults.
If I discover the problem I'll say.