Attribute Protocol (ATT)

API Reference

group bt_att

Attribute Protocol (ATT)

Defines

BT_ATT_ERR_SUCCESS
BT_ATT_ERR_INVALID_HANDLE
BT_ATT_ERR_READ_NOT_PERMITTED
BT_ATT_ERR_WRITE_NOT_PERMITTED
BT_ATT_ERR_INVALID_PDU
BT_ATT_ERR_AUTHENTICATION
BT_ATT_ERR_NOT_SUPPORTED
BT_ATT_ERR_INVALID_OFFSET
BT_ATT_ERR_AUTHORIZATION
BT_ATT_ERR_PREPARE_QUEUE_FULL
BT_ATT_ERR_ATTRIBUTE_NOT_FOUND
BT_ATT_ERR_ATTRIBUTE_NOT_LONG
BT_ATT_ERR_ENCRYPTION_KEY_SIZE
BT_ATT_ERR_INVALID_ATTRIBUTE_LEN
BT_ATT_ERR_UNLIKELY
BT_ATT_ERR_INSUFFICIENT_ENCRYPTION
BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE
BT_ATT_ERR_INSUFFICIENT_RESOURCES
BT_ATT_ERR_DB_OUT_OF_SYNC
BT_ATT_ERR_VALUE_NOT_ALLOWED
BT_ATT_ERR_WRITE_REQ_REJECTED
BT_ATT_ERR_CCC_IMPROPER_CONF
BT_ATT_ERR_PROCEDURE_IN_PROGRESS
BT_ATT_ERR_OUT_OF_RANGE
BT_ATT_MAX_ATTRIBUTE_LEN
BT_ATT_FIRST_ATTRIBUTE_HANDLE
BT_ATT_FIRST_ATTTRIBUTE_HANDLE
BT_ATT_LAST_ATTRIBUTE_HANDLE
BT_ATT_LAST_ATTTRIBUTE_HANDLE

Enums

enum bt_att_chan_opt

ATT channel option bit field values.

Note

BT_ATT_CHAN_OPT_UNENHANCED_ONLY and BT_ATT_CHAN_OPT_ENHANCED_ONLY are mutually exclusive and both bits may not be set.

Values:

enumerator BT_ATT_CHAN_OPT_NONE = 0x0

Both Enhanced and Unenhanced channels can be used

enumerator BT_ATT_CHAN_OPT_UNENHANCED_ONLY = BIT(0)

Only Unenhanced channels will be used

enumerator BT_ATT_CHAN_OPT_ENHANCED_ONLY = BIT(1)

Only Enhanced channels will be used

Functions

int bt_eatt_connect(struct bt_conn *conn, size_t num_channels)

Connect Enhanced ATT channels.

Sends a series of Credit Based Connection Requests to connect num_channels Enhanced ATT channels. The peer may have limited resources and fewer channels may be created.

Parameters
  • conn – The connection to send the request on

  • num_channels – The number of Enhanced ATT beares to request. Must be in the range 1 - CONFIG_BT_EATT_MAX , inclusive.

Return values
  • -EINVAL – if num_channels is not in the allowed range or conn is NULL.

  • -ENOMEM – if less than num_channels are allocated.

  • 0 – in case of success

Returns

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

size_t bt_eatt_count(struct bt_conn *conn)

Get number of EATT channels connected.

Parameters
  • conn – The connection to get the number of EATT channels for.

Returns

The number of EATT channels connected. Returns 0 if conn is NULL or not connected.