mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-15 21:40:22 +00:00
hfp: terminate/reject incoming call
This commit is contained in:
parent
a14eb9fccc
commit
56f716feca
23
src/hfp_hf.c
23
src/hfp_hf.c
@ -849,17 +849,32 @@ void hfp_hf_answer_incoming_call(bd_addr_t bd_addr){
|
|||||||
|
|
||||||
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS){
|
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS){
|
||||||
connection->hf_answer_incoming_call = 1;
|
connection->hf_answer_incoming_call = 1;
|
||||||
|
hfp_run_for_context(connection);
|
||||||
} else {
|
} else {
|
||||||
log_error("HFP HF: answering incoming call in wrong callsetup state %u", hfp_callsetup_status);
|
log_error("HFP HF: answering incoming call with wrong callsetup status %u", hfp_callsetup_status);
|
||||||
}
|
}
|
||||||
hfp_run_for_context(connection);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void hfp_hf_terminate_call(bd_addr_t bd_addr){
|
void hfp_hf_terminate_call(bd_addr_t bd_addr){
|
||||||
hfp_hf_establish_service_level_connection(bd_addr);
|
hfp_hf_establish_service_level_connection(bd_addr);
|
||||||
hfp_connection_t * connection = get_hfp_connection_context_for_bd_addr(bd_addr);
|
hfp_connection_t * connection = get_hfp_connection_context_for_bd_addr(bd_addr);
|
||||||
connection->hf_send_chup = 1;
|
|
||||||
hfp_run_for_context(connection);
|
if (hfp_call_status == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
|
||||||
|
connection->hf_send_chup = 1;
|
||||||
|
hfp_run_for_context(connection);
|
||||||
|
} else {
|
||||||
|
log_error("HFP HF: terminating incoming call with wrong call status %u", hfp_call_status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void hfp_hf_reject_call(bd_addr_t bd_addr){
|
||||||
|
hfp_hf_establish_service_level_connection(bd_addr);
|
||||||
|
hfp_connection_t * connection = get_hfp_connection_context_for_bd_addr(bd_addr);
|
||||||
|
|
||||||
|
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS){
|
||||||
|
connection->hf_send_chup = 1;
|
||||||
|
hfp_run_for_context(connection);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void hfp_hf_enable_calling_line_identification(bd_addr_t bd_addr){
|
void hfp_hf_enable_calling_line_identification(bd_addr_t bd_addr){
|
||||||
|
@ -154,6 +154,11 @@ void hfp_hf_release_audio_connection(bd_addr_t bd_addr);
|
|||||||
*/
|
*/
|
||||||
void hfp_hf_answer_incoming_call(bd_addr_t bd_addr);
|
void hfp_hf_answer_incoming_call(bd_addr_t bd_addr);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*/
|
||||||
|
void hfp_hf_reject_call(bd_addr_t bd_addr);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
*/
|
*/
|
||||||
|
@ -111,7 +111,9 @@ static void show_usage(void){
|
|||||||
printf("f - answer incoming call\n");
|
printf("f - answer incoming call\n");
|
||||||
printf("F - Hangup call\n");
|
printf("F - Hangup call\n");
|
||||||
|
|
||||||
|
printf("G - Reject call.\n");
|
||||||
printf("g - query network operator name\n");
|
printf("g - query network operator name\n");
|
||||||
|
|
||||||
printf("h - enable Calling Line Identification.\n");
|
printf("h - enable Calling Line Identification.\n");
|
||||||
|
|
||||||
printf("t - terminate connection\n");
|
printf("t - terminate connection\n");
|
||||||
@ -171,6 +173,10 @@ static int stdin_process(struct data_source *ds){
|
|||||||
printf("Hangup call.\n");
|
printf("Hangup call.\n");
|
||||||
hfp_hf_terminate_call(device_addr);
|
hfp_hf_terminate_call(device_addr);
|
||||||
break;
|
break;
|
||||||
|
case 'G':
|
||||||
|
printf("Reject call.\n");
|
||||||
|
hfp_hf_reject_call(device_addr);
|
||||||
|
break;
|
||||||
case 'g':
|
case 'g':
|
||||||
printf("Query operator.\n");
|
printf("Query operator.\n");
|
||||||
hfp_hf_query_operator_selection(device_addr);
|
hfp_hf_query_operator_selection(device_addr);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user