13deb3ec6SMatthias Ringwald /* 23deb3ec6SMatthias Ringwald * Copyright (C) 2014 BlueKitchen GmbH 33deb3ec6SMatthias Ringwald * 43deb3ec6SMatthias Ringwald * Redistribution and use in source and binary forms, with or without 53deb3ec6SMatthias Ringwald * modification, are permitted provided that the following conditions 63deb3ec6SMatthias Ringwald * are met: 73deb3ec6SMatthias Ringwald * 83deb3ec6SMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 93deb3ec6SMatthias Ringwald * notice, this list of conditions and the following disclaimer. 103deb3ec6SMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 113deb3ec6SMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 123deb3ec6SMatthias Ringwald * documentation and/or other materials provided with the distribution. 133deb3ec6SMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 143deb3ec6SMatthias Ringwald * contributors may be used to endorse or promote products derived 153deb3ec6SMatthias Ringwald * from this software without specific prior written permission. 163deb3ec6SMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 173deb3ec6SMatthias Ringwald * personal benefit and not for any commercial purpose or for 183deb3ec6SMatthias Ringwald * monetary gain. 193deb3ec6SMatthias Ringwald * 203deb3ec6SMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 213deb3ec6SMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 223deb3ec6SMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 233deb3ec6SMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 243deb3ec6SMatthias Ringwald * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 253deb3ec6SMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 263deb3ec6SMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 273deb3ec6SMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 283deb3ec6SMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 293deb3ec6SMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 303deb3ec6SMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 313deb3ec6SMatthias Ringwald * SUCH DAMAGE. 323deb3ec6SMatthias Ringwald * 333deb3ec6SMatthias Ringwald * Please inquire about commercial licensing options at 343deb3ec6SMatthias Ringwald * [email protected] 353deb3ec6SMatthias Ringwald * 363deb3ec6SMatthias Ringwald */ 373deb3ec6SMatthias Ringwald 383deb3ec6SMatthias Ringwald // ***************************************************************************** 393deb3ec6SMatthias Ringwald // 4066a048abSMatthias Ringwald // HFP Hands-Free (HF) unit 413deb3ec6SMatthias Ringwald // 423deb3ec6SMatthias Ringwald // ***************************************************************************** 433deb3ec6SMatthias Ringwald 443deb3ec6SMatthias Ringwald 45*80e33422SMatthias Ringwald #ifndef BTSTACK_HFP_HF_H 46*80e33422SMatthias Ringwald #define BTSTACK_HFP_HF_H 473deb3ec6SMatthias Ringwald 483deb3ec6SMatthias Ringwald #include "hci.h" 49efda0b48SMatthias Ringwald #include "classic/sdp_client_rfcomm.h" 503edc84c5SMatthias Ringwald #include "classic/hfp.h" 513deb3ec6SMatthias Ringwald 523deb3ec6SMatthias Ringwald #if defined __cplusplus 533deb3ec6SMatthias Ringwald extern "C" { 543deb3ec6SMatthias Ringwald #endif 553deb3ec6SMatthias Ringwald 563deb3ec6SMatthias Ringwald /* API_START */ 573deb3ec6SMatthias Ringwald 583deb3ec6SMatthias Ringwald /** 593deb3ec6SMatthias Ringwald * @brief Create HFP Hands-Free (HF) SDP service record. 60a0ffb263SMatthias Ringwald * @param service 61a0ffb263SMatthias Ringwald * @param rfcomm_channel_nr 62a0ffb263SMatthias Ringwald * @param name 63a0ffb263SMatthias Ringwald * @param suported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h 644f84bf36SMatthias Ringwald * @param wide_band_speech supported 653deb3ec6SMatthias Ringwald */ 664f84bf36SMatthias Ringwald void hfp_hf_create_sdp_record(uint8_t * service, uint32_t service_record_handle, int rfcomm_channel_nr, const char * name, uint16_t supported_features, int wide_band_speech); 673deb3ec6SMatthias Ringwald 683deb3ec6SMatthias Ringwald /** 69a0ffb263SMatthias Ringwald * @brief Set up HFP Hands-Free (HF) device without additional supported features. 70a0ffb263SMatthias Ringwald * @param rfcomm_channel_nr 713deb3ec6SMatthias Ringwald */ 72a0ffb263SMatthias Ringwald void hfp_hf_init(uint16_t rfcomm_channel_nr); 7366a048abSMatthias Ringwald 74a0ffb263SMatthias Ringwald /** 75a0ffb263SMatthias Ringwald * @brief Set codecs. 76a0ffb263SMatthias Ringwald * @param codecs_nr 77a0ffb263SMatthias Ringwald * @param codecs 78a0ffb263SMatthias Ringwald */ 79a0ffb263SMatthias Ringwald void hfp_hf_init_codecs(int codecs_nr, uint8_t * codecs); 803deb3ec6SMatthias Ringwald 81a0ffb263SMatthias Ringwald /** 82a0ffb263SMatthias Ringwald * @brief Set supported features. 83a0ffb263SMatthias Ringwald * @param supported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h 84a0ffb263SMatthias Ringwald */ 85a0ffb263SMatthias Ringwald void hfp_hf_init_supported_features(uint32_t supported_features); 86a0ffb263SMatthias Ringwald 87a0ffb263SMatthias Ringwald /** 88a0ffb263SMatthias Ringwald * @brief Set HF indicators. 89a0ffb263SMatthias Ringwald * @param indicators_nr 90a0ffb263SMatthias Ringwald * @param indicators 91a0ffb263SMatthias Ringwald */ 92a0ffb263SMatthias Ringwald void hfp_hf_init_hf_indicators(int indicators_nr, uint16_t * indicators); 93a0ffb263SMatthias Ringwald 9466a048abSMatthias Ringwald 953deb3ec6SMatthias Ringwald /** 963deb3ec6SMatthias Ringwald * @brief Register callback for the HFP Hands-Free (HF) client. 97a0ffb263SMatthias Ringwald * @param callback 983deb3ec6SMatthias Ringwald */ 9913839019SMatthias Ringwald void hfp_hf_register_packet_handler(btstack_packet_handler_t callback); 1003deb3ec6SMatthias Ringwald 1013deb3ec6SMatthias Ringwald /** 102a0ffb263SMatthias Ringwald * @brief Establish RFCOMM connection with the AG with given Bluetooth address, 103a0ffb263SMatthias Ringwald * and perform service level connection (SLC) agreement: 104a0ffb263SMatthias Ringwald * - exchange supported features 1053deb3ec6SMatthias Ringwald * - retrieve Audio Gateway (AG) indicators and their status 1063deb3ec6SMatthias Ringwald * - enable indicator status update in the AG 1073deb3ec6SMatthias Ringwald * - notify the AG about its own available codecs, if possible 1083deb3ec6SMatthias Ringwald * - retrieve the AG information describing the call hold and multiparty services, if possible 1093deb3ec6SMatthias Ringwald * - retrieve which HF indicators are enabled on the AG, if possible 110a0ffb263SMatthias Ringwald * The status of SLC connection establishment is reported via 111a0ffb263SMatthias Ringwald * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED. 112a0ffb263SMatthias Ringwald * 113a0ffb263SMatthias Ringwald * @param bd_addr Bluetooth address of the AG 1143deb3ec6SMatthias Ringwald */ 1153deb3ec6SMatthias Ringwald void hfp_hf_establish_service_level_connection(bd_addr_t bd_addr); 1163deb3ec6SMatthias Ringwald 1173deb3ec6SMatthias Ringwald /** 1183deb3ec6SMatthias Ringwald * @brief Release the RFCOMM channel and the audio connection between the HF and the AG. 119a0ffb263SMatthias Ringwald * The status of releasing the SLC connection is reported via 120a0ffb263SMatthias Ringwald * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED. 121a0ffb263SMatthias Ringwald * 122959e3c06SMatthias Ringwald * @param acl_handle of the AG 1233deb3ec6SMatthias Ringwald */ 124c8626498SMilanka Ringwald void hfp_hf_release_service_level_connection(hci_con_handle_t acl_handle); 1253deb3ec6SMatthias Ringwald 1263deb3ec6SMatthias Ringwald /** 127a0ffb263SMatthias Ringwald * @brief Enable status update for all indicators in the AG. 128a0ffb263SMatthias Ringwald * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted. 129a0ffb263SMatthias Ringwald * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED. 130a0ffb263SMatthias Ringwald * 131959e3c06SMatthias Ringwald * @param acl_handle of the AG 1323deb3ec6SMatthias Ringwald */ 133c8626498SMilanka Ringwald void hfp_hf_enable_status_update_for_all_ag_indicators(hci_con_handle_t acl_handle); 13466a048abSMatthias Ringwald 135a0ffb263SMatthias Ringwald /** 136a0ffb263SMatthias Ringwald * @brief Disable status update for all indicators in the AG. 137a0ffb263SMatthias Ringwald * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted. 138959e3c06SMatthias Ringwald * @param acl_handle of the AG 139a0ffb263SMatthias Ringwald */ 140c8626498SMilanka Ringwald void hfp_hf_disable_status_update_for_all_ag_indicators(hci_con_handle_t acl_handle); 1413deb3ec6SMatthias Ringwald 1423deb3ec6SMatthias Ringwald /** 143a0ffb263SMatthias Ringwald * @brief Enable or disable status update for the individual indicators in the AG using bitmap. 144a0ffb263SMatthias Ringwald * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted. 145a0ffb263SMatthias Ringwald * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED. 146a0ffb263SMatthias Ringwald * 147959e3c06SMatthias Ringwald * @param acl_handle of the AG 148a0ffb263SMatthias Ringwald * @param indicators_status_bitmap 32-bit bitmap, 0 - indicator is disabled, 1 - indicator is enabled 1493deb3ec6SMatthias Ringwald */ 150c8626498SMilanka Ringwald void hfp_hf_set_status_update_for_individual_ag_indicators(hci_con_handle_t acl_handle, uint32_t indicators_status_bitmap); 1513deb3ec6SMatthias Ringwald 1523deb3ec6SMatthias Ringwald /** 153a0ffb263SMatthias Ringwald * @brief Query the name of the currently selected Network operator by AG. 15466a048abSMatthias Ringwald * 155a0ffb263SMatthias Ringwald * The name is restricted to max 16 characters. The result is reported via 156a0ffb263SMatthias Ringwald * HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED subtype 157a0ffb263SMatthias Ringwald * containing network operator mode, format and name. 158a0ffb263SMatthias Ringwald * If no operator is selected, format and operator are omitted. 159a0ffb263SMatthias Ringwald * 160959e3c06SMatthias Ringwald * @param acl_handle of the AG 1613deb3ec6SMatthias Ringwald */ 162c8626498SMilanka Ringwald void hfp_hf_query_operator_selection(hci_con_handle_t acl_handle); 1633deb3ec6SMatthias Ringwald 1643deb3ec6SMatthias Ringwald /** 165a0ffb263SMatthias Ringwald * @brief Enable Extended Audio Gateway Error result codes in the AG. 1663deb3ec6SMatthias Ringwald * Whenever there is an error relating to the functionality of the AG as a 167a0ffb263SMatthias Ringwald * result of AT command, the AG shall send +CME ERROR. This error is reported via 168a0ffb263SMatthias Ringwald * HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR, see hfp_cme_error_t in hfp.h 169a0ffb263SMatthias Ringwald * 170959e3c06SMatthias Ringwald * @param acl_handle of the AG 1713deb3ec6SMatthias Ringwald */ 172c8626498SMilanka Ringwald void hfp_hf_enable_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle); 173a0ffb263SMatthias Ringwald 174a0ffb263SMatthias Ringwald /** 175a0ffb263SMatthias Ringwald * @brief Disable Extended Audio Gateway Error result codes in the AG. 176a0ffb263SMatthias Ringwald * 177959e3c06SMatthias Ringwald * @param acl_handle of the AG 178a0ffb263SMatthias Ringwald */ 179c8626498SMilanka Ringwald void hfp_hf_disable_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle); 1803deb3ec6SMatthias Ringwald 1813deb3ec6SMatthias Ringwald /** 182a0ffb263SMatthias Ringwald * @brief Establish audio connection. 183a0ffb263SMatthias Ringwald * The status of audio connection establishment is reported via 184a0ffb263SMatthias Ringwald * HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED. 185959e3c06SMatthias Ringwald * @param acl_handle of the AG 1863deb3ec6SMatthias Ringwald */ 187c8626498SMilanka Ringwald void hfp_hf_establish_audio_connection(hci_con_handle_t acl_handle); 1883deb3ec6SMatthias Ringwald 1893deb3ec6SMatthias Ringwald /** 190a0ffb263SMatthias Ringwald * @brief Release audio connection. 191a0ffb263SMatthias Ringwald * The status of releasing of the audio connection is reported via 192a0ffb263SMatthias Ringwald * HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED. 193a0ffb263SMatthias Ringwald * 194959e3c06SMatthias Ringwald * @param acl_handle of the AG 1953deb3ec6SMatthias Ringwald */ 196c8626498SMilanka Ringwald void hfp_hf_release_audio_connection(hci_con_handle_t acl_handle); 1973deb3ec6SMatthias Ringwald 198ce263fc8SMatthias Ringwald /** 199a0ffb263SMatthias Ringwald * @brief Answer incoming call. 200959e3c06SMatthias Ringwald * @param acl_handle of the AG 201ce263fc8SMatthias Ringwald */ 202c8626498SMilanka Ringwald void hfp_hf_answer_incoming_call(hci_con_handle_t acl_handle); 203ce263fc8SMatthias Ringwald 204ce263fc8SMatthias Ringwald /** 205a0ffb263SMatthias Ringwald * @brief Reject incoming call. 206959e3c06SMatthias Ringwald * @param acl_handle of the AG 207ce263fc8SMatthias Ringwald */ 208c8626498SMilanka Ringwald void hfp_hf_reject_incoming_call(hci_con_handle_t acl_handle); 209ce263fc8SMatthias Ringwald 210ce263fc8SMatthias Ringwald /** 211a0ffb263SMatthias Ringwald * @brief Release all held calls or sets User Determined User Busy (UDUB) for a waiting call. 212959e3c06SMatthias Ringwald * @param acl_handle of the AG 213ce263fc8SMatthias Ringwald */ 214c8626498SMilanka Ringwald void hfp_hf_user_busy(hci_con_handle_t acl_handle); 215ce263fc8SMatthias Ringwald 216ce263fc8SMatthias Ringwald /** 217a0ffb263SMatthias Ringwald * @brief Release all active calls (if any exist) and accepts the other (held or waiting) call. 218959e3c06SMatthias Ringwald * @param acl_handle of the AG 219ce263fc8SMatthias Ringwald */ 220c8626498SMilanka Ringwald void hfp_hf_end_active_and_accept_other(hci_con_handle_t acl_handle); 221ce263fc8SMatthias Ringwald 222ce263fc8SMatthias Ringwald /** 223a0ffb263SMatthias Ringwald * @brief Place all active calls (if any exist) on hold and accepts the other (held or waiting) call. 224959e3c06SMatthias Ringwald * @param acl_handle of the AG 225ce263fc8SMatthias Ringwald */ 226c8626498SMilanka Ringwald void hfp_hf_swap_calls(hci_con_handle_t acl_handle); 227ce263fc8SMatthias Ringwald 228ce263fc8SMatthias Ringwald /** 229a0ffb263SMatthias Ringwald * @brief Add a held call to the conversation. 230959e3c06SMatthias Ringwald * @param acl_handle of the AG 231ce263fc8SMatthias Ringwald */ 232c8626498SMilanka Ringwald void hfp_hf_join_held_call(hci_con_handle_t acl_handle); 233ce263fc8SMatthias Ringwald 234ce263fc8SMatthias Ringwald /** 235a0ffb263SMatthias Ringwald * @brief Connect the two calls and disconnects the subscriber from both calls (Explicit Call 236a0ffb263SMatthias Ringwald Transfer). 237959e3c06SMatthias Ringwald * @param acl_handle of the AG 238ce263fc8SMatthias Ringwald */ 239c8626498SMilanka Ringwald void hfp_hf_connect_calls(hci_con_handle_t acl_handle); 240ce263fc8SMatthias Ringwald 241ce263fc8SMatthias Ringwald /** 242a0ffb263SMatthias Ringwald * @brief Terminate an incoming or an outgoing call. 243a0ffb263SMatthias Ringwald * HFP_SUBEVENT_CALL_TERMINATED is sent upon call termination. 244959e3c06SMatthias Ringwald * @param acl_handle of the AG 245ce263fc8SMatthias Ringwald */ 246c8626498SMilanka Ringwald void hfp_hf_terminate_call(hci_con_handle_t acl_handle); 247ce263fc8SMatthias Ringwald 248ce263fc8SMatthias Ringwald /** 249a0ffb263SMatthias Ringwald * @brief Initiate outgoing voice call by providing the destination phone number to the AG. 250959e3c06SMatthias Ringwald * @param acl_handle of the AG 251a0ffb263SMatthias Ringwald * @param number 252ce263fc8SMatthias Ringwald */ 253c8626498SMilanka Ringwald void hfp_hf_dial_number(hci_con_handle_t acl_handle, char * number); 254ce263fc8SMatthias Ringwald 255ce263fc8SMatthias Ringwald /** 256a0ffb263SMatthias Ringwald * @brief Initiate outgoing voice call using the memory dialing feature of the AG. 257959e3c06SMatthias Ringwald * @param acl_handle of the AG 258a0ffb263SMatthias Ringwald * @param memory_id 259ce263fc8SMatthias Ringwald */ 260c8626498SMilanka Ringwald void hfp_hf_dial_memory(hci_con_handle_t acl_handle, int memory_id); 261ce263fc8SMatthias Ringwald 262ce263fc8SMatthias Ringwald /** 263a0ffb263SMatthias Ringwald * @brief Initiate outgoing voice call by recalling the last number dialed by the AG. 264959e3c06SMatthias Ringwald * @param acl_handle of the AG 265ce263fc8SMatthias Ringwald */ 266c8626498SMilanka Ringwald void hfp_hf_redial_last_number(hci_con_handle_t acl_handle); 267ce263fc8SMatthias Ringwald 268ce263fc8SMatthias Ringwald /* 269a0ffb263SMatthias Ringwald * @brief Enable the “Call Waiting notification” function in the AG. 270a0ffb263SMatthias Ringwald * The AG shall send the corresponding result code to the HF whenever 271a0ffb263SMatthias Ringwald * an incoming call is waiting during an ongoing call. In that event, 272a0ffb263SMatthias Ringwald * the HFP_SUBEVENT_CALL_WAITING_NOTIFICATION is emitted. 273a0ffb263SMatthias Ringwald * 274959e3c06SMatthias Ringwald * @param acl_handle of the AG 275ce263fc8SMatthias Ringwald */ 276c8626498SMilanka Ringwald void hfp_hf_activate_call_waiting_notification(hci_con_handle_t acl_handle); 277ce263fc8SMatthias Ringwald 278ce263fc8SMatthias Ringwald /* 279a0ffb263SMatthias Ringwald * @brief Disable the “Call Waiting notification” function in the AG. 280959e3c06SMatthias Ringwald * @param acl_handle of the AG 281ce263fc8SMatthias Ringwald */ 282c8626498SMilanka Ringwald void hfp_hf_deactivate_call_waiting_notification(hci_con_handle_t acl_handle); 283ce263fc8SMatthias Ringwald 284ce263fc8SMatthias Ringwald /* 285a0ffb263SMatthias Ringwald * @brief Enable the “Calling Line Identification notification” function in the AG. 286a0ffb263SMatthias Ringwald * The AG shall issue the corresponding result code just after every RING indication, 287a0ffb263SMatthias Ringwald * when the HF is alerted in an incoming call. In that event, 288a0ffb263SMatthias Ringwald * the HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION is emitted. 289959e3c06SMatthias Ringwald * @param acl_handle of the AG 290ce263fc8SMatthias Ringwald */ 291c8626498SMilanka Ringwald void hfp_hf_activate_calling_line_notification(hci_con_handle_t acl_handle); 292ce263fc8SMatthias Ringwald 293ce263fc8SMatthias Ringwald /* 294a0ffb263SMatthias Ringwald * @brief Disable the “Calling Line Identification notification” function in the AG. 295959e3c06SMatthias Ringwald * @param acl_handle of the AG 296ce263fc8SMatthias Ringwald */ 297c8626498SMilanka Ringwald void hfp_hf_deactivate_calling_line_notification(hci_con_handle_t acl_handle); 298ce263fc8SMatthias Ringwald 299ce263fc8SMatthias Ringwald 300ce263fc8SMatthias Ringwald /* 301a0ffb263SMatthias Ringwald * @brief Activate echo canceling and noise reduction in the AG. By default, 302a0ffb263SMatthias Ringwald * if the AG supports its own embedded echo canceling and/or noise reduction 303a0ffb263SMatthias Ringwald * functions, it shall have them activated until this function is called. 304a0ffb263SMatthias Ringwald * If the AG does not support any echo canceling and noise reduction functions, 305a0ffb263SMatthias Ringwald * it shall respond with the ERROR indicator (TODO) 306959e3c06SMatthias Ringwald * @param acl_handle of the AG 307ce263fc8SMatthias Ringwald */ 308c8626498SMilanka Ringwald void hfp_hf_activate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle); 309ce263fc8SMatthias Ringwald 310ce263fc8SMatthias Ringwald /* 311a0ffb263SMatthias Ringwald * @brief Deactivate echo canceling and noise reduction in the AG. 312ce263fc8SMatthias Ringwald */ 313c8626498SMilanka Ringwald void hfp_hf_deactivate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle); 314ce263fc8SMatthias Ringwald 315ce263fc8SMatthias Ringwald /* 316a0ffb263SMatthias Ringwald * @brief Activate voice recognition function. 317959e3c06SMatthias Ringwald * @param acl_handle of the AG 318ce263fc8SMatthias Ringwald */ 319c8626498SMilanka Ringwald void hfp_hf_activate_voice_recognition_notification(hci_con_handle_t acl_handle); 320ce263fc8SMatthias Ringwald 321ce263fc8SMatthias Ringwald /* 322a0ffb263SMatthias Ringwald * @brief Dectivate voice recognition function. 323959e3c06SMatthias Ringwald * @param acl_handle of the AG 324ce263fc8SMatthias Ringwald */ 325c8626498SMilanka Ringwald void hfp_hf_deactivate_voice_recognition_notification(hci_con_handle_t acl_handle); 326ce263fc8SMatthias Ringwald 327ce263fc8SMatthias Ringwald /* 328a0ffb263SMatthias Ringwald * @brief Set microphone gain. 329959e3c06SMatthias Ringwald * @param acl_handle of the AG 330a0ffb263SMatthias Ringwald * @param gain Valid range: [0,15] 331ce263fc8SMatthias Ringwald */ 332c8626498SMilanka Ringwald void hfp_hf_set_microphone_gain(hci_con_handle_t acl_handle, int gain); 333ce263fc8SMatthias Ringwald 334ce263fc8SMatthias Ringwald /* 335a0ffb263SMatthias Ringwald * @brief Set speaker gain. 336959e3c06SMatthias Ringwald * @param acl_handle of the AG 337a0ffb263SMatthias Ringwald * @param gain Valid range: [0,15] 338ce263fc8SMatthias Ringwald */ 339c8626498SMilanka Ringwald void hfp_hf_set_speaker_gain(hci_con_handle_t acl_handle, int gain); 340ce263fc8SMatthias Ringwald 341ce263fc8SMatthias Ringwald /* 342a0ffb263SMatthias Ringwald * @brief Instruct the AG to transmit a DTMF code. 343959e3c06SMatthias Ringwald * @param acl_handle of the AG 344a0ffb263SMatthias Ringwald * @param dtmf_code 345ce263fc8SMatthias Ringwald */ 346c8626498SMilanka Ringwald void hfp_hf_send_dtmf_code(hci_con_handle_t acl_handle, char code); 347ce263fc8SMatthias Ringwald 348ce263fc8SMatthias Ringwald /* 349a0ffb263SMatthias Ringwald * @brief Read numbers from the AG for the purpose of creating 350a0ffb263SMatthias Ringwald * a unique voice tag and storing the number and its linked voice 351a0ffb263SMatthias Ringwald * tag in the HF’s memory. 352a0ffb263SMatthias Ringwald * The number is reported via HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG. 353959e3c06SMatthias Ringwald * @param acl_handle of the AG 354ce263fc8SMatthias Ringwald */ 355c8626498SMilanka Ringwald void hfp_hf_request_phone_number_for_voice_tag(hci_con_handle_t acl_handle); 3563deb3ec6SMatthias Ringwald 357667ec068SMatthias Ringwald /* 358a0ffb263SMatthias Ringwald * @brief Query the list of current calls in AG. 359a0ffb263SMatthias Ringwald * The result is received via HFP_SUBEVENT_ENHANCED_CALL_STATUS. 360959e3c06SMatthias Ringwald * @param acl_handle of the AG 361667ec068SMatthias Ringwald */ 362c8626498SMilanka Ringwald void hfp_hf_query_current_call_status(hci_con_handle_t acl_handle); 363667ec068SMatthias Ringwald 364667ec068SMatthias Ringwald /* 365a0ffb263SMatthias Ringwald * @brief Release a call with index in the AG. 366959e3c06SMatthias Ringwald * @param acl_handle of the AG 367a0ffb263SMatthias Ringwald * @param index 368667ec068SMatthias Ringwald */ 369c8626498SMilanka Ringwald void hfp_hf_release_call_with_index(hci_con_handle_t acl_handle, int index); 370667ec068SMatthias Ringwald 371667ec068SMatthias Ringwald /* 372a0ffb263SMatthias Ringwald * @brief Place all parties of a multiparty call on hold with the 373a0ffb263SMatthias Ringwald * exception of the specified call. 374959e3c06SMatthias Ringwald * @param acl_handle of the AG 375a0ffb263SMatthias Ringwald * @param index 376667ec068SMatthias Ringwald */ 377c8626498SMilanka Ringwald void hfp_hf_private_consultation_with_call(hci_con_handle_t acl_handle, int index); 378667ec068SMatthias Ringwald 379667ec068SMatthias Ringwald /* 380a0ffb263SMatthias Ringwald * @brief Query the status of the “Response and Hold” state of the AG. 381a0ffb263SMatthias Ringwald * The result is reported via HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS. 382959e3c06SMatthias Ringwald * @param acl_handle of the AG 383667ec068SMatthias Ringwald */ 384c8626498SMilanka Ringwald void hfp_hf_rrh_query_status(hci_con_handle_t acl_handle); 385667ec068SMatthias Ringwald 386667ec068SMatthias Ringwald /* 387a0ffb263SMatthias Ringwald * @brief Put an incoming call on hold in the AG. 388959e3c06SMatthias Ringwald * @param acl_handle of the AG 389667ec068SMatthias Ringwald */ 390c8626498SMilanka Ringwald void hfp_hf_rrh_hold_call(hci_con_handle_t acl_handle); 391667ec068SMatthias Ringwald 392667ec068SMatthias Ringwald /* 393a0ffb263SMatthias Ringwald * @brief Accept held incoming call in the AG. 394959e3c06SMatthias Ringwald * @param acl_handle of the AG 395667ec068SMatthias Ringwald */ 396c8626498SMilanka Ringwald void hfp_hf_rrh_accept_held_call(hci_con_handle_t acl_handle); 397667ec068SMatthias Ringwald 398667ec068SMatthias Ringwald /* 399a0ffb263SMatthias Ringwald * @brief Reject held incoming call in the AG. 400959e3c06SMatthias Ringwald * @param acl_handle of the AG 401667ec068SMatthias Ringwald */ 402c8626498SMilanka Ringwald void hfp_hf_rrh_reject_held_call(hci_con_handle_t acl_handle); 403667ec068SMatthias Ringwald 404667ec068SMatthias Ringwald /* 405a0ffb263SMatthias Ringwald * @brief Query the AG subscriber number. 406a0ffb263SMatthias Ringwald * The result is reported via HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION. 407959e3c06SMatthias Ringwald * @param acl_handle of the AG 408667ec068SMatthias Ringwald */ 409c8626498SMilanka Ringwald void hfp_hf_query_subscriber_number(hci_con_handle_t acl_handle); 410667ec068SMatthias Ringwald 411667ec068SMatthias Ringwald /* 412a0ffb263SMatthias Ringwald * @brief Set HF indicator. 413959e3c06SMatthias Ringwald * @param acl_handle of the AG 414a0ffb263SMatthias Ringwald * @param assigned_number 415a0ffb263SMatthias Ringwald * @param value 416667ec068SMatthias Ringwald */ 417c8626498SMilanka Ringwald void hfp_hf_set_hf_indicator(hci_con_handle_t acl_handle, int assigned_number, int value); 418667ec068SMatthias Ringwald 419d7f6b5cbSMatthias Ringwald /* 420d7f6b5cbSMatthias Ringwald * @brief Tests if in-band ringtone is active on AG (requires SLC) 421d7f6b5cbSMatthias Ringwald * @aram acl_handler of the AG 422d7f6b5cbSMatthias Ringwald */ 423d7f6b5cbSMatthias Ringwald int hfp_hf_in_band_ringtone_active(hci_con_handle_t acl_handle); 424d7f6b5cbSMatthias Ringwald 4253deb3ec6SMatthias Ringwald /* API_END */ 4263deb3ec6SMatthias Ringwald 4273deb3ec6SMatthias Ringwald #if defined __cplusplus 4283deb3ec6SMatthias Ringwald } 4293deb3ec6SMatthias Ringwald #endif 4303deb3ec6SMatthias Ringwald 431*80e33422SMatthias Ringwald #endif // BTSTACK_HFP_HF_H 432