diff --git a/src/hfp.h b/src/hfp.h index 078734fac..af7c0221a 100644 --- a/src/hfp.h +++ b/src/hfp.h @@ -222,7 +222,7 @@ typedef enum { HFP_AG_INCOMING_CALL_ACCEPETED_BY_HF, HFP_AG_TERMINATE_CALL_BY_AG, HFP_AG_TERMINATE_CALL_BY_HF, - HFP_AG_CALL_DROPED, + HFP_AG_CALL_DROPPED, } hfp_ag_call_event_t; diff --git a/src/hfp_ag.c b/src/hfp_ag.c index 2251e8edb..243563f43 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -816,7 +816,6 @@ static void hfp_ag_trigger_terminate_call(void){ } } - static void hfp_ag_call_sm(hfp_ag_call_event_t event){ switch (event){ case HFP_AG_INCOMING_CALL: @@ -857,19 +856,18 @@ static void hfp_ag_call_sm(hfp_ag_call_event_t event){ } break; case HFP_AG_TERMINATE_CALL_BY_AG: + case HFP_AG_CALL_DROPPED: switch (hfp_ag_call_state){ case HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT: hfp_ag_callsetup_state = HFP_CALLSETUP_STATUS_NO_CALL_SETUP_IN_PROGRESS; hfp_ag_call_state = HFP_CALL_STATUS_NO_HELD_OR_ACTIVE_CALLS; hfp_ag_trigger_terminate_call(); - printf("TODO AG termante call\n"); + printf("TODO AG terminate or drop call\n"); break; default: break; } break; - case HFP_AG_CALL_DROPED: - break; default: break; } @@ -1101,17 +1099,20 @@ void hfp_ag_incoming_call(void){ hfp_ag_call_sm(HFP_AG_INCOMING_CALL); } +void hfp_ag_call_dropped(void){ + hfp_ag_call_sm(HFP_AG_CALL_DROPPED); +} +// call from AG UI void hfp_ag_answer_incoming_call(void){ hfp_ag_call_sm(HFP_AG_INCOMING_CALL_ACCEPETED_BY_AG); } -/** - * @brief - */ + void hfp_ag_terminate_call(void){ hfp_ag_call_sm(HFP_AG_TERMINATE_CALL_BY_AG); } + void hfp_ag_audio_connection_transfer_towards_ag(bd_addr_t bd_addr){ hfp_connection_t * connection = get_hfp_connection_context_for_bd_addr(bd_addr); if (connection->call_state != HFP_CALL_ACTIVE) return; diff --git a/src/hfp_ag.h b/src/hfp_ag.h index ac00a9c99..ba64e6464 100644 --- a/src/hfp_ag.h +++ b/src/hfp_ag.h @@ -175,6 +175,11 @@ void hfp_ag_set_use_in_band_ring_tone(int use_in_band_ring_tone); */ void hfp_ag_incoming_call(void); +/** + * @brief + */ +void hfp_ag_call_dropped(void); + /** * @brief */