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

Android Template App: Problems with reconnection

We are using the Android nRF toolbox v2.4.0 and have successfully implemented the Template app. The app will reliably connect with our device and functions well. The only problem is when we disconnect.
After a successful connection and disconnection, when the Connect button is pressed and the list of "Available Devices" is shown, our device is not shown.
If I restart the app, our device will always be listed.
Sequence:

  1. Press Connect. Our device is listed on the Available Device page.

  2. Choose our device. Connection is successful.

  3. Disconnect by pressing the Disconnect button. Disconnection is successful.

  4. Press Connect. Our device is not listed.

Rebooting our device has no effect on this issue. The mobile phone is a Nexus 5X with Android 7.1.1. The device is running an nRF51 with BLE 4.2. Thanks.

Parents
  • @Kristin. Thank you for the response. Using the nRF Connect app (Android), I can connect and disconnect repeatedly without a problem. Also, if I do the following:

    1. Press Connect. Our device is listed on the Available Device page.
    2. Choose our device. Connection is successful.
    3. Disconnect by pressing the Disconnect button. Disconnection is successful.
    4. Press Connect. Our device is not listed.
    5. Reset/restart our device. Our device is still not listed.

    If our device had stopped advertising after the disconnect, then I believe that it will reengage advertising after the reboot.

  • Hi, Thanks for the response. I have not modified the internal code at all. I'm starting to wonder if the device is not being disconnected at all. Which would explain why its not on the list and why rebooting the device does cause it to show up on the list. I have been depending on the onConnectClick link from the button to the internal BleManager code, but have recently moved to a different button. What is the correct method to call from my main activity to disconnect a device?

Reply
  • Hi, Thanks for the response. I have not modified the internal code at all. I'm starting to wonder if the device is not being disconnected at all. Which would explain why its not on the list and why rebooting the device does cause it to show up on the list. I have been depending on the onConnectClick link from the button to the internal BleManager code, but have recently moved to a different button. What is the correct method to call from my main activity to disconnect a device?

Children
No Data
Related