Bluetooth ATT Profile

group BT_ATT

Provide BT ATT profile interfaces.

Typedefs

typedef enum t_bt_att_msg_type T_BT_ATT_MSG_TYPE

BT ATT message type.

typedef struct t_bt_att_conn_cmpl T_BT_ATT_CONN_CMPL

BT ATT connection completed.

typedef struct t_bt_att_data_ind T_BT_ATT_DATA_IND

BT ATT data indication.

typedef void (*P_BT_ATT_CBACK)(uint8_t bd_addr[6], T_BT_ATT_MSG_TYPE msg_type, void *msg)

ATT message callback definition.

Added Since 2.11.1.0:

Param bd_addr:

[in] Remote BT address.

Param msg_type:

[in] ATT message type.

Param p_msg:

[in] Message buffer address.

Enums

enum t_bt_att_msg_type

BT ATT message type.

Values:

enumerator BT_ATT_MSG_CONN_CMPL

ATT connect successful

enumerator BT_ATT_MSG_CONN_FAIL

ATT connect fail

enumerator BT_ATT_MSG_DISCONN_CMPL

ATT disconnect successful

enumerator BT_ATT_MSG_DATA_IND

ATT data indicate

Functions

bool bt_att_init(P_BT_ATT_CBACK cback)

Initialize ATT profile.

Added Since 2.11.1.0:

Parameters:

cback[in] Callback function used to handle ATT message.

Return values:
  • true – ATT profile was initialized successfully.

  • false – ATT profile was failed to initialize.

Returns:

The status of initializing ATT profile.

bool bt_att_connect_req(uint8_t bd_addr[6])

Send an ATT connection request.

Added Since 2.11.1.0:

Parameters:

bd_addr[in] Remote BT address.

Return values:
  • true – ATT connection request was sent successfully.

  • false – ATT connection request was failed to send.

Returns:

The status of sending the ATT connection request.

bool bt_att_disconnect_req(uint8_t bd_addr[6])

Send an ATT disconnection request.

Added Since 2.11.1.0:

Parameters:

bd_addr[in] Remote BT address.

Return values:
  • true – ATT disconnection request was sent successfully.

  • false – ATT disconnection request was failed to send.

Returns:

The status of sending the ATT disconnection request.

struct t_bt_att_conn_cmpl

BT ATT connection completed.

Public Members

uint16_t conn_handle
uint16_t cid
uint16_t mtu_size
struct t_bt_att_data_ind

BT ATT data indication.

Public Members

uint8_t *buf
uint16_t len