Bluetooth LE code behaving differently on Windows 8.1 and 10

2

I'm using the Bluetooth Low Energy (BLE) API introduced by Microsoft with Windows 8, the BluetoothGATTxxx functions.

My code is working fine on Windows 8.1, but I have observed a difference in the behavior of BluetoothGATTSetDescriptorValue between 8.1 and Windows 10.

The scenario is the following:

  1. Pair the device with the Windows interface.
  2. Find it and enable data notifications with a call to BluetoothGATTSetDescriptorValue to set the field 'IsSubscribeToNotification' of ClientCharacteristicConfiguration to true.
  3. Register a callback to receive the new values (I tried to register the callback first, didn't work well).
  4. The callback gets called every time new data is sent from the device.

All is good. Now, if I turn the device off and on, then repeat steps 2 to 4 it will work fine on Windows 8.1, but not on Windows 10:

BluetoothGATTSetDescriptorValue returns 0x80070572 i.e. HRESULT_FROM_WIN32(ERROR_NO_USER_SESSION_KEY).

In practice, this means the user has to remove the pairing and redo it every time the device is turned off.

The problem is made worse by the fact that the device has some power management feature and will turn off automatically if it stays idle too long. It seems I need to keep it alive if I don't want the user to delete/redo the pairing every time they want to use the device!

Is anyone else running into this issue too? I tried several searches here and on the net but with no luck. A solution would be to force a new pairing programmatically, and since there is no API for this it would be an ugly hack. I definitely don't want to take that path...

bluetooth
windows-10
asked on Stack Overflow Aug 24, 2015 by David Le Bansais • edited Aug 24, 2015 by SaintLike

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0