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

BLE_GAP_EVT_CONN_PARAM_UPDATE shows odd connection parameter values

Upon initial connection with iOS device, returned connection values at BLE_GAP_EVT_CONN_PARAM_UPDATE are:

ble_event: got BLE_GAP_EVT_CONNECTED. role: 1, conn_handle: 1, min_conn_in: 24, max_conn_int: 24, slave: 0, sup_timeout: 72

After connection complete, returned connection values at BLE_GAP_EVT_CONN_PARAM_UPDATE are:

ble_event: got BLE_GAP_EVT_CONN_PARAM_UPDATE. role: 1, conn_handle: 1, min_conn_in: 65101, max_conn_int: 0, slave: 0, sup_timeout: 0

The values don't make sense. My on_ble_evt has the following case switch for printing the values to console.

    case BLE_GAP_EVT_CONN_PARAM_UPDATE: {
    // Get the connection   interval
    TRACE("on_ble_event: got BLE_GAP_EVT_CONN_PARAM_UPDATE. role: %d, conn_handle: %d, min_conn_in: %d, max_conn_int: %d, slave: %d, sup_timeout: %d\r\n",
        event->evt.gap_evt.params.connected.role,
        event->evt.gap_evt.conn_handle,
        event->evt.gap_evt.params.connected.conn_params.min_conn_interval,
        event->evt.gap_evt.params.connected.conn_params.max_conn_interval,
        event->evt.gap_evt.params.connected.conn_params.slave_latency,
        event->evt.gap_evt.params.connected.conn_params.conn_sup_timeout);
    }   break;

My values for gap_params_init() are:

#define MIN_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_1_25_MS)    /**< Minimum acceptable connection interval (0.1   seconds).   */
#define MAX_CONN_INTERVAL MSEC_TO_UNITS(15, UNIT_1_25_MS)    /**< Maximum acceptable connection interval (0.2   second). */
#define SLAVE_LATENCY   0                                    /**<   Slave latency.    */
#define CONN_SUP_TIMEOUT MSEC_TO_UNITS(4000, UNIT_10_MS)     /**<   Connection supervisory timeout (4 seconds). */

Why am I getting such strange values after renegotiating the connection parameters?

Parents
  • I would guess there is something wrong with the input to the trace call. i.e. the variables. Seems like you are referencing the connected event struct instead of the ble_gap_evt_conn_param_update_t struct

  • Thank you. I changed the trace calls to the following and I'm seeing proper connection parameter values now.

        TRACE("on_ble_event: got BLE_GAP_EVT_CONN_PARAM_UPDATE. role: %d, conn_handle: %d, min_conn_in: %d, max_conn_int: %d, slave: %d, sup_timeout: %d\r\n",
            event->evt.gap_evt.params.connected.role,
            event->evt.gap_evt.conn_handle,
            event->evt.gap_evt.params.conn_param_update.conn_params.min_conn_interval,
            event->evt.gap_evt.params.conn_param_update.conn_params.max_conn_interval,
            event->evt.gap_evt.params.conn_param_update.conn_params.slave_latency,
            event->evt.gap_evt.params.conn_param_update.conn_params.conn_sup_timeout);

Reply
  • Thank you. I changed the trace calls to the following and I'm seeing proper connection parameter values now.

        TRACE("on_ble_event: got BLE_GAP_EVT_CONN_PARAM_UPDATE. role: %d, conn_handle: %d, min_conn_in: %d, max_conn_int: %d, slave: %d, sup_timeout: %d\r\n",
            event->evt.gap_evt.params.connected.role,
            event->evt.gap_evt.conn_handle,
            event->evt.gap_evt.params.conn_param_update.conn_params.min_conn_interval,
            event->evt.gap_evt.params.conn_param_update.conn_params.max_conn_interval,
            event->evt.gap_evt.params.conn_param_update.conn_params.slave_latency,
            event->evt.gap_evt.params.conn_param_update.conn_params.conn_sup_timeout);

Children
No Data
Related