Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hfp_hf.h
Go to the documentation of this file.
1
4
5/*
6 * Copyright (c) 2015-2016 Intel Corporation
7 *
8 * SPDX-License-Identifier: Apache-2.0
9 */
10#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HFP_HF_H_
11#define ZEPHYR_INCLUDE_BLUETOOTH_HFP_HF_H_
12
19
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
26/* HFP CODEC IDs */
27#define BT_HFP_HF_CODEC_CVSD 0x01
28#define BT_HFP_HF_CODEC_MSBC 0x02
29#define BT_HFP_HF_CODEC_LC3_SWB 0x03
30
31struct bt_hfp_hf;
32
33struct bt_hfp_hf_call;
34
56
68
82
105
116 void (*connected)(struct bt_conn *conn, struct bt_hfp_hf *hf);
127 void (*disconnected)(struct bt_hfp_hf *hf);
136 void (*sco_connected)(struct bt_hfp_hf *hf, struct bt_conn *sco_conn);
145 void (*sco_disconnected)(struct bt_conn *sco_conn, uint8_t reason);
153 void (*service)(struct bt_hfp_hf *hf, uint32_t value);
162 void (*outgoing)(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call);
170 void (*remote_ringing)(struct bt_hfp_hf_call *call);
179 void (*incoming)(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call);
187 void (*incoming_held)(struct bt_hfp_hf_call *call);
195 void (*accept)(struct bt_hfp_hf_call *call);
203 void (*reject)(struct bt_hfp_hf_call *call);
211 void (*terminate)(struct bt_hfp_hf_call *call);
218 void (*held)(struct bt_hfp_hf_call *call);
225 void (*retrieve)(struct bt_hfp_hf_call *call);
233 void (*signal)(struct bt_hfp_hf *hf, uint32_t value);
241 void (*roam)(struct bt_hfp_hf *hf, uint32_t value);
249 void (*battery)(struct bt_hfp_hf *hf, uint32_t value);
257 void (*ring_indication)(struct bt_hfp_hf_call *call);
265 void (*dialing)(struct bt_hfp_hf *hf, int err);
278 void (*clip)(struct bt_hfp_hf_call *call, char *number, uint8_t type);
290 void (*vgm)(struct bt_hfp_hf *hf, uint8_t gain);
302 void (*vgs)(struct bt_hfp_hf *hf, uint8_t gain);
313 void (*inband_ring)(struct bt_hfp_hf *hf, bool inband);
329 void (*operator)(struct bt_hfp_hf *hf, uint8_t mode, uint8_t format, char *operator);
352 void (*codec_negotiate)(struct bt_hfp_hf *hf, uint8_t id);
363 void (*ecnr_turn_off)(struct bt_hfp_hf *hf, int err);
378 void (*call_waiting)(struct bt_hfp_hf_call *call, char *number, uint8_t type);
392 void (*voice_recognition)(struct bt_hfp_hf *hf, bool activate);
409 void (*vre_state)(struct bt_hfp_hf *hf, uint8_t state);
445 void (*textual_representation)(struct bt_hfp_hf *hf, char *id, uint8_t type,
446 uint8_t operation, char *text);
456 void (*request_phone_number)(struct bt_hfp_hf *hf, const char *number);
457
488 void (*subscriber_number)(struct bt_hfp_hf *hf, const char *number, uint8_t type,
490
503 void (*query_call)(struct bt_hfp_hf *hf, struct bt_hfp_hf_current_call *call);
504};
505
516
541int bt_hfp_hf_connect(struct bt_conn *conn, struct bt_hfp_hf **hf, uint8_t channel);
542
564int bt_hfp_hf_disconnect(struct bt_hfp_hf *hf);
565
579int bt_hfp_hf_cli(struct bt_hfp_hf *hf, bool enable);
580
602int bt_hfp_hf_vgm(struct bt_hfp_hf *hf, uint8_t gain);
603
625int bt_hfp_hf_vgs(struct bt_hfp_hf *hf, uint8_t gain);
626
636int bt_hfp_hf_get_operator(struct bt_hfp_hf *hf);
637
650int bt_hfp_hf_accept(struct bt_hfp_hf_call *call);
651
664int bt_hfp_hf_reject(struct bt_hfp_hf_call *call);
665
676int bt_hfp_hf_terminate(struct bt_hfp_hf_call *call);
677
690int bt_hfp_hf_hold_incoming(struct bt_hfp_hf_call *call);
691
702int bt_hfp_hf_query_respond_hold_status(struct bt_hfp_hf *hf);
703
717int bt_hfp_hf_number_call(struct bt_hfp_hf *hf, const char *number);
718
732int bt_hfp_hf_memory_dial(struct bt_hfp_hf *hf, const char *location);
733
746int bt_hfp_hf_redial(struct bt_hfp_hf *hf);
747
758int bt_hfp_hf_audio_connect(struct bt_hfp_hf *hf);
759
776int bt_hfp_hf_select_codec(struct bt_hfp_hf *hf, uint8_t codec_id);
777
790int bt_hfp_hf_set_codecs(struct bt_hfp_hf *hf, uint8_t codec_ids);
791
804int bt_hfp_hf_turn_off_ecnr(struct bt_hfp_hf *hf);
805
818int bt_hfp_hf_call_waiting_notify(struct bt_hfp_hf *hf, bool enable);
819
830int bt_hfp_hf_release_all_held(struct bt_hfp_hf *hf);
831
843int bt_hfp_hf_set_udub(struct bt_hfp_hf *hf);
844
857
869int bt_hfp_hf_hold_active_accept_other(struct bt_hfp_hf *hf);
870
881int bt_hfp_hf_join_conversation(struct bt_hfp_hf *hf);
882
894int bt_hfp_hf_explicit_call_transfer(struct bt_hfp_hf *hf);
895
907int bt_hfp_hf_release_specified_call(struct bt_hfp_hf_call *call);
908
922int bt_hfp_hf_private_consultation_mode(struct bt_hfp_hf_call *call);
923
935int bt_hfp_hf_voice_recognition(struct bt_hfp_hf *hf, bool activate);
936
949int bt_hfp_hf_ready_to_accept_audio(struct bt_hfp_hf *hf);
950
959int bt_hfp_hf_request_phone_number(struct bt_hfp_hf *hf);
960
973int bt_hfp_hf_transmit_dtmf_code(struct bt_hfp_hf_call *call, char code);
974
983int bt_hfp_hf_query_subscriber(struct bt_hfp_hf *hf);
984
985/* HFP HF Indicators */
987 HF_SERVICE_IND = 0, /* AG service indicator */
988 HF_CALL_IND, /* AG call indicator */
989 HF_CALL_SETUP_IND, /* AG call setup indicator */
990 HF_CALL_HELD_IND, /* AG call held indicator */
991 HF_SIGNAL_IND, /* AG signal indicator */
992 HF_ROAM_IND, /* AG roaming indicator */
993 HF_BATTERY_IND /* AG battery indicator */
994};
995
1012int bt_hfp_hf_indicator_status(struct bt_hfp_hf *hf, uint8_t status);
1013
1025int bt_hfp_hf_enhanced_safety(struct bt_hfp_hf *hf, bool enable);
1026
1038int bt_hfp_hf_battery(struct bt_hfp_hf *hf, uint8_t level);
1039
1051
1052#ifdef __cplusplus
1053}
1054#endif
1055
1059
1060#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HFP_HF_H_ */
Bluetooth subsystem core APIs.
int bt_hfp_hf_join_conversation(struct bt_hfp_hf *hf)
Handsfree HF add a held call to the conversation.
int bt_hfp_hf_vgm(struct bt_hfp_hf *hf, uint8_t gain)
Handsfree HF report Gain of Microphone (VGM)
int bt_hfp_hf_release_all_held(struct bt_hfp_hf *hf)
Handsfree HF release all held calls.
int bt_hfp_hf_vgs(struct bt_hfp_hf *hf, uint8_t gain)
Handsfree HF report Gain of Speaker (VGS)
int bt_hfp_hf_release_specified_call(struct bt_hfp_hf_call *call)
Handsfree HF release call with specified index.
int bt_hfp_hf_explicit_call_transfer(struct bt_hfp_hf *hf)
Handsfree HF explicit call transfer.
int bt_hfp_hf_register(struct bt_hfp_hf_cb *cb)
Register HFP HF profile.
int bt_hfp_hf_battery(struct bt_hfp_hf *hf, uint8_t level)
Handsfree HF remaining battery level.
int bt_hfp_hf_connect(struct bt_conn *conn, struct bt_hfp_hf **hf, uint8_t channel)
Initiate the service level connection establishment procedure.
int bt_hfp_hf_select_codec(struct bt_hfp_hf *hf, uint8_t codec_id)
Handsfree HF set selected codec id.
int bt_hfp_hf_release_active_accept_other(struct bt_hfp_hf *hf)
Handsfree HF release all active calls and accept other call.
bt_hfp_hf_call_mode
The mode of the call.
Definition hfp_hf.h:74
int bt_hfp_hf_call_waiting_notify(struct bt_hfp_hf *hf, bool enable)
Handsfree HF enable/disable call waiting notification.
int bt_hfp_hf_ready_to_accept_audio(struct bt_hfp_hf *hf)
Handsfree HF indicate that the HF is ready to accept audio.
int bt_hfp_hf_hold_active_accept_other(struct bt_hfp_hf *hf)
Handsfree HF hold all active calls and accept other call.
int bt_hfp_hf_hold_incoming(struct bt_hfp_hf_call *call)
Handsfree HF put the incoming call on hold.
int bt_hfp_hf_accept(struct bt_hfp_hf_call *call)
Handsfree HF accept the incoming call.
int bt_hfp_hf_cli(struct bt_hfp_hf *hf, bool enable)
Handsfree HF enable/disable Calling Line Identification (CLI) Notification.
int bt_hfp_hf_transmit_dtmf_code(struct bt_hfp_hf_call *call, char code)
Handsfree HF Transmit A specific DTMF Code.
bt_hfp_hf_call_dir
The direction of the call.
Definition hfp_hf.h:62
int bt_hfp_hf_query_respond_hold_status(struct bt_hfp_hf *hf)
Handsfree HF query respond and hold status of AG.
int bt_hfp_hf_set_udub(struct bt_hfp_hf *hf)
Handsfree HF set User Determined User Busy (UDUB) for a waiting call.
int bt_hfp_hf_turn_off_ecnr(struct bt_hfp_hf *hf)
Handsfree HF turns off AG's EC and NR.
bt_hfp_hf_call_status
The status of the call.
Definition hfp_hf.h:40
hfp_hf_ag_indicators
Definition hfp_hf.h:986
int bt_hfp_hf_query_list_of_current_calls(struct bt_hfp_hf *hf)
Handsfree HF query list of current calls.
int bt_hfp_hf_set_codecs(struct bt_hfp_hf *hf, uint8_t codec_ids)
Handsfree HF set supported codec ids.
int bt_hfp_hf_request_phone_number(struct bt_hfp_hf *hf)
Handsfree HF attach a phone number for a voice tag.
int bt_hfp_hf_redial(struct bt_hfp_hf *hf)
Handsfree HF redial last number.
int bt_hfp_hf_get_operator(struct bt_hfp_hf *hf)
Handsfree HF requests currently selected operator.
int bt_hfp_hf_enhanced_safety(struct bt_hfp_hf *hf, bool enable)
Handsfree HF enable/disable enhanced safety.
int bt_hfp_hf_indicator_status(struct bt_hfp_hf *hf, uint8_t status)
Handsfree HF set AG indicator activated/deactivated status.
int bt_hfp_hf_memory_dial(struct bt_hfp_hf *hf, const char *location)
Handsfree HF memory dialing call.
int bt_hfp_hf_terminate(struct bt_hfp_hf_call *call)
Handsfree HF terminate the incoming call.
int bt_hfp_hf_private_consultation_mode(struct bt_hfp_hf_call *call)
Handsfree HF request private consultation mode with specified call.
int bt_hfp_hf_reject(struct bt_hfp_hf_call *call)
Handsfree HF reject the incoming call.
int bt_hfp_hf_number_call(struct bt_hfp_hf *hf, const char *number)
Handsfree HF phone number call.
int bt_hfp_hf_audio_connect(struct bt_hfp_hf *hf)
Handsfree HF setup audio connection.
int bt_hfp_hf_query_subscriber(struct bt_hfp_hf *hf)
Handsfree HF Query Subscriber Number Information.
int bt_hfp_hf_voice_recognition(struct bt_hfp_hf *hf, bool activate)
Handsfree HF enable/disable the voice recognition function.
int bt_hfp_hf_disconnect(struct bt_hfp_hf *hf)
Release the service level connection.
@ BT_HFP_HF_CALL_MODE_DATA
Data call.
Definition hfp_hf.h:78
@ BT_HFP_HF_CALL_MODE_FAX
Fax transmission.
Definition hfp_hf.h:80
@ BT_HFP_HF_CALL_MODE_VOICE
Voice call.
Definition hfp_hf.h:76
@ BT_HFP_HF_CALL_DIR_OUTGOING
It is an outgoing call initiated by HF.
Definition hfp_hf.h:64
@ BT_HFP_HF_CALL_DIR_INCOMING
It is an incoming call from remote party.
Definition hfp_hf.h:66
@ BT_HFP_HF_CALL_STATUS_ACTIVE
Call is active and ongoing.
Definition hfp_hf.h:42
@ BT_HFP_HF_CALL_STATUS_ALERTING
Outgoing call is being alerted (ringing on remote end)
Definition hfp_hf.h:48
@ BT_HFP_HF_CALL_STATUS_INCOMING
Incoming call has arrived.
Definition hfp_hf.h:50
@ BT_HFP_HF_CALL_STATUS_WAITING
Incoming call is waiting (call waiting scenario)
Definition hfp_hf.h:52
@ BT_HFP_HF_CALL_STATUS_DIALING
Outgoing call is being dialed.
Definition hfp_hf.h:46
@ BT_HFP_HF_CALL_STATUS_HELD
Call is on hold.
Definition hfp_hf.h:44
@ BT_HFP_HF_CALL_STATUS_INCOMING_HELD
Call held by Response and Hold feature.
Definition hfp_hf.h:54
@ HF_BATTERY_IND
Definition hfp_hf.h:993
@ HF_CALL_SETUP_IND
Definition hfp_hf.h:989
@ HF_ROAM_IND
Definition hfp_hf.h:992
@ HF_SIGNAL_IND
Definition hfp_hf.h:991
@ HF_CALL_HELD_IND
Definition hfp_hf.h:990
@ HF_CALL_IND
Definition hfp_hf.h:988
@ HF_SERVICE_IND
Definition hfp_hf.h:987
state
Definition parser_state.h:29
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
HFP profile application callback.
Definition hfp_hf.h:107
void(* voice_recognition)(struct bt_hfp_hf *hf, bool activate)
Voice recognition activation/deactivation callback.
Definition hfp_hf.h:392
void(* query_call)(struct bt_hfp_hf *hf, struct bt_hfp_hf_current_call *call)
Query list of current calls callback.
Definition hfp_hf.h:503
void(* ecnr_turn_off)(struct bt_hfp_hf *hf, int err)
HF ECNR turns off callback.
Definition hfp_hf.h:363
void(* roam)(struct bt_hfp_hf *hf, uint32_t value)
HF indicator Callback.
Definition hfp_hf.h:241
void(* battery)(struct bt_hfp_hf *hf, uint32_t value)
HF indicator Callback.
Definition hfp_hf.h:249
void(* textual_representation)(struct bt_hfp_hf *hf, char *id, uint8_t type, uint8_t operation, char *text)
Textual representation callback.
Definition hfp_hf.h:445
void(* ring_indication)(struct bt_hfp_hf_call *call)
HF incoming call Ring indication callback to application.
Definition hfp_hf.h:257
void(* call_waiting)(struct bt_hfp_hf_call *call, char *number, uint8_t type)
HF call waiting notification callback to application.
Definition hfp_hf.h:378
void(* vre_state)(struct bt_hfp_hf *hf, uint8_t state)
Voice recognition engine state callback.
Definition hfp_hf.h:409
void(* vgs)(struct bt_hfp_hf *hf, uint8_t gain)
HF speaker gain notification callback to application.
Definition hfp_hf.h:302
void(* accept)(struct bt_hfp_hf_call *call)
HF call accept Callback.
Definition hfp_hf.h:195
void(* sco_disconnected)(struct bt_conn *sco_conn, uint8_t reason)
HF SCO/eSCO disconnected Callback.
Definition hfp_hf.h:145
void(* outgoing)(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call)
HF call outgoing Callback.
Definition hfp_hf.h:162
void(* retrieve)(struct bt_hfp_hf_call *call)
HF call retrieve Callback.
Definition hfp_hf.h:225
void(* vgm)(struct bt_hfp_hf *hf, uint8_t gain)
HF microphone gain notification callback to application.
Definition hfp_hf.h:290
void(* incoming)(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call)
HF call incoming Callback.
Definition hfp_hf.h:179
void(* connected)(struct bt_conn *conn, struct bt_hfp_hf *hf)
HF connected callback to application.
Definition hfp_hf.h:116
void(* terminate)(struct bt_hfp_hf_call *call)
HF call terminate Callback.
Definition hfp_hf.h:211
void(* sco_connected)(struct bt_hfp_hf *hf, struct bt_conn *sco_conn)
HF SCO/eSCO connected Callback.
Definition hfp_hf.h:136
void(* incoming_held)(struct bt_hfp_hf_call *call)
HF incoming call on hold Callback.
Definition hfp_hf.h:187
void(* dialing)(struct bt_hfp_hf *hf, int err)
HF call dialing Callback.
Definition hfp_hf.h:265
void(* service)(struct bt_hfp_hf *hf, uint32_t value)
HF indicator Callback.
Definition hfp_hf.h:153
void(* reject)(struct bt_hfp_hf_call *call)
HF call reject Callback.
Definition hfp_hf.h:203
void(* clip)(struct bt_hfp_hf_call *call, char *number, uint8_t type)
HF calling line identification notification callback to application.
Definition hfp_hf.h:278
void(* request_phone_number)(struct bt_hfp_hf *hf, const char *number)
Request phone number callback.
Definition hfp_hf.h:456
void(* inband_ring)(struct bt_hfp_hf *hf, bool inband)
HF in-band ring tone notification callback to application.
Definition hfp_hf.h:313
void(* remote_ringing)(struct bt_hfp_hf_call *call)
HF call outgoing call is ringing Callback.
Definition hfp_hf.h:170
void(* signal)(struct bt_hfp_hf *hf, uint32_t value)
HF indicator Callback.
Definition hfp_hf.h:233
void(* subscriber_number)(struct bt_hfp_hf *hf, const char *number, uint8_t type, uint8_t service)
Query subscriber number callback.
Definition hfp_hf.h:488
void(* held)(struct bt_hfp_hf_call *call)
HF call held Callback.
Definition hfp_hf.h:218
void(* disconnected)(struct bt_hfp_hf *hf)
HF disconnected callback to application.
Definition hfp_hf.h:127
The information of current call.
Definition hfp_hf.h:89
enum bt_hfp_hf_call_dir dir
Call direction (incoming/outgoing)
Definition hfp_hf.h:93
uint8_t type
Phone number type format identifier.
Definition hfp_hf.h:103
enum bt_hfp_hf_call_status status
Current status of the call.
Definition hfp_hf.h:95
uint8_t index
Call index identifier.
Definition hfp_hf.h:91
bool multiparty
True if call is part of a multiparty conference.
Definition hfp_hf.h:99
const char * number
Phone number string, NULL if not available.
Definition hfp_hf.h:101
enum bt_hfp_hf_call_mode mode
Call mode (voice/data/fax)
Definition hfp_hf.h:97