Namespaces
Variants
Actions

WLAN Management API

Jump to: navigation, search
Article Metadata

Code Example
Source file: Media:WLanEx.zip

Article
Created: ltomuta (17 Jun 2007)
Last edited: hamishwillee (08 May 2013)


Note.png
Note: :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 8 May 2013, at 03:00.
143 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved