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

Slave latency for S110/S120 connection

FormerMember
FormerMember

Hi everyone,

I am working with PCA10000 dongles with S110 and S120 softdevices. The connection parameters in both master and slave are

define MIN_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
define MAX_CONN_INTERVAL MSEC_TO_UNITS(7.5, UNIT_1_25_MS)
define SLAVE_LATENCY 65
define CONN_SUP_TIMEOUT MSEC_TO_UNITS(1000, UNIT_10_MS)

This works. But any higher value of SLAVE_LATENCY such as 70 and higher results in NRF_ERROR_INVALID_PARAM for sd_ble_gap_connect in S120. This SLAVE_LATENCY value is within the BLE specification. Any idea what's going on here? Thanks!

Parents
  • If you look at the following note in the ble_gap.h header file in S120 include directory:

    /**@brief GAP connection parameters.
     *
     * @note  When ble_conn_params_t is received in an event, both min_conn_interval and
     *        max_conn_interval will be equal to the connection interval set by the central.
     *
     * @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:
     *       conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval
     *       that corresponds to the following BT Spec 4.1 Vol 2 Part E, Section 7.8.12 requirement:
     *       The Supervision_Timeout in milliseconds shall be larger than
     *       (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds.
     */
    typedef struct
    {
      uint16_t min_conn_interval;         /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
      uint16_t max_conn_interval;         /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
      uint16_t slave_latency;             /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/
      uint16_t conn_sup_timeout;          /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/
    } ble_gap_conn_params_t;
    

    When you use a SLAVE_LATENCY=65 & CONN_SUP_TIMEOUT =1000, this will give you the following equation

    1000 > (1 + Conn_Latency) * Conn_Interval_Max * 2, which is (1+65)*(7.5 * 2) = 990

    When you use a SLAVE_LATENCY=70 & CONN_SUP_TIMEOUT =1000, this will give you the following equation

    1000 < (1 + Conn_Latency) * Conn_Interval_Max * 2, which is (1+70)*(7.5 * 2) = 1065

Reply
  • If you look at the following note in the ble_gap.h header file in S120 include directory:

    /**@brief GAP connection parameters.
     *
     * @note  When ble_conn_params_t is received in an event, both min_conn_interval and
     *        max_conn_interval will be equal to the connection interval set by the central.
     *
     * @note If both conn_sup_timeout and max_conn_interval are specified, then the following constraint applies:
     *       conn_sup_timeout * 4 > (1 + slave_latency) * max_conn_interval
     *       that corresponds to the following BT Spec 4.1 Vol 2 Part E, Section 7.8.12 requirement:
     *       The Supervision_Timeout in milliseconds shall be larger than
     *       (1 + Conn_Latency) * Conn_Interval_Max * 2, where Conn_Interval_Max is given in milliseconds.
     */
    typedef struct
    {
      uint16_t min_conn_interval;         /**< Minimum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
      uint16_t max_conn_interval;         /**< Maximum Connection Interval in 1.25 ms units, see @ref BLE_GAP_CP_LIMITS.*/
      uint16_t slave_latency;             /**< Slave Latency in number of connection events, see @ref BLE_GAP_CP_LIMITS.*/
      uint16_t conn_sup_timeout;          /**< Connection Supervision Timeout in 10 ms units, see @ref BLE_GAP_CP_LIMITS.*/
    } ble_gap_conn_params_t;
    

    When you use a SLAVE_LATENCY=65 & CONN_SUP_TIMEOUT =1000, this will give you the following equation

    1000 > (1 + Conn_Latency) * Conn_Interval_Max * 2, which is (1+65)*(7.5 * 2) = 990

    When you use a SLAVE_LATENCY=70 & CONN_SUP_TIMEOUT =1000, this will give you the following equation

    1000 < (1 + Conn_Latency) * Conn_Interval_Max * 2, which is (1+70)*(7.5 * 2) = 1065

Children
Related