hfp: use HFP_VR_TEXT_HEADER_SIZE that defines bytes needed for sending +BVRA message including quotes but excluding string length

This commit is contained in:
Milanka Ringwald 2021-08-23 11:39:02 +02:00
parent 51aa5d5a8f
commit a2e701c0d4
2 changed files with 6 additions and 3 deletions

View File

@ -117,8 +117,11 @@ extern "C" {
#define HFP_CALL_SERVICE_SIZE 3
#define HFP_MAX_NUM_CODECS 10
#define HFP_MAX_INDICATOR_DESC_SIZE 20
#define HFP_MAX_VR_TEXT_SIZE 100
#define HFP_MAX_INDICATOR_DESC_SIZE 20
#define HFP_MAX_VR_TEXT_SIZE 100
#define HFP_VR_TEXT_HEADER_SIZE 27 // bytes needed for sending +BVRA message including quotes but excluding string length:
// \r\n+BVRA: <vrect>,<vrecstate>,<textID>,<textType>,<textOperation>,"<string>"\r\n
#define HFP_MAX_NETWORK_OPERATOR_NAME_SIZE 17
#define HFP_HF_INDICATOR_UUID_ENHANCED_SAFETY 0x0001 // 0 - disabled, 1 - enabled

View File

@ -534,7 +534,7 @@ static int hfp_ag_send_voice_recognition_cmd(hfp_connection_t * hfp_connection,
}
static int hfp_ag_send_enhanced_voice_recognition_msg_cmd(hfp_connection_t * hfp_connection){
char buffer[HFP_MAX_VR_TEXT_SIZE + 30];
char buffer[HFP_VR_TEXT_HEADER_SIZE + HFP_MAX_VR_TEXT_SIZE];
snprintf(buffer, sizeof(buffer), "\r\n%s: 1,%d,%X,%d,%d,\"%s\"\r\n", HFP_ACTIVATE_VOICE_RECOGNITION,
hfp_connection->ag_vra_state,
hfp_connection->ag_msg.text_id,