Skip to content

Commit 0d015fd

Browse files
erbr-otcarlescufi
authored andcommitted
Bluetooth: test: adding helper to verify CTE_RSP notification
This to remove TODO and improve the CTE unit test Signed-off-by: Erik Brockhoff <[email protected]>
1 parent 5bd1c68 commit 0d015fd

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

tests/bluetooth/controller/common/include/helper_pdu.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,8 @@ void helper_pdu_verify_cte_req(const char *file, uint32_t line, struct pdu_data
129129
void helper_pdu_verify_cte_rsp(const char *file, uint32_t line, struct pdu_data *pdu, void *param);
130130
void helper_node_verify_cte_rsp(const char *file, uint32_t line, struct node_rx_pdu *rx,
131131
void *param);
132+
void helper_pdu_ntf_verify_cte_rsp(const char *file, uint32_t line, struct pdu_data *pdu,
133+
void *param);
132134

133135
enum helper_pdu_opcode {
134136
LL_VERSION_IND,

tests/bluetooth/controller/common/src/helper_pdu.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,3 +949,12 @@ void helper_node_verify_cte_rsp(const char *file, uint32_t line, struct node_rx_
949949
zassert_equal(memcmp(rx_iq_report->sample, p_iq_report->sample, p_iq_report->sample_count),
950950
0, "IQ samples mismatch.\nCalled at %s:%d\n", file, line);
951951
}
952+
953+
void helper_pdu_ntf_verify_cte_rsp(const char *file, uint32_t line, struct pdu_data *pdu,
954+
void *param)
955+
{
956+
zassert_equal(pdu->ll_id, PDU_DATA_LLID_CTRL, "Not a Control PDU.\nCalled at %s:%d\n", file,
957+
line);
958+
zassert_equal(pdu->llctrl.opcode, PDU_DATA_LLCTRL_TYPE_CTE_RSP,
959+
"Not a LL_CTE_RSP. Called at %s:%d\n", file, line);
960+
}

tests/bluetooth/controller/common/src/helper_util.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,7 @@ helper_pdu_ntf_verify_func_t *const helper_pdu_ntf_verify[] = {
137137
[LL_LENGTH_REQ] = NULL,
138138
[LL_LENGTH_RSP] = NULL,
139139
[LL_CTE_REQ] = NULL,
140-
/* TODO (ppryga): Add verification for RSP notification */
141-
[LL_CTE_RSP] = NULL,
140+
[LL_CTE_RSP] = helper_pdu_ntf_verify_cte_rsp,
142141
};
143142

144143
helper_node_encode_func_t *const helper_node_encode[] = {

0 commit comments

Comments
 (0)