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:
parent
5bd1c68dee
commit
0d015fd212
3 changed files with 12 additions and 2 deletions
|
@ -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_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 helper_node_verify_cte_rsp(const char *file, uint32_t line, struct node_rx_pdu *rx,
|
||||||
void *param);
|
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 {
|
enum helper_pdu_opcode {
|
||||||
LL_VERSION_IND,
|
LL_VERSION_IND,
|
||||||
|
|
|
@ -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),
|
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);
|
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);
|
||||||
|
}
|
||||||
|
|
|
@ -137,8 +137,7 @@ helper_pdu_ntf_verify_func_t *const helper_pdu_ntf_verify[] = {
|
||||||
[LL_LENGTH_REQ] = NULL,
|
[LL_LENGTH_REQ] = NULL,
|
||||||
[LL_LENGTH_RSP] = NULL,
|
[LL_LENGTH_RSP] = NULL,
|
||||||
[LL_CTE_REQ] = NULL,
|
[LL_CTE_REQ] = NULL,
|
||||||
/* TODO (ppryga): Add verification for RSP notification */
|
[LL_CTE_RSP] = helper_pdu_ntf_verify_cte_rsp,
|
||||||
[LL_CTE_RSP] = NULL,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
helper_node_encode_func_t *const helper_node_encode[] = {
|
helper_node_encode_func_t *const helper_node_encode[] = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue