hfp: track have clip alpha

This commit is contained in:
Matthias Ringwald 2022-03-18 09:30:14 +01:00
parent deac393b74
commit 125560b849
3 changed files with 10 additions and 2 deletions

View File

@ -577,6 +577,7 @@ void hfp_reset_context_flags(hfp_connection_t * hfp_connection){
hfp_connection->call_waiting_notification_enabled = 0;
hfp_connection->command = HFP_CMD_NONE;
hfp_connection->enable_status_update_for_ag_indicators = 0xFF;
hfp_connection->clip_have_alpha = false;
hfp_reset_voice_recognition(hfp_connection);
}
@ -1207,7 +1208,7 @@ static int hfp_parser_is_end_of_line(uint8_t byte){
static void hfp_parser_reset_line_buffer(hfp_connection_t *hfp_connection) {
hfp_connection->line_size = 0;
// hfp_connection->line_buffer[0] = 0;
// we don't set the first byte to '\0' to allow access to last argument e.g. in hfp_hf_handle_rfcommand
}
static void hfp_parser_store_if_token(hfp_connection_t * hfp_connection, uint8_t byte){
@ -1420,6 +1421,10 @@ static bool hfp_parse_byte(hfp_connection_t * hfp_connection, uint8_t byte, int
hfp_next_indicators_index(hfp_connection);
hfp_connection->ag_indicators_nr = hfp_connection->parser_item_index;
break;
case HFP_CMD_AG_SENT_CLIP_INFORMATION:
// track if last argument exists
hfp_connection->clip_have_alpha = hfp_connection->line_size != 0;
break;
default:
break;
}

View File

@ -715,7 +715,8 @@ typedef struct hfp_connection {
uint8_t call_index;
// also used for CLCC, CCWA, CLIP if set
uint8_t bnip_type; // 0 == not set
char bnip_number[25]; //
char bnip_number[25]; //
bool clip_have_alpha;
#ifdef ENABLE_CC256X_ASSISTED_HFP
bool cc256x_send_write_codec_config;

View File

@ -1269,6 +1269,8 @@ static void hfp_hf_handle_rfcomm_command(hfp_connection_t * hfp_connection){
int i;
bool event_emited;
// last argument is still in line_buffer
switch (hfp_connection->command){
case HFP_CMD_GET_SUBSCRIBER_NUMBER_INFORMATION:
hfp_connection->command = HFP_CMD_NONE;