feat(bt/bluedroid): Add flag to send BRSF features for hfp ag BQB test

This commit is contained in:
wanglai@espressif.com 2023-08-21 17:35:43 +08:00 committed by gongyantao
parent d1c701bfaa
commit 8996222eb9
2 changed files with 45 additions and 10 deletions

View File

@ -36,6 +36,9 @@
#include "stack/port_api.h"
#include "bta/utl.h"
#if BT_HF_AG_BQB_INCLUDED
static BOOLEAN s_bta_hf_ag_bqb_brsf_flag = false;
#endif /* BT_HF_AG_BQB_INCLUDED */
#if (BTA_AG_INCLUDED == TRUE)
/*****************************************************************************
@ -338,6 +341,22 @@ const UINT8 bta_ag_callsetup_ind_tbl[] =
#define COLON_IDX_4_VGSVGM 4
#endif
/*******************************************************************************
**
** Function bta_hf_ag_bqb_brsf_ctrl
**
** Description Control the usage of BTA_AG_BQB_BRSF_FEAT_SPEC for BQB test
**
** Returns void
**
*******************************************************************************/
#if BT_HF_AG_BQB_INCLUDED
void bta_hf_ag_bqb_brsf_ctrl(BOOLEAN enable)
{
s_bta_hf_ag_bqb_brsf_flag = enable;
}
#endif /* BT_HF_AG_BQB_INCLUDED */
/*******************************************
* Funcitons Result
********************************************/
@ -1025,7 +1044,15 @@ void bta_ag_at_hfp_cback(tBTA_AG_SCB *p_scb, UINT16 cmd, UINT8 arg_type,
/* store peer features */
p_scb->peer_features = (UINT16) int_arg;
/* send BRSF, send OK */
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BSRF_FEAT_SPEC));
#if BT_HF_AG_BQB_INCLUDED
if (s_bta_hf_ag_bqb_brsf_flag == true) {
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BQB_BRSF_FEAT_SPEC));
} else {
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BRSF_FEAT_SPEC));
}
#else
bta_ag_send_result(p_scb, BTA_AG_RES_BRSF, NULL, (INT16) (p_scb->features & BTA_AG_BRSF_FEAT_SPEC));
#endif /* BT_HF_AG_BQB_INCLUDED */
bta_ag_send_ok(p_scb);
break;
}

View File

@ -76,16 +76,24 @@
#define BTA_AG_ACP 0 /* accepted connection */
#define BTA_AG_INT 1 /* initiating connection */
/* feature mask that matches spec */
#define BTA_AG_BSRF_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
BTA_AG_FEAT_VTAG | BTA_AG_FEAT_REJECT | \
BTA_AG_FEAT_ECS | BTA_AG_FEAT_ECC | \
BTA_AG_FEAT_EXTERR | BTA_AG_FEAT_CODEC | \
BTA_AG_FEAT_ESCO_S4| BTA_AG_FEAT_VOIP)
#if BT_HF_AG_BQB_INCLUDED
/* feature mask that matches spec for BQB test */
#define BTA_AG_BQB_BRSF_FEAT_SPEC (BTA_AG_FEAT_VOIP | \
BTA_AG_FEAT_VTAG | BTA_AG_FEAT_CODEC | \
BTA_AG_FEAT_ECS | BTA_AG_FEAT_ECC | \
BTA_AG_FEAT_ESCO_S4 | BTA_AG_FEAT_EXTERR)
#endif /* BT_HF_AG_BQB_INCLUDED */
#define BTA_AG_SDP_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
/* feature mask that matches spec */
#define BTA_AG_BRSF_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
BTA_AG_FEAT_VTAG | BTA_AG_FEAT_REJECT | \
BTA_AG_FEAT_ECS | BTA_AG_FEAT_ECC | \
BTA_AG_FEAT_EXTERR | BTA_AG_FEAT_CODEC | \
BTA_AG_FEAT_ESCO_S4 | BTA_AG_FEAT_VOIP)
#define BTA_AG_SDP_FEAT_SPEC (BTA_AG_FEAT_3WAY | BTA_AG_FEAT_ECNR | \
BTA_AG_FEAT_VREC | BTA_AG_FEAT_INBAND | \
BTA_AG_FEAT_VTAG)
enum