diff --git a/pkg/nimble/autoconn/include/nimble_autoconn.h b/pkg/nimble/autoconn/include/nimble_autoconn.h index 0730657f2d..d9e23bfb4f 100644 --- a/pkg/nimble/autoconn/include/nimble_autoconn.h +++ b/pkg/nimble/autoconn/include/nimble_autoconn.h @@ -145,8 +145,11 @@ typedef struct { uint32_t scan_win; /** opening a new connection is aborted after this time [in ms] */ uint32_t conn_timeout; - /** connection interval used when opening a new connection [in ms] */ - uint32_t conn_itvl; + /** connection interval used when opening a new connection, lower bound. + * [in ms] */ + uint32_t conn_itvl_min; + /** connection interval, upper bound [in ms] */ + uint32_t conn_itvl_max; /** slave latency used for new connections [in ms] */ uint16_t conn_latency; /** supervision timeout used for new connections [in ms] */ diff --git a/pkg/nimble/autoconn/include/nimble_autoconn_params.h b/pkg/nimble/autoconn/include/nimble_autoconn_params.h index 9c259fdbf5..67532286f9 100644 --- a/pkg/nimble/autoconn/include/nimble_autoconn_params.h +++ b/pkg/nimble/autoconn/include/nimble_autoconn_params.h @@ -51,8 +51,11 @@ extern "C" { #ifndef NIMBLE_AUTOCONN_CONN_TIMEOUT_MS #define NIMBLE_AUTOCONN_CONN_TIMEOUT_MS (3 * NIMBLE_AUTOCONN_SCAN_WIN_MS) #endif -#ifndef NIMBLE_AUTOCONN_CONN_ITVL_MS -#define NIMBLE_AUTOCONN_CONN_ITVL_MS (75U) /* 75ms */ +#ifndef NIMBLE_AUTOCONN_CONN_ITVL_MIN_MS +#define NIMBLE_AUTOCONN_CONN_ITVL_MIN_MS 75U /* 75ms */ +#endif +#ifndef NIMBLE_AUTOCONN_CONN_ITVL_MAX_MS +#define NIMBLE_AUTOCONN_CONN_ITVL_MAX_MS 75U /* 75ms */ #endif #ifndef NIMBLE_AUTOCONN_CONN_LATENCY #define NIMBLE_AUTOCONN_CONN_LATENCY (0) @@ -74,7 +77,8 @@ extern "C" { .scan_itvl = NIMBLE_AUTOCONN_SCAN_ITVL_MS, \ .scan_win = NIMBLE_AUTOCONN_SCAN_WIN_MS, \ .conn_timeout = NIMBLE_AUTOCONN_CONN_TIMEOUT_MS, \ - .conn_itvl = NIMBLE_AUTOCONN_CONN_ITVL_MS, \ + .conn_itvl_min = NIMBLE_AUTOCONN_CONN_ITVL_MIN_MS, \ + .conn_itvl_max = NIMBLE_AUTOCONN_CONN_ITVL_MAX_MS, \ .conn_latency = NIMBLE_AUTOCONN_CONN_LATENCY, \ .conn_super_to = NIMBLE_AUTOCONN_CONN_SVTO_MS, \ .node_id = NIMBLE_AUTOCONN_NODE_ID, } diff --git a/pkg/nimble/autoconn/nimble_autoconn.c b/pkg/nimble/autoconn/nimble_autoconn.c index b75469b474..10f85d7b69 100644 --- a/pkg/nimble/autoconn/nimble_autoconn.c +++ b/pkg/nimble/autoconn/nimble_autoconn.c @@ -277,8 +277,8 @@ int nimble_autoconn_update(const nimble_autoconn_params_t *params, /* populate the connection parameters */ _conn_params.scan_itvl = BLE_GAP_SCAN_ITVL_MS(params->scan_win); _conn_params.scan_window = _conn_params.scan_itvl; - _conn_params.itvl_min = BLE_GAP_CONN_ITVL_MS(params->conn_itvl); - _conn_params.itvl_max = _conn_params.itvl_min; + _conn_params.itvl_min = BLE_GAP_CONN_ITVL_MS(params->conn_itvl_min); + _conn_params.itvl_max = BLE_GAP_CONN_ITVL_MS(params->conn_itvl_max); _conn_params.latency = 0; _conn_params.supervision_timeout = BLE_GAP_SUPERVISION_TIMEOUT_MS( params->conn_super_to);