[英]BluetoothAdapter notification when a bluetooth device is unboded
Function BluetoothAdapter.getDefaultAdapter().getBondedDevices()
returns a list of available connected bluetooth devices 功能
BluetoothAdapter.getDefaultAdapter().getBondedDevices()
返回可用的已连接蓝牙设备的列表
Can I get a notification if one of those devices suddenly becomes disconnected? 如果这些设备之一突然断开连接,我会收到通知吗?
First of all getBondedDevices() returns not connected devices. 首先,getBondedDevices()返回未连接的设备。 These devices are paired or bonded and that's all.
这些设备是配对或绑定的,仅此而已。 Connection establishes by socket.connect().
通过socket.connect()建立连接。 The second thing.
第二件事。 You can register a broadcast receiver for all events such bond state changed or device is connected \\ disconnected.
您可以为所有事件注册广播接收器,例如绑定状态已更改或设备已连接\\断开。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.