| Reply | « Previous Thread | Next Thread » |
|
I've used the code mentioned in other posts for connecting to a bluetooth device automatically without user intervention. This works very well except for one case:
When the bluetooth function is deactivated by the user in the connections menu, the bluetooth statuspane icon is removed. When devices are discovered using the StartNotifierAndGetResponse(), the user gets a prompt to enable bluetooth and the bluetooth statuspane icon is enabled. However, when using the automatic connection method, the bluetooth channel can be used (I get data) but the statuspane icon is still disabled and the bluetooth connection menu is indicating that bluetooth is turned off. I need to check the bluetooth "on/off" from the connections menu, and enable the bluetooth statuspane icon, otherwise the user won't get proper feedback. I would also think it's bad form to fool the user that bluetooth is off, when it is actually active... |
|
I've gotten a solution for my problem:
const TUid KPowerModeSettingNotifierUid = {0x100059E2}; void CBTServiceSearcher::CheckBluetoothL(TRequestStatus& aObserverRequestStatus) { TPckgBuf<TBool> pckg; if( !iIsDeviceSelectorConnected ){ User::LeaveIfError(iDeviceSelector.Connect()); iIsDeviceSelectorConnected = ETrue; } iDeviceSelector.StartNotifierAndGetResponse( aObserverRequestStatus, KPowerModeSettingNotifierUid, pckg, iResponse ); } When the RunL method gets called next time, the status member contains the information needed. (User enabled bluetooth, user didn't enable bluetooth) |
|
Hi ,
I m very new to Bluetooth Programming .. I just want to check whether the bluetooth is enabled or not ?? Accordingly i want to show the statusicon for bluetooth . Can u just explain your code meaning the mail classes used and also the methods functionality . Thanks in Advance .. |
| amitaggarwal |
| View Public Profile |
| Find all posts by amitaggarwal |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|