How to reduce the disconnecting time of two (central and peripheral) devices

Hi There,

I have almost done the project, I used nrf52832 as central(master) and nrf52810 as peripheral(slave).

i use the blinky example and everything working fine. I found that when i turn off the power of the slave, the central device takes little time(1~2 seconds) to disconnect. 

Is there any way to reduce this time?

Thank you in advance.

Habib

Parents
  • Hi Vidar,

    Thank you, I have tested by changing the time. But I couldn't feel any change.

    Best regards,

    Habib

  • Hi Habib,

    Please verify that your supervision timeout got updated. You do this by monitoring the BLE_GAP_EVT_CONN_PARAM_UPDATE event like this:

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
        uint32_t err_code;
    
        switch (p_ble_evt->header.evt_id)
        {
         ....
            case BLE_GAP_EVT_CONN_PARAM_UPDATE:
            {
                /* Interval is given in units of 1.25 ms. Multiply by 1.25 to get interval in ms */
                uint32_t new_conn_interval =
                    p_ble_evt->evt.gap_evt.params.conn_param_update.conn_params.max_conn_interval *
                    1.25;
                uint32_t supervision_timeout =
                    p_ble_evt->evt.gap_evt.params.conn_param_update.conn_params.conn_sup_timeout * 10;
    
    
                NRF_LOG_INFO(
                    "Connection paramaters updated. New interval is %d ms. Supervision timeout: %d",
                    new_conn_interval, supervision_timeout);
            }
            
            ....

    You may also need to adjust the default NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION setting in sdk_config.h.

    Best regards,

    Vidar

Reply
  • Hi Habib,

    Please verify that your supervision timeout got updated. You do this by monitoring the BLE_GAP_EVT_CONN_PARAM_UPDATE event like this:

    static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context)
    {
        uint32_t err_code;
    
        switch (p_ble_evt->header.evt_id)
        {
         ....
            case BLE_GAP_EVT_CONN_PARAM_UPDATE:
            {
                /* Interval is given in units of 1.25 ms. Multiply by 1.25 to get interval in ms */
                uint32_t new_conn_interval =
                    p_ble_evt->evt.gap_evt.params.conn_param_update.conn_params.max_conn_interval *
                    1.25;
                uint32_t supervision_timeout =
                    p_ble_evt->evt.gap_evt.params.conn_param_update.conn_params.conn_sup_timeout * 10;
    
    
                NRF_LOG_INFO(
                    "Connection paramaters updated. New interval is %d ms. Supervision timeout: %d",
                    new_conn_interval, supervision_timeout);
            }
            
            ....

    You may also need to adjust the default NRF_BLE_CONN_PARAMS_MAX_SUPERVISION_TIMEOUT_DEVIATION setting in sdk_config.h.

    Best regards,

    Vidar

Children
No Data
Related