What triggers the BluetoothDevice.ACTION_ACL broadcasts?

后端 未结 1 1187
小鲜肉
小鲜肉 2020-12-24 06:55

I would like to know what events in remote physical devices trigger ACTION_ACL_CONNECTED and ACTION_ACL_DISCONNECTED in a listening device. My test

相关标签:
1条回答
  • 2020-12-24 07:48

    I'm working with androids really messed up bt for quite some time now,

    here is what i can tell you:

    ACTION_ACL_CONNECTED is sent whenever a successful connection was established. This one is as simple as it gets.

    Now the rather annoying part.

    ACTION_ACL_DISCONNECTED is sent whenever the connection was closed on a HARDWARE level. WHEN that happens is a bit up to the device itself. IF you manually disconnect/plug out the other device, it somehow does not send a "dude, im gone" signal to the droid, instead after up to 20 seconds some watchdog barks and the connection is being closed and the intent is sent.

    Now i did try this only with SPP devices that I connect to. A headset afaik is actively connecting by itself because its not SPP. So it automatically connects to you, if you are paired and in listening mode. Now i dont know what the headset does if you "power it off". Maybe it disconnects properly or maybe it just disrupts the connection without saying goodbye. In the latter case it would take some time for the watchdog to disconnect from the droid side, which can take from 0 to 20 seconds, dont ask me why, its just my observation.

    0 讨论(0)
提交回复
热议问题