xref: /btstack/src/classic/hfp_hf.h (revision a0ffb263e02c613f9155d5035f68cb0ad7b80d74)
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 
4566a048abSMatthias Ringwald #ifndef __BTSTACK_HFP_HF_H
4666a048abSMatthias Ringwald #define __BTSTACK_HFP_HF_H
473deb3ec6SMatthias Ringwald 
483deb3ec6SMatthias Ringwald #include "hci.h"
493edc84c5SMatthias Ringwald #include "classic/sdp_query_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.
60*a0ffb263SMatthias Ringwald  * @param service
61*a0ffb263SMatthias Ringwald  * @param rfcomm_channel_nr
62*a0ffb263SMatthias Ringwald  * @param name
63*a0ffb263SMatthias Ringwald  * @param suported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h
643deb3ec6SMatthias Ringwald  */
659b1c3b4dSMatthias 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);
663deb3ec6SMatthias Ringwald 
673deb3ec6SMatthias Ringwald /**
68*a0ffb263SMatthias Ringwald  * @brief Set up HFP Hands-Free (HF) device without additional supported features.
69*a0ffb263SMatthias Ringwald  * @param rfcomm_channel_nr
703deb3ec6SMatthias Ringwald  */
71*a0ffb263SMatthias Ringwald void hfp_hf_init(uint16_t rfcomm_channel_nr);
7266a048abSMatthias Ringwald 
73*a0ffb263SMatthias Ringwald /**
74*a0ffb263SMatthias Ringwald  * @brief Set codecs.
75*a0ffb263SMatthias Ringwald  * @param codecs_nr
76*a0ffb263SMatthias Ringwald  * @param codecs
77*a0ffb263SMatthias Ringwald  */
78*a0ffb263SMatthias Ringwald void hfp_hf_init_codecs(int codecs_nr, uint8_t * codecs);
793deb3ec6SMatthias Ringwald 
80*a0ffb263SMatthias Ringwald /**
81*a0ffb263SMatthias Ringwald  * @brief Set supported features.
82*a0ffb263SMatthias Ringwald  * @param supported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h
83*a0ffb263SMatthias Ringwald  */
84*a0ffb263SMatthias Ringwald void hfp_hf_init_supported_features(uint32_t supported_features);
85*a0ffb263SMatthias Ringwald 
86*a0ffb263SMatthias Ringwald /**
87*a0ffb263SMatthias Ringwald  * @brief Set HF indicators.
88*a0ffb263SMatthias Ringwald  * @param indicators_nr
89*a0ffb263SMatthias Ringwald  * @param indicators
90*a0ffb263SMatthias Ringwald  */
91*a0ffb263SMatthias Ringwald void hfp_hf_init_hf_indicators(int indicators_nr, uint16_t * indicators);
92*a0ffb263SMatthias Ringwald 
9366a048abSMatthias Ringwald 
943deb3ec6SMatthias Ringwald /**
953deb3ec6SMatthias Ringwald  * @brief Register callback for the HFP Hands-Free (HF) client.
96*a0ffb263SMatthias Ringwald  * @param callback
973deb3ec6SMatthias Ringwald  */
983deb3ec6SMatthias Ringwald void hfp_hf_register_packet_handler(hfp_callback_t callback);
993deb3ec6SMatthias Ringwald 
1003deb3ec6SMatthias Ringwald /**
101*a0ffb263SMatthias Ringwald  * @brief Establish RFCOMM connection with the AG with given Bluetooth address,
102*a0ffb263SMatthias Ringwald  * and perform service level connection (SLC) agreement:
103*a0ffb263SMatthias Ringwald  * - exchange supported features
1043deb3ec6SMatthias Ringwald  * - retrieve Audio Gateway (AG) indicators and their status
1053deb3ec6SMatthias Ringwald  * - enable indicator status update in the AG
1063deb3ec6SMatthias Ringwald  * - notify the AG about its own available codecs, if possible
1073deb3ec6SMatthias Ringwald  * - retrieve the AG information describing the call hold and multiparty services, if possible
1083deb3ec6SMatthias Ringwald  * - retrieve which HF indicators are enabled on the AG, if possible
109*a0ffb263SMatthias Ringwald  * The status of SLC connection establishment is reported via
110*a0ffb263SMatthias Ringwald  * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED.
111*a0ffb263SMatthias Ringwald  *
112*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
1133deb3ec6SMatthias Ringwald  */
1143deb3ec6SMatthias Ringwald void hfp_hf_establish_service_level_connection(bd_addr_t bd_addr);
1153deb3ec6SMatthias Ringwald 
1163deb3ec6SMatthias Ringwald /**
1173deb3ec6SMatthias Ringwald  * @brief Release the RFCOMM channel and the audio connection between the HF and the AG.
118*a0ffb263SMatthias Ringwald  * The status of releasing the SLC connection is reported via
119*a0ffb263SMatthias Ringwald  * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED.
120*a0ffb263SMatthias Ringwald  *
121*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
1223deb3ec6SMatthias Ringwald  */
1233deb3ec6SMatthias Ringwald void hfp_hf_release_service_level_connection(bd_addr_t bd_addr);
1243deb3ec6SMatthias Ringwald 
1253deb3ec6SMatthias Ringwald /**
126*a0ffb263SMatthias Ringwald  * @brief Enable status update for all indicators in the AG.
127*a0ffb263SMatthias Ringwald  * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted.
128*a0ffb263SMatthias Ringwald  * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED.
129*a0ffb263SMatthias Ringwald  *
130*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
1313deb3ec6SMatthias Ringwald  */
132ce263fc8SMatthias Ringwald void hfp_hf_enable_status_update_for_all_ag_indicators(bd_addr_t bd_addr);
13366a048abSMatthias Ringwald 
134*a0ffb263SMatthias Ringwald /**
135*a0ffb263SMatthias Ringwald  * @brief Disable status update for all indicators in the AG.
136*a0ffb263SMatthias Ringwald  * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted.
137*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
138*a0ffb263SMatthias Ringwald  */
139ce263fc8SMatthias Ringwald void hfp_hf_disable_status_update_for_all_ag_indicators(bd_addr_t bd_addr);
1403deb3ec6SMatthias Ringwald 
1413deb3ec6SMatthias Ringwald /**
142*a0ffb263SMatthias Ringwald  * @brief Enable or disable status update for the individual indicators in the AG using bitmap.
143*a0ffb263SMatthias Ringwald  * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted.
144*a0ffb263SMatthias Ringwald  * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED.
145*a0ffb263SMatthias Ringwald  *
146*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
147*a0ffb263SMatthias Ringwald  * @param indicators_status_bitmap 32-bit bitmap, 0 - indicator is disabled, 1 - indicator is enabled
1483deb3ec6SMatthias Ringwald  */
149ce263fc8SMatthias Ringwald void hfp_hf_set_status_update_for_individual_ag_indicators(bd_addr_t bd_addr, uint32_t indicators_status_bitmap);
1503deb3ec6SMatthias Ringwald 
1513deb3ec6SMatthias Ringwald /**
152*a0ffb263SMatthias Ringwald  * @brief Query the name of the currently selected Network operator by AG.
15366a048abSMatthias Ringwald  *
154*a0ffb263SMatthias Ringwald  * The name is restricted to max 16 characters. The result is reported via
155*a0ffb263SMatthias Ringwald  * HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED subtype
156*a0ffb263SMatthias Ringwald  * containing network operator mode, format and name.
157*a0ffb263SMatthias Ringwald  * If no operator is selected, format and operator are omitted.
158*a0ffb263SMatthias Ringwald  *
159*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
1603deb3ec6SMatthias Ringwald  */
1613deb3ec6SMatthias Ringwald void hfp_hf_query_operator_selection(bd_addr_t bd_addr);
1623deb3ec6SMatthias Ringwald 
1633deb3ec6SMatthias Ringwald /**
164*a0ffb263SMatthias Ringwald  * @brief Enable Extended Audio Gateway Error result codes in the AG.
1653deb3ec6SMatthias Ringwald  * Whenever there is an error relating to the functionality of the AG as a
166*a0ffb263SMatthias Ringwald  * result of AT command, the AG shall send +CME ERROR. This error is reported via
167*a0ffb263SMatthias Ringwald  * HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR, see hfp_cme_error_t in hfp.h
168*a0ffb263SMatthias Ringwald  *
169*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
1703deb3ec6SMatthias Ringwald  */
171ce263fc8SMatthias Ringwald void hfp_hf_enable_report_extended_audio_gateway_error_result_code(bd_addr_t bd_addr);
172*a0ffb263SMatthias Ringwald 
173*a0ffb263SMatthias Ringwald /**
174*a0ffb263SMatthias Ringwald  * @brief Disable Extended Audio Gateway Error result codes in the AG.
175*a0ffb263SMatthias Ringwald  *
176*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
177*a0ffb263SMatthias Ringwald  */
178ce263fc8SMatthias Ringwald  void hfp_hf_disable_report_extended_audio_gateway_error_result_code(bd_addr_t bd_addr);
1793deb3ec6SMatthias Ringwald 
1803deb3ec6SMatthias Ringwald /**
181*a0ffb263SMatthias Ringwald  * @brief Establish audio connection.
182*a0ffb263SMatthias Ringwald  * The status of audio connection establishment is reported via
183*a0ffb263SMatthias Ringwald  * HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED.
184*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
1853deb3ec6SMatthias Ringwald  */
1863deb3ec6SMatthias Ringwald void hfp_hf_establish_audio_connection(bd_addr_t bd_addr);
1873deb3ec6SMatthias Ringwald 
1883deb3ec6SMatthias Ringwald /**
189*a0ffb263SMatthias Ringwald  * @brief Release audio connection.
190*a0ffb263SMatthias Ringwald  * The status of releasing of the audio connection is reported via
191*a0ffb263SMatthias Ringwald  * HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED.
192*a0ffb263SMatthias Ringwald  *
193*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
1943deb3ec6SMatthias Ringwald  */
1953deb3ec6SMatthias Ringwald void hfp_hf_release_audio_connection(bd_addr_t bd_addr);
1963deb3ec6SMatthias Ringwald 
197ce263fc8SMatthias Ringwald /**
198*a0ffb263SMatthias Ringwald  * @brief Answer incoming call.
199*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
200ce263fc8SMatthias Ringwald  */
201ce263fc8SMatthias Ringwald void hfp_hf_answer_incoming_call(bd_addr_t bd_addr);
202ce263fc8SMatthias Ringwald 
203ce263fc8SMatthias Ringwald /**
204*a0ffb263SMatthias Ringwald  * @brief Reject incoming call.
205*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
206ce263fc8SMatthias Ringwald  */
207*a0ffb263SMatthias Ringwald void hfp_hf_reject_incoming_call(bd_addr_t bd_addr);
208ce263fc8SMatthias Ringwald 
209ce263fc8SMatthias Ringwald /**
210*a0ffb263SMatthias Ringwald  * @brief Release all held calls or sets User Determined User Busy (UDUB) for a waiting call.
211*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
212ce263fc8SMatthias Ringwald  */
213ce263fc8SMatthias Ringwald void hfp_hf_user_busy(bd_addr_t addr);
214ce263fc8SMatthias Ringwald 
215ce263fc8SMatthias Ringwald /**
216*a0ffb263SMatthias Ringwald  * @brief Release all active calls (if any exist) and accepts the other (held or waiting) call.
217*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
218ce263fc8SMatthias Ringwald  */
219ce263fc8SMatthias Ringwald void hfp_hf_end_active_and_accept_other(bd_addr_t addr);
220ce263fc8SMatthias Ringwald 
221ce263fc8SMatthias Ringwald /**
222*a0ffb263SMatthias Ringwald  * @brief Place all active calls (if any exist) on hold and accepts the other (held or waiting) call.
223*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
224ce263fc8SMatthias Ringwald  */
225ce263fc8SMatthias Ringwald void hfp_hf_swap_calls(bd_addr_t addr);
226ce263fc8SMatthias Ringwald 
227ce263fc8SMatthias Ringwald /**
228*a0ffb263SMatthias Ringwald  * @brief Add a held call to the conversation.
229*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
230ce263fc8SMatthias Ringwald  */
231ce263fc8SMatthias Ringwald void hfp_hf_join_held_call(bd_addr_t addr);
232ce263fc8SMatthias Ringwald 
233ce263fc8SMatthias Ringwald /**
234*a0ffb263SMatthias Ringwald  * @brief Connect the two calls and disconnects the subscriber from both calls (Explicit Call
235*a0ffb263SMatthias Ringwald Transfer).
236*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
237ce263fc8SMatthias Ringwald  */
238ce263fc8SMatthias Ringwald void hfp_hf_connect_calls(bd_addr_t addr);
239ce263fc8SMatthias Ringwald 
240ce263fc8SMatthias Ringwald /**
241*a0ffb263SMatthias Ringwald  * @brief Terminate an incoming or an outgoing call.
242*a0ffb263SMatthias Ringwald  * HFP_SUBEVENT_CALL_TERMINATED is sent upon call termination.
243*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
244ce263fc8SMatthias Ringwald  */
245ce263fc8SMatthias Ringwald void hfp_hf_terminate_call(bd_addr_t bd_addr);
246ce263fc8SMatthias Ringwald 
247ce263fc8SMatthias Ringwald /**
248*a0ffb263SMatthias Ringwald  * @brief Initiate outgoing voice call by providing the destination phone number to the AG.
249*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
250*a0ffb263SMatthias Ringwald  * @param number
251ce263fc8SMatthias Ringwald  */
252ce263fc8SMatthias Ringwald void hfp_hf_dial_number(bd_addr_t bd_addr, char * number);
253ce263fc8SMatthias Ringwald 
254ce263fc8SMatthias Ringwald /**
255*a0ffb263SMatthias Ringwald  * @brief Initiate outgoing voice call using the memory dialing feature of the AG.
256*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
257*a0ffb263SMatthias Ringwald  * @param memory_id
258ce263fc8SMatthias Ringwald  */
259*a0ffb263SMatthias Ringwald void hfp_hf_dial_memory(bd_addr_t bd_addr, int memory_id);
260ce263fc8SMatthias Ringwald 
261ce263fc8SMatthias Ringwald /**
262*a0ffb263SMatthias Ringwald  * @brief Initiate outgoing voice call by recalling the last number dialed by the AG.
263*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
264ce263fc8SMatthias Ringwald  */
265ce263fc8SMatthias Ringwald void hfp_hf_redial_last_number(bd_addr_t bd_addr);
266ce263fc8SMatthias Ringwald 
267ce263fc8SMatthias Ringwald /*
268*a0ffb263SMatthias Ringwald  * @brief Enable the “Call Waiting notification” function in the AG.
269*a0ffb263SMatthias Ringwald  * The AG shall send the corresponding result code to the HF whenever
270*a0ffb263SMatthias Ringwald  * an incoming call is waiting during an ongoing call. In that event,
271*a0ffb263SMatthias Ringwald  * the HFP_SUBEVENT_CALL_WAITING_NOTIFICATION is emitted.
272*a0ffb263SMatthias Ringwald  *
273*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
274ce263fc8SMatthias Ringwald  */
275ce263fc8SMatthias Ringwald void hfp_hf_activate_call_waiting_notification(bd_addr_t bd_addr);
276ce263fc8SMatthias Ringwald 
277ce263fc8SMatthias Ringwald /*
278*a0ffb263SMatthias Ringwald  * @brief Disable the “Call Waiting notification” function in the AG.
279*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
280ce263fc8SMatthias Ringwald  */
281ce263fc8SMatthias Ringwald void hfp_hf_deactivate_call_waiting_notification(bd_addr_t bd_addr);
282ce263fc8SMatthias Ringwald 
283ce263fc8SMatthias Ringwald /*
284*a0ffb263SMatthias Ringwald  * @brief Enable the “Calling Line Identification notification” function in the AG.
285*a0ffb263SMatthias Ringwald  * The AG shall issue the corresponding result code just after every RING indication,
286*a0ffb263SMatthias Ringwald  * when the HF is alerted in an incoming call. In that event,
287*a0ffb263SMatthias Ringwald  * the HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION is emitted.
288*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
289ce263fc8SMatthias Ringwald  */
290ce263fc8SMatthias Ringwald void hfp_hf_activate_calling_line_notification(bd_addr_t bd_addr);
291ce263fc8SMatthias Ringwald 
292ce263fc8SMatthias Ringwald /*
293*a0ffb263SMatthias Ringwald  * @brief Disable the “Calling Line Identification notification” function in the AG.
294*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
295ce263fc8SMatthias Ringwald  */
296ce263fc8SMatthias Ringwald void hfp_hf_deactivate_calling_line_notification(bd_addr_t bd_addr);
297ce263fc8SMatthias Ringwald 
298ce263fc8SMatthias Ringwald 
299ce263fc8SMatthias Ringwald /*
300*a0ffb263SMatthias Ringwald  * @brief Activate echo canceling and noise reduction in the AG. By default,
301*a0ffb263SMatthias Ringwald  * if the AG supports its own embedded echo canceling and/or noise reduction
302*a0ffb263SMatthias Ringwald  * functions, it shall have them activated until this function is called.
303*a0ffb263SMatthias Ringwald  * If the AG does not support any echo canceling and noise reduction functions,
304*a0ffb263SMatthias Ringwald  * it shall respond with the ERROR indicator (TODO)
305*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
306ce263fc8SMatthias Ringwald  */
307ce263fc8SMatthias Ringwald void hfp_hf_activate_echo_canceling_and_noise_reduction(bd_addr_t bd_addr);
308ce263fc8SMatthias Ringwald 
309ce263fc8SMatthias Ringwald /*
310*a0ffb263SMatthias Ringwald  * @brief Deactivate echo canceling and noise reduction in the AG.
311ce263fc8SMatthias Ringwald  */
312ce263fc8SMatthias Ringwald void hfp_hf_deactivate_echo_canceling_and_noise_reduction(bd_addr_t bd_addr);
313ce263fc8SMatthias Ringwald 
314ce263fc8SMatthias Ringwald /*
315*a0ffb263SMatthias Ringwald  * @brief Activate voice recognition function.
316*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
317ce263fc8SMatthias Ringwald  */
318ce263fc8SMatthias Ringwald void hfp_hf_activate_voice_recognition_notification(bd_addr_t bd_addr);
319ce263fc8SMatthias Ringwald 
320ce263fc8SMatthias Ringwald /*
321*a0ffb263SMatthias Ringwald  * @brief Dectivate voice recognition function.
322*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
323ce263fc8SMatthias Ringwald  */
324ce263fc8SMatthias Ringwald void hfp_hf_deactivate_voice_recognition_notification(bd_addr_t bd_addr);
325ce263fc8SMatthias Ringwald 
326ce263fc8SMatthias Ringwald /*
327*a0ffb263SMatthias Ringwald  * @brief Set microphone gain.
328*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
329*a0ffb263SMatthias Ringwald  * @param gain Valid range: [0,15]
330ce263fc8SMatthias Ringwald  */
331ce263fc8SMatthias Ringwald void hfp_hf_set_microphone_gain(bd_addr_t bd_addr, int gain);
332ce263fc8SMatthias Ringwald 
333ce263fc8SMatthias Ringwald /*
334*a0ffb263SMatthias Ringwald  * @brief Set speaker gain.
335*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
336*a0ffb263SMatthias Ringwald  * @param gain Valid range: [0,15]
337ce263fc8SMatthias Ringwald  */
338ce263fc8SMatthias Ringwald void hfp_hf_set_speaker_gain(bd_addr_t bd_addr, int gain);
339ce263fc8SMatthias Ringwald 
340ce263fc8SMatthias Ringwald /*
341*a0ffb263SMatthias Ringwald  * @brief Instruct the AG to transmit a DTMF code.
342*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
343*a0ffb263SMatthias Ringwald  * @param dtmf_code
344ce263fc8SMatthias Ringwald  */
345ce263fc8SMatthias Ringwald void hfp_hf_send_dtmf_code(bd_addr_t bd_addr, char code);
346ce263fc8SMatthias Ringwald 
347ce263fc8SMatthias Ringwald /*
348*a0ffb263SMatthias Ringwald  * @brief Read numbers from the AG for the purpose of creating
349*a0ffb263SMatthias Ringwald  * a unique voice tag and storing the number and its linked voice
350*a0ffb263SMatthias Ringwald  * tag in the HF’s memory.
351*a0ffb263SMatthias Ringwald  * The number is reported via HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG.
352*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
353ce263fc8SMatthias Ringwald  */
354ce263fc8SMatthias Ringwald void hfp_hf_request_phone_number_for_voice_tag(bd_addr_t addr);
3553deb3ec6SMatthias Ringwald 
356667ec068SMatthias Ringwald /*
357*a0ffb263SMatthias Ringwald  * @brief Query the list of current calls in AG.
358*a0ffb263SMatthias Ringwald  * The result is received via HFP_SUBEVENT_ENHANCED_CALL_STATUS.
359*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
360667ec068SMatthias Ringwald  */
361667ec068SMatthias Ringwald void hfp_hf_query_current_call_status(bd_addr_t addr);
362667ec068SMatthias Ringwald 
363667ec068SMatthias Ringwald /*
364*a0ffb263SMatthias Ringwald  * @brief Release a call with index in the AG.
365*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
366*a0ffb263SMatthias Ringwald  * @param index
367667ec068SMatthias Ringwald  */
368667ec068SMatthias Ringwald void hfp_hf_release_call_with_index(bd_addr_t addr, int index);
369667ec068SMatthias Ringwald 
370667ec068SMatthias Ringwald /*
371*a0ffb263SMatthias Ringwald  * @brief Place all parties of a multiparty call on hold with the
372*a0ffb263SMatthias Ringwald  * exception of the specified call.
373*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
374*a0ffb263SMatthias Ringwald  * @param index
375667ec068SMatthias Ringwald  */
376667ec068SMatthias Ringwald void hfp_hf_private_consultation_with_call(bd_addr_t addr, int index);
377667ec068SMatthias Ringwald 
378667ec068SMatthias Ringwald /*
379*a0ffb263SMatthias Ringwald  * @brief Query the status of the “Response and Hold” state of the AG.
380*a0ffb263SMatthias Ringwald  * The result is reported via HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS.
381*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
382667ec068SMatthias Ringwald  */
383667ec068SMatthias Ringwald void hfp_hf_rrh_query_status(bd_addr_t addr);
384667ec068SMatthias Ringwald 
385667ec068SMatthias Ringwald /*
386*a0ffb263SMatthias Ringwald  * @brief Put an incoming call on hold in the AG.
387*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
388667ec068SMatthias Ringwald  */
389667ec068SMatthias Ringwald void hfp_hf_rrh_hold_call(bd_addr_t addr);
390667ec068SMatthias Ringwald 
391667ec068SMatthias Ringwald /*
392*a0ffb263SMatthias Ringwald  * @brief Accept held incoming call in the AG.
393*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
394667ec068SMatthias Ringwald  */
395667ec068SMatthias Ringwald void hfp_hf_rrh_accept_held_call(bd_addr_t addr);
396667ec068SMatthias Ringwald 
397667ec068SMatthias Ringwald /*
398*a0ffb263SMatthias Ringwald  * @brief Reject held incoming call in the AG.
399*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
400667ec068SMatthias Ringwald  */
401667ec068SMatthias Ringwald void hfp_hf_rrh_reject_held_call(bd_addr_t addr);
402667ec068SMatthias Ringwald 
403667ec068SMatthias Ringwald /*
404*a0ffb263SMatthias Ringwald  * @brief Query the AG subscriber number.
405*a0ffb263SMatthias Ringwald  * The result is reported via HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION.
406*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
407667ec068SMatthias Ringwald  */
408667ec068SMatthias Ringwald void hfp_hf_query_subscriber_number(bd_addr_t addr);
409667ec068SMatthias Ringwald 
410667ec068SMatthias Ringwald /*
411*a0ffb263SMatthias Ringwald  * @brief Set HF indicator.
412*a0ffb263SMatthias Ringwald  * @param bd_addr Bluetooth address of the AG
413*a0ffb263SMatthias Ringwald  * @param assigned_number
414*a0ffb263SMatthias Ringwald  * @param value
415667ec068SMatthias Ringwald  */
416667ec068SMatthias Ringwald void hfp_hf_set_hf_indicator(bd_addr_t addr, int assigned_number, int value);
417667ec068SMatthias Ringwald 
4183deb3ec6SMatthias Ringwald /* API_END */
4193deb3ec6SMatthias Ringwald 
4203deb3ec6SMatthias Ringwald #if defined __cplusplus
4213deb3ec6SMatthias Ringwald }
4223deb3ec6SMatthias Ringwald #endif
4233deb3ec6SMatthias Ringwald 
42466a048abSMatthias Ringwald #endif // __BTSTACK_HFP_HF_H