Bluetooth: controller: Refactor Conn Param Req implementation
Refactor the Connection Parameter Request Procedure to be separate from and not overlap the variables of the Connection Update Procedure. Also, added missing implementations to pass all Connection Parameter Request Procedure related Conformance Tests. Jira: ZEP-1918 Signed-off-by: Vinayak Kariappa Chettimada <vich@nordicsemi.no>
This commit is contained in:
parent
f597c8120e
commit
2b2eb9bb07
5 changed files with 909 additions and 509 deletions
|
@ -112,6 +112,13 @@ config BT_CTLR_LE_ENC
|
|||
# Enable support for Bluetooth v4.0 LE Encryption feature in the
|
||||
# Controller.
|
||||
|
||||
config BT_CTLR_CONN_PARAM_REQ
|
||||
bool "Connection Parameter Request"
|
||||
default y
|
||||
help
|
||||
Enable support for Bluetooth v4.1 Connection Parameter Request feature
|
||||
in the Controller.
|
||||
|
||||
config BT_CTLR_LE_PING
|
||||
bool "LE Ping"
|
||||
default y
|
||||
|
|
|
@ -2431,6 +2431,10 @@ static void le_conn_param_req(struct pdu_data *pdu_data, u16_t handle,
|
|||
|
||||
if (!(event_mask & BT_EVT_MASK_LE_META_EVENT) ||
|
||||
!(le_event_mask & BT_EVT_MASK_LE_CONN_PARAM_REQ)) {
|
||||
/* event masked, reject the conn param req */
|
||||
ll_conn_update(handle, 2, BT_HCI_ERR_UNSUPP_REMOTE_FEATURE,
|
||||
0, 0, 0);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -37,6 +37,12 @@
|
|||
#define RADIO_BLE_FEAT_BIT_ENC 0
|
||||
#endif /* !CONFIG_BT_CTLR_LE_ENC */
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)
|
||||
#define RADIO_BLE_FEAT_BIT_CONN_PARAM_REQ BIT64(BT_LE_FEAT_BIT_CONN_PARAM_REQ)
|
||||
#else /* !CONFIG_BT_CTLR_CONN_PARAM_REQ */
|
||||
#define RADIO_BLE_FEAT_BIT_CONN_PARAM_REQ 0
|
||||
#endif /* !CONFIG_BT_CTLR_CONN_PARAM_REQ */
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_LE_PING)
|
||||
#define RADIO_BLE_FEAT_BIT_PING BIT64(BT_LE_FEAT_BIT_PING)
|
||||
#else /* !CONFIG_BT_CTLR_LE_PING */
|
||||
|
@ -140,7 +146,7 @@
|
|||
#define RADIO_BLE_FEAT_BIT_MASK 0x1FFFF
|
||||
#define RADIO_BLE_FEAT_BIT_MASK_VALID 0x1CF2F
|
||||
#define RADIO_BLE_FEAT (RADIO_BLE_FEAT_BIT_ENC | \
|
||||
BIT(BT_LE_FEAT_BIT_CONN_PARAM_REQ) | \
|
||||
RADIO_BLE_FEAT_BIT_CONN_PARAM_REQ | \
|
||||
BIT(BT_LE_FEAT_BIT_EXT_REJ_IND) | \
|
||||
BIT(BT_LE_FEAT_BIT_SLAVE_FEAT_REQ) | \
|
||||
RADIO_BLE_FEAT_BIT_PING | \
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
enum llcp {
|
||||
LLCP_NONE,
|
||||
LLCP_CONNECTION_UPDATE,
|
||||
LLCP_CONN_UPD,
|
||||
LLCP_CHAN_MAP,
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_LE_ENC)
|
||||
|
@ -17,6 +17,7 @@ enum llcp {
|
|||
LLCP_FEATURE_EXCHANGE,
|
||||
LLCP_VERSION_EXCHANGE,
|
||||
/* LLCP_TERMINATE, */
|
||||
LLCP_CONNECTION_PARAM_REQ,
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_LE_PING)
|
||||
LLCP_PING,
|
||||
|
@ -132,35 +133,21 @@ struct connection {
|
|||
enum llcp llcp_type;
|
||||
union {
|
||||
struct {
|
||||
enum {
|
||||
LLCP_CUI_STATE_INPROG,
|
||||
LLCP_CUI_STATE_USE,
|
||||
LLCP_CUI_STATE_SELECT
|
||||
} state:2 __packed;
|
||||
u8_t is_internal:1;
|
||||
u16_t interval;
|
||||
u16_t latency;
|
||||
u16_t timeout;
|
||||
u8_t preferred_periodicity;
|
||||
u16_t instant;
|
||||
u16_t offset0;
|
||||
u16_t offset1;
|
||||
u16_t offset2;
|
||||
u16_t offset3;
|
||||
u16_t offset4;
|
||||
u16_t offset5;
|
||||
u32_t ticks_ref;
|
||||
u32_t ticks_to_offset_next;
|
||||
u32_t win_offset_us;
|
||||
u16_t *pdu_win_offset;
|
||||
u8_t win_size;
|
||||
u8_t state:3;
|
||||
#define LLCP_CONN_STATE_INPROG 0 /* master + slave proc in progress
|
||||
* until instant
|
||||
*/
|
||||
#define LLCP_CONN_STATE_INITIATE 1 /* master sends conn_update */
|
||||
#define LLCP_CONN_STATE_REQ 2 /* master / slave send req */
|
||||
#define LLCP_CONN_STATE_RSP 3 /* master rej / slave rej/rsp */
|
||||
#define LLCP_CONN_STATE_APP_WAIT 4 /* app resp */
|
||||
#define LLCP_CONN_STATE_RSP_WAIT 5 /* master rsp or slave conn_update
|
||||
* or rej
|
||||
*/
|
||||
u8_t is_internal:2;
|
||||
} connection_update;
|
||||
u16_t *pdu_win_offset;
|
||||
u32_t ticks_anchor;
|
||||
} conn_upd;
|
||||
struct {
|
||||
u8_t initiate;
|
||||
u8_t chm[5];
|
||||
|
@ -207,6 +194,37 @@ struct connection {
|
|||
} radio_pdu_node_rx;
|
||||
} llcp_terminate;
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_CONN_PARAM_REQ)
|
||||
struct {
|
||||
u8_t req;
|
||||
u8_t ack;
|
||||
enum {
|
||||
LLCP_CPR_STATE_REQ,
|
||||
LLCP_CPR_STATE_RSP,
|
||||
LLCP_CPR_STATE_APP_REQ,
|
||||
LLCP_CPR_STATE_APP_WAIT,
|
||||
LLCP_CPR_STATE_RSP_WAIT,
|
||||
LLCP_CPR_STATE_UPD
|
||||
} state:3 __packed;
|
||||
u8_t cmd:1;
|
||||
u8_t status;
|
||||
u16_t interval;
|
||||
u16_t latency;
|
||||
u16_t timeout;
|
||||
u8_t preferred_periodicity;
|
||||
u16_t reference_conn_event_count;
|
||||
u16_t offset0;
|
||||
u16_t offset1;
|
||||
u16_t offset2;
|
||||
u16_t offset3;
|
||||
u16_t offset4;
|
||||
u16_t offset5;
|
||||
u16_t *pdu_win_offset0;
|
||||
u32_t ticks_ref;
|
||||
u32_t ticks_to_offset_next;
|
||||
} llcp_conn_param;
|
||||
#endif /* CONFIG_BT_CTLR_CONN_PARAM_REQ */
|
||||
|
||||
#if defined(CONFIG_BT_CTLR_DATA_LENGTH)
|
||||
struct {
|
||||
u8_t req;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue