Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connect and disconnect from Bluetooth BLE on Windows Phone 8.1

I've got a device that is operated by Windows Phone 8.1 and Android phones. Since only one of these phones can use the device at any time, we need to disconnect from the device as soon as we finished the use.

On Android, the library we use is able to connect and disconnect, but on Windows Phone 8.1 I can only seem to connect, I can't find a way to tell the phone to disconnect from the device. I have to manually unpair the phone from the device,

has anyone been able to disconnect a paired Bluetooth device? If yes, how?

Thank you!

like image 629
Ravenheart Avatar asked Oct 31 '22 11:10

Ravenheart


1 Answers

Call Dispose() on the GattDeviceService, ensure that all GattCharacteristic objects are null and DON'T unregister ValueChanged event handlers from GattCharacteristic. Finally call GC.Collect() (Microsoft told that this is a bug in WP8.1 and should be fixed in Win10)

like image 180
Niklas Hoesl Avatar answered Nov 15 '22 05:11

Niklas Hoesl