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

About the "BLE_GAP_EVT_DISCONNECTED" event nRF52832

Hello.

After pairing with a tablet or computer, if you leave it for a few seconds without operating it

I wrote out the cause of the disconnection by debugging.

"Error 34 (0x22): GATT CONN LMP TIMEOUT"

What are the possible causes and countermeasures?

  • Hi,

    Thank for these files. They were much more informative. Here I see from the sniffer trace (Disconnect.pcapng) that the nRF disconnects with reason BLE_HCI_CONN_INTERVAL_UNACCEPTABLE (0x3B) in #1977, #2783 and #3592.

    You write that you do not see this if you include line 50, which delays the next connection parameter a very long time (24 hours, which I assume is longer than the time you test). Therefore my first assumption was that the conn_params module disconnected, but that is not the case as you have set disconnect_on_fail = false.

    The actual reason this fails is that you explicitly disconnect on the BLE_CONN_PARAMS_EVT_FAILED event in your ConnectParamsEventHandler() function, with the reason BLE_HCI_CONN_INTERVAL_UNACCEPTABLE. So the nRF is doing exactly as you would expect with this code. If you do not want to disconnect even when you do not get the connection parameters you request, you should remove line 670 - 678 in your BLEControl.c.

    Einar

  • We become indebted to.


    Let me ask you an additional question about advertise.

    ・ Question

     After starting the advertisement and passing "APP_ADV_DURATION (180s)",

     Advertise will stop and sleep.

    If you want to continue advertising without going to sleep

    Should I resume advertising when the BLE_ADV_EVT_IDLE event occurs?

    In that case, the function to call is


    "Ble_advertising_start"

    "Ble_advertising_restart_without_whitelist"

    Which one?

    We apologize for the inconvenience, but thank you.

  • Hi,

    As you use the advertising module, you can restart advertising with ble_advertising_start(). I do not see any reference to whitelist in your code so in practice this would be equivalent to using ble_advertising_restart_without_whitelist() in your case. Generally, which one to use depends on if you want to start advertising with whitelist or not.

    Note that you can also prevent advertising from timeout out by setting the duration to 0.

  • Einar san

    Thank you for your answer.

    Use ble_advertising_start () and We will take measures to set the period to 0.

    Thank you for your support.

Related