Categories: S60 | Symbian C++ | Connectivity | WLAN
This page was last modified 10:45, 2 February 2008.
WLAN Management API
From Forum Nokia Wiki
| Note! |
|---|
|
The WLAN Management APIs provide the necessary functions to scan through the WLAN network and get various kinds of information such as:
1) By using MWlanMgmtInterface::ActivateNotificationsL to subscribe to WLAN indications. You will then get MWlanMgmtNotifications::BssidChanged notification when the BSSID changes.
2) By using MWlanMgmtInterface::GetConnectionSignalQuality we can get the current signal strength of the established WLAN connection.
3) The instantaneous signal level of the hot spots can be retrieved using the RXLevel() API.
4) We can also scan for WLAN network and get other details as explained in the following
Capabilities Required:
NetworkServices ReadUserData WriteUserData ReadDeviceData
code snippet:
void CWLanSampleExAppUi::ScanNetworksL() { TBuf<10> infoBuff; TInt securityMode; CWlanScanInfo* scanInfo=CWlanScanInfo::NewL(); CleanupStack::PushL(scanInfo); CWlanMgmtClient* client=CWlanMgmtClient::NewL(); CleanupStack::PushL(client); TInt i=1; client->GetScanResults(*scanInfo); for(scanInfo->First(); !scanInfo->IsDone(); scanInfo->Next() ) { ibuff.Zero(); ibuff.AppendNum(i); CEikonEnv::InfoWinL(_L("Network"),ibuff); i++; securityMode=scanInfo->SecurityMode(); if(securityMode==0) { CEikonEnv::InfoWinL(_L("SecurityMode"),_L("Open")); } else if(securityMode==1) { CEikonEnv::InfoWinL(_L("SecurityMode"),_L("WEP Mode")); } else if(securityMode==2) { CEikonEnv::InfoWinL(_L("SecurityMode"),_L("802d1x Mode")); } else if(securityMode==3) { CEikonEnv::InfoWinL(_L("SecurityMode"),_L("WPA")); } //In general if the least significant bit of the capability 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" TUint16 capability=scanInfo->Capability(); TInt pad(1); TInt lanType=capability & pad; if(lanType==1) CEikonEnv::InfoWinL(_L("Network mode"),_L("Infrastructure")); else CEikonEnv::InfoWinL(_L("Network mode"),_L("Adhoc")); infoBuff.Zero(); TWlanBssid bssid; scanInfo->Bssid( bssid ); ibuff.Zero(); ibuff.Copy(bssid);''' CEikonEnv::InfoWinL(_L("BSSID"),ibuff);''' } CleanupStack::PopAndDestroy(2); }
NOTE: Commanding the handover between two hot spots is not possible via any interface; the WLAN subsystem controls roaming and the subsystem will automatically select the best WLAN AP available and hence there are no APIs available for commanding handover between two hot spots. The roaming threshold is by default 80 (-80dBm).
Example project
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| code & WLAN | DanBenjamin | General Discussion | 1 | 2007-11-27 07:13 |
| why can't Start-On-Boot Api be downloaded? | Casper1314 | General Symbian C++ | 4 | 2006-10-09 07:10 |
| How to understand BeaconInterval? | ramis55 | General Symbian C++ | 6 | 2007-08-24 11:58 |
| N95 WiLan Connection problem | TingHan | Wired and Wireless interfaces | 5 | 2007-07-18 21:09 |
| Midlet/WLAN S60 problems | gifvars | Mobile Java Networking & Messaging & Security | 0 | 2007-08-07 15:29 |
