JuulLabs / kable

Kotlin Asynchronous Bluetooth Low-Energy
https://juullabs.github.io/kable
Apache License 2.0
829 stars 83 forks source link

BLE devices disconnecting sporadically on Native #591

Open Phoenix7351 opened 1 year ago

Phoenix7351 commented 1 year ago

Logging shows:

API MISUSE: Cancelling connection for unused peripheral <CBPeripheral: 0x2816bc4e0, identifier = 23584B66-2C3C-09F2-CF3F-BC60BDA79D4B, name = JUUL2 QDA0N0U4, mtu = 23, state = connecting>, Did you forget to keep a reference to it?

This error comes from CoreBluetooth.

Haven't found much rhyme or reason for when it happens yet, but when it does the device will not reconnect--even on subsequent relaunches of the consuming app.

Phoenix7351 commented 1 year ago

Just got more misuse logs. Now one for powered on state:

API MISUSE: Cancelling connection for unused peripheral <CBPeripheral: 0x2827fd5f0, identifier = 23584B66-2C3C-09F2-CF3F-BC60BDA79D4B, name = JUUL2 QDA0N0U4, mtu = 23, state = connecting>, Did you forget to keep a reference to it?

API MISUSE: <CBCentralManager: 0x282dff480> can only accept this command while in the powered on state