英文:
UWP Callback when connect/disconnect to a bluetooth devices
问题
我们有一个要求,需要监听蓝牙连接的变化:
例如:连接到任何蓝牙设备,断开与任何蓝牙设备的连接。
请注意,这不是用于监视特定蓝牙设备状态,而是用于监视Windows上任何蓝牙设备的连接/断开。
是否有适用于UWP的API支持此功能?谢谢。
英文:
We have a requirement to listen the Bluetooth connection changes:
such as: connect to a any BT devices, disconnect to a any BT devices.
Please note, it is not for monitoring certain BT devices status, it's for monitoring any BT devices connect/disconnect on Windows.
Is there any API (available for UWP) to support this feature? Thanks.
答案1
得分: 0
你可以使用事件DeviceWatcher.Added和DeviceWatcher.Removed来监视Windows上连接/断开连接的任何蓝牙设备。
建议您参考示例#DeviceEnumerationAndPairing,选择监视蓝牙设备。在蓝牙设备断开连接或连接后,您将收到消息。
英文:
You can use Event DeviceWatcher.Added and DeviceWatcher.Removed to monitor any Bluetooth devices connect/disconnect on Windows.
It is recommended that you refer to the sample #DeviceEnumerationAndPairing and choose to monitor Bluetooth devices. After the bluetooth device is disconnected or connected, you will receive the message.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论