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
Hands Free Profile (HFP)

Hands Free Profile (HFP) . More...

Data Structures

struct  bt_hfp_hf_cb
 HFP profile application callback. More...
 

Macros

#define BT_HFP_HF_CODEC_CVSD   0x01
 
#define BT_HFP_HF_CODEC_MSBC   0x02
 
#define BT_HFP_HF_CODEC_LC3_SWB   0x03
 

Enumerations

enum  hfp_hf_ag_indicators {
  HF_SERVICE_IND = 0 , HF_CALL_IND , HF_CALL_SETUP_IND , HF_CALL_HELD_IND ,
  HF_SIGNAL_IND , HF_ROAM_IND , HF_BATTERY_IND
}
 

Functions

int bt_hfp_hf_register (struct bt_hfp_hf_cb *cb)
 Register HFP HF profile.
 
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_disconnect (struct bt_hfp_hf *hf)
 Release the service level connection.
 
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_vgm (struct bt_hfp_hf *hf, uint8_t gain)
 Handsfree HF report Gain of Microphone (VGM)
 
int bt_hfp_hf_vgs (struct bt_hfp_hf *hf, uint8_t gain)
 Handsfree HF report Gain of Speaker (VGS)
 
int bt_hfp_hf_get_operator (struct bt_hfp_hf *hf)
 Handsfree HF requests currently selected operator.
 
int bt_hfp_hf_accept (struct bt_hfp_hf_call *call)
 Handsfree HF accept the incoming call.
 
int bt_hfp_hf_reject (struct bt_hfp_hf_call *call)
 Handsfree HF reject the incoming call.
 
int bt_hfp_hf_terminate (struct bt_hfp_hf_call *call)
 Handsfree HF terminate the incoming 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_query_respond_hold_status (struct bt_hfp_hf *hf)
 Handsfree HF query respond and hold status of AG.
 
int bt_hfp_hf_number_call (struct bt_hfp_hf *hf, const char *number)
 Handsfree HF phone number call.
 
int bt_hfp_hf_memory_dial (struct bt_hfp_hf *hf, const char *location)
 Handsfree HF memory dialing call.
 
int bt_hfp_hf_redial (struct bt_hfp_hf *hf)
 Handsfree HF redial last number.
 
int bt_hfp_hf_audio_connect (struct bt_hfp_hf *hf)
 Handsfree HF setup audio connection.
 
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_set_codecs (struct bt_hfp_hf *hf, uint8_t codec_ids)
 Handsfree HF set supported codec ids.
 
int bt_hfp_hf_turn_off_ecnr (struct bt_hfp_hf *hf)
 Handsfree HF turns off AG's EC and NR.
 
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_release_all_held (struct bt_hfp_hf *hf)
 Handsfree HF release all held calls.
 
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_release_active_accept_other (struct bt_hfp_hf *hf)
 Handsfree HF release all active calls and accept other call.
 
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_join_conversation (struct bt_hfp_hf *hf)
 Handsfree HF add a held call to the conversation.
 
int bt_hfp_hf_explicit_call_transfer (struct bt_hfp_hf *hf)
 Handsfree HF explicit call transfer.
 
int bt_hfp_hf_release_specified_call (struct bt_hfp_hf_call *call)
 Handsfree HF release call with specified index.
 
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_voice_recognition (struct bt_hfp_hf *hf, bool activate)
 Handsfree HF enable/disable the voice recognition function.
 
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_request_phone_number (struct bt_hfp_hf *hf)
 Handsfree HF attach a phone number for a voice tag.
 
int bt_hfp_hf_transmit_dtmf_code (struct bt_hfp_hf_call *call, char code)
 Handsfree HF Transmit A specific DTMF Code.
 
int bt_hfp_hf_query_subscriber (struct bt_hfp_hf *hf)
 Handsfree HF Query Subscriber Number Information.
 
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_enhanced_safety (struct bt_hfp_hf *hf, bool enable)
 Handsfree HF enable/disable enhanced safety.
 
int bt_hfp_hf_battery (struct bt_hfp_hf *hf, uint8_t level)
 Handsfree HF remaining battery level.
 

Detailed Description

Hands Free Profile (HFP) .

Macro Definition Documentation

◆ BT_HFP_HF_CODEC_CVSD

#define BT_HFP_HF_CODEC_CVSD   0x01

◆ BT_HFP_HF_CODEC_LC3_SWB

#define BT_HFP_HF_CODEC_LC3_SWB   0x03

◆ BT_HFP_HF_CODEC_MSBC

