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

Disable automatic Connection Parameter Update Request?

Hi,

I am pairing my devices with LE SC and passkey entry. I would like my connection interval to be "high" (upwards of 500ms) but this raises an issue. Pairing then takes approximately a minute, because of a high connection interval and many LE SMP Pairing commands / responses.

Now, it's trivial to trigger Connection Parameter Update Request anytime during the process using sd_ble_gap_conn_param_update() to set and then reset connection parameters to different values. The problem is, parameters set using sd_ble_gap_ppcp_set() take some sort of precedence, and my parameters set using sd_ble_gap_conn_param_update() get essentially overridden. See attached overridden-conn-params.btsnoop. In my peripheral source code (peer manager handler) I am doing the following:

static void pm_evt_handler(pm_evt_t const * p_evt)
{
    uint16_t conn_handle = p_evt->conn_handle;

    switch(p_evt->evt_id)
    {
        /* ...other event handling here... */
        case PM_EVT_CONN_SEC_START:
        {
            ble_gap_conn_params_t params;
            params.min_conn_interval = MSEC_TO_UNITS(100, UNIT_1_25_MS);
            params.max_conn_interval = MSEC_TO_UNITS(100, UNIT_1_25_MS);
            params.conn_sup_timeout  = MSEC_TO_UNITS(500, UNIT_10_MS);
            params.slave_latency     = 0;
            sd_ble_gap_conn_param_update(conn_handle, &params);
        }
        break;
        /* ...other event handling here... */
    }
}

This results in a Connection Parameter Update Request as shown in frame 87 in overridden-conn-params.btsnoop. However, a new Connection Parameter Update Request is sent in frame 99, which is no good since pairing is still yet to complete. It takes 48.882 seconds from the SMP Pairing Request (frame 85)  to HCI_EVT Sent Encryption Change (frame 234).

Getting rid of sd_ble_gap_ppcp_set() results in funky behavior, see attached rejected-conn-params.btsnoop. The peripheral keeps sending Connection Parameter Update Requests, which keep getting rejected because they contain invalid values. Eventually, after three tries, peripheral disconnects with Reason: 0x3B - Unacceptable Connection Parameters.

Is there any way to disable these automatic Connection Parameter Update Requests?

Parents Reply Children
  • Here's what I ended up doing.

    On the peripheral, set minimum connection interval to BLE_GAP_CP_MIN_CONN_INTVL_MIN, max to BLE_GAP_CP_MIN_CONN_INTVL_MAX and supervision timeout to BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX. This results with the peripheral not sending any Connection Parameter Update Requests.

    On the central, connected with "low" connection interval. Once pairing succeeded, updated my connection parameters with sd_ble_gap_conn_param_update() to "high" values.

Related