xref: /btstack/src/classic/hfp_hf.h (revision f0e9886bf1825249aaea7e15f4fe6fb8d065bffb)
1 /*
2  * Copyright (C) 2014 BlueKitchen GmbH
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  * 3. Neither the name of the copyright holders nor the names of
14  *    contributors may be used to endorse or promote products derived
15  *    from this software without specific prior written permission.
16  * 4. Any redistribution, use, or modification is done solely for
17  *    personal benefit and not for any commercial purpose or for
18  *    monetary gain.
19  *
20  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS
24  * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31  * SUCH DAMAGE.
32  *
33  * Please inquire about commercial licensing options at
34  * [email protected]
35  *
36  */
37 
38 /**
39  * @title HFP Hands-Free (HF)
40  *
41  */
42 
43 #ifndef BTSTACK_HFP_HF_H
44 #define BTSTACK_HFP_HF_H
45 
46 #include "hci.h"
47 #include "classic/sdp_client_rfcomm.h"
48 #include "classic/hfp.h"
49 
50 #if defined __cplusplus
51 extern "C" {
52 #endif
53 
54 /* API_START */
55 
56 /**
57  * @brief Create HFP Hands-Free (HF) SDP service record.
58  * @param service
59  * @param rfcomm_channel_nr
60  * @param name
61  * @param suported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h
62  * @param wide_band_speech supported
63  */
64 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);
65 
66 /**
67  * @brief Set up HFP Hands-Free (HF) device without additional supported features.
68  * @param rfcomm_channel_nr
69  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
70  *                  - L2CAP_SERVICE_ALREADY_REGISTERED,
71  *                  - RFCOMM_SERVICE_ALREADY_REGISTERED or
72  *                  - BTSTACK_MEMORY_ALLOC_FAILED if allocation of any of RFCOMM or L2CAP services failed
73  */
74 uint8_t hfp_hf_init(uint16_t rfcomm_channel_nr);
75 
76 /**
77  * @brief Set codecs.
78  * @param codecs_nr
79  * @param codecs
80  */
81 void hfp_hf_init_codecs(int codecs_nr, const uint8_t * codecs);
82 
83 /**
84  * @brief Set supported features.
85  * @param supported_features 32-bit bitmap, see HFP_HFSF_* values in hfp.h
86  */
87 void hfp_hf_init_supported_features(uint32_t supported_features);
88 
89 /**
90  * @brief Set HF indicators.
91  * @param indicators_nr
92  * @param indicators
93  */
94 void hfp_hf_init_hf_indicators(int indicators_nr, const uint16_t * indicators);
95 
96 
97 /**
98  * @brief Register callback for the HFP Hands-Free (HF) client.
99  * @param callback
100  */
101 void hfp_hf_register_packet_handler(btstack_packet_handler_t callback);
102 
103 /**
104  * @brief Establish RFCOMM connection with the AG with given Bluetooth address,
105  * and perform service level connection (SLC) agreement:
106  * - exchange supported features
107  * - retrieve Audio Gateway (AG) indicators and their status
108  * - enable indicator status update in the AG
109  * - notify the AG about its own available codecs, if possible
110  * - retrieve the AG information describing the call hold and multiparty services, if possible
111  * - retrieve which HF indicators are enabled on the AG, if possible
112  * The status of SLC connection establishment is reported via
113  * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_ESTABLISHED.
114  *
115  * @param bd_addr Bluetooth address of the AG
116  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
117  *              - ERROR_CODE_COMMAND_DISALLOWED if connection already exists, or
118  *              - BTSTACK_MEMORY_ALLOC_FAILED
119  */
120 uint8_t hfp_hf_establish_service_level_connection(bd_addr_t bd_addr);
121 
122 /**
123  * @brief Release the RFCOMM channel and the audio connection between the HF and the AG.
124  * The status of releasing the SLC connection is reported via
125  * HFP_SUBEVENT_SERVICE_LEVEL_CONNECTION_RELEASED.
126  *
127  * @param acl_handle
128  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
129  */
130 uint8_t hfp_hf_release_service_level_connection(hci_con_handle_t acl_handle);
131 
132 /**
133  * @brief Enable status update for all indicators in the AG.
134  * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted.
135  * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED.
136  *
137  * @param acl_handle
138  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
139  */
140 uint8_t hfp_hf_enable_status_update_for_all_ag_indicators(hci_con_handle_t acl_handle);
141 
142 /**
143  * @brief Disable status update for all indicators in the AG.
144  * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted.
145  *
146  * @param acl_handle
147  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
148  */
149 uint8_t hfp_hf_disable_status_update_for_all_ag_indicators(hci_con_handle_t acl_handle);
150 
151 /**
152  * @brief Enable or disable status update for the individual indicators in the AG using bitmap.
153  * The status field of the HFP_SUBEVENT_COMPLETE reports if the command was accepted.
154  * The status of an AG indicator is reported via HFP_SUBEVENT_AG_INDICATOR_STATUS_CHANGED.
155  *
156  * @param acl_handle
157  * @param indicators_status_bitmap 32-bit bitmap, 0 - indicator is disabled, 1 - indicator is enabled
158  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
159  */
160 uint8_t hfp_hf_set_status_update_for_individual_ag_indicators(hci_con_handle_t acl_handle, uint32_t indicators_status_bitmap);
161 
162 /**
163  * @brief Query the name of the currently selected Network operator by AG.
164  *
165  * The name is restricted to max 16 characters. The result is reported via
166  * HFP_SUBEVENT_NETWORK_OPERATOR_CHANGED subtype
167  * containing network operator mode, format and name.
168  * If no operator is selected, format and operator are omitted.
169  *
170  * @param acl_handle
171  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
172  *              - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or
173  *              - ERROR_CODE_COMMAND_DISALLOWED if connection in wrong state
174  */
175 uint8_t hfp_hf_query_operator_selection(hci_con_handle_t acl_handle);
176 
177 /**
178  * @brief Enable Extended Audio Gateway Error result codes in the AG.
179  * Whenever there is an error relating to the functionality of the AG as a
180  * result of AT command, the AG shall send +CME ERROR. This error is reported via
181  * HFP_SUBEVENT_EXTENDED_AUDIO_GATEWAY_ERROR, see hfp_cme_error_t in hfp.h
182  *
183  * @param acl_handle
184  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
185  */
186 uint8_t hfp_hf_enable_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle);
187 
188 /**
189  * @brief Disable Extended Audio Gateway Error result codes in the AG.
190  *
191  * @param acl_handle
192  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
193  */
194  uint8_t hfp_hf_disable_report_extended_audio_gateway_error_result_code(hci_con_handle_t acl_handle);
195 
196 /**
197  * @brief Establish audio connection.
198  * The status of audio connection establishment is reported via HFP_SUBEVENT_AUDIO_CONNECTION_ESTABLISHED.
199  *
200  * @param acl_handle
201  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
202  *              - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or
203  *              - ERROR_CODE_COMMAND_DISALLOWED if connection in wrong state
204  */
205 uint8_t hfp_hf_establish_audio_connection(hci_con_handle_t acl_handle);
206 
207 /**
208  * @brief Release audio connection.
209  * The status of releasing of the audio connection is reported via
210  * HFP_SUBEVENT_AUDIO_CONNECTION_RELEASED.
211  *
212  * @param acl_handle
213  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
214  */
215 uint8_t hfp_hf_release_audio_connection(hci_con_handle_t acl_handle);
216 
217 /**
218  * @brief Answer incoming call.
219  *
220  * @param acl_handle
221  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
222  *              - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or
223  *              - ERROR_CODE_COMMAND_DISALLOWED if answering incoming call with wrong callsetup status
224  */
225 uint8_t hfp_hf_answer_incoming_call(hci_con_handle_t acl_handle);
226 
227 /**
228  * @brief Reject incoming call.
229  *
230  * @param acl_handle
231  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
232  */
233 uint8_t hfp_hf_reject_incoming_call(hci_con_handle_t acl_handle);
234 
235 /**
236  * @brief Release all held calls or sets User Determined User Busy (UDUB) for a waiting call.
237  *
238  * @param acl_handle
239  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
240  */
241 uint8_t hfp_hf_user_busy(hci_con_handle_t acl_handle);
242 
243 /**
244  * @brief Release all active calls (if any exist) and accepts the other (held or waiting) call.
245  *
246  * @param acl_handle
247  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
248  */
249 uint8_t hfp_hf_end_active_and_accept_other(hci_con_handle_t acl_handle);
250 
251 /**
252  * @brief Place all active calls (if any exist) on hold and accepts the other (held or waiting) call.
253  *
254  * @param acl_handle
255  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
256  */
257 uint8_t hfp_hf_swap_calls(hci_con_handle_t acl_handle);
258 
259 /**
260  * @brief Add a held call to the conversation.
261  *
262  * @param acl_handle
263  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
264  */
265 uint8_t hfp_hf_join_held_call(hci_con_handle_t acl_handle);
266 
267 /**
268  * @brief Connect the two calls and disconnects the subscriber from both calls (Explicit Call Transfer).
269  *
270  * @param acl_handle
271  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
272  */
273 uint8_t hfp_hf_connect_calls(hci_con_handle_t acl_handle);
274 
275 /**
276  * @brief Terminate an incoming or an outgoing call. HFP_SUBEVENT_CALL_TERMINATED is sent upon call termination.
277  *
278  * @param acl_handle
279  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
280  */
281 uint8_t hfp_hf_terminate_call(hci_con_handle_t acl_handle);
282 
283 /**
284  * @brief Initiate outgoing voice call by providing the destination phone number to the AG.
285  *
286  * @param acl_handle
287  * @param number
288  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
289  */
290 uint8_t hfp_hf_dial_number(hci_con_handle_t acl_handle, char * number);
291 
292 /**
293  * @brief Initiate outgoing voice call using the memory dialing feature of the AG.
294  *
295  * @param acl_handle
296  * @param memory_id
297  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
298  */
299 uint8_t hfp_hf_dial_memory(hci_con_handle_t acl_handle, int memory_id);
300 
301 /**
302  * @brief Initiate outgoing voice call by recalling the last number dialed by the AG.
303  *
304  * @param acl_handle
305  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
306  */
307 uint8_t hfp_hf_redial_last_number(hci_con_handle_t acl_handle);
308 
309 /*
310  * @brief Enable the “Call Waiting notification” function in the AG.
311  * The AG shall send the corresponding result code to the HF whenever
312  * an incoming call is waiting during an ongoing call. In that event,
313  * the HFP_SUBEVENT_CALL_WAITING_NOTIFICATION is emitted.
314  *
315  * @param acl_handle
316  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
317  */
318 uint8_t hfp_hf_activate_call_waiting_notification(hci_con_handle_t acl_handle);
319 
320 /*
321  * @brief Disable the “Call Waiting notification” function in the AG.
322  *
323  * @param acl_handle
324  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
325  */
326 uint8_t hfp_hf_deactivate_call_waiting_notification(hci_con_handle_t acl_handle);
327 
328 /*
329  * @brief Enable the “Calling Line Identification notification” function in the AG.
330  * The AG shall issue the corresponding result code just after every RING indication,
331  * when the HF is alerted in an incoming call. In that event,
332  * the HFP_SUBEVENT_CALLING_LINE_INDETIFICATION_NOTIFICATION is emitted.
333  * @param acl_handle
334  */
335 uint8_t hfp_hf_activate_calling_line_notification(hci_con_handle_t acl_handle);
336 
337 /*
338  * @brief Disable the “Calling Line Identification notification” function in the AG.
339  *
340  * @param acl_handle
341  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
342  */
343 uint8_t hfp_hf_deactivate_calling_line_notification(hci_con_handle_t acl_handle);
344 
345 
346 /*
347  * @brief Activate echo canceling and noise reduction in the AG. By default,
348  * if the AG supports its own embedded echo canceling and/or noise reduction
349  * functions, it shall have them activated until this function is called.
350  * If the AG does not support any echo canceling and noise reduction functions,
351  * it shall respond with the ERROR indicator (TODO)
352  *
353  * @param acl_handle
354  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
355  */
356 uint8_t hfp_hf_activate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle);
357 
358 /*
359  * @brief Deactivate echo canceling and noise reduction in the AG.
360  *
361  * @param acl_handle
362  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
363  */
364 uint8_t hfp_hf_deactivate_echo_canceling_and_noise_reduction(hci_con_handle_t acl_handle);
365 
366 /*
367  * @brief Activate voice recognition function.
368  *
369  * @param acl_handle
370  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
371  */
372 uint8_t hfp_hf_activate_voice_recognition_notification(hci_con_handle_t acl_handle);
373 
374 /*
375  * @brief Dectivate voice recognition function.
376  *
377  * @param acl_handle
378  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
379  */
380 uint8_t hfp_hf_deactivate_voice_recognition_notification(hci_con_handle_t acl_handle);
381 
382 /*
383  * @brief Start enhanced voice recognition session.
384  *
385  * @param acl_handle
386  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
387  *              - ERROR_CODE_COMMAND_DISALLOWED if HF does not support it, or wrong VRA status
388  */
389 uint8_t hfp_hf_start_enhanced_voice_recognition_session(hci_con_handle_t acl_handle);
390 
391 /*
392  * @brief Stop enhanced voice recognition session.
393  *
394  * @param acl_handle
395  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
396  *              - ERROR_CODE_COMMAND_DISALLOWED if HF does not support it, or wrong VRA status
397  */
398 uint8_t hfp_hf_stop_enhanced_voice_recognition_session(hci_con_handle_t acl_handle);
399 
400 /*
401  * @brief Set microphone gain.
402  *
403  * @param acl_handle
404  * @param gain Valid range: [0,15]
405  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
406  *              - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or
407  *              - ERROR_CODE_COMMAND_DISALLOWED if invalid gain range
408  */
409 uint8_t hfp_hf_set_microphone_gain(hci_con_handle_t acl_handle, int gain);
410 
411 /*
412  * @brief Set speaker gain.
413  *
414  * @param acl_handle
415  * @param gain Valid range: [0,15]
416  * @return status ERROR_CODE_SUCCESS if successful, otherwise:
417  *              - ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist, or
418  *              - ERROR_CODE_COMMAND_DISALLOWED if invalid gain range
419  */
420 uint8_t hfp_hf_set_speaker_gain(hci_con_handle_t acl_handle, int gain);
421 
422 /*
423  * @brief Instruct the AG to transmit a DTMF code.
424  *
425  * @param acl_handle
426  * @param dtmf_code
427  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
428  */
429 uint8_t hfp_hf_send_dtmf_code(hci_con_handle_t acl_handle, char code);
430 
431 /*
432  * @brief Read numbers from the AG for the purpose of creating
433  * a unique voice tag and storing the number and its linked voice
434  * tag in the HF’s memory.
435  * The number is reported via HFP_SUBEVENT_NUMBER_FOR_VOICE_TAG.
436  *
437  * @param acl_handle
438  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
439  */
440 uint8_t hfp_hf_request_phone_number_for_voice_tag(hci_con_handle_t acl_handle);
441 
442 /*
443  * @brief Query the list of current calls in AG.
444  * The result is received via HFP_SUBEVENT_ENHANCED_CALL_STATUS.
445  *
446  * @param acl_handle
447  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
448  */
449 uint8_t hfp_hf_query_current_call_status(hci_con_handle_t acl_handle);
450 
451 /*
452  * @brief Release a call with index in the AG.
453  *
454  * @param acl_handle
455  * @param index
456  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
457  */
458 uint8_t hfp_hf_release_call_with_index(hci_con_handle_t acl_handle, int index);
459 
460 /*
461  * @brief Place all parties of a multiparty call on hold with the
462  * exception of the specified call.
463  *
464  * @param acl_handle
465  * @param index
466  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
467  */
468 uint8_t hfp_hf_private_consultation_with_call(hci_con_handle_t acl_handle, int index);
469 
470 /*
471  * @brief Query the status of the “Response and Hold” state of the AG.
472  * The result is reported via HFP_SUBEVENT_RESPONSE_AND_HOLD_STATUS.
473  *
474  * @param acl_handle
475  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
476  */
477 uint8_t hfp_hf_rrh_query_status(hci_con_handle_t acl_handle);
478 
479 /*
480  * @brief Put an incoming call on hold in the AG.
481  *
482  * @param acl_handle
483  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
484  */
485 uint8_t hfp_hf_rrh_hold_call(hci_con_handle_t acl_handle);
486 
487 /*
488  * @brief Accept held incoming call in the AG.
489  *
490  * @param acl_handle
491  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
492  */
493 uint8_t hfp_hf_rrh_accept_held_call(hci_con_handle_t acl_handle);
494 
495 /*
496  * @brief Reject held incoming call in the AG.
497  *
498  * @param acl_handle
499  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
500  */
501 uint8_t hfp_hf_rrh_reject_held_call(hci_con_handle_t acl_handle);
502 
503 /*
504  * @brief Query the AG subscriber number. The result is reported via HFP_SUBEVENT_SUBSCRIBER_NUMBER_INFORMATION.
505  *
506  * @param acl_handle
507  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
508  */
509 uint8_t hfp_hf_query_subscriber_number(hci_con_handle_t acl_handle);
510 
511 /*
512  * @brief Set HF indicator.
513  *
514  * @param acl_handle
515  * @param assigned_number
516  * @param value
517  * @return status ERROR_CODE_SUCCESS if successful, otherwise ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if connection does not exist
518  */
519 uint8_t hfp_hf_set_hf_indicator(hci_con_handle_t acl_handle, int assigned_number, int value);
520 
521 /*
522  * @brief Tests if in-band ringtone is active on AG (requires SLC)
523  *
524  * @param acl_handler
525  * @return 0 if unknown acl_handle or in-band ring-tone disabled, otherwise 1
526  */
527 int hfp_hf_in_band_ringtone_active(hci_con_handle_t acl_handle);
528 
529 /**
530  * @brief De-Init HFP HF
531  */
532 void hfp_hf_deinit(void);
533 
534 /* API_END */
535 
536 #if defined __cplusplus
537 }
538 #endif
539 
540 #endif // BTSTACK_HFP_HF_H
541