diff --git a/src/classic/hfp.c b/src/classic/hfp.c index 662bd3962..0573b8432 100644 --- a/src/classic/hfp.c +++ b/src/classic/hfp.c @@ -1381,7 +1381,7 @@ static bool hfp_parse_byte(hfp_connection_t * hfp_connection, uint8_t byte, int // store command id for custom command and just store rest of line if (hfp_connection->command == HFP_CMD_CUSTOM_MESSAGE){ const hfp_custom_at_command_t * at_command = hfp_custom_command_lookup((const char *)hfp_connection->line_buffer); - hfp_connection->ag_custom_at_command_id = at_command->command_id; + hfp_connection->custom_at_command_id = at_command->command_id; hfp_connection->parser_state = HFP_PARSER_CUSTOM_COMMAND; return true; } diff --git a/src/classic/hfp.h b/src/classic/hfp.h index 32cb1527e..29ce137fd 100644 --- a/src/classic/hfp.h +++ b/src/classic/hfp.h @@ -641,6 +641,9 @@ typedef struct hfp_connection { // HF: AT Command, AG: Unsolicited Result Code const char * send_custom_message; + // HF: Unsolicited Result Code, AG: AT Command + uint16_t custom_at_command_id; + bool emit_vra_enabled_after_audio_established; // AG only uint8_t change_in_band_ring_tone_setting; @@ -665,7 +668,6 @@ typedef struct hfp_connection { int send_status_of_current_calls; int next_call_index; - uint16_t ag_custom_at_command_id; // HF only // HF: track command for which ok/error response need to be received diff --git a/src/classic/hfp_ag.c b/src/classic/hfp_ag.c index 98c72a5e3..e9df1b7de 100644 --- a/src/classic/hfp_ag.c +++ b/src/classic/hfp_ag.c @@ -895,7 +895,7 @@ static void hfp_ag_emit_custom_command_event(hfp_connection_t * hfp_connection){ event[1] = 5 + line_len; event[2] = HFP_SUBEVENT_CUSTOM_AT_COMMAND; little_endian_store_16(event, 3, hfp_connection->acl_handle); - little_endian_store_16(event, 5, hfp_connection->ag_custom_at_command_id); + little_endian_store_16(event, 5, hfp_connection->custom_at_command_id); memcpy(&event[7], hfp_connection->line_buffer, line_len); (*hfp_ag_callback)(HCI_EVENT_PACKET, 0, event, 7 + line_len); } @@ -2532,7 +2532,7 @@ static void hfp_ag_handle_rfcomm_data(hfp_connection_t * hfp_connection, uint8_t case HFP_CMD_CUSTOM_MESSAGE: hfp_connection->command = HFP_CMD_NONE; hfp_parser_reset_line_buffer(hfp_connection); - log_info("Custom AT Command ID 0x%04x", hfp_connection->ag_custom_at_command_id); + log_info("Custom AT Command ID 0x%04x", hfp_connection->custom_at_command_id); hfp_ag_emit_custom_command_event(hfp_connection); break; case HFP_CMD_UNKNOWN: