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
bt_hfp_hf_cb Struct Reference

HFP profile application callback. More...

#include <hfp_hf.h>

Data Fields

void(* connected )(struct bt_conn *conn, struct bt_hfp_hf *hf)
 HF connected callback to application.
 
void(* disconnected )(struct bt_hfp_hf *hf)
 HF disconnected callback to application.
 
void(* sco_connected )(struct bt_hfp_hf *hf, struct bt_conn *sco_conn)
 HF SCO/eSCO connected Callback.
 
void(* sco_disconnected )(struct bt_conn *sco_conn, uint8_t reason)
 HF SCO/eSCO disconnected Callback.
 
void(* service )(struct bt_hfp_hf *hf, uint32_t value)
 HF indicator Callback.
 
void(* outgoing )(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call)
 HF call outgoing Callback.
 
void(* remote_ringing )(struct bt_hfp_hf_call *call)
 HF call outgoing call is ringing Callback.
 
void(* incoming )(struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call)
 HF call incoming Callback.
 
void(* incoming_held )(struct bt_hfp_hf_call *call)
 HF incoming call on hold Callback.
 
void(* accept )(struct bt_hfp_hf_call *call)
 HF call accept Callback.
 
void(* reject )(struct bt_hfp_hf_call *call)
 HF call reject Callback.
 
void(* terminate )(struct bt_hfp_hf_call *call)
 HF call terminate Callback.
 
void(* held )(struct bt_hfp_hf_call *call)
 HF call held Callback.
 
void(* retrieve )(struct bt_hfp_hf_call *call)
 HF call retrieve Callback.
 
void(* signal )(struct bt_hfp_hf *hf, uint32_t value)
 HF indicator Callback.
 
void(* roam )(struct bt_hfp_hf *hf, uint32_t value)
 HF indicator Callback.
 
void(* battery )(struct bt_hfp_hf *hf, uint32_t value)
 HF indicator Callback.
 
void(* ring_indication )(struct bt_hfp_hf_call *call)
 HF incoming call Ring indication callback to application.
 
void(* dialing )(struct bt_hfp_hf *hf, int err)
 HF call dialing Callback.
 
void(* clip )(struct bt_hfp_hf_call *call, char *number, uint8_t type)
 HF calling line identification notification callback to application.
 
void(* vgm )(struct bt_hfp_hf *hf, uint8_t gain)
 HF microphone gain notification callback to application.
 
void(* vgs )(struct bt_hfp_hf *hf, uint8_t gain)
 HF speaker gain notification callback to application.
 
void(* inband_ring )(struct bt_hfp_hf *hf, bool inband)
 HF in-band ring tone notification callback to application.
 
