Zephyr API Documentation 4.1.99
A Scalable Open Source RTOS
|
|
4.1.99 |
Hands Free Profile - Audio Gateway (HFP-AG) . More...
Data Structures | |
struct | bt_hfp_ag_cb |
HFP profile AG application callback. More... | |
Macros | |
#define | BT_HFP_AG_CODEC_CVSD 0x01 |
#define | BT_HFP_AG_CODEC_MSBC 0x02 |
#define | BT_HFP_AG_CODEC_LC3_SWB 0x03 |
Typedefs | |
typedef 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. | |
Enumerations | |
enum | bt_hfp_ag_indicator { BT_HFP_AG_SERVICE_IND = 0 , BT_HFP_AG_CALL_IND = 1 , BT_HFP_AG_CALL_SETUP_IND = 2 , BT_HFP_AG_CALL_HELD_IND = 3 , BT_HFP_AG_SIGNAL_IND = 4 , BT_HFP_AG_ROAM_IND = 5 , BT_HFP_AG_BATTERY_IND = 6 , BT_HFP_AG_IND_MAX } |
enum | hfp_ag_hf_indicators { HFP_AG_ENHANCED_SAFETY_IND = 1 , HFP_AG_BATTERY_LEVEL_IND = 2 } |
Functions | |
int | bt_hfp_ag_register (struct bt_hfp_ag_cb *cb) |
Register HFP AG profile. | |
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_disconnect (struct bt_hfp_ag *ag) |
Disconnect the hfp ag session. | |
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_incoming (struct bt_hfp_ag_call *call) |
Put the incoming call on hold. | |
int | bt_hfp_ag_reject (struct bt_hfp_ag_call *call) |
Reject the incoming call. | |
int | bt_hfp_ag_accept (struct bt_hfp_ag_call *call) |
Accept the incoming call. | |
int | bt_hfp_ag_terminate (struct bt_hfp_ag_call *call) |
Terminate the active/hold call. | |
int | bt_hfp_ag_retrieve (struct bt_hfp_ag_call *call) |
Retrieve the held call. | |
int | bt_hfp_ag_hold (struct bt_hfp_ag_call *call) |
Hold the active call. | |
int | bt_hfp_ag_outgoing (struct bt_hfp_ag *ag, const char *number) |
Dial a call. | |
int | bt_hfp_ag_remote_ringing (struct bt_hfp_ag_call *call) |
Notify HFP Unit that the remote starts ringing. | |
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_remote_accept (struct bt_hfp_ag_call *call) |
Notify HFP Unit that the remote accepts the call. | |
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_explicit_call_transfer (struct bt_hfp_ag *ag) |
explicit call transfer | |
int | bt_hfp_ag_vgm (struct bt_hfp_ag *ag, uint8_t vgm) |
Set the HF microphone gain. | |
int | bt_hfp_ag_vgs (struct bt_hfp_ag *ag, uint8_t vgs) |
Set the HF speaker gain. | |
int | bt_hfp_ag_set_operator (struct bt_hfp_ag *ag, uint8_t mode, char *name) |
Set currently network operator. | |
int | bt_hfp_ag_audio_connect (struct bt_hfp_ag *ag, uint8_t id) |
Create audio connection. | |
int | bt_hfp_ag_inband_ringtone (struct bt_hfp_ag *ag, bool inband) |
Set In-Band Ring Tone. | |
int | bt_hfp_ag_voice_recognition (struct bt_hfp_ag *ag, bool activate) |
Enable/disable the voice recognition function. | |
int | bt_hfp_ag_vre_state (struct bt_hfp_ag *ag, uint8_t state) |
set voice recognition engine state | |
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_signal_strength (struct bt_hfp_ag *ag, uint8_t strength) |
Set signal strength. | |
int | bt_hfp_ag_roaming_status (struct bt_hfp_ag *ag, uint8_t status) |
Set roaming status. | |
int | bt_hfp_ag_battery_level (struct bt_hfp_ag *ag, uint8_t level) |
Set battery level. | |
int | bt_hfp_ag_service_availability (struct bt_hfp_ag *ag, bool available) |
Set service availability. | |
int | bt_hfp_ag_hf_indicator (struct bt_hfp_ag *ag, enum hfp_ag_hf_indicators indicator, bool enable) |
Activate/deactivate HF indicator. | |
Hands Free Profile - Audio Gateway (HFP-AG) .
#define BT_HFP_AG_CODEC_CVSD 0x01 |
#include <zephyr/bluetooth/classic/hfp_ag.h>
#define BT_HFP_AG_CODEC_LC3_SWB 0x03 |
#include <zephyr/bluetooth/classic/hfp_ag.h>
#define BT_HFP_AG_CODEC_MSBC 0x02 |
#include <zephyr/bluetooth/classic/hfp_ag.h>
typedef int(* bt_hfp_ag_query_subscriber_func_t) (struct bt_hfp_ag *ag, char *number, uint8_t type, uint8_t service) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Query subscriber number callback function.
When AG wants to send subscriber number information, all information will be passed through the callback. And the subscriber number information will be sent out in this function.
ag | HFP AG object. |
number | Subscriber number. |
type | Type of subscriber number specifies the format of the phone number provided, and can be one of the following values:
|
service | Service of subscriber number indicates which service this phone number relates to. Shall be either 4 (voice) or 5 (fax). |
enum bt_hfp_ag_indicator |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Enumerator | |
---|---|
BT_HFP_AG_SERVICE_IND | |
BT_HFP_AG_CALL_IND | |
BT_HFP_AG_CALL_SETUP_IND | |
BT_HFP_AG_CALL_HELD_IND | |
BT_HFP_AG_SIGNAL_IND | |
BT_HFP_AG_ROAM_IND | |
BT_HFP_AG_BATTERY_IND | |
BT_HFP_AG_IND_MAX |
enum hfp_ag_hf_indicators |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Enumerator | |
---|---|
HFP_AG_ENHANCED_SAFETY_IND | |
HFP_AG_BATTERY_LEVEL_IND |
int bt_hfp_ag_accept | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Accept the incoming call.
Accept the incoming call.
call | HFP AG call object. |
int bt_hfp_ag_audio_connect | ( | struct bt_hfp_ag * | ag, |
uint8_t | id ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Create audio connection.
Create audio conenction by HFP AG. There are two setups included, Codec connection and audio connection. The codec connection will be established firstly if the codec negotiation are supported by both side. If the passed codec id is not same as the last codec connection, the codec connection procedure will be triggered. After the codec conenction is established, the audio conenction will be started. The passed codec id could be one of BT_HFP_AG_CODEC_XXX. If the codec negotiation feature is supported by both side, the codec id could be one of the bitmaps of ids
notified by callback codec
. Or, the id
should be BT_HFP_AG_CODEC_CVSD.
ag | HFP AG object. |
id | Codec Id. |
int bt_hfp_ag_battery_level | ( | struct bt_hfp_ag * | ag, |
uint8_t | level ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set battery level.
Set battery level.
ag | HFP AG object. |
level | battery level. |
int bt_hfp_ag_connect | ( | struct bt_conn * | conn, |
struct bt_hfp_ag ** | ag, | ||
uint8_t | channel ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Create the hfp ag session.
Create the hfp ag session
conn | ACL connection object. |
ag | Created HFP AG object. |
channel | Peer rfcomm channel to be connected. |
int bt_hfp_ag_disconnect | ( | struct bt_hfp_ag * | ag | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Disconnect the hfp ag session.
Disconnect the hfp ag session
ag | HFP AG object. |
int bt_hfp_ag_explicit_call_transfer | ( | struct bt_hfp_ag * | ag | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
explicit call transfer
Connects the two calls and disconnects the subscriber from both calls (Explicit Call Transfer). If CONFIG_BT_HFP_AG_3WAY_CALL
is not enabled, the error -ENOTSUP
will be returned if the function called.
ag | HFP AG object. |
int bt_hfp_ag_hf_indicator | ( | struct bt_hfp_ag * | ag, |
enum hfp_ag_hf_indicators | indicator, | ||
bool | enable ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Activate/deactivate HF indicator.
It allows HF to issue the +BIND unsolicited result code to activate/deactivate of the AG’s supported HF Indicators. The indicator of supported indicators can be activated/deactivated are defined in enum hfp_ag_hf_indicators
. BT_HFP_AG_HF_INDICATOR_ENH_SAFETY
is used to support Enhanced Safety
. Only the configuration has been enabled, the indicator
can be HFP_AG_ENHANCED_SAFETY_IND. BT_HFP_AG_HF_INDICATOR_BATTERY
is used to support Remaining level of Battery
. Only the configuration has been enabled, the indicator
can be HFP_AG_BATTERY_LEVEL_IND. If CONFIG_BT_HFP_HF_HF_INDICATORS
is not enabled, the error -ENOTSUP
will be returned if the function called.
ag | HFP AG object. |
indicator | The indicator of the AG’s supported HF Indicators. |
enable | enable/disable specific HF Indicator. |
int bt_hfp_ag_hold | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Hold the active call.
Hold the active call.
call | HFP AG call object. |
int bt_hfp_ag_hold_incoming | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Put the incoming call on hold.
Put the incoming call on hold.
call | HFP AG call object. |
int bt_hfp_ag_inband_ringtone | ( | struct bt_hfp_ag * | ag, |
bool | inband ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set In-Band Ring Tone.
Set In-Band Ring Tone.
ag | HFP AG object. |
inband | In-band or no in-band. |
int bt_hfp_ag_outgoing | ( | struct bt_hfp_ag * | ag, |
const char * | number ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Dial a call.
Dial a call.
ag | HFP AG object. |
number | Dialing number. |
int bt_hfp_ag_register | ( | struct bt_hfp_ag_cb * | cb | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Register HFP AG profile.
Register Handsfree profile AG callbacks to monitor the state and get the required HFP details to display.
cb | callback structure. |
int bt_hfp_ag_reject | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Reject the incoming call.
Reject the incoming call.
call | HFP AG call object. |
int bt_hfp_ag_remote_accept | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Notify HFP Unit that the remote accepts the call.
Notify HFP Unit that the remote accepts the call.
call | HFP AG call object. |
int bt_hfp_ag_remote_incoming | ( | struct bt_hfp_ag * | ag, |
const char * | number ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Notify HFP Unit of an incoming call.
Notify HFP Unit of an incoming call.
ag | HFP AG object. |
number | Dialing number. |
int bt_hfp_ag_remote_reject | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Notify HFP Unit that the remote rejects the call.
Notify HFP Unit that the remote rejects the call.
call | HFP AG call object. |
int bt_hfp_ag_remote_ringing | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Notify HFP Unit that the remote starts ringing.
Notify HFP Unit that the remote starts ringing.
call | HFP AG call object. |
int bt_hfp_ag_remote_terminate | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Notify HFP Unit that the remote terminates the active/hold call.
Notify HFP Unit that the remote terminates the active/hold call.
call | HFP AG call object. |
int bt_hfp_ag_retrieve | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Retrieve the held call.
Retrieve the held call.
call | HFP AG call object. |
int bt_hfp_ag_roaming_status | ( | struct bt_hfp_ag * | ag, |
uint8_t | status ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set roaming status.
Set roaming status.
ag | HFP AG object. |
status | Roaming status. |
int bt_hfp_ag_service_availability | ( | struct bt_hfp_ag * | ag, |
bool | available ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set service availability.
Set service availability.
ag | HFP AG object. |
available | service availability |
int bt_hfp_ag_set_operator | ( | struct bt_hfp_ag * | ag, |
uint8_t | mode, | ||
char * | name ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set currently network operator.
Set currently network operator.
ag | HFP AG object. |
mode | Current mode and provides no information with regard to the name of the operator. |
name | A string in alphanumeric format representing the name of the network operator. This string shall not exceed 16 characters. |
int bt_hfp_ag_signal_strength | ( | struct bt_hfp_ag * | ag, |
uint8_t | strength ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set signal strength.
Set signal strength.
ag | HFP AG object. |
strength | Signal strength. |
int bt_hfp_ag_terminate | ( | struct bt_hfp_ag_call * | call | ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Terminate the active/hold call.
Terminate the active/hold call.
call | HFP AG call object. |
int bt_hfp_ag_vgm | ( | struct bt_hfp_ag * | ag, |
uint8_t | vgm ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set the HF microphone gain.
Set the HF microphone gain
ag | HFP AG object. |
vgm | Microphone gain value. |
int bt_hfp_ag_vgs | ( | struct bt_hfp_ag * | ag, |
uint8_t | vgs ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Set the HF speaker gain.
Set the HF speaker gain
ag | HFP AG object. |
vgs | Speaker gain value. |
int bt_hfp_ag_voice_recognition | ( | struct bt_hfp_ag * | ag, |
bool | activate ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
Enable/disable the voice recognition function.
Enables/disables the voice recognition function. If CONFIG_BT_HFP_AG_VOICE_RECG
is not enabled, the error -ENOTSUP
will be returned if the function called.
ag | HFP AG object. |
activate | Activate/deactivate the voice recognition function. |
int bt_hfp_ag_vre_state | ( | struct bt_hfp_ag * | ag, |
uint8_t | state ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
set voice recognition engine state
It is used to set the voice recognition engine state. The unsolicited result code +BVRA: 1,<vrecstate>
will be sent. <vrecstate>
: Bitmask that reflects the current state of the voice recognition engine on the AG. Bit 0 - If it is 1, the AG is ready to accept audio input Bit 1 - If it is 1, the AG is sending audio to the HF Bit 2 - If it is 1, the AG is processing the audio input If CONFIG_BT_HFP_AG_ENH_VOICE_RECG
is not enabled, the error -ENOTSUP
will be returned if the function called.
ag | HFP AG object. |
state | The value of <vrecstate> . |
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 ) |
#include <zephyr/bluetooth/classic/hfp_ag.h>
set voice recognition engine state and textual representation
It is used to set the voice recognition engine state with textual representation. unsolicited result code +BVRA: 1,<vrecstate>, <textualRepresentation>
will be sent. <vrecstate>
is same as parameter state
of function bt_hfp_ag_vre_state
. <textualRepresentation>: <textID>,<textType>,<textOperation>, <string>
. <textID>
: Unique ID of the current text as a hexadecimal string (a maximum of 4 characters in length, but less than 4 characters in length is valid). <textType>
: ID of the textType from the following list: 0 - Text recognized by the AG from the audio input provided by the HF 1 - Text of the audio output from the AG 2 - Text of the audio output from the AG that contains a question 3 - Text of the audio output from the AG that contains an error description <textOperation>
: ID of the operation of the text 1 - NewText: Indicates that a new text started. Shall be used when the <textID>
changes 2 - Replace: Replace any existing text with the same <textID>
and same <textType>
3 - Append: Attach new text to existing text and keep the same <textID>
and same <textType>
<string>
: The <string>
parameter shall be a UTF-8 text string and shall always be contained within double quotes. If CONFIG_BT_HFP_AG_VOICE_RECG_TEXT
is not enabled, the error -ENOTSUP
will be returned if the function called.
ag | HFP AG object. |
state | The value of <vrecstate> . |
id | Value of <textID> . |
type | Value of <textType> . |
operation | Value of <textOperation> . |
text | Value of <string> . |