#define BT_HFP_HF_CODEC_MSBC   0x02

Enumeration Type Documentation

◆ hfp_hf_ag_indicators

#include <zephyr/bluetooth/classic/hfp_hf.h>

Enumerator
HF_SERVICE_IND 
HF_CALL_IND 
HF_CALL_SETUP_IND 
HF_CALL_HELD_IND 
HF_SIGNAL_IND 
HF_ROAM_IND 
HF_BATTERY_IND 

Function Documentation

◆ bt_hfp_hf_accept()

int bt_hfp_hf_accept ( struct bt_hfp_hf_call * call)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF accept the incoming call.

Send the ATA command to accept the incoming call. OR, send the AT+BTRH=1 command to accept a held incoming call.

Note
It cannot be used when multiple calls are ongoing.
Parameters
callHFP HF call object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_audio_connect()

int bt_hfp_hf_audio_connect ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF setup audio connection.

Setup audio conenction by sending AT+BCC. If CONFIG_BT_HFP_HF_CODEC_NEG is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_battery()

int bt_hfp_hf_battery ( struct bt_hfp_hf * hf,
uint8_t level )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF remaining battery level.

It allows HF to transfer of HF indicator remaining battery level value. If CONFIG_BT_HFP_HF_HF_INDICATOR_BATTERY is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
levelThe remaining battery level.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_call_waiting_notify()

int bt_hfp_hf_call_waiting_notify ( struct bt_hfp_hf * hf,
bool enable )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF enable/disable call waiting notification.

Enable call waiting notification by sending AT+CCWA=1. Disable call waiting notification by sending AT+CCWA=0. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
enableEnable/disable.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_cli()

int bt_hfp_hf_cli ( struct bt_hfp_hf * hf,
bool enable )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF enable/disable Calling Line Identification (CLI) Notification.

Enable/disable Calling Line Identification (CLI) Notification. The AT command AT+CLIP will be sent to the AG to enable/disable the CLI unsolicited result code +CLIP when calling the function. If CONFIG_BT_HFP_HF_CLI is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
enableEnable/disable CLI.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_connect()

int bt_hfp_hf_connect ( struct bt_conn * conn,
struct bt_hfp_hf ** hf,
uint8_t channel )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Initiate the service level connection establishment procedure.

Initiate the service level connection establishment procedure on the ACL connection specified by the parameter conn using the specific RFCOMM channel discovered by the function bt_br_discovery_start.

The parameter hf is a output parameter. When the service level connection establishment procedure is initiated without any error, the HFP HF object is allocated and it will be returned via the parameter hf if the parameter hf is not a NULL pointer.

When service level conenction is established, the registered callback connected will be triggered to notify the application that the service level connection establishment procedure is done. And the HFP HF object is valid at this time. It means after the function is called without any error, all interfaces provided by HFP HF can only be called after the registered callback connected is triggered.

Parameters
connACL connection object.
hfCreated HFP HF object.
channelPeer RFCOMM channel to be connected.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_disconnect()

int bt_hfp_hf_disconnect ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Release the service level connection.

Release the service level connection from the peer device.

The function can only be called after the registered callback connected is triggered.

If the function is called without any error, the HFP HF object is invalid at this time. All interfaces provided by HFP HF should not be called anymore.

If the service level connection is released, the registered callback disconnected will be triggered to notify the application that the service level connection release procedure is done. And the HFP HF object will be freed after the registered callback disconnected returned.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_enhanced_safety()

int bt_hfp_hf_enhanced_safety ( struct bt_hfp_hf * hf,
bool enable )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF enable/disable enhanced safety.

It allows HF to transfer of HF indicator enhanced safety value. If CONFIG_BT_HFP_HF_HF_INDICATOR_ENH_SAFETY is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
enableThe enhanced safety is enabled/disabled.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_explicit_call_transfer()

int bt_hfp_hf_explicit_call_transfer ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF explicit call transfer.

Connects the two calls and disconnects the subscriber from both calls (Explicit Call Transfer) by sending AT+CHLD=4. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_get_operator()

int bt_hfp_hf_get_operator ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF requests currently selected operator.

Send the AT+COPS? (Read) command to find the currently selected operator.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_hold_active_accept_other()

int bt_hfp_hf_hold_active_accept_other ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF hold all active calls and accept other call.

Hold all active calls (if any exist) and accepts the other (held or waiting) call by sending AT+CHLD=2. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_hold_incoming()

