Plug and unplug Bluetooth BLE on Windows Phone 8.1

I have a device that is controlled 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 finish using it.

On Android, the library we use can connect and disconnect, but on Windows Phone 8.1 I can only connect, I can’t find a way to tell the phone to disconnect from the device. I need to manually disconnect the phone from the device,

Has anyone been able to disconnect a paired Bluetooth device? If so, how?

Thank!

+4
source share
3 answers

Dispose() GattDeviceService, , GattCharacteristic null ValueChanged GattCharacteristic. GC.Collect() (Microsoft , WP8.1 ​​ Win10)

+2

StreamSocket, Dispose() .

using() .

0

win8, , UWP, : https://msdn.microsoft.com/en-us/windows/uwp/devices-sensors/pair-devices

, DeviceInformation.Pairing.UnpairAsync. https://msdn.microsoft.com/library/windows/apps/windows.devices.enumeration.deviceinformationpairing.unpairasync

Calling this method opens a dialog box with a window asking the user for permission to eliminate it.

0
source

Source: https://habr.com/ru/post/1570860/


All Articles