专题一 Symbian 如何获取通信参数获取之WLan MAC
2010-01-26 16:35
169 查看
一、开发环境:
1. IDE:Carbide C++2.0
2. SDK:Symbian S60 3rd +API plug-in for S60 3rd
二、功能介绍
1.获取Symbian S60 3rd手机WLan mac地址。
2.获取Symbian S60 3rd手机WLan 状态。
三、开发说明:
1.新建Symbian OS C++ project.
2.工程类型选择:Gui Application
3.引入头文件:
#include <e32property.h>
#include <wlaninternalpskeys.h>
4.引入Lib文件:euser
5.添加Menu项:
EWLanMAC,
EWLanStatus
6.添加EWLanMAC的响应函数:
void CWLanInfoAppUi::GetWLanMacAddress()
{
TBuf8<20> address;
TInt ret=RProperty::Get(KPSUidWlan,KPSWlanMacAddress,address);
if(ret!=KErrNone)
{
if(ret==KErrNotFound)
CEikonEnv::InfoWinL(_L("WLan MAC Address /n"),_L("Not Found"));
}
else
{
TBuf<20> wlanMACAddress;
for ( TInt i = 0; i < address.Length(); i++ )
{
TUint16 addbyte = address[i];
wlanMACAddress.AppendNum( addbyte,EHex );
if(i < address.Length()-1)
wlanMACAddress.Append(_L(":"));
}
CEikonEnv::InfoWinL(_L("WLan MAC Address /n"),wlanMACAddress);
}
}
7.添加EWLanStatus的消息相应函数:
void CWLanInfoAppUi::GetWLanIndicatorStatus()
{
TInt value;
RProperty::Get(KPSUidWlan,KPSWlanIndicator,value);
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
TBuf<25> msg;
switch(value)
{
case EPSWlanIndicatorNone:
{
msg.Copy(_L("No Wlan Indicator"));
informationNote->ExecuteLD(msg);
break;
}
case EPSWlanIndicatorAvailable:
{
msg.Copy(_L("Wlan Indicator Available"));
informationNote->ExecuteLD(msg);
break;
}
case EPSWlanIndicatorActive:
{
msg.Copy(_L("Wlan is Active"));
informationNote->ExecuteLD(msg);
break;
}
case EPSWlanIndicatorActiveSecure:
{
msg.Copy(_L("Wlan is Active & secure")); // WEP key enabled
informationNote->ExecuteLD(msg);
break;
}
}
}
1. IDE:Carbide C++2.0
2. SDK:Symbian S60 3rd +API plug-in for S60 3rd
二、功能介绍
1.获取Symbian S60 3rd手机WLan mac地址。
2.获取Symbian S60 3rd手机WLan 状态。
三、开发说明:
1.新建Symbian OS C++ project.
2.工程类型选择:Gui Application
3.引入头文件:
#include <e32property.h>
#include <wlaninternalpskeys.h>
4.引入Lib文件:euser
5.添加Menu项:
EWLanMAC,
EWLanStatus
6.添加EWLanMAC的响应函数:
void CWLanInfoAppUi::GetWLanMacAddress()
{
TBuf8<20> address;
TInt ret=RProperty::Get(KPSUidWlan,KPSWlanMacAddress,address);
if(ret!=KErrNone)
{
if(ret==KErrNotFound)
CEikonEnv::InfoWinL(_L("WLan MAC Address /n"),_L("Not Found"));
}
else
{
TBuf<20> wlanMACAddress;
for ( TInt i = 0; i < address.Length(); i++ )
{
TUint16 addbyte = address[i];
wlanMACAddress.AppendNum( addbyte,EHex );
if(i < address.Length()-1)
wlanMACAddress.Append(_L(":"));
}
CEikonEnv::InfoWinL(_L("WLan MAC Address /n"),wlanMACAddress);
}
}
7.添加EWLanStatus的消息相应函数:
void CWLanInfoAppUi::GetWLanIndicatorStatus()
{
TInt value;
RProperty::Get(KPSUidWlan,KPSWlanIndicator,value);
CAknInformationNote* informationNote = new (ELeave) CAknInformationNote;
TBuf<25> msg;
switch(value)
{
case EPSWlanIndicatorNone:
{
msg.Copy(_L("No Wlan Indicator"));
informationNote->ExecuteLD(msg);
break;
}
case EPSWlanIndicatorAvailable:
{
msg.Copy(_L("Wlan Indicator Available"));
informationNote->ExecuteLD(msg);
break;
}
case EPSWlanIndicatorActive:
{
msg.Copy(_L("Wlan is Active"));
informationNote->ExecuteLD(msg);
break;
}
case EPSWlanIndicatorActiveSecure:
{
msg.Copy(_L("Wlan is Active & secure")); // WEP key enabled
informationNote->ExecuteLD(msg);
break;
}
}
}
相关文章推荐
- 专题一 Symbian如何获取通讯参数之Signal Strength
- 如何在JS代码里获取浏览器地址栏传过来的参数/页面间传值
- 如何获取iphone基带芯片工作时候获取到的一些参数呢,如信号强度,小区,周围小区以及一些更深入的参数,有人了解吗
- 如何获取url#号后的参数
- 如何获取照片的拍照时间及相关参数
- struts2中action如何获取Session,jsp页面参数等等信息的值
- Java如何把链接中的参数在页面使用参数名字获取ModelMap model去页面显示或者处理
- Java如何获取方法参数的参数名称?
- 如何获取本机的MAC和IP
- 如何获取本机的MAC和IP
- 如何获取shell脚本的可选参数
- Linux下如何获取网络设备MAC地址
- spring mvc如何获取问号后的url参数
- 如何在SQL Server中从触发器中获取引发该触发器的SQL语句内的相应参数?
- struts2中action如何获取Session,jsp页面参数等等信息的值
- 润乾报表V5自定义函数中当有多个参数时如何获取
- php中如何用$_GET[ ]方法获取相同参数第二个值?
- asp.net如何获取客户端网卡mac地址
- 如何用ASP来获取网卡的MAC地址
- struts2--前台数据通过参数传给后台,后台如何获取参数