This commit is contained in:
Milanka Ringwald 2015-11-26 14:27:00 +01:00
commit a579b7a5c0
3 changed files with 17 additions and 10 deletions

View File

@ -1034,14 +1034,18 @@ 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
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);
if (context->line_size<1){
log_info("Parsed Enable AG indicator pos %u('%s') - unchanged\n", context->parser_item_index,
context->ag_indicators[context->parser_item_index].name);
}
else if (context->ag_indicators[context->parser_item_index].mandatory){
log_info("Parsed Enable AG indicator pos %u('%s') - ignore (mandatory)\n",
context->parser_item_index, context->ag_indicators[context->parser_item_index].name);
} else {
log_info("Parsed Enable AG indicator %u('%s') - mandatory indicator, ignore value %u\n",
context->parser_item_index, context->ag_indicators[context->parser_item_index].name, value);
value = atoi((char *)&context->line_buffer[0]);
context->ag_indicators[context->parser_item_index].enabled = value;
log_info("Parsed Enable AG indicator pos %u('%s'): %u\n", context->parser_item_index,
context->ag_indicators[context->parser_item_index].name, value);
}
context->parser_item_index++;
break;

View File

@ -658,8 +658,8 @@ static int hfp_ag_run_for_context_service_level_connection_queries(hfp_connectio
return 1;
}
case HFP_CMD_ENABLE_INDICATOR_STATUS_UPDATE:
printf("TODO\n");
break;
hfp_ag_ok(context->rfcomm_cid);
return 1;
default:
break;
}
@ -1288,6 +1288,10 @@ static void hfp_run_for_context(hfp_connection_t *context){
int i;
for (i=0;i<context->ag_indicators_nr;i++){
if (get_bit(context->ag_indicators_status_update_bitmap, i)){
if (!context->enable_status_update_for_ag_indicators) {
printf("+CMER:3,0,0,0 - not sending update for %s\n", hfp_ag_indicators[i].name);
break;
}
context->ag_indicators_status_update_bitmap = store_bit(context->ag_indicators_status_update_bitmap, i, 0);
hfp_ag_transfer_ag_indicators_status_cmd(context->rfcomm_cid, &hfp_ag_indicators[i]);
return;

View File

@ -364,7 +364,6 @@ static int codecs_exchange_state_machine(hfp_connection_t * context){
*/
if (context->ok_pending) return 0;
int done = 1;
printf(" -> State machine: CC\n");
switch (context->command){