void(*)(struct bt_hfp_hf *hf, uint8_t id) operator) (struct bt_hfp_hf *hf, uint8_t mode, uint8_t format, char *operator);void(*codec_negotiate
 HF network operator notification callback to application.
 
void(* ecnr_turn_off )(struct bt_hfp_hf *hf, int err)
 HF ECNR turns off callback.
 
void(* call_waiting )(struct bt_hfp_hf_call *call, char *number, uint8_t type)
 HF call waiting notification callback to application.
 
void(* voice_recognition )(struct bt_hfp_hf *hf, bool activate)
 Voice recognition activation/deactivation callback.
 
void(* vre_state )(struct bt_hfp_hf *hf, uint8_t state)
 Voice recognition engine state callback.
 
void(* textual_representation )(struct bt_hfp_hf *hf, char *id, uint8_t type, uint8_t operation, char *text)
 Textual representation callback.
 
void(* request_phone_number )(struct bt_hfp_hf *hf, const char *number)
 Request phone number callback.
 
void(* subscriber_number )(struct bt_hfp_hf *hf, const char *number, uint8_t type, uint8_t service)
 Query subscriber number callback.
 

Detailed Description

HFP profile application callback.

Field Documentation

◆ accept

void(* bt_hfp_hf_cb::accept) (struct bt_hfp_hf_call *call)

HF call accept Callback.

This callback provides the incoming/outgoing call active status to the application.

Parameters
callHFP HF call object.

◆ battery

void(* bt_hfp_hf_cb::battery) (struct bt_hfp_hf *hf, uint32_t value)

HF indicator Callback.

This callback battery service indicator value to the application

Parameters
hfHFP HF object.
valuebattery indicator value received from the AG.

◆ call_waiting

void(* bt_hfp_hf_cb::call_waiting) (struct bt_hfp_hf_call *call, char *number, uint8_t type)

HF call waiting notification callback to application.

If this callback is provided it will be called whenever there is a unsolicited result code +CCWA. This notification can be enabled/disabled by calling function bt_hfp_hf_call_waiting_notify. If CONFIG_BT_HFP_HF_3WAY_CALL is not enabled, the unsolicited result code +CCWA will be ignored. And the callback will not be notified.

Parameters
callHFP HF call object.
numberNotified phone number.
typeSpecify the format of the phone number.

◆ clip

void(* bt_hfp_hf_cb::clip) (struct bt_hfp_hf_call *call, char *number, uint8_t type)

HF calling line identification notification callback to application.

If this callback is provided it will be called whenever there is a unsolicited result code +CLIP. If CONFIG_BT_HFP_HF_CLI is not enabled, the unsolicited result code +CLIP will be ignored. And the callback will not be notified.

Parameters
callHFP HF call object.
numberNotified phone number.
typeSpecify the format of the phone number.

◆ connected

void(* bt_hfp_hf_cb::connected) (struct bt_conn *conn, struct bt_hfp_hf *hf)

HF connected callback to application.

If this callback is provided it will be called whenever the connection completes.

Parameters
connConnection object.
hfHFP HF object.

◆ dialing

void(* bt_hfp_hf_cb::dialing) (struct bt_hfp_hf *hf, int err)

HF call dialing Callback.

This callback provides call dialing result to the application.

Parameters
hfHFP HF object.
errResult of calling dialing.

◆ disconnected

void(* bt_hfp_hf_cb::disconnected) (struct bt_hfp_hf *hf)

HF disconnected callback to application.

If this callback is provided it will be called whenever the connection gets disconnected, including when a connection gets rejected or cancelled or any error in SLC establishment. And the HFP HF object will be freed after the registered callback disconnected returned.

Parameters
hfHFP HF object.

◆ ecnr_turn_off

void(* bt_hfp_hf_cb::ecnr_turn_off) (struct bt_hfp_hf *hf, int err)

HF ECNR turns off callback.

If this callback is provided it will be called whenever the response of ECNR turning off is received from AG. If CONFIG_BT_HFP_HF_ECNR is not enabled, the callback will not be notified.

Parameters
hfHFP HF object.
errThe result of request.

◆ held

void(* bt_hfp_hf_cb::held) (struct bt_hfp_hf_call *call)

HF call held Callback.

This callback provides call held to the application

Parameters
callHFP HF call object.

◆ inband_ring

void(* bt_hfp_hf_cb::inband_ring) (struct bt_hfp_hf *hf, bool inband)

HF in-band ring tone notification callback to application.

If this callback is provided it will be called whenever there is a unsolicited result code +BSIR issued by the AG to indicate to the HF that the in-band ring tone setting has been locally changed.

Parameters
hfHFP HF object.
inbandIn-band ring tone status from the AG.

◆ incoming

void(* bt_hfp_hf_cb::incoming) (struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call)

HF call incoming Callback.

This callback provides the incoming call status to the application.

Parameters
hfHFP HF object.
callHFP HF call object.

◆ incoming_held

void(* bt_hfp_hf_cb::incoming_held) (struct bt_hfp_hf_call *call)

HF incoming call on hold Callback.

This callback provides the incoming call on hold status to the application.

Parameters
callHFP HF call object.

◆ operator)

