diff --git a/subsys/bluetooth/controller/hci/hci.c b/subsys/bluetooth/controller/hci/hci.c index 935b827d32f3d..db1a26e5b867c 100644 --- a/subsys/bluetooth/controller/hci/hci.c +++ b/subsys/bluetooth/controller/hci/hci.c @@ -7908,7 +7908,11 @@ static void le_unknown_rsp(struct pdu_data *pdu_data, uint16_t handle, le_remote_feat_complete(BT_HCI_ERR_UNSUPP_REMOTE_FEATURE, NULL, handle, buf); break; - +#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ) + case PDU_DATA_LLCTRL_TYPE_CTE_REQ: + le_df_cte_req_failed(BT_HCI_ERR_UNSUPP_REMOTE_FEATURE, handle, buf); + break; +#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ default: BT_WARN("type: 0x%02x", pdu_data->llctrl.unknown_rsp.type); break; diff --git a/subsys/bluetooth/controller/ll_sw/ull_conn_types.h b/subsys/bluetooth/controller/ll_sw/ull_conn_types.h index 54c7bb36b146e..85cbafc34de85 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_conn_types.h +++ b/subsys/bluetooth/controller/ll_sw/ull_conn_types.h @@ -404,7 +404,17 @@ struct llcp_struct { struct { uint8_t sent; uint8_t valid; + /* + * Stores features supported by peer device. The content of the member may be + * verified when feature exchange procedure has completed, valid member is set to 1. + */ uint64_t features_peer; + /* + * Stores features common for two connected devices. Before feature exchange + * procedure is completed, the member stores information about all features + * supported by local device. After completion of the procedure, the feature set + * may be limited to features that are common. + */ uint64_t features_used; } fex; diff --git a/subsys/bluetooth/controller/ll_sw/ull_df.c b/subsys/bluetooth/controller/ll_sw/ull_df.c index dc2cddd3ecb9d..24af5cf624ffa 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_df.c +++ b/subsys/bluetooth/controller/ll_sw/ull_df.c @@ -1166,51 +1166,43 @@ uint8_t ll_df_set_conn_cte_req_enable(uint16_t handle, uint8_t enable, ull_cp_cte_req_set_disable(conn); return BT_HCI_ERR_SUCCESS; - } else { - if (!conn->lll.df_rx_cfg.is_initialized) { - return BT_HCI_ERR_CMD_DISALLOWED; - } + } - if (conn->llcp.cte_req.is_enabled) { - return BT_HCI_ERR_CMD_DISALLOWED; - } + if (!conn->lll.df_rx_cfg.is_initialized) { + return BT_HCI_ERR_CMD_DISALLOWED; + } + + if (conn->llcp.cte_req.is_enabled) { + return BT_HCI_ERR_CMD_DISALLOWED; + } #if defined(CONFIG_BT_CTLR_PHY) - /* CTE request may be enabled only in case the receiver PHY is not CODED */ - if (conn->lll.phy_rx == PHY_CODED) { - return BT_HCI_ERR_CMD_DISALLOWED; - } + /* CTE request may be enabled only in case the receiver PHY is not CODED */ + if (conn->lll.phy_rx == PHY_CODED) { + return BT_HCI_ERR_CMD_DISALLOWED; + } #endif /* CONFIG_BT_CTLR_PHY */ - if (cte_request_interval != 0 && cte_request_interval < conn->lll.latency) { - return BT_HCI_ERR_CMD_DISALLOWED; - } - - if (requested_cte_length < BT_HCI_LE_CTE_LEN_MIN || - requested_cte_length > BT_HCI_LE_CTE_LEN_MAX) { - return BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL; - } - - if (requested_cte_type != BT_HCI_LE_AOA_CTE && - requested_cte_type != BT_HCI_LE_AOD_CTE_1US && - requested_cte_type != BT_HCI_LE_AOD_CTE_2US) { - return BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL; - } + if (cte_request_interval != 0 && cte_request_interval < conn->lll.latency) { + return BT_HCI_ERR_CMD_DISALLOWED; + } - /* If controller is aware of features supported by peer device then check - * whether required features are enabled. - */ - if (conn->llcp.fex.valid && - (!(conn->llcp.fex.features_peer & BIT64(BT_LE_FEAT_BIT_CONN_CTE_RESP)))) { - return BT_HCI_ERR_UNSUPP_REMOTE_FEATURE; - } + if (requested_cte_length < BT_HCI_LE_CTE_LEN_MIN || + requested_cte_length > BT_HCI_LE_CTE_LEN_MAX) { + return BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL; + } - conn->llcp.cte_req.is_enabled = 1U; - conn->llcp.cte_req.req_interval = cte_request_interval; - conn->llcp.cte_req.cte_type = requested_cte_type; - conn->llcp.cte_req.min_cte_len = requested_cte_length; + if (requested_cte_type != BT_HCI_LE_AOA_CTE && + requested_cte_type != BT_HCI_LE_AOD_CTE_1US && + requested_cte_type != BT_HCI_LE_AOD_CTE_2US) { + return BT_HCI_ERR_UNSUPP_FEATURE_PARAM_VAL; } + conn->llcp.cte_req.is_enabled = 1U; + conn->llcp.cte_req.req_interval = cte_request_interval; + conn->llcp.cte_req.cte_type = requested_cte_type; + conn->llcp.cte_req.min_cte_len = requested_cte_length; + return ull_cp_cte_req(conn, requested_cte_length, requested_cte_type); } #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp.c b/subsys/bluetooth/controller/ll_sw/ull_llcp.c index e08f4fb20c45e..1fea6bf9ea232 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp.c @@ -971,6 +971,19 @@ uint8_t ull_cp_cte_req(struct ll_conn *conn, uint8_t min_cte_len, uint8_t cte_ty { struct proc_ctx *ctx; + /* If Controller gained, awareness: + * - by Feature Exchange control procedure that peer device does not support CTE response, + * - by reception LL_UNKNOWN_RSP with unknown type LL_CTE_REQ that peer device does not + * recognize CTE request, + * then response to Host that CTE request enable command is not possible due to unsupported + * remote feature. + */ + if ((conn->llcp.fex.valid && + (!(conn->llcp.fex.features_peer & BIT64(BT_LE_FEAT_BIT_CONN_CTE_RESP)))) || + (!conn->llcp.fex.valid && !feature_cte_req(conn))) { + return BT_HCI_ERR_UNSUPP_REMOTE_FEATURE; + } + /* The request may be started by periodic CTE request procedure, so it skips earlier * verification of PHY. In case the PHY has changed to CODE the request should be stopped. */ diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c index b26a0ced761a8..934f8dd769ec0 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_common.c @@ -219,6 +219,9 @@ static void lp_comm_ntf_cte_req(struct ll_conn *conn, struct proc_ctx *ctx, stru llcp_ntf_encode_cte_req(pdu); } break; + case PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP: + llcp_ntf_encode_unknown_rsp(ctx, pdu); + break; case PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND: llcp_ntf_encode_reject_ext_ind(ctx, pdu); break; @@ -228,6 +231,17 @@ static void lp_comm_ntf_cte_req(struct ll_conn *conn, struct proc_ctx *ctx, stru } } +static void lp_comm_ntf_cte_req_tx(struct ll_conn *conn, struct proc_ctx *ctx) +{ + if (llcp_ntf_alloc_is_available()) { + lp_comm_ntf(conn, ctx); + ull_cp_cte_req_set_disable(conn); + ctx->state = LP_COMMON_STATE_IDLE; + } else { + ctx->state = LP_COMMON_STATE_WAIT_NTF; + } +} + static void lp_comm_complete_cte_req(struct ll_conn *conn, struct proc_ctx *ctx) { if (conn->llcp.cte_req.is_enabled) { @@ -238,22 +252,19 @@ static void lp_comm_complete_cte_req(struct ll_conn *conn, struct proc_ctx *ctx) conn->llcp.cte_req.req_interval; } ctx->state = LP_COMMON_STATE_IDLE; - } else if (llcp_ntf_alloc_is_available()) { - lp_comm_ntf(conn, ctx); - ull_cp_cte_req_set_disable(conn); - ctx->state = LP_COMMON_STATE_IDLE; } else { - ctx->state = LP_COMMON_STATE_WAIT_NTF; + lp_comm_ntf_cte_req_tx(conn, ctx); } } else if (ctx->response_opcode == PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND && - ctx->reject_ext_ind.reject_opcode == PDU_DATA_LLCTRL_TYPE_CTE_REQ) { - if (llcp_ntf_alloc_is_available()) { - lp_comm_ntf(conn, ctx); - ull_cp_cte_req_set_disable(conn); - ctx->state = LP_COMMON_STATE_IDLE; - } else { - ctx->state = LP_COMMON_STATE_WAIT_NTF; - } + ctx->reject_ext_ind.reject_opcode == PDU_DATA_LLCTRL_TYPE_CTE_REQ) { + lp_comm_ntf_cte_req_tx(conn, ctx); + } else if (ctx->response_opcode == PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP && + ctx->unknown_response.type == PDU_DATA_LLCTRL_TYPE_CTE_REQ) { + /* CTE response is unsupported in peer, so disable locally for this + * connection + */ + feature_unmask_features(conn, LL_FEAT_BIT_CONNECTION_CTE_REQ); + lp_comm_ntf_cte_req_tx(conn, ctx); } else if (ctx->response_opcode == PDU_DATA_LLCTRL_TYPE_UNUSED) { /* This path is related with handling disable the CTE REQ when PHY * has been changed to CODED PHY. BT 5.3 Core Vol 4 Part E 7.8.85 @@ -263,7 +274,9 @@ static void lp_comm_complete_cte_req(struct ll_conn *conn, struct proc_ctx *ctx) ull_cp_cte_req_set_disable(conn); ctx->state = LP_COMMON_STATE_IDLE; } else { - /* Illegal response opcode */ + /* Illegal response opcode, internally changes state to + * LP_COMMON_STATE_IDLE + */ lp_comm_terminate_invalid_pdu(conn, ctx); } } else { diff --git a/subsys/bluetooth/controller/ll_sw/ull_llcp_features.h b/subsys/bluetooth/controller/ll_sw/ull_llcp_features.h index a715ada5df42d..1f876412d42e3 100644 --- a/subsys/bluetooth/controller/ll_sw/ull_llcp_features.h +++ b/subsys/bluetooth/controller/ll_sw/ull_llcp_features.h @@ -117,6 +117,15 @@ static inline bool feature_phy_coded(struct ll_conn *conn) #endif } +static inline bool feature_cte_req(struct ll_conn *conn) +{ +#if defined(CONFIG_BT_CTLR_DF) && defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ) + return conn->llcp.fex.features_used & LL_FEAT_BIT_CONNECTION_CTE_REQ; +#else + return 0; +#endif +} + /* * for asymmetric features we can check either if we support it * or if the peer supports it @@ -148,10 +157,6 @@ static inline bool feature_peer_smi_tx(struct ll_conn *conn) * per_adv * pwr_class1 * min_chann - * CTE_req - * CTE_rsp - * CTE_tx - * CTE_rx * ant_sw_CTE_tx * ant_sw_CTE_rx * tone_ext diff --git a/tests/bluetooth/controller/ctrl_cte_req/src/main.c b/tests/bluetooth/controller/ctrl_cte_req/src/main.c index 7306cbc570a13..3d15ff37883c7 100644 --- a/tests/bluetooth/controller/ctrl_cte_req/src/main.c +++ b/tests/bluetooth/controller/ctrl_cte_req/src/main.c @@ -110,118 +110,15 @@ void test_cte_req_central_local(void) /* Receive notification of sampled CTE response */ ut_rx_pdu(LL_CTE_RSP, &ntf, &remote_cte_rsp); - /* There should not be a host notifications */ + /* The RX queue should be empty now */ ut_rx_q_is_empty(); - /* Release tx node */ - ull_cp_release_tx(&conn, tx); - - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); -} - -/* Tests of invalid rsp execution of CTE Request Procedure */ - -/* +-----+ +-------+ +-----+ - * | UT | | LL_A | | LT | - * +-----+ +-------+ +-----+ - * | | | - * | Start initiation | | - * | CTE Request Proc. | | - * |--------------------------->| | - * | | | - * | | LL_LE_CTE_REQ | - * | |------------------>| - * | | | - * | | LL__RSP | - * | |<------------------| - * | | | - * ~~~~~~~~~~~~~~~~~ TERMINATE CONNECTION ~~~~~~~~~~~~~~ - * | | | - * | | | - * | | | - */ -void test_cte_req_central_local_invalid_rsp(void) -{ - uint8_t err; - struct node_tx *tx; - struct pdu_data_llctrl_unknown_rsp unknown_rsp = { - .type = PDU_DATA_LLCTRL_TYPE_CTE_REQ - }; - struct pdu_data_llctrl_reject_ind reject_ind = { - .error_code = BT_HCI_ERR_LL_PROC_COLLISION - }; - struct pdu_data_llctrl_cte_req local_cte_req = { - .cte_type_req = BT_HCI_LE_AOA_CTE, - .min_cte_len_req = BT_HCI_LE_CTE_LEN_MIN, - }; - - /* Role */ - test_set_role(&conn, BT_HCI_ROLE_PERIPHERAL); - - /* Connect */ - ull_cp_state_set(&conn, ULL_CP_CONNECTED); - - /* Initiate an CTE Request Procedure */ - err = ull_cp_cte_req(&conn, local_cte_req.min_cte_len_req, local_cte_req.cte_type_req); - zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL); - - /* Prepare */ - event_prepare(&conn); - - /* Tx Queue should have one LL Control PDU */ - lt_rx(LL_CTE_REQ, &conn, &tx, &local_cte_req); - lt_rx_q_is_empty(&conn); - - /* Rx */ - lt_tx(LL_UNKNOWN_RSP, &conn, &unknown_rsp); - - /* Done */ - event_done(&conn); - - /* There should not be a host notifications */ - ut_rx_q_is_empty(); - - /* Release tx node */ - ull_cp_release_tx(&conn, tx); - - /* Termination 'triggered' */ - zassert_equal(conn.llcp_terminate.reason_final, BT_HCI_ERR_LMP_PDU_NOT_ALLOWED, - "Terminate reason %d", conn.llcp_terminate.reason_final); - - /* Clear termination flag for subsequent test cycle */ - conn.llcp_terminate.reason_final = 0; - - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), - "Free CTX buffers %d", ctx_buffers_free()); - - /* Initiate another CTE Request Procedure */ - err = ull_cp_cte_req(&conn, local_cte_req.min_cte_len_req, local_cte_req.cte_type_req); - zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL); - - /* Prepare */ - event_prepare(&conn); - - /* Tx Queue should have one LL Control PDU */ - lt_rx(LL_CTE_REQ, &conn, &tx, &local_cte_req); - lt_rx_q_is_empty(&conn); - - /* Rx */ - lt_tx(LL_REJECT_IND, &conn, &reject_ind); - - /* Done */ - event_done(&conn); - - /* There should not be a host notifications */ - ut_rx_q_is_empty(); + /* Release Ntf */ + ull_cp_release_ntf(ntf); /* Release tx node */ ull_cp_release_tx(&conn, tx); - /* Termination 'triggered' */ - zassert_equal(conn.llcp_terminate.reason_final, BT_HCI_ERR_LMP_PDU_NOT_ALLOWED, - "Terminate reason %d", conn.llcp_terminate.reason_final); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", ctx_buffers_free()); } @@ -288,12 +185,15 @@ void test_cte_req_peripheral_local(void) /* Receive notification of sampled CTE response */ ut_rx_pdu(LL_CTE_RSP, &ntf, &remote_cte_rsp); + /* The RX queue should be empty now */ + ut_rx_q_is_empty(); + + /* Release Ntf */ + ull_cp_release_ntf(ntf); + /* Release tx node */ ull_cp_release_tx(&conn, tx); - /* There should not be a host notifications */ - ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", ctx_buffers_free()); } @@ -504,9 +404,12 @@ void test_cte_req_rejected_inv_ll_param_central_local(void) /* Receive notification of sampled CTE response */ ut_rx_pdu(LL_REJECT_EXT_IND, &ntf, &remote_reject_ext_ind); - /* There should not be a host notifications */ + /* The RX queue should be empty now */ ut_rx_q_is_empty(); + /* Release Ntf */ + ull_cp_release_ntf(ntf); + /* Release tx node */ ull_cp_release_tx(&conn, tx); @@ -580,12 +483,15 @@ void test_cte_req_rejected_inv_ll_param_peripheral_local(void) /* Receive notification of sampled CTE response */ ut_rx_pdu(LL_REJECT_EXT_IND, &ntf, &remote_reject_ext_ind); + /* The RX queue should be empty now */ + ut_rx_q_is_empty(); + + /* Release Ntf */ + ull_cp_release_ntf(ntf); + /* Release tx node */ ull_cp_release_tx(&conn, tx); - /* There should not be a host notifications */ - ut_rx_q_is_empty(); - zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", ctx_buffers_free()); } @@ -734,6 +640,96 @@ void test_cte_req_reject_inv_ll_param_peripheral_remote(void) "Free CTX buffers %d", ctx_buffers_free()); } +/* +-----+ +-------+ +-----+ + * | UT | | LL_A | | LT | + * +-----+ +-------+ +-----+ + * | | | + * | Start initiation | | + * | CTE Request Proc. | | + * |--------------------------->| | + * | | | + * | | LL_LE_CTE_REQ | + * | |------------------------------->| + * | | | + * | | LL_UNKNOWN_RSP | + * | |<-------------------------------| + * | | | + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * | | | + * | LE CTE Request Failed | | + * |<---------------------------| | + * | | | + * | | | + */ +void test_cte_req_ll_unknown_rsp_local(uint8_t role) +{ + uint8_t err; + struct node_tx *tx; + + struct pdu_data_llctrl_cte_req local_cte_req = { + .cte_type_req = BT_HCI_LE_AOD_CTE_1US, + .min_cte_len_req = BT_HCI_LE_CTE_LEN_MIN, + }; + + struct pdu_data_llctrl_unknown_rsp unknown_rsp = { .type = PDU_DATA_LLCTRL_TYPE_CTE_REQ }; + struct node_rx_pdu *ntf; + + /* Role */ + test_set_role(&conn, role); + + /* Connect */ + ull_cp_state_set(&conn, ULL_CP_CONNECTED); + + /* Initiate an CTE Request Procedure */ + err = ull_cp_cte_req(&conn, local_cte_req.min_cte_len_req, local_cte_req.cte_type_req); + zassert_equal(err, BT_HCI_ERR_SUCCESS, NULL); + + /* Prepare */ + event_prepare(&conn); + + /* Tx Queue should have one LL Control PDU */ + lt_rx(LL_CTE_REQ, &conn, &tx, &local_cte_req); + lt_rx_q_is_empty(&conn); + + /* Rx */ + lt_tx(LL_UNKNOWN_RSP, &conn, &unknown_rsp); + + /* Done */ + event_done(&conn); + + /* Receive notification of reception of unknown response. The notification is changed to + * HCI_LE_CTE_Request_Failed before send to host by HCI. This is why it is verified if CTE + * request state machine sends LL_UNKNOWN_RSP towards host. + */ + ut_rx_pdu(LL_UNKNOWN_RSP, &ntf, &unknown_rsp); + + /* The RX queue should be empty now */ + ut_rx_q_is_empty(); + + /* Release Ntf */ + ull_cp_release_ntf(ntf); + + /* Release tx node */ + ull_cp_release_tx(&conn, tx); + + zassert_equal(ctx_buffers_free(), test_ctx_buffers_cnt(), "Free CTX buffers %d", + ctx_buffers_free()); + + /* Verify that CTE response feature is marked as not supported by peer device */ + err = ull_cp_cte_req(&conn, local_cte_req.min_cte_len_req, local_cte_req.cte_type_req); + zassert_equal(err, BT_HCI_ERR_UNSUPP_REMOTE_FEATURE, NULL); +} + +void test_cte_req_ll_unknown_rsp_central_local(void) +{ + test_cte_req_ll_unknown_rsp_local(BT_HCI_ROLE_CENTRAL); +} + +void test_cte_req_ll_unknown_rsp_peripheral_local(void) +{ + test_cte_req_ll_unknown_rsp_local(BT_HCI_ROLE_PERIPHERAL); +} + /* Tests related with PHY update procedure and CTE request procedure "collision" */ #define PREFER_S2_CODING 0U @@ -844,9 +840,12 @@ static void run_local_cte_req(struct pdu_data_llctrl_cte_req *cte_req) /* Receive notification of sampled CTE response */ ut_rx_pdu(LL_CTE_RSP, &ntf, &remote_cte_rsp); - /* There should not be a host notifications */ + /* The RX queue should be empty now */ ut_rx_q_is_empty(); + /* Release Ntf */ + ull_cp_release_ntf(ntf); + /* Release tx node */ ull_cp_release_tx(&conn, tx); } @@ -924,7 +923,7 @@ void check_phy_update_and_cte_req_complete(bool is_local, struct pdu_data_llctrl ull_cp_release_tx(&conn, tx); } - /* There should not be a host notifications */ + /* The RX queue should be empty now */ ut_rx_q_is_empty(); check_current_phy_state(&conn, phy_req->tx_phys, PREFER_S2_CODING, phy_req->tx_phys); @@ -1494,8 +1493,6 @@ void test_main(void) ztest_test_suite( cte_req, ztest_unit_test_setup_teardown(test_cte_req_central_local, setup, unit_test_noop), - ztest_unit_test_setup_teardown(test_cte_req_central_local_invalid_rsp, setup, - unit_test_noop), ztest_unit_test_setup_teardown(test_cte_req_peripheral_local, setup, unit_test_noop), ztest_unit_test_setup_teardown(test_cte_req_central_remote, setup, unit_test_noop), @@ -1509,6 +1506,10 @@ void test_main(void) setup, unit_test_noop), ztest_unit_test_setup_teardown(test_cte_req_reject_inv_ll_param_peripheral_remote, setup, unit_test_noop), + ztest_unit_test_setup_teardown(test_cte_req_ll_unknown_rsp_central_local, setup, + unit_test_noop), + ztest_unit_test_setup_teardown(test_cte_req_ll_unknown_rsp_peripheral_local, setup, + unit_test_noop), ztest_unit_test_setup_teardown( test_central_local_cte_req_wait_for_phy_update_complete_and_disable, setup, unit_test_noop), @@ -1516,7 +1517,7 @@ void test_main(void) test_central_local_cte_req_wait_for_phy_update_complete_and_disable, setup, unit_test_noop), ztest_unit_test_setup_teardown( - test_peripheral_local_cte_req_wait_for_phy_update_complete, setup, + test_central_local_cte_req_wait_for_phy_update_complete, setup, unit_test_noop), ztest_unit_test_setup_teardown( test_central_local_phy_update_wait_for_cte_req_complete, setup, diff --git a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h index a5a097ea2b8b9..8d3b76f58e69e 100644 --- a/tests/bluetooth/controller/mock_ctrl/include/kconfig.h +++ b/tests/bluetooth/controller/mock_ctrl/include/kconfig.h @@ -158,7 +158,7 @@ #endif #ifndef CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN -#define CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN 39 +#define CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN 38 #endif /* Kconfig Cheats */ diff --git a/tests/bluetooth/df/common/src/bt_conn_common.c b/tests/bluetooth/df/common/src/bt_conn_common.c index f9eeed32fb1f3..43b86e736d520 100644 --- a/tests/bluetooth/df/common/src/bt_conn_common.c +++ b/tests/bluetooth/df/common/src/bt_conn_common.c @@ -14,6 +14,7 @@ #include +#include #include #include #include @@ -43,6 +44,8 @@ uint16_t ut_bt_create_connection(void) conn->llcp.cte_req.is_enabled = 0U; #endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */ + conn->llcp.fex.features_used |= BIT(BT_LE_FEAT_BIT_CONN_CTE_RESP); + return conn->lll.handle; } diff --git a/tests/bluetooth/df/connection_cte_req/prj.conf b/tests/bluetooth/df/connection_cte_req/prj.conf index 6280ed8e69939..55ba125739027 100644 --- a/tests/bluetooth/df/connection_cte_req/prj.conf +++ b/tests/bluetooth/df/connection_cte_req/prj.conf @@ -28,4 +28,4 @@ CONFIG_BT_DF_CONNECTION_CTE_RSP=y CONFIG_BT_DF_CONNECTION_CTE_REQ=y # Set antenna switch pattern to max allowed value -CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN=39 +CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN=38 diff --git a/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c b/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c index 6cd6d782374de..abf92e3a70ae1 100644 --- a/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c +++ b/tests/bluetooth/df/connection_cte_req/src/test_cte_req_enable.c @@ -194,7 +194,7 @@ static void cte_rx_param_setup(void) cte_req_params_set(); - ut_bt_create_connection(); + g_conn_handle = ut_bt_create_connection(); ut_bt_set_periph_latency(g_conn_handle, CONN_PERIPH_LATENCY); send_set_conn_cte_rx_params(g_conn_handle, &cte_rx_params, true); diff --git a/tests/bluetooth/df/connection_cte_tx_params/prj.conf b/tests/bluetooth/df/connection_cte_tx_params/prj.conf index 6519aeea950c5..c6cca863d455d 100644 --- a/tests/bluetooth/df/connection_cte_tx_params/prj.conf +++ b/tests/bluetooth/df/connection_cte_tx_params/prj.conf @@ -17,4 +17,4 @@ CONFIG_BT_DF=y CONFIG_BT_CTLR_DF=y # set antenna switch pattern to max allowed value -CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN=39 +CONFIG_BT_CTLR_DF_MAX_ANT_SW_PATTERN_LEN=38