Categories: S60 | Symbian C++ | Connectivity | WLAN
This page was last modified 14:11, 2 April 2008.
WLAN Info API
From Forum Nokia Wiki
| Note! |
|---|
|
The WLAN Info API provides publish & subscribe keys for WLAN using which we can retrieve MAC Address and also check the WLAN status.
WLAN MAC address is also usually found printed on the phone underneath the battery.The star-hash code is : *#62209526#
Use cases
These P&S keys are useful to retrieve MAC Address even when there is no WLAN connection established.
They are useful to find out whether the WLAN connection is open type or WEP secured.
Example code
Header files
#include <wlaninternalpskeys.h> #include <e32property.h>
LIBRARY euser.lib
The following UID & UInt values are provided in wlaninternalpskeys.h header.
const TUid KPSUidWlan = { 0x101f8ec5 }; const TUint KPSWlanMacAddress = 0x00000001; const TUint KPSWlanIndicator = 0x00000002;
The RProperty type of KPSWlanMacAddress property is EByteArray.
The following code gives the unique WLAN MAC Address:
TBuf8<20> address; RProperty::Get(KPSUidWlan,KPSWlanMacAddress,address); TBuf<20> wlanMACAddress; for ( TInt i = 0; i < address.Length(); i++ ) { TUint16 addbyte = address[i]; wlanMACAddress.AppendFormat(_L("%02X:"), addbyte); } if ( wlanMACAddress.Length() ) // remove trailing ':' { wlanMACAddress.Delete(wlanMACAddress.Length()-1, 1); } CEikonEnv::InfoWinL(_L("WLan MAC Address \n"),wlanMACAddress);
The RProperty type of KPSWlanIndicator property is EInt.
The following code gives the information about WLAN connection:
TInt value; RProperty::Get(KPSUidWlan,KPSWlanIndicator,value); CAknInformationNote* informationNote = new (ELeave) CAknInformationNote; TBuf<30> msg; switch(value) { case EPSWlanIndicatorNone: { msg.Copy(_L("No Wlan Indicator")); informationNote->ExecuteLD(msg); break; } case EPSWlanIndicatorActive: { msg.Copy(_L("Wlan is Active")); informationNote->ExecuteLD(msg); break; } ...... ...... }
Example project
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| howto receive Wlan iap -> wlan network name | miikkis | Symbian Networking & Messaging | 1 | 2008-06-03 06:37 |
| Problem in RTSP Strreaming | sajidul | General Symbian C++ | 4 | 2007-01-29 11:15 |
| WEP key of WLAN IAP? | chishti_hameed | Symbian Networking & Messaging | 5 | 2006-10-23 21:03 |
| OMA Provisioning content v1.2 | Andas | Developer Resources Feedback (Documentation, Examples, Training) | 13 | 2007-05-08 09:08 |
| WLAN CONNECTS, BUT NOT WORKING WELL | MacF | Symbian Networking & Messaging | 0 | 2006-12-27 12:36 |
