hfp: verify if the acl handle exists

This commit is contained in:
Milanka Ringwald 2016-07-27 15:05:08 +02:00
parent 8a0c2d7bda
commit a33eb0c45b
2 changed files with 201 additions and 20 deletions

View File

@ -2073,6 +2073,10 @@ void hfp_ag_establish_service_level_connection(bd_addr_t bd_addr){
void hfp_ag_release_service_level_connection(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
hfp_release_service_level_connection(hfp_connection);
hfp_run_for_context(hfp_connection);
}
@ -2080,7 +2084,7 @@ void hfp_ag_release_service_level_connection(hci_con_handle_t acl_handle){
void hfp_ag_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle, hfp_cme_error_t error){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP HF: hfp_connection doesn't exist.");
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->extended_audio_gateway_error = 0;
@ -2116,6 +2120,10 @@ static void hfp_ag_setup_audio_connection(hfp_connection_t * hfp_connection){
void hfp_ag_establish_audio_connection(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->establish_audio_connection = 0;
hfp_ag_setup_audio_connection(hfp_connection);
hfp_run_for_context(hfp_connection);
@ -2123,6 +2131,10 @@ void hfp_ag_establish_audio_connection(hci_con_handle_t acl_handle){
void hfp_ag_release_audio_connection(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
hfp_release_audio_connection(hfp_connection);
hfp_run_for_context(hfp_connection);
}
@ -2243,6 +2255,10 @@ void hfp_ag_set_battery_level(int level){
void hfp_ag_activate_voice_recognition(hci_con_handle_t acl_handle, int activate){
if (!get_bit(hfp_supported_features, HFP_AGSF_VOICE_RECOGNITION_FUNCTION)) return;
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
if (!get_bit(hfp_connection->remote_supported_features, HFP_HFSF_VOICE_RECOGNITION_FUNCTION)) {
printf("AG cannot acivate voice recognition - not supported by HF\n");
@ -2260,6 +2276,10 @@ void hfp_ag_activate_voice_recognition(hci_con_handle_t acl_handle, int activate
void hfp_ag_set_microphone_gain(hci_con_handle_t acl_handle, int gain){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
if (hfp_connection->microphone_gain != gain){
hfp_connection->command = HFP_CMD_SET_MICROPHONE_GAIN;
hfp_connection->microphone_gain = gain;
@ -2270,6 +2290,10 @@ void hfp_ag_set_microphone_gain(hci_con_handle_t acl_handle, int gain){
void hfp_ag_set_speaker_gain(hci_con_handle_t acl_handle, int gain){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
if (hfp_connection->speaker_gain != gain){
hfp_connection->speaker_gain = gain;
hfp_connection->send_speaker_gain = 1;
@ -2279,17 +2303,29 @@ void hfp_ag_set_speaker_gain(hci_con_handle_t acl_handle, int gain){
void hfp_ag_send_phone_number_for_voice_tag(hci_con_handle_t acl_handle, const char * number){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
hfp_ag_set_clip(0, number);
hfp_connection->send_phone_number_for_voice_tag = 1;
}
void hfp_ag_reject_phone_number_for_voice_tag(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->send_error = 1;
}
void hfp_ag_send_dtmf_code_done(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->ok_pending = 1;
}
@ -2304,6 +2340,10 @@ void hfp_ag_clear_last_dialed_number(void){
void hfp_ag_notify_incoming_call_waiting(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP AG: ACL connection 0x%2x is not found.", acl_handle);
return;
}
if (!hfp_connection->call_waiting_notification_enabled) return;
hfp_connection->ag_notify_incoming_call_waiting = 1;

View File

@ -1143,14 +1143,18 @@ void hfp_hf_establish_service_level_connection(bd_addr_t bd_addr){
void hfp_hf_release_service_level_connection(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_release_service_level_connection(hfp_connection);
hfp_run_for_context(hfp_connection);
}
static void hfp_hf_set_status_update_for_all_ag_indicators(hci_con_handle_t acl_handle, uint8_t enable){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP HF: hfp_connection doesn't exist.");
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->enable_status_update_for_ag_indicators = enable;
@ -1168,8 +1172,8 @@ void hfp_hf_disable_status_update_for_all_ag_indicators(hci_con_handle_t acl_han
// TODO: returned ERROR - wrong format
void hfp_hf_set_status_update_for_individual_ag_indicators(hci_con_handle_t acl_handle, uint32_t indicators_status_bitmap){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP HF: hfp_connection doesn't exist.");
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->change_status_update_for_individual_ag_indicators = 1;
@ -1179,8 +1183,8 @@ void hfp_hf_set_status_update_for_individual_ag_indicators(hci_con_handle_t acl_
void hfp_hf_query_operator_selection(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP HF: hfp_connection doesn't exist.");
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
switch (hfp_connection->hf_query_operator_state){
@ -1198,8 +1202,8 @@ void hfp_hf_query_operator_selection(hci_con_handle_t acl_handle){
static void hfp_hf_set_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle, uint8_t enable){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection){
log_error("HFP HF: hfp_connection doesn't exist.");
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->enable_extended_audio_gateway_error_report = enable;
@ -1218,6 +1222,10 @@ void hfp_hf_disable_report_extended_audio_gateway_error_result_code(hci_con_hand
void hfp_hf_establish_audio_connection(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->establish_audio_connection = 0;
if (hfp_connection->state == HFP_AUDIO_CONNECTION_ESTABLISHED) return;
@ -1242,12 +1250,20 @@ void hfp_hf_establish_audio_connection(hci_con_handle_t acl_handle){
void hfp_hf_release_audio_connection(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_release_audio_connection(hfp_connection);
hfp_run_for_context(hfp_connection);
}
void hfp_hf_answer_incoming_call(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS){
hfp_connection->hf_answer_incoming_call = 1;
@ -1259,12 +1275,20 @@ void hfp_hf_answer_incoming_call(hci_con_handle_t acl_handle){
void hfp_hf_terminate_call(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_chup = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_reject_incoming_call(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS){
hfp_connection->hf_send_chup = 1;
@ -1274,6 +1298,10 @@ void hfp_hf_reject_incoming_call(hci_con_handle_t acl_handle){
void hfp_hf_user_busy(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS){
hfp_connection->hf_send_chld_0 = 1;
@ -1283,6 +1311,10 @@ void hfp_hf_user_busy(hci_con_handle_t acl_handle){
void hfp_hf_end_active_and_accept_other(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS ||
hfp_call_status == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
@ -1293,6 +1325,10 @@ void hfp_hf_end_active_and_accept_other(hci_con_handle_t acl_handle){
void hfp_hf_swap_calls(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS ||
hfp_call_status == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
@ -1303,6 +1339,10 @@ void hfp_hf_swap_calls(hci_con_handle_t acl_handle){
void hfp_hf_join_held_call(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS ||
hfp_call_status == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
@ -1313,6 +1353,10 @@ void hfp_hf_join_held_call(hci_con_handle_t acl_handle){
void hfp_hf_connect_calls(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS ||
hfp_call_status == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
@ -1323,6 +1367,10 @@ void hfp_hf_connect_calls(hci_con_handle_t acl_handle){
void hfp_hf_release_call_with_index(hci_con_handle_t acl_handle, int index){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS ||
hfp_call_status == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
@ -1334,6 +1382,10 @@ void hfp_hf_release_call_with_index(hci_con_handle_t acl_handle, int index){
void hfp_hf_private_consultation_with_call(hci_con_handle_t acl_handle, int index){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_callsetup_status == HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS ||
hfp_call_status == HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT){
@ -1345,16 +1397,24 @@ void hfp_hf_private_consultation_with_call(hci_con_handle_t acl_handle, int inde
void hfp_hf_dial_number(hci_con_handle_t acl_handle, char * number){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_initiate_outgoing_call = 1;
hfp_connection->hf_initiate_outgoing_call = 1;
snprintf(phone_number, sizeof(phone_number), "%s", number);
hfp_run_for_context(hfp_connection);
}
void hfp_hf_dial_memory(hci_con_handle_t acl_handle, int memory_id){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_initiate_memory_dialing = 1;
hfp_connection->hf_initiate_memory_dialing = 1;
hfp_connection->memory_id = memory_id;
hfp_run_for_context(hfp_connection);
@ -1362,72 +1422,112 @@ void hfp_hf_dial_memory(hci_con_handle_t acl_handle, int memory_id){
void hfp_hf_redial_last_number(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_initiate_redial_last_number = 1;
hfp_connection->hf_initiate_redial_last_number = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_activate_call_waiting_notification(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_activate_call_waiting_notification = 1;
hfp_connection->hf_activate_call_waiting_notification = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_deactivate_call_waiting_notification(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_deactivate_call_waiting_notification = 1;
hfp_connection->hf_deactivate_call_waiting_notification = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_activate_calling_line_notification(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_activate_calling_line_notification = 1;
hfp_connection->hf_activate_calling_line_notification = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_deactivate_calling_line_notification(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_deactivate_calling_line_notification = 1;
hfp_connection->hf_deactivate_calling_line_notification = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_activate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_activate_echo_canceling_and_noise_reduction = 1;
hfp_connection->hf_activate_echo_canceling_and_noise_reduction = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_deactivate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_deactivate_echo_canceling_and_noise_reduction = 1;
hfp_connection->hf_deactivate_echo_canceling_and_noise_reduction = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_activate_voice_recognition_notification(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_activate_voice_recognition_notification = 1;
hfp_connection->hf_activate_voice_recognition_notification = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_deactivate_voice_recognition_notification(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_deactivate_voice_recognition_notification = 1;
hfp_connection->hf_deactivate_voice_recognition_notification = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_set_microphone_gain(hci_con_handle_t acl_handle, int gain){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_connection->microphone_gain == gain) return;
if (gain < 0 || gain > 15){
@ -1441,6 +1541,10 @@ void hfp_hf_set_microphone_gain(hci_con_handle_t acl_handle, int gain){
void hfp_hf_set_speaker_gain(hci_con_handle_t acl_handle, int gain){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
if (hfp_connection->speaker_gain == gain) return;
if (gain < 0 || gain > 15){
@ -1454,18 +1558,31 @@ void hfp_hf_set_speaker_gain(hci_con_handle_t acl_handle, int gain){
void hfp_hf_send_dtmf_code(hci_con_handle_t acl_handle, char code){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_dtmf_code = code;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_request_phone_number_for_voice_tag(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_binp = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_query_current_call_status(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_clcc = 1;
hfp_run_for_context(hfp_connection);
}
@ -1473,6 +1590,10 @@ void hfp_hf_query_current_call_status(hci_con_handle_t acl_handle){
void hfp_hf_rrh_query_status(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_rrh = 1;
hfp_connection->hf_send_rrh_command = '?';
hfp_run_for_context(hfp_connection);
@ -1480,6 +1601,10 @@ void hfp_hf_rrh_query_status(hci_con_handle_t acl_handle){
void hfp_hf_rrh_hold_call(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_rrh = 1;
hfp_connection->hf_send_rrh_command = '0';
hfp_run_for_context(hfp_connection);
@ -1487,6 +1612,10 @@ void hfp_hf_rrh_hold_call(hci_con_handle_t acl_handle){
void hfp_hf_rrh_accept_held_call(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_rrh = 1;
hfp_connection->hf_send_rrh_command = '1';
hfp_run_for_context(hfp_connection);
@ -1494,6 +1623,10 @@ void hfp_hf_rrh_accept_held_call(hci_con_handle_t acl_handle){
void hfp_hf_rrh_reject_held_call(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_rrh = 1;
hfp_connection->hf_send_rrh_command = '2';
hfp_run_for_context(hfp_connection);
@ -1501,12 +1634,20 @@ void hfp_hf_rrh_reject_held_call(hci_con_handle_t acl_handle){
void hfp_hf_query_subscriber_number(hci_con_handle_t acl_handle){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
hfp_connection->hf_send_cnum = 1;
hfp_run_for_context(hfp_connection);
}
void hfp_hf_set_hf_indicator(hci_con_handle_t acl_handle, int assigned_number, int value){
hfp_connection_t * hfp_connection = get_hfp_connection_context_for_acl_handle(acl_handle);
if (!hfp_connection) {
log_error("HFP HF: ACL handle 0x%2x is not found.", acl_handle);
return;
}
// find index for assigned number
int i;
for (i = 0; i < hfp_indicators_nr ; i++){