This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Unable to connect to bonded device on Android

Hi, I have a problem with BLE connection. When I bond to the device and then connect, everything works and connection is stable. When I kill the app and try to connect again to the bonded device, I get disconnected from the Android with status code 22(connection terminated by localhost).

Do you know the difference of these scenarios under the Android hood? I can't figure out why does this keep happening when the phone is obviously able to connect to the device after the bonding procedure.

For connection I use the standard code used in the Android examples, there is no magic going on.

Thanks a lot for your help.

Parents
  • Oh, I see, but it's still weird since when I connect right after the bonding, I can sometimes see a couple of connection updates with interval value set to 36 and it works. When I kill the app, or disconnect from the peripheral and try to connect again, I can only see one connection update with interval value set to 6 followed by disconnect. Could you please point me to the place where you found this info about the 7.5ms interval for discovery? Maybe I can find some more there. And thank you once again for helping me here, I'm starting to be desperate.

Reply
  • Oh, I see, but it's still weird since when I connect right after the bonding, I can sometimes see a couple of connection updates with interval value set to 36 and it works. When I kill the app, or disconnect from the peripheral and try to connect again, I can only see one connection update with interval value set to 6 followed by disconnect. Could you please point me to the place where you found this info about the 7.5ms interval for discovery? Maybe I can find some more there. And thank you once again for helping me here, I'm starting to be desperate.

Children
No Data
Related