Zephyr Project API 4.1.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
hfp_ag.h
Go to the documentation of this file.
1
5/*
6 * Copyright (c) 2015-2016 Intel Corporation
7 * Copyright 2023-2024 NXP
8 *
9 * SPDX-License-Identifier: Apache-2.0
10 */
11#ifndef ZEPHYR_INCLUDE_BLUETOOTH_HFP_AG_H_
12#define ZEPHYR_INCLUDE_BLUETOOTH_HFP_AG_H_
13
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* HFP AG Indicators */
29 BT_HFP_AG_SERVICE_IND = 0, /* Service availability indicator */
30 BT_HFP_AG_CALL_IND = 1, /* call status indicator */
31 BT_HFP_AG_CALL_SETUP_IND = 2, /* Call set up status indicator */
32 BT_HFP_AG_CALL_HELD_IND = 3, /* Call hold status indicator */
33 BT_HFP_AG_SIGNAL_IND = 4, /* Signal strength indicator */
34 BT_HFP_AG_ROAM_IND = 5, /* Roaming status indicator */
35 BT_HFP_AG_BATTERY_IND = 6, /* Battery change indicator */
36 BT_HFP_AG_IND_MAX /* Indicator MAX value */
37};
38
39/* HFP CODEC */
40#define BT_HFP_AG_CODEC_CVSD 0x01
41#define BT_HFP_AG_CODEC_MSBC 0x02
42#define BT_HFP_AG_CODEC_LC3_SWB 0x03
43
44struct bt_hfp_ag;
45struct bt_hfp_ag_call;
46
71typedef int (*bt_hfp_ag_query_subscriber_func_t)(struct bt_hfp_ag *ag, char *number, uint8_t type,
72 uint8_t service);
73
74/* HF indicators */
76 HFP_AG_ENHANCED_SAFETY_IND = 1, /* Enhanced Safety */
77 HFP_AG_BATTERY_LEVEL_IND = 2, /* Remaining level of Battery */
78};
79
80/* The status of the call */
81enum __packed bt_hfp_ag_call_status {
82 BT_HFP_AG_CALL_STATUS_ACTIVE = 0, /* Call is active */
83 BT_HFP_AG_CALL_STATUS_HELD = 1, /* Call is on hold */
84 BT_HFP_AG_CALL_STATUS_DIALING = 2, /* Outgoing call is being dialed */
85 BT_HFP_AG_CALL_STATUS_ALERTING = 3, /* Outgoing call is being alerted */
86 BT_HFP_AG_CALL_STATUS_INCOMING = 4, /* Incoming call is came */
87 BT_HFP_AG_CALL_STATUS_WAITING = 5, /* Incoming call is waiting */
88 BT_HFP_AG_CALL_STATUS_INCOMING_HELD = 6 /* Call held by Response and Hold */
89};
90
91/* The direction of the call */
92enum __packed bt_hfp_ag_call_dir {
93 BT_HFP_AG_CALL_DIR_OUTGOING = 0, /* It is a outgoing call */
94 BT_HFP_AG_CALL_DIR_INCOMING = 1, /* It is a incoming call */
95};
96
105 char number[CONFIG_BT_HFP_AG_PHONE_NUMBER_MAX_LEN + 1];
109};
110
121 void (*connected)(struct bt_conn *conn, struct bt_hfp_ag *ag);
130 void (*disconnected)(struct bt_hfp_ag *ag);
139 void (*sco_connected)(struct bt_hfp_ag *ag, struct bt_conn *sco_conn);
148 void (*sco_disconnected)(struct bt_conn *sco_conn, uint8_t reason);
149
168 int (*get_ongoing_call)(struct bt_hfp_ag *ag);
169
182 int (*memory_dial)(struct bt_hfp_ag *ag, const char *location, char **number);
183
198 int (*number_call)(struct bt_hfp_ag *ag, const char *number);
199
209 void (*outgoing)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number);
210
220 void (*incoming)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number);
221
229 void (*incoming_held)(struct bt_hfp_ag_call *call);
230
239 void (*ringing)(struct bt_hfp_ag_call *call, bool in_band);
240
248 void (*accept)(struct bt_hfp_ag_call *call);
249
257 void (*held)(struct bt_hfp_ag_call *call);
258
266 void (*retrieve)(struct bt_hfp_ag_call *call);
267
275 void (*reject)(struct bt_hfp_ag_call *call);
276
284 void (*terminate)(struct bt_hfp_ag_call *call);
285
293 void (*codec)(struct bt_hfp_ag *ag, uint32_t ids);
294
303 void (*codec_negotiate)(struct bt_hfp_ag *ag, int err);
304
320 void (*audio_connect_req)(struct bt_hfp_ag *ag);
321
330 void (*vgm)(struct bt_hfp_ag *ag, uint8_t gain);
331
340 void (*vgs)(struct bt_hfp_ag *ag, uint8_t gain);
341
352 void (*ecnr_turn_off)(struct bt_hfp_ag *ag);
353
369 void (*explicit_call_transfer)(struct bt_hfp_ag *ag);
370
387 void (*voice_recognition)(struct bt_hfp_ag *ag, bool activate);
388
405 void (*ready_to_accept_audio)(struct bt_hfp_ag *ag);
406
423 int (*request_phone_number)(struct bt_hfp_ag *ag, char **number);
424
436 void (*transmit_dtmf_code)(struct bt_hfp_ag *ag, char code);
437
448 int (*subscriber_number)(struct bt_hfp_ag *ag, bt_hfp_ag_query_subscriber_func_t func);
449
461 void (*hf_indicator_value)(struct bt_hfp_ag *ag, enum hfp_ag_hf_indicators indicator,
462 uint32_t value);
463};
464
475
486int bt_hfp_ag_connect(struct bt_conn *conn, struct bt_hfp_ag **ag, uint8_t channel);
487
496int bt_hfp_ag_disconnect(struct bt_hfp_ag *ag);
497
507int bt_hfp_ag_remote_incoming(struct bt_hfp_ag *ag, const char *number);
508
517int bt_hfp_ag_hold_incoming(struct bt_hfp_ag_call *call);
518
527int bt_hfp_ag_reject(struct bt_hfp_ag_call *call);
528
537int bt_hfp_ag_accept(struct bt_hfp_ag_call *call);
538
547int bt_hfp_ag_terminate(struct bt_hfp_ag_call *call);
548
557int bt_hfp_ag_retrieve(struct bt_hfp_ag_call *call);
558
567int bt_hfp_ag_hold(struct bt_hfp_ag_call *call);
568
578int bt_hfp_ag_outgoing(struct bt_hfp_ag *ag, const char *number);
579
588int bt_hfp_ag_remote_ringing(struct bt_hfp_ag_call *call);
589
598int bt_hfp_ag_remote_reject(struct bt_hfp_ag_call *call);
599
608int bt_hfp_ag_remote_accept(struct bt_hfp_ag_call *call);
609
618int bt_hfp_ag_remote_terminate(struct bt_hfp_ag_call *call);
619
631int bt_hfp_ag_explicit_call_transfer(struct bt_hfp_ag *ag);
632
642int bt_hfp_ag_vgm(struct bt_hfp_ag *ag, uint8_t vgm);
643
653int bt_hfp_ag_vgs(struct bt_hfp_ag *ag, uint8_t vgs);
654
668int bt_hfp_ag_set_operator(struct bt_hfp_ag *ag, uint8_t mode, char *name);
669
690int bt_hfp_ag_audio_connect(struct bt_hfp_ag *ag, uint8_t id);
691
701int bt_hfp_ag_inband_ringtone(struct bt_hfp_ag *ag, bool inband);
702
714int bt_hfp_ag_voice_recognition(struct bt_hfp_ag *ag, bool activate);
715
733int bt_hfp_ag_vre_state(struct bt_hfp_ag *ag, uint8_t state);
734
775int bt_hfp_ag_vre_textual_representation(struct bt_hfp_ag *ag, uint8_t state, const char *id,
776 uint8_t type, uint8_t operation, const char *text);
777
787int bt_hfp_ag_signal_strength(struct bt_hfp_ag *ag, uint8_t strength);
788
798int bt_hfp_ag_roaming_status(struct bt_hfp_ag *ag, uint8_t status);
799
809int bt_hfp_ag_battery_level(struct bt_hfp_ag *ag, uint8_t level);
810
820int bt_hfp_ag_service_availability(struct bt_hfp_ag *ag, bool available);
821
843int bt_hfp_ag_hf_indicator(struct bt_hfp_ag *ag, enum hfp_ag_hf_indicators indicator, bool enable);
844
855int bt_hfp_ag_ongoing_calls(struct bt_hfp_ag *ag, struct bt_hfp_ag_ongoing_call *calls,
856 size_t count);
857
858#ifdef __cplusplus
859}
860#endif
861
866#endif /* ZEPHYR_INCLUDE_BLUETOOTH_HFP_HF_H_ */
Bluetooth subsystem core APIs.
int bt_hfp_ag_remote_accept(struct bt_hfp_ag_call *call)
Notify HFP Unit that the remote accepts the call.
bt_hfp_ag_call_dir
Definition hfp_ag.h:92
hfp_ag_hf_indicators
Definition hfp_ag.h:75
int bt_hfp_ag_remote_ringing(struct bt_hfp_ag_call *call)
Notify HFP Unit that the remote starts ringing.
int bt_hfp_ag_roaming_status(struct bt_hfp_ag *ag, uint8_t status)
Set roaming status.
int bt_hfp_ag_reject(struct bt_hfp_ag_call *call)
Reject the incoming call.
int bt_hfp_ag_signal_strength(struct bt_hfp_ag *ag, uint8_t strength)
Set signal strength.
int bt_hfp_ag_voice_recognition(struct bt_hfp_ag *ag, bool activate)
Enable/disable the voice recognition function.
int bt_hfp_ag_terminate(struct bt_hfp_ag_call *call)
Terminate the active/hold call.
int bt_hfp_ag_accept(struct bt_hfp_ag_call *call)
Accept the incoming call.
int bt_hfp_ag_vre_state(struct bt_hfp_ag *ag, uint8_t state)
set voice recognition engine state
bt_hfp_ag_indicator
Definition hfp_ag.h:28
int bt_hfp_ag_register(struct bt_hfp_ag_cb *cb)
Register HFP AG profile.
int bt_hfp_ag_retrieve(struct bt_hfp_ag_call *call)
Retrieve the held call.
int bt_hfp_ag_remote_incoming(struct bt_hfp_ag *ag, const char *number)
Notify HFP Unit of an incoming call.
int bt_hfp_ag_hold(struct bt_hfp_ag_call *call)
Hold the active call.
int bt_hfp_ag_battery_level(struct bt_hfp_ag *ag, uint8_t level)
Set battery level.
int bt_hfp_ag_vre_textual_representation(struct bt_hfp_ag *ag, uint8_t state, const char *id, uint8_t type, uint8_t operation, const char *text)
set voice recognition engine state and textual representation
int bt_hfp_ag_remote_terminate(struct bt_hfp_ag_call *call)
Notify HFP Unit that the remote terminates the active/hold call.
int bt_hfp_ag_vgm(struct bt_hfp_ag *ag, uint8_t vgm)
Set the HF microphone gain.
int bt_hfp_ag_audio_connect(struct bt_hfp_ag *ag, uint8_t id)
Create audio connection.
int bt_hfp_ag_ongoing_calls(struct bt_hfp_ag *ag, struct bt_hfp_ag_ongoing_call *calls, size_t count)
Set the ongoing calls.
int bt_hfp_ag_outgoing(struct bt_hfp_ag *ag, const char *number)
Dial a call.
int bt_hfp_ag_connect(struct bt_conn *conn, struct bt_hfp_ag **ag, uint8_t channel)
Create the hfp ag session.
int bt_hfp_ag_explicit_call_transfer(struct bt_hfp_ag *ag)
explicit call transfer
int bt_hfp_ag_inband_ringtone(struct bt_hfp_ag *ag, bool inband)
Set In-Band Ring Tone.
int bt_hfp_ag_hf_indicator(struct bt_hfp_ag *ag, enum hfp_ag_hf_indicators indicator, bool enable)
Activate/deactivate HF indicator.
int bt_hfp_ag_set_operator(struct bt_hfp_ag *ag, uint8_t mode, char *name)
Set currently network operator.
int bt_hfp_ag_hold_incoming(struct bt_hfp_ag_call *call)
Put the incoming call on hold.
int bt_hfp_ag_vgs(struct bt_hfp_ag *ag, uint8_t vgs)
Set the HF speaker gain.
int bt_hfp_ag_remote_reject(struct bt_hfp_ag_call *call)
Notify HFP Unit that the remote rejects the call.
bt_hfp_ag_call_status
Definition hfp_ag.h:81
int(* bt_hfp_ag_query_subscriber_func_t)(struct bt_hfp_ag *ag, char *number, uint8_t type, uint8_t service)
Query subscriber number callback function.
Definition hfp_ag.h:71
int bt_hfp_ag_disconnect(struct bt_hfp_ag *ag)
Disconnect the hfp ag session.
int bt_hfp_ag_service_availability(struct bt_hfp_ag *ag, bool available)
Set service availability.
@ BT_HFP_AG_CALL_DIR_INCOMING
Definition hfp_ag.h:94
@ BT_HFP_AG_CALL_DIR_OUTGOING
Definition hfp_ag.h:93
@ HFP_AG_BATTERY_LEVEL_IND
Definition hfp_ag.h:77
@ HFP_AG_ENHANCED_SAFETY_IND
Definition hfp_ag.h:76
@ BT_HFP_AG_SERVICE_IND
Definition hfp_ag.h:29
@ BT_HFP_AG_CALL_SETUP_IND
Definition hfp_ag.h:31
@ BT_HFP_AG_CALL_HELD_IND
Definition hfp_ag.h:32
@ BT_HFP_AG_SIGNAL_IND
Definition hfp_ag.h:33
@ BT_HFP_AG_BATTERY_IND
Definition hfp_ag.h:35
@ BT_HFP_AG_CALL_IND
Definition hfp_ag.h:30
@ BT_HFP_AG_ROAM_IND
Definition hfp_ag.h:34
@ BT_HFP_AG_IND_MAX
Definition hfp_ag.h:36
@ BT_HFP_AG_CALL_STATUS_DIALING
Definition hfp_ag.h:84
@ BT_HFP_AG_CALL_STATUS_INCOMING_HELD
Definition hfp_ag.h:88
@ BT_HFP_AG_CALL_STATUS_ALERTING
Definition hfp_ag.h:85
@ BT_HFP_AG_CALL_STATUS_ACTIVE
Definition hfp_ag.h:82
@ BT_HFP_AG_CALL_STATUS_INCOMING
Definition hfp_ag.h:86
@ BT_HFP_AG_CALL_STATUS_WAITING
Definition hfp_ag.h:87
@ BT_HFP_AG_CALL_STATUS_HELD
Definition hfp_ag.h:83
state
Definition parser_state.h:29
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
HFP profile AG application callback.
Definition hfp_ag.h:112
void(* ringing)(struct bt_hfp_ag_call *call, bool in_band)
HF ringing Callback.
Definition hfp_ag.h:239
void(* voice_recognition)(struct bt_hfp_ag *ag, bool activate)
Voice recognition activation/deactivation callback.
Definition hfp_ag.h:387
void(* codec)(struct bt_hfp_ag *ag, uint32_t ids)
Supported codec Ids callback.
Definition hfp_ag.h:293
void(* vgs)(struct bt_hfp_ag *ag, uint8_t gain)
HF VGS setting callback.
Definition hfp_ag.h:340
void(* audio_connect_req)(struct bt_hfp_ag *ag)
Audio connection request callback.
Definition hfp_ag.h:320
void(* incoming_held)(struct bt_hfp_ag_call *call)
HF incoming call is held Callback.
Definition hfp_ag.h:229
void(* accept)(struct bt_hfp_ag_call *call)
HF call accept Callback.
Definition hfp_ag.h:248
void(* codec_negotiate)(struct bt_hfp_ag *ag, int err)
Codec negotiate callback.
Definition hfp_ag.h:303
void(* outgoing)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number)
HF outgoing Callback.
Definition hfp_ag.h:209
void(* sco_disconnected)(struct bt_conn *sco_conn, uint8_t reason)
HF SCO/eSCO disconnected Callback.
Definition hfp_ag.h:148
void(* hf_indicator_value)(struct bt_hfp_ag *ag, enum hfp_ag_hf_indicators indicator, uint32_t value)
HF indicator value callback.
Definition hfp_ag.h:461
int(* subscriber_number)(struct bt_hfp_ag *ag, bt_hfp_ag_query_subscriber_func_t func)
Get subscriber number callback.
Definition hfp_ag.h:448
int(* number_call)(struct bt_hfp_ag *ag, const char *number)
HF phone number calling request Callback.
Definition hfp_ag.h:198
void(* retrieve)(struct bt_hfp_ag_call *call)
HF call retrieve Callback.
Definition hfp_ag.h:266
void(* incoming)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number)
HF incoming Callback.
Definition hfp_ag.h:220
void(* vgm)(struct bt_hfp_ag *ag, uint8_t gain)
HF VGM setting callback.
Definition hfp_ag.h:330
void(* sco_connected)(struct bt_hfp_ag *ag, struct bt_conn *sco_conn)
HF SCO/eSCO connected Callback.
Definition hfp_ag.h:139
void(* connected)(struct bt_conn *conn, struct bt_hfp_ag *ag)
HF AG connected callback to application.
Definition hfp_ag.h:121
void(* reject)(struct bt_hfp_ag_call *call)
HF call reject Callback.
Definition hfp_ag.h:275
void(* held)(struct bt_hfp_ag_call *call)
HF call held Callback.
Definition hfp_ag.h:257
void(* explicit_call_transfer)(struct bt_hfp_ag *ag)
HF explicit call transfer callback.
Definition hfp_ag.h:369
int(* get_ongoing_call)(struct bt_hfp_ag *ag)
Get ongoing call information Callback.
Definition hfp_ag.h:168
void(* ecnr_turn_off)(struct bt_hfp_ag *ag)
HF ECNR turns off callback.
Definition hfp_ag.h:352
void(* transmit_dtmf_code)(struct bt_hfp_ag *ag, char code)
Transmit a DTMF Code callback.
Definition hfp_ag.h:436
void(* ready_to_accept_audio)(struct bt_hfp_ag *ag)
Ready to accept audio callback.
Definition hfp_ag.h:405
void(* terminate)(struct bt_hfp_ag_call *call)
HF call terminate Callback.
Definition hfp_ag.h:284
int(* request_phone_number)(struct bt_hfp_ag *ag, char **number)
Request phone number callback.
Definition hfp_ag.h:423
int(* memory_dial)(struct bt_hfp_ag *ag, const char *location, char **number)
HF memory dialing request Callback.
Definition hfp_ag.h:182
void(* disconnected)(struct bt_hfp_ag *ag)
HF disconnected callback to application.
Definition hfp_ag.h:130
The ongoing call.
Definition hfp_ag.h:104
char number[CONFIG_BT_HFP_AG_PHONE_NUMBER_MAX_LEN+1]
Definition hfp_ag.h:105
uint8_t type
Definition hfp_ag.h:106
enum bt_hfp_ag_call_dir dir
Definition hfp_ag.h:107
enum bt_hfp_ag_call_status status
Definition hfp_ag.h:108