Hands Free Profile (HFP)

API Reference

group bt_hfp

Hands Free Profile (HFP)

Defines

HFP_HF_CMD_OK
HFP_HF_CMD_ERROR
HFP_HF_CMD_CME_ERROR
HFP_HF_CMD_UNKNOWN_ERROR

Enums

enum bt_hfp_hf_at_cmd

Values:

enumerator BT_HFP_HF_ATA
enumerator BT_HFP_HF_AT_CHUP

Functions

int bt_hfp_hf_register(struct bt_hfp_hf_cb *cb)

Register HFP HF profile.

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

Parameters
  • cb – callback structure.

Returns

0 in case of success or negative value in case of error.

int bt_hfp_hf_send_cmd(struct bt_conn *conn, enum bt_hfp_hf_at_cmd cmd)

Handsfree client Send AT.

Send specific AT commands to handsfree client profile.

Parameters
  • conn – Connection object.

  • cmd – AT command to be sent.

Returns

0 in case of success or negative value in case of error.

struct bt_hfp_hf_cmd_complete
#include <hfp_hf.h>

HFP HF Command completion field.

struct bt_hfp_hf_cb
#include <hfp_hf.h>

HFP profile application callback.

Public Members

void (*connected)(struct bt_conn *conn)

HF connected callback to application

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

Parameters
  • conn – Connection object.

void (*disconnected)(struct bt_conn *conn)

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 establisment.

Parameters
  • conn – Connection object.

void (*service)(struct bt_conn *conn, uint32_t value)

HF indicator Callback

This callback provides service indicator value to the application

Parameters
  • conn – Connection object.

  • value – service indicator value received from the AG.

void (*call)(struct bt_conn *conn, uint32_t value)

HF indicator Callback

This callback provides call indicator value to the application

Parameters
  • conn – Connection object.

  • value – call indicator value received from the AG.

void (*call_setup)(struct bt_conn *conn, uint32_t value)

HF indicator Callback

This callback provides call setup indicator value to the application

Parameters
  • conn – Connection object.

  • value – call setup indicator value received from the AG.

void (*call_held)(struct bt_conn *conn, uint32_t value)

HF indicator Callback

This callback provides call held indicator value to the application

Parameters
  • conn – Connection object.

  • value – call held indicator value received from the AG.

void (*signal)(struct bt_conn *conn, uint32_t value)

HF indicator Callback

This callback provides signal indicator value to the application

Parameters
  • conn – Connection object.

  • value – signal indicator value received from the AG.

void (*roam)(struct bt_conn *conn, uint32_t value)

HF indicator Callback

This callback provides roaming indicator value to the application

Parameters
  • conn – Connection object.

  • value – roaming indicator value received from the AG.

void (*battery)(struct bt_conn *conn, uint32_t value)

HF indicator Callback

This callback battery service indicator value to the application

Parameters
  • conn – Connection object.

  • value – battery indicator value received from the AG.

void (*ring_indication)(struct bt_conn *conn)

HF incoming call Ring indication callback to application

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

Parameters
  • conn – Connection object.

void (*cmd_complete_cb)(struct bt_conn *conn, struct bt_hfp_hf_cmd_complete *cmd)

HF notify command completed callback to application

The command sent from the application is notified about its status

Parameters
  • conn – Connection object.

  • cmd – structure contains status of the command including cme.