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

gls example : connect to the bonded peripheral

Hello

I am running gls example on SDK14.2.

I paired after flashing program to my DK board, and then turn off power.

And turned on again, but i can't connect to my DK board( nRF connect show that the gls is bonded ).

Why?

another question : everytime I press "disconnect" in nRF connect, but my peripheral has not any event occurred.

Thanks in advance.

Parents Reply Children
  • The Android phone should send a disconnect on air so that the nRF should see it (and log it if you have logging enabled). If not, then the nRF will think the connection is active until there is a supervision timeout. Do you have a sniffer trace?

    A few questions:

    • Which nRF Connect version did you use on the Android phone where it did not work?
    • Which Android version?
    • Which Phone model?
  • I want to advertise when nRF connect press "disconnect" , but I can't get any event to do this.

    I don't have sniffer.

    nRF connect( 4.19.1 ) ; Android( 7.0 ) ; ASUS ZenPad 3S 10 (Z500M)

  • You will always get a BLE_GAP_EVT_DISCONNECTED on the nRF side when there is a disconnect, and the advertising module used in the GLS example will start to advertise immediately after the BLE_GAP_EVT_DISCONNECTED event. However, the time when this comes depend on the type of disconnect. If the phone sends a disconnect, then the you will get the BLE_GAP_EVT_DISCONNECTED immediately with the disconnect reason  BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION. If the phone did not send a disconnect (for some reason), then you will wait until the supervision timeout and the disconnect reason will be BLE_HCI_CONNECTION_TIMEOUT.

Related