hfp: response and hold fix

This commit is contained in:
Matthias Ringwald 2015-11-29 20:32:34 +01:00
parent 7b6928f7a1
commit ea56b9a4f8
2 changed files with 7 additions and 7 deletions

View File

@ -540,8 +540,8 @@ typedef struct hfp_connection {
uint8_t send_phone_number_for_voice_tag;
uint8_t send_ag_status_indicators;
uint8_t send_response_and_hold_status; // 0xff - for don't
uint8_t send_response_and_hold_status; // 0 - don't send. BRTH:0 == 1, ..
// AG only
uint8_t change_in_band_ring_tone_setting;
uint8_t ag_ring;

View File

@ -989,7 +989,7 @@ static void hfp_ag_send_response_and_hold_state(hfp_response_and_hold_state_t st
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);
connection->send_response_and_hold_status = state;
connection->send_response_and_hold_status = state + 1;
}
}
@ -1396,9 +1396,9 @@ static void hfp_run_for_context(hfp_connection_t *context){
}
// note: before update AG indicators and ok_pending
if (context->send_response_and_hold_status != 0xff){
int status = context->send_response_and_hold_status;
context->send_response_and_hold_status = 0xff;
if (context->send_response_and_hold_status){
int status = context->send_response_and_hold_status - 1;
context->send_response_and_hold_status = 0;
hfp_ag_set_response_and_hold(context->rfcomm_cid, status);
return;
}
@ -1531,7 +1531,7 @@ static void hfp_handle_rfcomm_data(uint8_t packet_type, uint16_t channel, uint8_
switch(context->command){
case HFP_CMD_RESPONSE_AND_HOLD_QUERY:
if (hfp_ag_response_and_hold_active){
context->send_response_and_hold_status = HFP_RESPONSE_AND_HOLD_INCOMING_ON_HOLD;
context->send_response_and_hold_status = HFP_RESPONSE_AND_HOLD_INCOMING_ON_HOLD + 1;
}
context->ok_pending = 1;
break;