专题一 Symbian如何获取通讯参数之Signal Strength
2010-01-29 14:02
288 查看
一、开发环境
IDE:Carbide.C++2.0
SDK:S60 3rd
二、功能介绍
获取手机信号的强弱(Signal Strength)。
三、开发说明
S60 3rd版本中,手机信号量的获取与之前的版本有很大的区别。主要是通过CTelephony的GetNetworkInfo()函数获取,本文提供的是SDK中的一个例子:
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TSignalStrengthV1 iSigStrengthV1;
CTelephony::TSignalStrengthV1Pckg iSigStrengthV1Pckg;
public:
CClientApp(CTelephony* aTelephony);
void SomeFunction();
private:
/*
These are the pure virtual methods from CActive that
MUST be implemented by all active objects
*/
void RunL();
void DoCancel();
};
CClientApp::CClientApp(CTelephony* aTelephony)
: CActive(EPriorityStandard),
iTelephony(aTelephony),
iSigStrengthV1Pckg(iSigStrengthV1)
{
//default constructor
}
void CClientApp::SomeFunction()
{
iTelephony->GetSignalStrength(iStatus, iSigStrengthV1Pckg);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
TInt32 sigStrength = iSigStrengthV1.iSignalStrength;
TInt8 bar = iSigStrengthV1.iBar;
}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetSignalStrengthCancel);
}
IDE:Carbide.C++2.0
SDK:S60 3rd
二、功能介绍
获取手机信号的强弱(Signal Strength)。
三、开发说明
S60 3rd版本中,手机信号量的获取与之前的版本有很大的区别。主要是通过CTelephony的GetNetworkInfo()函数获取,本文提供的是SDK中的一个例子:
#include <e32base.h>
#include <Etel3rdParty.h>
class CClientApp : public CActive
{
private:
CTelephony* iTelephony;
CTelephony::TSignalStrengthV1 iSigStrengthV1;
CTelephony::TSignalStrengthV1Pckg iSigStrengthV1Pckg;
public:
CClientApp(CTelephony* aTelephony);
void SomeFunction();
private:
/*
These are the pure virtual methods from CActive that
MUST be implemented by all active objects
*/
void RunL();
void DoCancel();
};
CClientApp::CClientApp(CTelephony* aTelephony)
: CActive(EPriorityStandard),
iTelephony(aTelephony),
iSigStrengthV1Pckg(iSigStrengthV1)
{
//default constructor
}
void CClientApp::SomeFunction()
{
iTelephony->GetSignalStrength(iStatus, iSigStrengthV1Pckg);
SetActive();
}
void CClientApp::RunL()
{
if(iStatus==KErrNone)
{
TInt32 sigStrength = iSigStrengthV1.iSignalStrength;
TInt8 bar = iSigStrengthV1.iBar;
}
}
void CClientApp::DoCancel()
{
iTelephony->CancelAsync(CTelephony::EGetSignalStrengthCancel);
}
相关文章推荐
- 专题一 Symbian 如何获取通信参数获取之WLan MAC
- 不同web如何通讯之 html页面获取传递的参数
- [Android讨论] 如何获取当前signal strength,不用onSignalStrengthsChanged
- Java如何把链接中的参数在页面使用参数名字获取ModelMap model去页面显示或者处理
- asp.net mvc 如何在View中获取Url参数的值
- 如何在SQL Server中从触发器中获取引发该触发器的SQL语句内的相应参数?
- Javascript Request获取请求参数如何实现
- 在c语言写的cgi程序中如何获取URL传递的参数
- 如何从编码过的当前url中通过get获取参数
- (转)获取android手机内部存储空间和外部存储空间的参数 && 如何决定一个apk的安装位置
- 如何获取iphone基带芯片工作时候获取到的一些参数呢,如信号强度,小区,周围小区以及一些更深入的参数,有人了解吗
- javascript如何获取URL参数的值
- java如何获取方法参数名
- post multipart/form-data 类型表单如何获取File外其他参数
- fortran如何获取命令行中输入的参数
- struts2中action如何获取Session,jsp页面参数等等信息的值
- AOP 切面的使用,以及如何在通知上获取切入方法的注解和参数
- ASP如何获取地址栏get参数(非常简单的)
- 如何用js获取浏览器URL中查询字符串的参数