Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

btm_sec_disconnected : Device is NULL

  1. Trying to build connection between Nexus4 and Nexus 5 via Insecure Bluetooth Connection. Insecure meaning no pairing is required.
  2. The code hence developed did work for sometime and both phones were able to talk to each other. An app on nexus4 would launch via broadcast message when Nexus 5 initiates BL Connection.
  3. At some point, i get this
E/BluetoothRemoteDevices: aclStateChangeCallback: Device is NULL
E/bt-btm  btm_sec_disconnected - Clearing Pending flag

in Nexus4 phone. Post which, I am not getting any Broadcast message when the other phone(Nexus 5) tries to set up a connection. Any pointers why I am getting this ?

PS : Same is working fine across other phones. I did restart Nexus4, renamed bluetooth name. But dint had the luck.

like image 559
Vny Kumar Avatar asked Jul 05 '26 12:07

Vny Kumar


1 Answers

Try restarting the bluetooth or the entire device. I have noticed this issue on devices with the (a particular one?) Broadcom bluetooth chipset. The Android bluetooth stack just decides to close the connection sometimes before it reaches your app. Sometimes I can detect this by listening for ACL_CONNECTED events, I am hoping to programmatically restart the bluetooth by detecting it this way. It goes away most of the time after the restart.

like image 97
caja Avatar answered Jul 07 '26 01:07

caja



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!