简体   繁体   English

是否对蓝牙RFCOMM / SPP连接的更改广播了ACTION_CONNECTION_STATE_CHANGED?

[英]Is ACTION_CONNECTION_STATE_CHANGED broadcasted on changes to Bluetooth RFCOMM / SPP connections?

Is ACTION_CONNECTION_STATE_CHANGED broadcasted on changes to RFCOMM / SPP connections? 是否对RFCOMM / SPP连接的更改广播了ACTION_CONNECTION_STATE_CHANGED?

Or is it only broadcast on changes to the 'other profiles' (A2DP etc.) 或者仅在“其他配置文件”(A2DP等)的更改中广播

I'm trying to avoid having to manage the state of an RFCOMM connection if it's state is already being managed by the BluetoothAdapter 我试图避免必须管理RFCOMM连接的状态,如果它的状态已经由BluetoothAdapter管理

Also, not that I would resort to it but, has anyone attempted to use the @hidden BluetoothStateChangeCallback interface in BluetoothAdapter? 此外,不是我会诉诸它,但有没有人试图在BluetoothAdapter中使用@hidden BluetoothStateChangeCallback接口?

RFCOMM is not a bluetooth 'Profile' it is a protocol. RFCOMM不是蓝牙'Profile'它是一种协议。

Serial Port Profile (SPP) is based on RFCOMM and is a profile. 串行端口配置文件(SPP)基于RFCOMM并且是配置文件。 Though I am using 虽然我正在使用

"the well-known SPP UUID 00001101-0000-1000-8000-00805F9B34FB" “众所周知的SPP UUID 00001101-0000-1000-8000-00805F9B34FB”

SPP doesn't seem to be an 'officially supported' profile, and thus ACTION_CONNECTION_STATE_CHANGED is not broadcast. SPP似乎不是“官方支持”的配置文件,因此不会广播ACTION_CONNECTION_STATE_CHANGED。

ACTION_ACL_CONNECTED, ACTION_ACL_DISCONNECTED, and ACTION_ACL_DISCONNECT_REQUESTED broadcast events of BluetoothDevice can be used to listen for the state of a bluetoothDevice. 蓝牙设备的 ACTION_ACL_CONNECTED,ACTION_ACL_DISCONNECTED和ACTION_ACL_DISCONNECT_REQUESTED广播事件可用于监听bluetoothDevice的状态。

These are low level events that will be broadcast for both the RFCOMM protocol and Profile connections. 这些是将为RFCOMM协议和Profile连接广播的低级事件。

I've found that these broadcasts don't necessarily behave in an expected manner though. 我发现这些广播并不一定以预期的方式表现。 As was also experienced here What triggers the BluetoothDevice.ACTION_ACL broadcasts? 正如在这里也经历过什么触发了BluetoothDevice.ACTION_ACL广播?

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM