conn_sup_timeout

Good day,

We have a requirement for our medical device to detect disconnection of the Bluetooth link in a very timely and consistent manner.

We have an application layer supervisor to check the connection status by checking the last time a valid application layer packet was received. 

We would like to be able to rely on the GATT disconnection event as a backup means of detecting a disconnection as it is critical for the safety of the patient.

Disconnection generates a BLE_GAP_EVT_DISCONNECTED event and gap_evt.params.disconnected.reason is set to 0x08.

We would like to be able to set the exact time that the SoftDevice (S140) will need before it generates a disconnect event. 

We have tried setting

   gap_conn_params.conn_sup_timeout = BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN;
   gap_conn_params.conn_sup_timeout = BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX;
   ...
   err_code = ble_conn_params_change_conn_params(&gap_conn_params, conn_handle);
and either way, we get the same result (disconnection event generated after about 3 seconds).
Nothing we do changes the disconnection timeout. Can you please point us in the right direction as to what conditions are required for a connection to be disconnect and how to set the timing?
Thank you heaps
OP
Parents
  • Hello,

    Thank you for sharing the detailed information about your issue. To adjust the Bluetooth disconnection timeout, please ensure that the connection parameters are set correctly. Here are some points to consider:

    1. Check the conn_sup_timeout value: Make sure you are using a value within the range of BLE_GAP_CP_CONN_SUP_TIMEOUT_MIN to BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX. If you've tried both without any changes, there might be another issue.

    2. Update connection parameters: After setting gap_conn_params, ensure you call ble_conn_params_change_conn_params() with the correct conn_handle and check the returned error code.

    3. Check connection status: Ensure there are no interferences from the application or other hardware that could affect the disconnection timing. my location

    4. Documentation and examples: Review the SoftDevice S140 documentation for guidance on configuring connection parameters and look for specific examples.

  • The BLE disconnect event timing is dictated by the connection supervision timeout agreed during link negotiation; the peripheral can propose values, but the central ultimately decides—so changing conn_sup_timeout on your side alone won’t override it; to get faster detection you need the central to accept a shorter supervision timeout (minimum 100 ms), otherwise you’ll always see ~3 s default.

    bloodmoney

Reply Children
No Data
Related