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

Understanding BLE_GATTC_EVT_TIMEOUT

In the blinky-central example, on_ble_evt() switches over both BLE_GAP_EVT_DISCONNECTED and BLE_GATTC_EVT_TIMEOUT.

  • Why is this required? Won't a client GATT timeout trigger a BLE_GAP_EVT_DISCONNECTED event anyway?
  • Why is BLE_GATTS_EVT_TIMEOUT (i.e. GATT server timeout) also checked?
Parents
  • Hi,

    Q1) Won't a client GATT timeout trigger a BLE_GAP_EVT_DISCONNECTED event anyway?

    A1 ) No. The SoftDevice will disable all ATT traffic and mark the ATT connection as down, but it’s up to the application to do the final disconnect with sd_ble_gap_disconnect().


    Q2) Why is BLE_GATTS_EVT_TIMEOUT (i.e. GATT server timeout) also checked?

    A2) The SoftDevice can be configured to act concurrently as both a peripheral and as a central. In this case the code to check for both events is therefore added.

  • Just to make sure: will calling sd_ble_gap_disconnect() when handling BLE_GATTC/S_EVT_TIMEOUT eventually trigger the BLE_GAP_EVT_DISCONNECTED event? I'm trying to unify business logic paths.

Reply Children
No Data
Related