Categories: Symbian C++ | S60 | Symbian OS | Connectivity | Bluetooth | Code Examples
This page was last modified 17:18, 23 June 2008.
How to set Bluetooth power state
From Forum Nokia Wiki
This document will very briefly explain how to change the Bluetooth device power state on a S60 3rd Edition device.
The information in this document is provided as is and the code samples are not meant to be of commercial quality.
Please note that you need to download and install the Extensions plug-in package for S60 3rd Edition SDK for Symbian OS, for C++, MR, Version 3 from [1] to gain access to the needed APIs.
At the time of writing, the API plugin is only available for S60 3rd MR.
The public S60 3rd Edition MR SDK includes an UID that can be utilized to toggle BT power state using a notifier. This approach however cannot handle the device discoverability setting correctly.
A better approach is to use the Bluetooth Engine API, available in the Extensions plugin mentioned above.
MBTMCMSettingsCB interface needs to be implemented and a pointer to the implementor must passed as an argument, when constructing the CBTMCMSettings object.
#include <bteng.h> // bteng.lib … CBTMCMSettings* btSettings = CBTMCMSettings::NewL( observer ); … TInt err = iBtSettings->SetPowerState( EFalse ); // or ETrue… delete iBtSettings;
Note that you can not change the power state through the central repository key: even though the key is writable, changes to it are not propagated to the stack.
For getting the Bluetooth Status (On/Off), we can use Central Repository in 3rd edition
CRepository *crepository = CRepository::NewL(KCRUidBluetoothPowerState); TInt BluetoothStatus=0; User::LeaveIfError( crepository->Get(KBTPowerState, BluetoothStatus) );
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How i can solve this !! | eng.ppu | Bluetooth Technology | 3 | 2008-06-01 14:32 |
| exe behaviour at phone power off | nubiah | General Symbian C++ | 1 | 2006-04-15 17:21 |
| Turn Bluetooth ON/OFF programatically - S60 3rd MR | heuven | Symbian Networking & Messaging | 5 | 2007-01-15 18:02 |
| WSP Transaction State | brijesh | Symbian Networking & Messaging | 0 | 2003-11-10 14:05 |
| Managing WLAN power save mode at application level | Estrella | General Symbian C++ | 0 | 2008-03-28 10:17 |
