Namespaces

Variants
Actions

Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.

WLAN Management API

From Wiki
Jump to: navigation, search
Article Metadata
Code Example
Source file: Media:WLanEx.zip
Article
Created: ltomuta (17 Jun 2007)
Last edited: hamishwillee (30 May 2013)


Note.pngNote: :This API is not part of the public SDK. It can be found in the SDK API Plug-in.

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

Headers required:

#include <wlanmgmtclient.h>

Capabilities Required:

Capability 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

File:WLanEx.zip


Related Links:

This page was last modified on 30 May 2013, at 23:39.
77 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×