int bt_hfp_hf_hold_incoming ( struct bt_hfp_hf_call * call)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF put the incoming call on hold.

Send the AT+BTRH=0 command to put the incoming call on hold. If the incoming call has been held, the callback on_hold will be triggered.

Note
It cannot be used when multiple calls are ongoing.
Parameters
callHFP HF call object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_indicator_status()

int bt_hfp_hf_indicator_status ( struct bt_hfp_hf * hf,
uint8_t status )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF set AG indicator activated/deactivated status.

It allows HF to issue the AT+BIA command if it needs to change the activated/deactivated status of indicators in the AG. The index of all indicators can be activated/deactivated are defined in enum hfp_hf_ag_indicators. The each bit of parameter status represents the indicator status corresponding to the index. Such as, value 0b111110 of status means the AG indicator service is required to be deactivated. Others are required to be activated.

Parameters
hfHFP HF object.
statusThe activated/deactivated bitmap status of AG indicators.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_join_conversation()

int bt_hfp_hf_join_conversation ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF add a held call to the conversation.

Add a held call to the conversation by sending AT+CHLD=3. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_memory_dial()

int bt_hfp_hf_memory_dial ( struct bt_hfp_hf * hf,
const char * location )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF memory dialing call.

Initiate outgoing voice calls using the memory dialing feature of the AG. Send the ATD>Nan... command to start memory dialing. The result of the command will be notified through the callback dialing.

Parameters
hfHFP HF object.
locationMemory location.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_number_call()

int bt_hfp_hf_number_call ( struct bt_hfp_hf * hf,
const char * number )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF phone number call.

Initiate outgoing voice calls by providing the destination phone number to the AG. Send the ATDdd…dd command to start phone number call. The result of the command will be notified through the callback dialing.

Parameters
hfHFP HF object.
numberPhone number.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_private_consultation_mode()

int bt_hfp_hf_private_consultation_mode ( struct bt_hfp_hf_call * call)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF request private consultation mode with specified call.

Request private consultation mode with specified call (Place all calls on hold EXCEPT the call indicated by <idx>.) by sending AT+CHLD=2<idx>. <idx> is index of specified call. If CONFIG_BT_HFP_HF_ECC is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
callHFP HF call object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_query_respond_hold_status()

int bt_hfp_hf_query_respond_hold_status ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF query respond and hold status of AG.

Send the AT+BTRH? command to query respond and hold status of AG. The status respond and hold will be notified through callback on_hold.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_query_subscriber()

int bt_hfp_hf_query_subscriber ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF Query Subscriber Number Information.

It allows HF to query the AG subscriber number by sending AT+CNUM.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_ready_to_accept_audio()

int bt_hfp_hf_ready_to_accept_audio ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF indicate that the HF is ready to accept audio.

This value indicates that the HF is ready to accept audio when the Audio Connection is first established. The HF shall only send this value if the eSCO link has been established. If CONFIG_BT_HFP_HF_ENH_VOICE_RECG is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_redial()

int bt_hfp_hf_redial ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF redial last number.

Initiate outgoing voice calls by recalling the last number dialed by the AG. Send the AT+BLDN command to recall the last number. The result of the command will be notified through the callback dialing.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_register()

int bt_hfp_hf_register ( struct bt_hfp_hf_cb * cb)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Register HFP HF profile.

Register Handsfree profile callbacks to monitor the state and get the required HFP details to display.

Parameters
cbcallback structure.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_reject()

int bt_hfp_hf_reject ( struct bt_hfp_hf_call * call)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF reject the incoming call.

Send the AT+CHUP command to reject the incoming call. OR, send the AT+BTRH=2 command to reject a held incoming call.

Note
It cannot be used when multiple calls are ongoing.
Parameters
callHFP HF call object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_release_active_accept_other()

int bt_hfp_hf_release_active_accept_other ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF release all active calls and accept other call.

Release all active calls (if any exist) and accepts the other (held or waiting) call by sending AT+CHLD=1. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_release_all_held()

int bt_hfp_hf_release_all_held ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF release all held calls.

Release all held calls by sending AT+CHLD=0. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_release_specified_call()

int bt_hfp_hf_release_specified_call ( struct bt_hfp_hf_call * call)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF release call with specified index.

Release call with specified index by sending AT+CHLD=1<idx>. <idx> is index of specified call. If CONFIG_BT_HFP_HF_ECC is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
callHFP HF call object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_request_phone_number()

int bt_hfp_hf_request_phone_number ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF attach a phone number for a voice tag.

