Thursday, January 22, 2015

HOW TO GET NOTIFIED WHILE BT TURNED ON?

BtnotifierAPI.h - for KPowerModeSettingNotifierUid

Register with the notifer
RNotifier notifier;
User::LeaveIfError( notifier.Connect() );
TPckgBuf dummy(ETrue);
TPckgBuf reply(EFalse);
notifier.StartNotifierAndGetResponse(iStatus, KPowerModeSettingNotifierUid, dummy, reply);
if(!IsActive())
SetActive();

Note: Power changes will be notifed in RunL()

Cancel the notification request
notifier.CancelNotifier(KPowerModeSettingNotifierUid);
notifier.Close();

0 comments:

Post a Comment