Bluetooth LE connectivity issue on Nexus 9

I am currently testing an application using Bluetooth LE. I got the application to work, just the problem is that on Nexus 9 the GATT connection will periodically disconnect, apparently for no reason, and I have to completely restart the connection. This does not happen on the other device I'm working with (LG G4).

While looking at the system logs, he tells me what is happening, but I have no idea how to fix it.

693-913/? W/BluetoothEventManager: CachedBluetoothDevice for device 00:20:62:00:12:03 not found, calling readPairedDevices(). 693-913/? E/BluetoothEventManager: Got bonding state changed for 00:20:62:00:12:03, but we have no record of that device. 16562-16648/? W/bt_btif: bta_gattc_conn_cback() - cif=3 connected=0 conn_id=3 reason=0x0022 16562-16648/? W/bt_btif: bta_gattc_conn_cback() - cif=4 connected=0 conn_id=4 reason=0x0022 16562-16648/? W/bt_btif: bta_gattc_conn_cback() - cif=5 connected=0 conn_id=5 reason=0x0022 16562-16648/? I/bt_btm_sec: btm_sec_disconnected clearing pending flag handle:64 reason:34 16562-16648/? E/bt_btif: bta_gattc_mark_bg_conn unable to find the bg connection mask for: 00:20:62:00:12:03 //<-- the device address 16562-16626/? D/BtGatt.GattService: onDisconnected() - clientIf=5, connId=5, address=00:20:62:00:12:03 3434-3445/com.blabla D/BluetoothGatt: onClientConnectionState() - status=34 clientIf=5 device=00:20:62:00:12:03 16562-16626/? E/BluetoothRemoteDevices: state12newState1 3434-3445/com.blabla E/Bluetooth: onConnectionStateChange: Device -> LE_Dual_SPK Address -> 00:20:62:00:12:03 State -> Disconnected 

Is this a problem with my code or is it a problem with the Broadcom chip?

+5
source share
1 answer

Oh Android, how are you so rubbish.

This was due to the fact that Nexus allowed me to connect to the device and communicate with it without contacting it. Thus, when the system checked the status of the connection, it could not find the mask, it was marked as a bad connection and reset it.

+4
source

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


All Articles