Hi,
When I call sd_ble_gap_disconnect( m_conn_handle, BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION), it usually takes about 100 msec, and come back with event BLE_GAP_EVT_DISCONNECTED, and with reason BLE_HCI_LOCAL_HOST_TERMINATED_CONNECTION. Occasionally, it will take 4 seconds, and I get reason BLE_HCI_STATUS_CODE_LMP_RESPONSE_TIMEOUT.
After searching through, I thought I could change the supervision timeout from 4 seconds to 2 seconds and speed up that process. However, it is still 4 seconds after the change. Below are the parameters.
#define MIN_CONNECTION_INTERVAL MSEC_TO_UNITS(20, UNIT_1_25_MS)
#define MAX_CONNECTION_INTERVAL MSEC_TO_UNITS(75, UNIT_1_25_MS)
#define SLAVE_LATENCY 0
#define SUPERVISION_TIMEOUT MSEC_TO_UNITS(2000, UNIT_10_MS)
Initially, it uses sd_ble_gap_ppcp_set() to set up the values. I also tried adding sd_ble_gap_conn_param_update() before the disconnect call. The new supervision timeout value has no effect.
Both sides have the same parameters. Using SDK15.3.0 and nRF52832, s132_nrf52_6.1.1_softdevice.hex.
Any ideas? Thanks.