简体   繁体   English

取消绑定蓝牙设备时的BluetoothAdapter通知

[英]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. 您可以为所有事件注册广播接收器,例如绑定状态已更改或设备已连接\\断开。

See more information here 在这里查看更多信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么BluetoothAdapter.startDiscovery(..)需要广播蓝牙设备? - Why BluetoothAdapter.startDiscovery(..) require to get Bluetooth device broadcast? bluetoothAdapter.startDiscovery() 不从通知面板单击蓝牙按钮就不会启动并立即完成 - bluetoothAdapter.startDiscovery() doesn't start without clicking the bluetooth button from the notification panel and finishes immediately 显示有关蓝牙设备断开连接的通知 - Show notification on bluetooth device disconnection 通过BluetoothAdapter将蓝牙与getRemoteDevice()连接 - Connect bluetooth with getRemoteDevice() from BluetoothAdapter E / BluetoothAdapter:蓝牙活页夹为空 - E/BluetoothAdapter: Bluetooth binder is null 收到BluetoothAdapter时,从蓝牙服务器始终正常断开连接。STATE_TURNING_OFF - Consistent graceful disconnect from Bluetooth server when receiving BluetoothAdapter.STATE_TURNING_OFF 蓝牙LE:向设备发送“处理价值通知” - Bluetooth LE: Send “Handle Value Notification” to device NearbBy通过API通知已配对的蓝牙设备 - NearbBy API notification to paired bluetooth device 每次将蓝牙设备与任何设备配对时,以及当它发现任何已配对设备获得通知时,如何获得通知? - How to get notified when each time bluetooth device is paired with any devices and when it device finds any paired devices get notification? 缺少BluetoothAdapter.isEnabled.BLUETOOTH所需的权限 - missing permissions required by BluetoothAdapter.isEnabled.BLUETOOTH
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM