I am using a PCA10040 board and the UART example from another question.
Now, having tried some different phones I suspect that my Sony E6553 with Android 7.0 has a bug that automatically connects to my board. The debug output looks like this after I have pressed the disconnect button in the nRF UART v2.0 app:
APP:INFO:Connected
APP:INFO:Disconnected
APP:INFO:Connected
APP:INFO:Disconnected
APP:INFO:Connected
APP:INFO:Disconnected
[...]
The LED on the board stays lit which means that it is connected and will not advertise, which is a problem when I try to connect using another phone. I have found some ways to make it disconnect:
- Reset the board
- Turn off Bluetooth on my phone
- Move the phone (or the board!) out of range. When moving the phone back close to the board, it will not automatically connect again.
Closing the nRF UART app with the back button is not sufficient to make it disconnect, neither is to forcibly close the app, or even uninstalling it. This leads me to think that the problem is somewhere deeper in the Android system.
Below is a pdml-file of the following use case:
- Scan for device
- Connect
- Disconnect (which hangs in a connect/disconnect-cycle)