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.

S60 3rd关闭蓝牙

From Wiki
Jump to: navigation, search
Article Metadata

文章
tyeen 在 05 Feb 2009 创建
最后由 hamishwillee 在 15 Dec 2011 编辑

谁能改改这篇文章格式,没写过wiki,献丑了....

   去年做一个蓝牙的小程序,最后想实现程序退出时自动关闭蓝牙,但是试过好多办法都没有结果,最终论坛的cxt_programmer提供了文章链接,看过后豁然开朗。后来cxt说总结一下,当时因为网络不方便,加上程序待完善,拖到了今天,很不应该。现在献丑总结一下我关闭蓝牙的办法:
   首先要说明的是,要关闭蓝牙必须有 WriteDeviceData 的权限,Carbide自带的签名权限是不够的,可以去别的手机论坛或SymbianSign去申请证书。
   下面是我关闭蓝牙的代码:

CBTMCMSettings* btSettings = CBTMCMSettings::NewL( (MBTMCMSettingsCB*)NULL );
TInt ret = btSettings->SetPowerState( EFalse );

   这样就可以关闭蓝牙了。
   使用CBTMCMSettings类,需要的头文件是bteng.h,需要的库是bteng.lib。二者是在nokia提供的扩展包里的,carbide里并不提供。可以从www.forum.nokia.com上下载,这里提供一个3rd_fp1版本的扩展包的下载链接
   [[1]]
This page was last modified on 15 December 2011, at 06:08.
296 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.

×