Bluetooth: test: adding helper to verify CTE_RSP notification

This to remove TODO and improve the CTE unit test

Signed-off-by: Erik Brockhoff <erbr@oticon.com>
This commit is contained in:
Erik Brockhoff 2022-04-06 10:59:03 +02:00 committed by Carles Cufí
commit 0d015fd212
3 changed files with 12 additions and 2 deletions

View file

@ -129,6 +129,8 @@ void helper_pdu_verify_cte_req(const char *file, uint32_t line, struct pdu_data
void helper_pdu_verify_cte_rsp(const char *file, uint32_t line, struct pdu_data *pdu, void *param);
void helper_node_verify_cte_rsp(const char *file, uint32_t line, struct node_rx_pdu *rx,
void *param);
void helper_pdu_ntf_verify_cte_rsp(const char *file, uint32_t line, struct pdu_data *pdu,
void *param);
enum helper_pdu_opcode {
LL_VERSION_IND,

View file

@ -949,3 +949,12 @@ void helper_node_verify_cte_rsp(const char *file, uint32_t line, struct node_rx_
zassert_equal(memcmp(rx_iq_report->sample, p_iq_report->sample, p_iq_report->sample_count),
0, "IQ samples mismatch.\nCalled at %s:%d\n", file, line);
}
void helper_pdu_ntf_verify_cte_rsp(const char *file, uint32_t line, struct pdu_data *pdu,
void *param)
{
zassert_equal(pdu->ll_id, PDU_DATA_LLID_CTRL, "Not a Control PDU.\nCalled at %s:%d\n", file,
line);
zassert_equal(pdu->llctrl.opcode, PDU_DATA_LLCTRL_TYPE_CTE_RSP,
"Not a LL_CTE_RSP. Called at %s:%d\n", file, line);
}

View file

@ -137,8 +137,7 @@ helper_pdu_ntf_verify_func_t *const helper_pdu_ntf_verify[] = {
[LL_LENGTH_REQ] = NULL,
[LL_LENGTH_RSP] = NULL,
[LL_CTE_REQ] = NULL,
/* TODO (ppryga): Add verification for RSP notification */
[LL_CTE_RSP] = NULL,
[LL_CTE_RSP] = helper_pdu_ntf_verify_cte_rsp,
};
helper_node_encode_func_t *const helper_node_encode[] = {