Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
 4.1.99
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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
90 void (*connected)(struct bt_conn *conn, struct bt_hfp_ag *ag);
99 void (*disconnected)(struct bt_hfp_ag *ag);
108 void (*sco_connected)(struct bt_hfp_ag *ag, struct bt_conn *sco_conn);
117 void (*sco_disconnected)(struct bt_conn *sco_conn, uint8_t reason);
118
131 int (*memory_dial)(struct bt_hfp_ag *ag, const char *location, char **number);
132
147 int (*number_call)(struct bt_hfp_ag *ag, const char *number);
148
158 void (*outgoing)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number);
159
169 void (*incoming)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number);
170
178 void (*incoming_held)(struct bt_hfp_ag_call *call);
179
188 void (*ringing)(struct bt_hfp_ag_call *call, bool in_band);
189
197 void (*accept)(struct bt_hfp_ag_call *call);
198
206 void (*held)(struct bt_hfp_ag_call *call);
207
215 void (*retrieve)(struct bt_hfp_ag_call *call);
216
224 void (*reject)(struct bt_hfp_ag_call *call);
225
233 void (*terminate)(struct bt_hfp_ag_call *call);
234
242 void (*codec)(struct bt_hfp_ag *ag, uint32_t ids);
243
252 void (*codec_negotiate)(struct bt_hfp_ag *ag, int err);
253
269 void (*audio_connect_req)(struct bt_hfp_ag *ag);
270
279 void (*vgm)(struct bt_hfp_ag *ag, uint8_t gain);
280
289 void (*vgs)(struct bt_hfp_ag *ag, uint8_t gain);
290
301 void (*ecnr_turn_off)(struct bt_hfp_ag *ag);
302
318 void (*explicit_call_transfer)(struct bt_hfp_ag *ag);
319
336 void (*voice_recognition)(struct bt_hfp_ag *ag, bool activate);
337
354 void (*ready_to_accept_audio)(struct bt_hfp_ag *ag);
355
372 int (*request_phone_number)(struct bt_hfp_ag *ag, char **number);
373
385 void (*transmit_dtmf_code)(struct bt_hfp_ag *ag, char code);
386
397 int (*subscriber_number)(struct bt_hfp_ag *ag, bt_hfp_ag_query_subscriber_func_t func);
398
410 void (*hf_indicator_value)(struct bt_hfp_ag *ag, enum hfp_ag_hf_indicators indicator,
411 uint32_t value);
412};
413
424
435int bt_hfp_ag_connect(struct bt_conn *conn, struct bt_hfp_ag **ag, uint8_t channel);
436
445int bt_hfp_ag_disconnect(struct bt_hfp_ag *ag);
446
456int bt_hfp_ag_remote_incoming(struct bt_hfp_ag *ag, const char *number);
457
466int bt_hfp_ag_hold_incoming(struct bt_hfp_ag_call *call);
467
476int bt_hfp_ag_reject(struct bt_hfp_ag_call *call);
477
486int bt_hfp_ag_accept(struct bt_hfp_ag_call *call);
487
496int bt_hfp_ag_terminate(struct bt_hfp_ag_call *call);
497
506int bt_hfp_ag_retrieve(struct bt_hfp_ag_call *call);
507
516int bt_hfp_ag_hold(struct bt_hfp_ag_call *call);
517
527int bt_hfp_ag_outgoing(struct bt_hfp_ag *ag, const char *number);
528
537int bt_hfp_ag_remote_ringing(struct bt_hfp_ag_call *call);
538
547int bt_hfp_ag_remote_reject(struct bt_hfp_ag_call *call);
548
557int bt_hfp_ag_remote_accept(struct bt_hfp_ag_call *call);
558
567int bt_hfp_ag_remote_terminate(struct bt_hfp_ag_call *call);
568
580int bt_hfp_ag_explicit_call_transfer(struct bt_hfp_ag *ag);
581
591int bt_hfp_ag_vgm(struct bt_hfp_ag *ag, uint8_t vgm);
592
602int bt_hfp_ag_vgs(struct bt_hfp_ag *ag, uint8_t vgs);
603
617int bt_hfp_ag_set_operator(struct bt_hfp_ag *ag, uint8_t mode, char *name);
618
639int bt_hfp_ag_audio_connect(struct bt_hfp_ag *ag, uint8_t id);
640
650int bt_hfp_ag_inband_ringtone(struct bt_hfp_ag *ag, bool inband);
651
663int bt_hfp_ag_voice_recognition(struct bt_hfp_ag *ag, bool activate);
664
682int bt_hfp_ag_vre_state(struct bt_hfp_ag *ag, uint8_t state);
683
724int bt_hfp_ag_vre_textual_representation(struct bt_hfp_ag *ag, uint8_t state, const char *id,
725 uint8_t type, uint8_t operation, const char *text);
726
736int bt_hfp_ag_signal_strength(struct bt_hfp_ag *ag, uint8_t strength);
737
747int bt_hfp_ag_roaming_status(struct bt_hfp_ag *ag, uint8_t status);
748
758int bt_hfp_ag_battery_level(struct bt_hfp_ag *ag, uint8_t level);
759
769int bt_hfp_ag_service_availability(struct bt_hfp_ag *ag, bool available);
770
792int bt_hfp_ag_hf_indicator(struct bt_hfp_ag *ag, enum hfp_ag_hf_indicators indicator, bool enable);
793
794#ifdef __cplusplus
795}
796#endif
797
802#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.
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_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_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_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.
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.
@ 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
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:81
void(* ringing)(struct bt_hfp_ag_call *call, bool in_band)
HF ringing Callback.
Definition hfp_ag.h:188
void(* voice_recognition)(struct bt_hfp_ag *ag, bool activate)
Voice recognition activation/deactivation callback.
Definition hfp_ag.h:336
void(* codec)(struct bt_hfp_ag *ag, uint32_t ids)
Supported codec Ids callback.
Definition hfp_ag.h:242
void(* vgs)(struct bt_hfp_ag *ag, uint8_t gain)
HF VGS setting callback.
Definition hfp_ag.h:289
void(* audio_connect_req)(struct bt_hfp_ag *ag)
Audio connection request callback.
Definition hfp_ag.h:269
void(* incoming_held)(struct bt_hfp_ag_call *call)
HF incoming call is held Callback.
Definition hfp_ag.h:178
void(* accept)(struct bt_hfp_ag_call *call)
HF call accept Callback.
Definition hfp_ag.h:197
void(* codec_negotiate)(struct bt_hfp_ag *ag, int err)
Codec negotiate callback.
Definition hfp_ag.h:252
void(* outgoing)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number)
HF outgoing Callback.
Definition hfp_ag.h:158
void(* sco_disconnected)(struct bt_conn *sco_conn, uint8_t reason)
HF SCO/eSCO disconnected Callback.
Definition hfp_ag.h:117
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:410
int(* subscriber_number)(struct bt_hfp_ag *ag, bt_hfp_ag_query_subscriber_func_t func)
Get subscriber number callback.
Definition hfp_ag.h:397
int(* number_call)(struct bt_hfp_ag *ag, const char *number)
HF phone number calling request Callback.
Definition hfp_ag.h:147
void(* retrieve)(struct bt_hfp_ag_call *call)
HF call retrieve Callback.
Definition hfp_ag.h:215
void(* incoming)(struct bt_hfp_ag *ag, struct bt_hfp_ag_call *call, const char *number)
HF incoming Callback.
Definition hfp_ag.h:169
void(* vgm)(struct bt_hfp_ag *ag, uint8_t gain)
HF VGM setting callback.
Definition hfp_ag.h:279
void(* sco_connected)(struct bt_hfp_ag *ag, struct bt_conn *sco_conn)
HF SCO/eSCO connected Callback.
Definition hfp_ag.h:108
void(* connected)(struct bt_conn *conn, struct bt_hfp_ag *ag)
HF AG connected callback to application.
Definition hfp_ag.h:90
void(* reject)(struct bt_hfp_ag_call *call)
HF call reject Callback.
Definition hfp_ag.h:224
void(* held)(struct bt_hfp_ag_call *call)
HF call held Callback.
Definition hfp_ag.h:206
void(* explicit_call_transfer)(struct bt_hfp_ag *ag)
HF explicit call transfer callback.
Definition hfp_ag.h:318
void(* ecnr_turn_off)(struct bt_hfp_ag *ag)
HF ECNR turns off callback.
Definition hfp_ag.h:301
void(* transmit_dtmf_code)(struct bt_hfp_ag *ag, char code)
Transmit a DTMF Code callback.
Definition hfp_ag.h:385
void(* ready_to_accept_audio)(struct bt_hfp_ag *ag)
Ready to accept audio callback.
Definition hfp_ag.h:354
void(* terminate)(struct bt_hfp_ag_call *call)
HF call terminate Callback.
Definition hfp_ag.h:233
int(* request_phone_number)(struct bt_hfp_ag *ag, char **number)
Request phone number callback.
Definition hfp_ag.h:372
int(* memory_dial)(struct bt_hfp_ag *ag, const char *location, char **number)
HF memory dialing request Callback.
Definition hfp_ag.h:131
void(* disconnected)(struct bt_hfp_ag *ag)
HF disconnected callback to application.
Definition hfp_ag.h:99