mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
hfp: list indicator name in log, don't send update if indicator disabled
This commit is contained in:
parent
c52e356b36
commit
42dbbb66b4
@ -1032,10 +1032,14 @@ void hfp_parse(hfp_connection_t * context, uint8_t byte, int isHandsFree){
|
||||
break;
|
||||
case HFP_CMD_ENABLE_INDIVIDUAL_AG_INDICATOR_STATUS_UPDATE:
|
||||
// AG parses new gen. ind. state
|
||||
log_info("Parsed Enable ag indicator state: %s\n", context->line_buffer);
|
||||
value = atoi((char *)&context->line_buffer[0]);
|
||||
if (!context->ag_indicators[context->parser_item_index].mandatory){
|
||||
context->ag_indicators[context->parser_item_index].enabled = value;
|
||||
log_info("Parsed Enable AG indicator %u('%s'): %u\n", context->parser_item_index,
|
||||
context->ag_indicators[context->parser_item_index].name, value);
|
||||
} else {
|
||||
log_info("Parsed Enable AG indicator %u('%s') - ignore (mandatory)\n",
|
||||
context->parser_item_index, context->ag_indicators[context->parser_item_index].name);
|
||||
}
|
||||
context->parser_item_index++;
|
||||
break;
|
||||
|
@ -1727,10 +1727,16 @@ static void hfp_ag_set_ag_indicator(const char * name, int value){
|
||||
if (indicator_index < 0) return;
|
||||
hfp_ag_indicators[indicator_index].status = value;
|
||||
|
||||
|
||||
linked_list_iterator_t it;
|
||||
linked_list_iterator_init(&it, hfp_get_connections());
|
||||
while (linked_list_iterator_has_next(&it)){
|
||||
hfp_connection_t * connection = (hfp_connection_t *)linked_list_iterator_next(&it);
|
||||
if (!connection->ag_indicators[indicator_index].enabled) {
|
||||
log_info("AG indicator '%s' changed to %u but not enabled", hfp_ag_indicators[indicator_index].name, value);
|
||||
continue;
|
||||
}
|
||||
log_info("AG indicator '%s' changed to %u, request transfer statur", hfp_ag_indicators[indicator_index].name, value);
|
||||
connection->ag_indicators_status_update_bitmap = store_bit(connection->ag_indicators_status_update_bitmap, indicator_index, 1);
|
||||
hfp_run_for_context(connection);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user