Send AT command "AT+BINP=1" to request phone number to the AG.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_select_codec()

int bt_hfp_hf_select_codec ( struct bt_hfp_hf * hf,
uint8_t codec_id )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF set selected codec id.

Set selected codec id by sending AT+BCS. The function is used to response the codec negotiation request notified by callback codec_negotiate. The parameter codec_id should be same as id of callback codec_negotiate if the id could be supported. Or, call bt_hfp_hf_set_codecs to notify the AG Codec IDs supported by HFP HF. If CONFIG_BT_HFP_HF_CODEC_NEG is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
codec_idSelected codec id.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_set_codecs()

int bt_hfp_hf_set_codecs ( struct bt_hfp_hf * hf,
uint8_t codec_ids )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF set supported codec ids.

Set supported codec ids by sending AT+BAC. This function is used to notify AG the supported Codec IDs of HF. If CONFIG_BT_HFP_HF_CODEC_NEG is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
codec_idsSupported codec IDs.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_set_udub()

int bt_hfp_hf_set_udub ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF set User Determined User Busy (UDUB) for a waiting call.

Set User Determined User Busy (UDUB) for a waiting call by sending AT+CHLD=0. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_terminate()

int bt_hfp_hf_terminate ( struct bt_hfp_hf_call * call)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF terminate the incoming call.

Send the AT+CHUP command to terminate the incoming call.

Note
It cannot be used when multiple calls are ongoing.
Parameters
callHFP HF call object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_transmit_dtmf_code()

int bt_hfp_hf_transmit_dtmf_code ( struct bt_hfp_hf_call * call,
char code )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF Transmit A specific DTMF Code.

During an ongoing call, the HF transmits the AT+VTS command to instruct the AG to transmit a specific DTMF code to its network connection. The set of the code is "0-9,#,*,A-D".

Parameters
callHFP HF call object.
codeA specific DTMF code.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_turn_off_ecnr()

int bt_hfp_hf_turn_off_ecnr ( struct bt_hfp_hf * hf)

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF turns off AG's EC and NR.

Turn off the AG's EC and NR by sending AT+NREC=0. The result of the command is notified through the callback ecnr_turn_off. If CONFIG_BT_HFP_HF_ECNR is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_vgm()

int bt_hfp_hf_vgm ( struct bt_hfp_hf * hf,
uint8_t gain )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF report Gain of Microphone (VGM)

Report Gain of Microphone (VGM). The AT command AT+VGM=<gain> will be sent to the AG to report its current microphone gain level setting to the AG. <gain> is a decimal numeric constant, relating to a particular (implementation dependent) volume level controlled by the HF. This command does not change the microphone gain of the AG; it simply indicates the current value of the microphone gain in the HF. If CONFIG_BT_HFP_HF_VOLUME is not enabled, the error -ENOTSUP will be returned if the function called. For "Volume Level Synchronization", the HF application could call the function to set VGM gain value in HF connection callback function. Then after the HF connection callback returned, VGM gain will be sent to HFP AG.

Parameters
hfHFP HF object.
gainGain of microphone.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_vgs()

int bt_hfp_hf_vgs ( struct bt_hfp_hf * hf,
uint8_t gain )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF report Gain of Speaker (VGS)

Report Gain of Speaker (VGS). The AT command AT+VGS=<gain> will be sent to the AG to report its current speaker gain level setting to the AG. <gain> is a decimal numeric constant, relating to a particular (implementation dependent) volume level controlled by the HF. This command does not change the speaker gain of the AG; it simply indicates the current value of the speaker gain in the HF. If CONFIG_BT_HFP_HF_VOLUME is not enabled, the error -ENOTSUP will be returned if the function called. For "Volume Level Synchronization", the HF application could call the function to set VGS gain value in HF connection callback function. Then after the HF connection callback returned, VGS gain will be sent to HFP AG.

Parameters
hfHFP HF object.
gainGain of speaker.
Returns
0 in case of success or negative value in case of error.

◆ bt_hfp_hf_voice_recognition()

int bt_hfp_hf_voice_recognition ( struct bt_hfp_hf * hf,
bool activate )

#include <zephyr/bluetooth/classic/hfp_hf.h>

Handsfree HF enable/disable the voice recognition function.

Enables/disables the voice recognition function in the AG. If CONFIG_BT_HFP_HF_VOICE_RECG is not enabled, the error -ENOTSUP will be returned if the function called.

Parameters
hfHFP HF object.
activateActivate/deactivate the voice recognition function.
Returns
0 in case of success or negative value in case of error.