void(*)(struct bt_hfp_hf *hf, uint8_t id) bt_hfp_hf_cb::operator)(struct bt_hfp_hf *hf, uint8_t mode, uint8_t format, char *operator); void(*codec_negotiate

HF network operator notification callback to application.

If this callback is provided it will be called whenever there is a response code +COPS issued by the AG to response the AT+COPS? command issued by the HF by calling function bt_hfp_hf_get_operator.

Parameters
hfHFP HF object.
modeCurrent mode.
formatFormat of the operator parameter string. It should be zero.
operatorA string in alphanumeric format representing the name of the network operator.

◆ outgoing

void(* bt_hfp_hf_cb::outgoing) (struct bt_hfp_hf *hf, struct bt_hfp_hf_call *call)

HF call outgoing Callback.

This callback provides the outgoing call status to the application.

Parameters
hfHFP HF object.
callHFP HF call object.

◆ reject

void(* bt_hfp_hf_cb::reject) (struct bt_hfp_hf_call *call)

HF call reject Callback.

This callback provides the incoming/outgoing call reject status to the application.

Parameters
callHFP HF call object.

◆ remote_ringing

void(* bt_hfp_hf_cb::remote_ringing) (struct bt_hfp_hf_call *call)

HF call outgoing call is ringing Callback.

This callback provides the outgoing call is ringing status to the application.

Parameters
callHFP HF call object.

◆ request_phone_number

void(* bt_hfp_hf_cb::request_phone_number) (struct bt_hfp_hf *hf, const char *number)

Request phone number callback.

If this callback is provided it will be called whenever the result code +BINP: <Phone number> is received from AG. If the request is failed, the number will be NULL.

Parameters
hfHFP HF object.
numberValue of <Phone number>.

◆ retrieve

void(* bt_hfp_hf_cb::retrieve) (struct bt_hfp_hf_call *call)

HF call retrieve Callback.

This callback provides call retrieved to the application

Parameters
callHFP HF call object.

◆ ring_indication

void(* bt_hfp_hf_cb::ring_indication) (struct bt_hfp_hf_call *call)

HF incoming call Ring indication callback to application.

If this callback is provided it will be called whenever there is an incoming call.

Parameters
callHFP HF call object.

◆ roam

void(* bt_hfp_hf_cb::roam) (struct bt_hfp_hf *hf, uint32_t value)

HF indicator Callback.

This callback provides roaming indicator value to the application

Parameters
hfHFP HF object.
valueroaming indicator value received from the AG.

◆ sco_connected

void(* bt_hfp_hf_cb::sco_connected) (struct bt_hfp_hf *hf, struct bt_conn *sco_conn)

HF SCO/eSCO connected Callback.

If this callback is provided it will be called whenever the SCO/eSCO connection completes.

Parameters
hfHFP HF object.
sco_connSCO/eSCO Connection object.

◆ sco_disconnected

void(* bt_hfp_hf_cb::sco_disconnected) (struct bt_conn *sco_conn, uint8_t reason)

HF SCO/eSCO disconnected Callback.

If this callback is provided it will be called whenever the SCO/eSCO connection gets disconnected.

Parameters
connSCO/eSCO Connection object.
reasonBT_HCI_ERR_* reason for the disconnection.

◆ service

void(* bt_hfp_hf_cb::service) (struct bt_hfp_hf *hf, uint32_t value)

HF indicator Callback.

This callback provides service indicator value to the application

Parameters
hfHFP HF object.
valueservice indicator value received from the AG.

◆ signal

void(* bt_hfp_hf_cb::signal) (struct bt_hfp_hf *hf, uint32_t value)

HF indicator Callback.

This callback provides signal indicator value to the application

Parameters
hfHFP HF object.
valuesignal indicator value received from the AG.

◆ subscriber_number

void(* bt_hfp_hf_cb::subscriber_number) (struct bt_hfp_hf *hf, const char *number, uint8_t type, uint8_t service)

Query subscriber number callback.

If this callback is provided it will be called whenever the result code +CUNM: [<alpha>],<number>, <type>,[<speed> ,<service>] is received from AG. <alpha>: This optional field is not supported, and shall be left blank. <number>: Quoted string containing the phone number in the format specified by <type>. <type> field specifies the format of the phone number provided, and can be one of the following values:

  • values 128-143: The phone number format may be a national or international format, and may contain prefix and/or escape digits. No changes on the number presentation are required.
  • values 144-159: The phone number format is an international number, including the country code prefix. If the plus sign ("+") is not included as part of the number and shall be added by the AG as needed.
  • values 160-175: National number. No prefix nor escape digits included. <speed>: This optional field is not supported, and shall be left blank. <service>: Indicates which service this phone number relates to. Shall be either 4 (voice) or 5 (fax).
Parameters
hfHFP HF object.
numberValue of <number> without quotes.
typeValue of <type>.
serviceValue of <service>.

◆ terminate

void(* bt_hfp_hf_cb::terminate) (struct bt_hfp_hf_call *call)

HF call terminate Callback.

This callback provides the incoming/outgoing call terminate status to the application.

Parameters
callHFP HF call object.

◆ textual_representation

void(* bt_hfp_hf_cb::textual_representation) (struct bt_hfp_hf *hf, char *id, uint8_t type, uint8_t operation, char *text)

Textual representation callback.

If this callback is provided it will be called whenever the unsolicited result code +BVRA: 1,<vrecstate>, <textualRepresentation> is received from AG. <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_HF_VOICE_RECG_TEXT is not enabled, the unsolicited result code +BVRA will be ignored. And the callback will not be notified.

Parameters
hfHFP HF object.
idValue of <textID>.
typeValue of <textType>.
operationValue of <textOperation>.
textValue of <string>.

◆ vgm

void(* bt_hfp_hf_cb::vgm) (struct bt_hfp_hf *hf, uint8_t gain)

HF microphone gain notification callback to application.

If this callback is provided it will be called whenever there is a unsolicited result code +VGM. If CONFIG_BT_HFP_HF_VOLUME is not enabled, the unsolicited result code +VGM will be ignored. And the callback will not be notified.

Parameters
hfHFP HF object.
gainMicrophone gain.

◆ vgs

void(* bt_hfp_hf_cb::vgs) (struct bt_hfp_hf *hf, uint8_t gain)

HF speaker gain notification callback to application.

If this callback is provided it will be called whenever there is a unsolicited result code +VGS. If CONFIG_BT_HFP_HF_VOLUME is not enabled, the unsolicited result code +VGS will be ignored. And the callback will not be notified.

Parameters
hfHFP HF object.
gainSpeaker gain.

◆ voice_recognition

void(* bt_hfp_hf_cb::voice_recognition) (struct bt_hfp_hf *hf, bool activate)

Voice recognition activation/deactivation callback.

If this callback is provided it will be called whenever the unsolicited result code +BVRA is notified the HF when the voice recognition function in the AG is activated/deactivated autonomously from the AG. If CONFIG_BT_HFP_HF_VOICE_RECG is not enabled, the unsolicited result code +BVRA will be ignored. And the callback will not be notified.

Parameters
hfHFP HF object.
activateVoice recognition activation/deactivation.

◆ vre_state

void(* bt_hfp_hf_cb::vre_state) (struct bt_hfp_hf *hf, uint8_t state)

Voice recognition engine state callback.

If this callback is provided it will be called whenever the unsolicited result code +BVRA: 1,<vrecstate> is received from AG. <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_HF_ENH_VOICE_RECG is not enabled, the unsolicited result code +BVRA will be ignored. And the callback will not be notified.

Parameters
hfHFP HF object.
stateValue of <vrecstate>.

The documentation for this struct was generated from the following file: