Android BLE API: Autoconnect not working for every device?

I have two peripheral devices, for example device1 and device2, and one Android device for the central role. Android can connect as to BluetoothDevice .connectGatt () using autoConnect = false.

The problem is that the autoConnect functions work well for device1 , device2 does not even connect once with autoConnect = true.

onConnectionStateChange callback is not called on either side (android and device2 ). Ad and scan response packages were configured on device2, is the cause of the problem? Although we know that the settings for an autonomous connection must be provided completely on the central side, the peripheral side has nothing to do with it, changing the peripheral device also changes the behavior of the auto-connection on the central side.

any insight? Thank you in advance.

+6
source share

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


All Articles