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 232fca4dadSMilanka Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN 242fca4dadSMilanka Ringwald * GMBH 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 38fe5a6c4eSMilanka Ringwald /** 39fe5a6c4eSMilanka Ringwald * @title HFP Hands-Free (HF) 40fe5a6c4eSMilanka Ringwald * 41fe5a6c4eSMilanka Ringwald */ 423deb3ec6SMatthias Ringwald 4380e33422SMatthias Ringwald #ifndef BTSTACK_HFP_HF_H 4480e33422SMatthias Ringwald #define BTSTACK_HFP_HF_H 453deb3ec6SMatthias Ringwald 463deb3ec6SMatthias Ringwald #include "hci.h" 47efda0b48SMatthias Ringwald #include "classic/sdp_client_rfcomm.h" 483edc84c5SMatthias Ringwald #include "classic/hfp.h" 493deb3ec6SMatthias Ringwald 503deb3ec6SMatthias Ringwald #if defined __cplusplus 513deb3ec6SMatthias Ringwald extern "C" { 523deb3ec6SMatthias Ringwald #endif 533deb3ec6SMatthias Ringwald 543deb3ec6SMatthias Ringwald /* API_START */ 553deb3ec6SMatthias Ringwald 563deb3ec6SMatthias Ringwald /** 573deb3ec6SMatthias Ringwald * @brief Create HFP Hands-Free (HF) SDP service record. 58a0ffb263SMatthias Ringwald * @param service 59a0ffb263SMatthias Ringwald * @param rfcomm_channel_nr 60ada240cdSMatthias Ringwald * @param name or NULL for default value. Provide "" (empty string) to skip attribute 61ada240cdSMatthias Ringwald * @param supported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h 62aa10b9cbSMatthias Ringwald * @param codecs_nr number of codecs in codecs argument 63aa10b9cbSMatthias Ringwald * @param codecs 643deb3ec6SMatthias Ringwald */ 65aa10b9cbSMatthias Ringwald void hfp_hf_create_sdp_record_with_codecs(uint8_t * service, uint32_t service_record_handle, int rfcomm_channel_nr, 66aa10b9cbSMatthias Ringwald const char * name, uint16_t supported_features, uint8_t codecs_nr, const uint8_t * codecs); 673deb3ec6SMatthias Ringwald 683deb3ec6SMatthias Ringwald /** 69a0ffb263SMatthias Ringwald * @brief Set up HFP Hands-Free (HF) device without additional supported features. 70a0ffb263SMatthias Ringwald * @param rfcomm_channel_nr 71b4df8028SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 72b4df8028SMilanka Ringwald * - L2CAP_SERVICE_ALREADY_REGISTERED, 73b4df8028SMilanka Ringwald * - RFCOMM_SERVICE_ALREADY_REGISTERED or 74b4df8028SMilanka Ringwald * - BTSTACK_MEMORY_ALLOC_FAILED if allocation of any of RFCOMM or L2CAP services failed 753deb3ec6SMatthias Ringwald */ 76ab2445a0SMatthias Ringwald uint8_t hfp_hf_init(uint8_t rfcomm_channel_nr); 7766a048abSMatthias Ringwald 78a0ffb263SMatthias Ringwald /** 79a0ffb263SMatthias Ringwald * @brief Set codecs. 80aa10b9cbSMatthias Ringwald * @param codecs_nr number of codecs in codecs argument 81a0ffb263SMatthias Ringwald * @param codecs 82a0ffb263SMatthias Ringwald */ 83aa10b9cbSMatthias Ringwald void hfp_hf_init_codecs(uint8_t codecs_nr, const uint8_t * codecs); 843deb3ec6SMatthias Ringwald 85a0ffb263SMatthias Ringwald /** 86a0ffb263SMatthias Ringwald * @brief Set supported features. 87a0ffb263SMatthias Ringwald * @param supported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h 88a0ffb263SMatthias Ringwald */ 89a0ffb263SMatthias Ringwald void hfp_hf_init_supported_features(uint32_t supported_features); 90a0ffb263SMatthias Ringwald 91a0ffb263SMatthias Ringwald /** 92a0ffb263SMatthias Ringwald * @brief Set HF indicators. 93a0ffb263SMatthias Ringwald * @param indicators_nr 94a0ffb263SMatthias Ringwald * @param indicators 95a0ffb263SMatthias Ringwald */ 967ca89cabSMatthias Ringwald void hfp_hf_init_hf_indicators(int indicators_nr, const uint16_t * indicators); 97a0ffb263SMatthias Ringwald 9866a048abSMatthias Ringwald 993deb3ec6SMatthias Ringwald /** 1003deb3ec6SMatthias Ringwald * @brief Register callback for the HFP Hands-Free (HF) client. 101a0ffb263SMatthias Ringwald * @param callback 1023deb3ec6SMatthias Ringwald */ 10313839019SMatthias Ringwald void hfp_hf_register_packet_handler(btstack_packet_handler_t callback); 1043deb3ec6SMatthias Ringwald 1053deb3ec6SMatthias Ringwald /** 10642aadee5SMatthias Ringwald * @brief Set microphone gain used during SLC for Volume Synchronization. 10742aadee5SMatthias Ringwald * 10842aadee5SMatthias Ringwald * @param gain Valid range: [0,15] 10942aadee5SMatthias Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 11042aadee5SMatthias Ringwald * - ERROR_CODE_INVALID_HCI_COMMAND_PARAMETERS if invalid gain range 11142aadee5SMatthias Ringwald */ 11242aadee5SMatthias Ringwald uint8_t hfp_hf_set_default_microphone_gain(uint8_t gain); 11342aadee5SMatthias Ringwald 11442aadee5SMatthias Ringwald /** 11542aadee5SMatthias Ringwald * @brief Set speaker gain used during SLC for Volume Synchronization. 11642aadee5SMatthias Ringwald * 11742aadee5SMatthias Ringwald * @param gain Valid range: [0,15] 11842aadee5SMatthias Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 11942aadee5SMatthias Ringwald * - ERROR_CODE_INVALID_HCI_COMMAND_PARAMETERS if invalid gain range 12042aadee5SMatthias Ringwald */ 12142aadee5SMatthias Ringwald uint8_t hfp_hf_set_default_speaker_gain(uint8_t gain); 12242aadee5SMatthias Ringwald 12342aadee5SMatthias Ringwald /** 124a0ffb263SMatthias Ringwald * @brief Establish RFCOMM connection with the AG with given Bluetooth address, 125a0ffb263SMatthias Ringwald * and perform service level connection (SLC) agreement: 126a0ffb263SMatthias Ringwald * - exchange supported features 1273deb3ec6SMatthias Ringwald * - retrieve Audio Gateway (AG) indicators and their status 1283deb3ec6SMatthias Ringwald * - enable indicator status update in the AG 1293deb3ec6SMatthias Ringwald * - notify the AG about its own available codecs, if possible 1303deb3ec6SMatthias Ringwald * - retrieve the AG information describing the call hold and multiparty services, if possible 1313deb3ec6SMatthias Ringwald * - retrieve which HF indicators are enabled on the AG, if possible 132a0ffb263SMatthias Ringwald * The status of SLC connection establishment is reported via 133a0ffb263SMatthias Ringwald * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED. 134a0ffb263SMatthias Ringwald * 135a0ffb263SMatthias Ringwald * @param bd_addr Bluetooth address of the AG 1364eb3f1d8SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 137657bc59fSMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if connection already exists, or 1384eb3f1d8SMilanka Ringwald * - BTSTACK_MEMORY_ALLOC_FAILED 1393deb3ec6SMatthias Ringwald */ 1404eb3f1d8SMilanka Ringwald uint8_t hfp_hf_establish_service_level_connection(bd_addr_t bd_addr); 1413deb3ec6SMatthias Ringwald 1423deb3ec6SMatthias Ringwald /** 1433deb3ec6SMatthias Ringwald * @brief Release the RFCOMM channel and the audio connection between the HF and the AG. 144a0ffb263SMatthias Ringwald * The status of releasing the SLC connection is reported via 145a0ffb263SMatthias Ringwald * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED. 146a0ffb263SMatthias Ringwald * 1473c65e705SMilanka Ringwald * @param acl_handle 148657bc59fSMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 1493deb3ec6SMatthias Ringwald */ 150657bc59fSMilanka Ringwald uint8_t hfp_hf_release_service_level_connection(hci_con_handle_t acl_handle); 1513deb3ec6SMatthias Ringwald 1523deb3ec6SMatthias Ringwald /** 153a0ffb263SMatthias Ringwald * @brief Enable status update for all indicators in the AG. 154a0ffb263SMatthias Ringwald * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted. 155a0ffb263SMatthias Ringwald * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED. 156a0ffb263SMatthias Ringwald * 1573c65e705SMilanka Ringwald * @param acl_handle 1583c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 1593deb3ec6SMatthias Ringwald */ 1603c65e705SMilanka Ringwald uint8_t hfp_hf_enable_status_update_for_all_ag_indicators(hci_con_handle_t acl_handle); 16166a048abSMatthias Ringwald 162a0ffb263SMatthias Ringwald /** 163a0ffb263SMatthias Ringwald * @brief Disable status update for all indicators in the AG. 164a0ffb263SMatthias Ringwald * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted. 1653c65e705SMilanka Ringwald * 1663c65e705SMilanka Ringwald * @param acl_handle 1673c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 168a0ffb263SMatthias Ringwald */ 1693c65e705SMilanka Ringwald uint8_t hfp_hf_disable_status_update_for_all_ag_indicators(hci_con_handle_t acl_handle); 1703deb3ec6SMatthias Ringwald 1713deb3ec6SMatthias Ringwald /** 172a0ffb263SMatthias Ringwald * @brief Enable or disable status update for the individual indicators in the AG using bitmap. 173a0ffb263SMatthias Ringwald * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted. 174a0ffb263SMatthias Ringwald * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED. 175a0ffb263SMatthias Ringwald * 1763c65e705SMilanka Ringwald * @param acl_handle 177a0ffb263SMatthias Ringwald * @param indicators_status_bitmap 32-bit bitmap, 0 - indicator is disabled, 1 - indicator is enabled 1783c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 1793deb3ec6SMatthias Ringwald */ 1803c65e705SMilanka Ringwald uint8_t hfp_hf_set_status_update_for_individual_ag_indicators(hci_con_handle_t acl_handle, uint32_t indicators_status_bitmap); 1813deb3ec6SMatthias Ringwald 1823deb3ec6SMatthias Ringwald /** 183a0ffb263SMatthias Ringwald * @brief Query the name of the currently selected Network operator by AG. 18466a048abSMatthias Ringwald * 185a0ffb263SMatthias Ringwald * The name is restricted to max 16 characters. The result is reported via 186a0ffb263SMatthias Ringwald * HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED subtype 187a0ffb263SMatthias Ringwald * containing network operator mode, format and name. 188a0ffb263SMatthias Ringwald * If no operator is selected, format and operator are omitted. 189a0ffb263SMatthias Ringwald * 1903c65e705SMilanka Ringwald * @param acl_handle 1913c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 1923c65e705SMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 1933c65e705SMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if connection in wrong state 1943deb3ec6SMatthias Ringwald */ 1953c65e705SMilanka Ringwald uint8_t hfp_hf_query_operator_selection(hci_con_handle_t acl_handle); 1963deb3ec6SMatthias Ringwald 1973deb3ec6SMatthias Ringwald /** 198a0ffb263SMatthias Ringwald * @brief Enable Extended Audio Gateway Error result codes in the AG. 1993deb3ec6SMatthias Ringwald * Whenever there is an error relating to the functionality of the AG as a 200a0ffb263SMatthias Ringwald * result of AT command, the AG shall send +CME ERROR. This error is reported via 201a0ffb263SMatthias Ringwald * HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR, see hfp_cme_error_t in hfp.h 202a0ffb263SMatthias Ringwald * 2033c65e705SMilanka Ringwald * @param acl_handle 2043c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 2053deb3ec6SMatthias Ringwald */ 2063c65e705SMilanka Ringwald uint8_t hfp_hf_enable_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle); 207a0ffb263SMatthias Ringwald 208a0ffb263SMatthias Ringwald /** 209a0ffb263SMatthias Ringwald * @brief Disable Extended Audio Gateway Error result codes in the AG. 210a0ffb263SMatthias Ringwald * 2113c65e705SMilanka Ringwald * @param acl_handle 2123c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 213a0ffb263SMatthias Ringwald */ 2143c65e705SMilanka Ringwald uint8_t hfp_hf_disable_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle); 2153deb3ec6SMatthias Ringwald 2163deb3ec6SMatthias Ringwald /** 217a0ffb263SMatthias Ringwald * @brief Establish audio connection. 2183c65e705SMilanka Ringwald * The status of audio connection establishment is reported via HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED. 2193c65e705SMilanka Ringwald * 2203c65e705SMilanka Ringwald * @param acl_handle 2213c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 2223c65e705SMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 2233c65e705SMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if connection in wrong state 2243deb3ec6SMatthias Ringwald */ 2253c65e705SMilanka Ringwald uint8_t hfp_hf_establish_audio_connection(hci_con_handle_t acl_handle); 2263deb3ec6SMatthias Ringwald 2273deb3ec6SMatthias Ringwald /** 228a0ffb263SMatthias Ringwald * @brief Release audio connection. 229a0ffb263SMatthias Ringwald * The status of releasing of the audio connection is reported via 230a0ffb263SMatthias Ringwald * HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED. 231a0ffb263SMatthias Ringwald * 2323c65e705SMilanka Ringwald * @param acl_handle 2333c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 2343deb3ec6SMatthias Ringwald */ 2353c65e705SMilanka Ringwald uint8_t hfp_hf_release_audio_connection(hci_con_handle_t acl_handle); 2363deb3ec6SMatthias Ringwald 237ce263fc8SMatthias Ringwald /** 238a0ffb263SMatthias Ringwald * @brief Answer incoming call. 2393c65e705SMilanka Ringwald * 2403c65e705SMilanka Ringwald * @param acl_handle 2413c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 2423c65e705SMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 2433c65e705SMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if answering incoming call with wrong callsetup status 244ce263fc8SMatthias Ringwald */ 2453c65e705SMilanka Ringwald uint8_t hfp_hf_answer_incoming_call(hci_con_handle_t acl_handle); 246ce263fc8SMatthias Ringwald 247ce263fc8SMatthias Ringwald /** 248a0ffb263SMatthias Ringwald * @brief Reject incoming call. 2493c65e705SMilanka Ringwald * 2503c65e705SMilanka Ringwald * @param acl_handle 2513c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 252ce263fc8SMatthias Ringwald */ 2533c65e705SMilanka Ringwald uint8_t hfp_hf_reject_incoming_call(hci_con_handle_t acl_handle); 254ce263fc8SMatthias Ringwald 255ce263fc8SMatthias Ringwald /** 256a0ffb263SMatthias Ringwald * @brief Release all held calls or sets User Determined User Busy (UDUB) for a waiting call. 2573c65e705SMilanka Ringwald * 2583c65e705SMilanka Ringwald * @param acl_handle 2593c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 260ce263fc8SMatthias Ringwald */ 2613c65e705SMilanka Ringwald uint8_t hfp_hf_user_busy(hci_con_handle_t acl_handle); 262ce263fc8SMatthias Ringwald 263ce263fc8SMatthias Ringwald /** 264a0ffb263SMatthias Ringwald * @brief Release all active calls (if any exist) and accepts the other (held or waiting) call. 2653c65e705SMilanka Ringwald * 2663c65e705SMilanka Ringwald * @param acl_handle 2673c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 268ce263fc8SMatthias Ringwald */ 2693c65e705SMilanka Ringwald uint8_t hfp_hf_end_active_and_accept_other(hci_con_handle_t acl_handle); 270ce263fc8SMatthias Ringwald 271ce263fc8SMatthias Ringwald /** 272a0ffb263SMatthias Ringwald * @brief Place all active calls (if any exist) on hold and accepts the other (held or waiting) call. 2733c65e705SMilanka Ringwald * 2743c65e705SMilanka Ringwald * @param acl_handle 2753c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 276ce263fc8SMatthias Ringwald */ 2773c65e705SMilanka Ringwald uint8_t hfp_hf_swap_calls(hci_con_handle_t acl_handle); 278ce263fc8SMatthias Ringwald 279ce263fc8SMatthias Ringwald /** 280a0ffb263SMatthias Ringwald * @brief Add a held call to the conversation. 2813c65e705SMilanka Ringwald * 2823c65e705SMilanka Ringwald * @param acl_handle 2833c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 284ce263fc8SMatthias Ringwald */ 2853c65e705SMilanka Ringwald uint8_t hfp_hf_join_held_call(hci_con_handle_t acl_handle); 286ce263fc8SMatthias Ringwald 287ce263fc8SMatthias Ringwald /** 2883c65e705SMilanka Ringwald * @brief Connect the two calls and disconnects the subscriber from both calls (Explicit Call Transfer). 2893c65e705SMilanka Ringwald * 2903c65e705SMilanka Ringwald * @param acl_handle 2913c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 292ce263fc8SMatthias Ringwald */ 2933c65e705SMilanka Ringwald uint8_t hfp_hf_connect_calls(hci_con_handle_t acl_handle); 294ce263fc8SMatthias Ringwald 295ce263fc8SMatthias Ringwald /** 2963c65e705SMilanka Ringwald * @brief Terminate an incoming or an outgoing call. HFP_SUBEVENT_CALL_TERMINATED is sent upon call termination. 2973c65e705SMilanka Ringwald * 2983c65e705SMilanka Ringwald * @param acl_handle 2993c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 300ce263fc8SMatthias Ringwald */ 3013c65e705SMilanka Ringwald uint8_t hfp_hf_terminate_call(hci_con_handle_t acl_handle); 302ce263fc8SMatthias Ringwald 303ce263fc8SMatthias Ringwald /** 3042be52304SMatthias Ringwald * @brief Terminate all held calls. 3052be52304SMatthias Ringwald * 3062be52304SMatthias Ringwald * @param acl_handle 3072be52304SMatthias Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 3082be52304SMatthias Ringwald */ 3092be52304SMatthias Ringwald uint8_t hfp_hf_terminate_held_calls(hci_con_handle_t acl_handle); 3102be52304SMatthias Ringwald 3112be52304SMatthias Ringwald /** 312a0ffb263SMatthias Ringwald * @brief Initiate outgoing voice call by providing the destination phone number to the AG. 3133c65e705SMilanka Ringwald * 3143c65e705SMilanka Ringwald * @param acl_handle 315a0ffb263SMatthias Ringwald * @param number 3163c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 317ce263fc8SMatthias Ringwald */ 3183c65e705SMilanka Ringwald uint8_t hfp_hf_dial_number(hci_con_handle_t acl_handle, char * number); 319ce263fc8SMatthias Ringwald 320ce263fc8SMatthias Ringwald /** 321a0ffb263SMatthias Ringwald * @brief Initiate outgoing voice call using the memory dialing feature of the AG. 3223c65e705SMilanka Ringwald * 3233c65e705SMilanka Ringwald * @param acl_handle 324a0ffb263SMatthias Ringwald * @param memory_id 3253c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 326ce263fc8SMatthias Ringwald */ 3273c65e705SMilanka Ringwald uint8_t hfp_hf_dial_memory(hci_con_handle_t acl_handle, int memory_id); 328ce263fc8SMatthias Ringwald 329ce263fc8SMatthias Ringwald /** 330a0ffb263SMatthias Ringwald * @brief Initiate outgoing voice call by recalling the last number dialed by the AG. 3313c65e705SMilanka Ringwald * 3323c65e705SMilanka Ringwald * @param acl_handle 3333c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 334ce263fc8SMatthias Ringwald */ 3353c65e705SMilanka Ringwald uint8_t hfp_hf_redial_last_number(hci_con_handle_t acl_handle); 336ce263fc8SMatthias Ringwald 337154628ccSMatthias Ringwald /** 338a0ffb263SMatthias Ringwald * @brief Enable the “Call Waiting notification” function in the AG. 339a0ffb263SMatthias Ringwald * The AG shall send the corresponding result code to the HF whenever 340a0ffb263SMatthias Ringwald * an incoming call is waiting during an ongoing call. In that event, 341a0ffb263SMatthias Ringwald * the HFP_SUBEVENT_CALL_WAITING_NOTIFICATION is emitted. 342a0ffb263SMatthias Ringwald * 3433c65e705SMilanka Ringwald * @param acl_handle 3443c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 345ce263fc8SMatthias Ringwald */ 3463c65e705SMilanka Ringwald uint8_t hfp_hf_activate_call_waiting_notification(hci_con_handle_t acl_handle); 347ce263fc8SMatthias Ringwald 348154628ccSMatthias Ringwald /** 349a0ffb263SMatthias Ringwald * @brief Disable the “Call Waiting notification” function in the AG. 3503c65e705SMilanka Ringwald * 3513c65e705SMilanka Ringwald * @param acl_handle 3523c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 353ce263fc8SMatthias Ringwald */ 3543c65e705SMilanka Ringwald uint8_t hfp_hf_deactivate_call_waiting_notification(hci_con_handle_t acl_handle); 355ce263fc8SMatthias Ringwald 356154628ccSMatthias Ringwald /** 357a0ffb263SMatthias Ringwald * @brief Enable the “Calling Line Identification notification” function in the AG. 358a0ffb263SMatthias Ringwald * The AG shall issue the corresponding result code just after every RING indication, 359a0ffb263SMatthias Ringwald * when the HF is alerted in an incoming call. In that event, 360a0ffb263SMatthias Ringwald * the HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION is emitted. 3613c65e705SMilanka Ringwald * @param acl_handle 362ce263fc8SMatthias Ringwald */ 3633c65e705SMilanka Ringwald uint8_t hfp_hf_activate_calling_line_notification(hci_con_handle_t acl_handle); 364ce263fc8SMatthias Ringwald 365154628ccSMatthias Ringwald /** 366a0ffb263SMatthias Ringwald * @brief Disable the “Calling Line Identification notification” function in the AG. 3673c65e705SMilanka Ringwald * 3683c65e705SMilanka Ringwald * @param acl_handle 3693c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 370ce263fc8SMatthias Ringwald */ 3713c65e705SMilanka Ringwald uint8_t hfp_hf_deactivate_calling_line_notification(hci_con_handle_t acl_handle); 372ce263fc8SMatthias Ringwald 373ce263fc8SMatthias Ringwald 374154628ccSMatthias Ringwald /** 3756ba83b5eSMilanka Ringwald * @brief Deactivate echo canceling (EC) and noise reduction (NR) in the AG and emit 3766ba83b5eSMilanka Ringwald * HFP_SUBEVENT_ECHO_CANCELING_NOISE_REDUCTION_DEACTIVATE with status ERROR_CODE_SUCCESS if AG supports EC and AG. 3776ba83b5eSMilanka Ringwald * If the AG supports its own embedded echo canceling and/or noise reduction function, 3786ba83b5eSMilanka Ringwald * it shall have EC and NR activated until this function is called. 3793c65e705SMilanka Ringwald * 3803c65e705SMilanka Ringwald * @param acl_handle 3816ba83b5eSMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 3826ba83b5eSMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 3836ba83b5eSMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if HFP_(HF/AG)SF_EC_NR_FUNCTION feature is not supported by AG and HF 384ce263fc8SMatthias Ringwald */ 3853c65e705SMilanka Ringwald uint8_t hfp_hf_deactivate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle); 386ce263fc8SMatthias Ringwald 387af97579eSMilanka Ringwald /** 388b321b609SMilanka Ringwald * @brief Activate voice recognition and emit HFP_SUBEVENT_VOICE_RECOGNITION_ACTIVATED event with status ERROR_CODE_SUCCESS 389acd11d4aSMilanka Ringwald * if successful, otherwise ERROR_CODE_COMMAND_DISALLOWED. Prerequisite is established SLC. 3903c65e705SMilanka Ringwald * 3913c65e705SMilanka Ringwald * @param acl_handle 392af97579eSMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 393af97579eSMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 3946ba83b5eSMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if feature HFP_(HF/AG)SF_VOICE_RECOGNITION_FUNCTION is not supported by HF and AG, or already activated 395ce263fc8SMatthias Ringwald */ 396af97579eSMilanka Ringwald uint8_t hfp_hf_activate_voice_recognition(hci_con_handle_t acl_handle); 397ce263fc8SMatthias Ringwald 398af97579eSMilanka Ringwald /** 399b321b609SMilanka Ringwald * @brief Dectivate voice recognition and emit HFP_SUBEVENT_VOICE_RECOGNITION_DEACTIVATED event with status ERROR_CODE_SUCCESS 400acd11d4aSMilanka Ringwald * if successful, otherwise ERROR_CODE_COMMAND_DISALLOWED. Prerequisite is established SLC. 4013c65e705SMilanka Ringwald * 4023c65e705SMilanka Ringwald * @param acl_handle 403af97579eSMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 404af97579eSMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 4056ba83b5eSMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if feature HFP_(HF/AG)SF_VOICE_RECOGNITION_FUNCTION is not supported by HF and AG, or already activated 406ce263fc8SMatthias Ringwald */ 407af97579eSMilanka Ringwald uint8_t hfp_hf_deactivate_voice_recognition(hci_con_handle_t acl_handle); 408be55a11dSMilanka Ringwald 409371c1bb2SMilanka Ringwald 410371c1bb2SMilanka Ringwald /** 411371c1bb2SMilanka Ringwald * @brief Indicate that the HF is ready to accept audio. Prerequisite is established voice recognition session. 412e8e72901SMilanka Ringwald * The HF may call this function during an ongoing AVR (Audio Voice Recognition) session to terminate audio output from 413371c1bb2SMilanka Ringwald * the AG (if there is any) and prepare the AG for new audio input. 414371c1bb2SMilanka Ringwald * 415371c1bb2SMilanka Ringwald * @param acl_handle 416371c1bb2SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 4176ba83b5eSMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if feature HFP_(HF/AG)SF_ENHANCED_VOICE_RECOGNITION_STATUS is not supported by HF and AG, or wrong VRA status 418371c1bb2SMilanka Ringwald */ 419de9e0ea7SMilanka Ringwald uint8_t hfp_hf_enhanced_voice_recognition_report_ready_for_audio(hci_con_handle_t acl_handle); 420371c1bb2SMilanka Ringwald 421ce263fc8SMatthias Ringwald 422154628ccSMatthias Ringwald /** 423a0ffb263SMatthias Ringwald * @brief Set microphone gain. 4243c65e705SMilanka Ringwald * 4253c65e705SMilanka Ringwald * @param acl_handle 426a0ffb263SMatthias Ringwald * @param gain Valid range: [0,15] 4273c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 4283c65e705SMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 4293c65e705SMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if invalid gain range 430ce263fc8SMatthias Ringwald */ 4313c65e705SMilanka Ringwald uint8_t hfp_hf_set_microphone_gain(hci_con_handle_t acl_handle, int gain); 432ce263fc8SMatthias Ringwald 433154628ccSMatthias Ringwald /** 434a0ffb263SMatthias Ringwald * @brief Set speaker gain. 4353c65e705SMilanka Ringwald * 4363c65e705SMilanka Ringwald * @param acl_handle 437a0ffb263SMatthias Ringwald * @param gain Valid range: [0,15] 4383c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 4393c65e705SMilanka Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 4403c65e705SMilanka Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if invalid gain range 441ce263fc8SMatthias Ringwald */ 4423c65e705SMilanka Ringwald uint8_t hfp_hf_set_speaker_gain(hci_con_handle_t acl_handle, int gain); 443ce263fc8SMatthias Ringwald 444154628ccSMatthias Ringwald /** 445a0ffb263SMatthias Ringwald * @brief Instruct the AG to transmit a DTMF code. 4463c65e705SMilanka Ringwald * 4473c65e705SMilanka Ringwald * @param acl_handle 448a0ffb263SMatthias Ringwald * @param dtmf_code 4493c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 450ce263fc8SMatthias Ringwald */ 4513c65e705SMilanka Ringwald uint8_t hfp_hf_send_dtmf_code(hci_con_handle_t acl_handle, char code); 452ce263fc8SMatthias Ringwald 453154628ccSMatthias Ringwald /** 454a0ffb263SMatthias Ringwald * @brief Read numbers from the AG for the purpose of creating 455a0ffb263SMatthias Ringwald * a unique voice tag and storing the number and its linked voice 456a0ffb263SMatthias Ringwald * tag in the HF’s memory. 457a0ffb263SMatthias Ringwald * The number is reported via HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG. 4583c65e705SMilanka Ringwald * 4593c65e705SMilanka Ringwald * @param acl_handle 4603c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 461ce263fc8SMatthias Ringwald */ 4623c65e705SMilanka Ringwald uint8_t hfp_hf_request_phone_number_for_voice_tag(hci_con_handle_t acl_handle); 4633deb3ec6SMatthias Ringwald 464154628ccSMatthias Ringwald /** 465a0ffb263SMatthias Ringwald * @brief Query the list of current calls in AG. 466a0ffb263SMatthias Ringwald * The result is received via HFP_SUBEVENT_ENHANCED_CALL_STATUS. 4673c65e705SMilanka Ringwald * 4683c65e705SMilanka Ringwald * @param acl_handle 4693c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 470667ec068SMatthias Ringwald */ 4713c65e705SMilanka Ringwald uint8_t hfp_hf_query_current_call_status(hci_con_handle_t acl_handle); 472667ec068SMatthias Ringwald 473154628ccSMatthias Ringwald /** 474a0ffb263SMatthias Ringwald * @brief Release a call with index in the AG. 4753c65e705SMilanka Ringwald * 4763c65e705SMilanka Ringwald * @param acl_handle 477a0ffb263SMatthias Ringwald * @param index 4783c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 479667ec068SMatthias Ringwald */ 4803c65e705SMilanka Ringwald uint8_t hfp_hf_release_call_with_index(hci_con_handle_t acl_handle, int index); 481667ec068SMatthias Ringwald 482154628ccSMatthias Ringwald /** 483a0ffb263SMatthias Ringwald * @brief Place all parties of a multiparty call on hold with the 484a0ffb263SMatthias Ringwald * exception of the specified call. 4853c65e705SMilanka Ringwald * 4863c65e705SMilanka Ringwald * @param acl_handle 487a0ffb263SMatthias Ringwald * @param index 4883c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 489667ec068SMatthias Ringwald */ 4903c65e705SMilanka Ringwald uint8_t hfp_hf_private_consultation_with_call(hci_con_handle_t acl_handle, int index); 491667ec068SMatthias Ringwald 492154628ccSMatthias Ringwald /** 493a0ffb263SMatthias Ringwald * @brief Query the status of the “Response and Hold” state of the AG. 494a0ffb263SMatthias Ringwald * The result is reported via HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS. 4953c65e705SMilanka Ringwald * 4963c65e705SMilanka Ringwald * @param acl_handle 4973c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 498667ec068SMatthias Ringwald */ 4993c65e705SMilanka Ringwald uint8_t hfp_hf_rrh_query_status(hci_con_handle_t acl_handle); 500667ec068SMatthias Ringwald 501154628ccSMatthias Ringwald /** 502a0ffb263SMatthias Ringwald * @brief Put an incoming call on hold in the AG. 5033c65e705SMilanka Ringwald * 5043c65e705SMilanka Ringwald * @param acl_handle 5053c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 506667ec068SMatthias Ringwald */ 5073c65e705SMilanka Ringwald uint8_t hfp_hf_rrh_hold_call(hci_con_handle_t acl_handle); 508667ec068SMatthias Ringwald 509154628ccSMatthias Ringwald /** 510a0ffb263SMatthias Ringwald * @brief Accept held incoming call in the AG. 5113c65e705SMilanka Ringwald * 5123c65e705SMilanka Ringwald * @param acl_handle 5133c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 514667ec068SMatthias Ringwald */ 5153c65e705SMilanka Ringwald uint8_t hfp_hf_rrh_accept_held_call(hci_con_handle_t acl_handle); 516667ec068SMatthias Ringwald 517154628ccSMatthias Ringwald /** 518a0ffb263SMatthias Ringwald * @brief Reject held incoming call in the AG. 5193c65e705SMilanka Ringwald * 5203c65e705SMilanka Ringwald * @param acl_handle 5213c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 522667ec068SMatthias Ringwald */ 5233c65e705SMilanka Ringwald uint8_t hfp_hf_rrh_reject_held_call(hci_con_handle_t acl_handle); 524667ec068SMatthias Ringwald 525154628ccSMatthias Ringwald /** 5263c65e705SMilanka Ringwald * @brief Query the AG subscriber number. The result is reported via HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION. 5273c65e705SMilanka Ringwald * 5283c65e705SMilanka Ringwald * @param acl_handle 5293c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 530667ec068SMatthias Ringwald */ 5313c65e705SMilanka Ringwald uint8_t hfp_hf_query_subscriber_number(hci_con_handle_t acl_handle); 532667ec068SMatthias Ringwald 533154628ccSMatthias Ringwald /** 534a0ffb263SMatthias Ringwald * @brief Set HF indicator. 5353c65e705SMilanka Ringwald * 5363c65e705SMilanka Ringwald * @param acl_handle 537a0ffb263SMatthias Ringwald * @param assigned_number 538a0ffb263SMatthias Ringwald * @param value 5393c65e705SMilanka Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist 540667ec068SMatthias Ringwald */ 5413c65e705SMilanka Ringwald uint8_t hfp_hf_set_hf_indicator(hci_con_handle_t acl_handle, int assigned_number, int value); 542667ec068SMatthias Ringwald 543154628ccSMatthias Ringwald /** 544d7f6b5cbSMatthias Ringwald * @brief Tests if in-band ringtone is active on AG (requires SLC) 5453c65e705SMilanka Ringwald * 5463c65e705SMilanka Ringwald * @param acl_handler 5473c65e705SMilanka Ringwald * @return 0 if unknown acl_handle or in-band ring-tone disabled, otherwise 1 548d7f6b5cbSMatthias Ringwald */ 549d7f6b5cbSMatthias Ringwald int hfp_hf_in_band_ringtone_active(hci_con_handle_t acl_handle); 550d7f6b5cbSMatthias Ringwald 551154628ccSMatthias Ringwald /** 5524e8ee53aSMatthias Ringwald * @brief Provide Apple Accessory information after SLC 5534e8ee53aSMatthias Ringwald * @param vendor_id 5544e8ee53aSMatthias Ringwald * @param product_id 5554e8ee53aSMatthias Ringwald * @param version 5564e8ee53aSMatthias Ringwald * @param features bitmask: bit 0 = reserved, bit 1 = battery reporting, bit 2 = docked or powered, bit 3 = Siri 5574e8ee53aSMatthias Ringwald */ 5584e8ee53aSMatthias Ringwald void hfp_hf_apple_set_identification(uint16_t vendor_id, uint16_t product_id, const char * version, uint8_t features); 5594e8ee53aSMatthias Ringwald 5604e8ee53aSMatthias Ringwald /** 561*910dced5SMatthias Ringwald * @brief Set Apple Accessory Battery Level 562*910dced5SMatthias Ringwald * @param battery_level range: 0..9 563*910dced5SMatthias Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_INVALID_HCI_COMMAND_PARAMETERS battery level out of range 564*910dced5SMatthias Ringwald */ 565*910dced5SMatthias Ringwald uint8_t hfp_hf_apple_set_battery_level(uint8_t battery_level); 566*910dced5SMatthias Ringwald 567*910dced5SMatthias Ringwald /** 568*910dced5SMatthias Ringwald * @brief Set Apple Accessory Docked State 569*910dced5SMatthias Ringwald * @param docked 0 = undocked, 1 = docked 570*910dced5SMatthias Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_INVALID_HCI_COMMAND_PARAMETERS docked state invalid 571*910dced5SMatthias Ringwald */ 572*910dced5SMatthias Ringwald uint8_t hfp_hf_apple_set_docked_state(uint8_t docked); 573*910dced5SMatthias Ringwald 574*910dced5SMatthias Ringwald /** 57551a2ebdeSMatthias Ringwald * @brief Send AT command (most likely a vendor-specific command not part of standard HFP). 5767f8f1191SMatthias Ringwald * @note Result (OK/ERROR) is reported via HFP_SUBEVENT_CUSTOM_AT_MESSAGE_SENT 57751a2ebdeSMatthias Ringwald * To receive potential unsolicited result code, add ENABLE_HFP_AT_MESSAGES to get all message via HFP_SUBEVENT_AT_MESSAGE_RECEIVED 57851a2ebdeSMatthias Ringwald * 5798b9052a4SMatthias Ringwald * @param acl_handle 58051a2ebdeSMatthias Ringwald * @param at_command to send 58151a2ebdeSMatthias Ringwald * @return status ERROR_CODE_SUCCESS if successful, otherwise: 58251a2ebdeSMatthias Ringwald * - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or 58351a2ebdeSMatthias Ringwald * - ERROR_CODE_COMMAND_DISALLOWED if extended audio gateway error report is disabled 58451a2ebdeSMatthias Ringwald */ 5858b9052a4SMatthias Ringwald uint8_t hfp_hf_send_at_command(hci_con_handle_t acl_handle, const char * at_command); 58651a2ebdeSMatthias Ringwald 58720b2edb6SMatthias Ringwald /** 588077c2d92SMatthias Ringwald * @brief Register custom AT command. 589077c2d92SMatthias Ringwald * @param hfp_custom_at_command (with '+' prefix) 590077c2d92SMatthias Ringwald */ 591077c2d92SMatthias Ringwald void hfp_hf_register_custom_at_command(hfp_custom_at_command_t * custom_at_command); 592077c2d92SMatthias Ringwald 593077c2d92SMatthias Ringwald /** 59420b2edb6SMatthias Ringwald * @brief De-Init HFP HF 59520b2edb6SMatthias Ringwald */ 59620b2edb6SMatthias Ringwald void hfp_hf_deinit(void); 59720b2edb6SMatthias Ringwald 598aa10b9cbSMatthias Ringwald /** 599aa10b9cbSMatthias Ringwald * @brief Create HFP Hands-Free (HF) SDP service record. 600aa10b9cbSMatthias Ringwald * @deprecated Use hfp_hf_create_sdp_record_with_codecs instead 601aa10b9cbSMatthias Ringwald * @param service 602aa10b9cbSMatthias Ringwald * @param rfcomm_channel_nr 603aa10b9cbSMatthias Ringwald * @param name 604aa10b9cbSMatthias Ringwald * @param suported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h 605aa10b9cbSMatthias Ringwald * @param wide_band_speech supported 606aa10b9cbSMatthias Ringwald */ 607aa10b9cbSMatthias 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); 608aa10b9cbSMatthias Ringwald 6093deb3ec6SMatthias Ringwald /* API_END */ 6103deb3ec6SMatthias Ringwald 6113deb3ec6SMatthias Ringwald #if defined __cplusplus 6123deb3ec6SMatthias Ringwald } 6133deb3ec6SMatthias Ringwald #endif 6143deb3ec6SMatthias Ringwald 61580e33422SMatthias Ringwald #endif // BTSTACK_HFP_HF_H 616