This project has moved. For the latest updates, please go here.

Bring it back to live after power suspend/off

Topics: Bluetooth - BlueSoliel
May 2, 2012 at 4:28 PM

The device no longer listens to incoming connections after power suspend/off.    Everything works great until I power the device off and then back on.  At this point, the other device can no longer see this Bluetopia device in range.

I implemented some code to notify me when the device is powered on and then I set the radio to discoverable and connectable again.  This works however is not how it should work.   The user should not have to turn the device on to keep connected.

So then I tried to implement PowerPolicyNotify(PPN_UNATTENDEDMODE, True) to keep the device in unnatended mode but it didn't work either. 

What should I do?


May 9, 2012 at 6:56 PM

Sorry missed this message.

For my original client for Bluetopia they wanted the device to be able to sleep, and supported Widcomm and Bluetopia stacks.  So in my application for them whenever the app started to use Bluetooth -- it was a client-side app so whenever it did a discovery or connect -- it checked if the device had just resumed and if so waited 15seconds for things to settle down (mainly for Widcom IIRC) and (for Bluetopia) ensured the radio was on (turn it on and wait for the status to reflect that).  For the resume monitoring it used used th system power notifications (RequestPowerNotifications).

So the top-level function was like:

       internal void EnsureRadioOn()
           // Note: Bluetopia Radio defaults to off at start-up
           if (_radio.Mode != RadioMode.PowerOff) {
           _radio.Mode = RadioMode.Connectable;
           this.BeginInvoke((Action)delegate { // Likely called from UI thread but make sure...
               this.textBox1.Text += "Turned radio on\r\n\r\n";
           if (_radio.Mode != RadioMode.PowerOff) {
           for (int i = 0; i < 6; ++i) {
               if (_radio.Mode != RadioMode.PowerOff) {
           Debug.WriteLine("Radio.mode: " + _radio.Mode);

 And Power2.EnsureResumeOk did the 'wait 15 seconds after resume' handling.