Zephyr Project API 3.7.0-rc1
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Attribute Protocol (ATT)

Attribute Protocol (ATT) More...

Macros

#define BT_ATT_ERR_SUCCESS   0x00
 The ATT operation was successful.
 
#define BT_ATT_ERR_INVALID_HANDLE   0x01
 The attribute handle given was not valid on the server.
 
#define BT_ATT_ERR_READ_NOT_PERMITTED   0x02
 The attribute cannot be read.
 
#define BT_ATT_ERR_WRITE_NOT_PERMITTED   0x03
 The attribute cannot be written.
 
#define BT_ATT_ERR_INVALID_PDU   0x04
 The attribute PDU was invalid.
 
#define BT_ATT_ERR_AUTHENTICATION   0x05
 The attribute requires authentication before it can be read or written.
 
#define BT_ATT_ERR_NOT_SUPPORTED   0x06
 The ATT Server does not support the request received from the client.
 
#define BT_ATT_ERR_INVALID_OFFSET   0x07
 Offset specified was past the end of the attribute.
 
#define BT_ATT_ERR_AUTHORIZATION   0x08
 The attribute requires authorization before it can be read or written.
 
#define BT_ATT_ERR_PREPARE_QUEUE_FULL   0x09
 Too many prepare writes have been queued.
 
#define BT_ATT_ERR_ATTRIBUTE_NOT_FOUND   0x0a
 No attribute found within the given attribute handle range.
 
#define BT_ATT_ERR_ATTRIBUTE_NOT_LONG   0x0b
 The attribute cannot be read using the ATT_READ_BLOB_REQ PDU.
 
#define BT_ATT_ERR_ENCRYPTION_KEY_SIZE   0x0c
 The Encryption Key Size used for encrypting this link is too short.
 
#define BT_ATT_ERR_INVALID_ATTRIBUTE_LEN   0x0d
 The attribute value length is invalid for the operation.
 
#define BT_ATT_ERR_UNLIKELY   0x0e
 The attribute request that was requested has encountered an error that was unlikely.
 
#define BT_ATT_ERR_INSUFFICIENT_ENCRYPTION   0x0f
 The attribute requires encryption before it can be read or written.
 
#define BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE   0x10
 The attribute type is not a supported grouping attribute.
 
#define BT_ATT_ERR_INSUFFICIENT_RESOURCES   0x11
 Insufficient Resources to complete the request.
 
#define BT_ATT_ERR_DB_OUT_OF_SYNC   0x12
 The server requests the client to rediscover the database.
 
#define BT_ATT_ERR_VALUE_NOT_ALLOWED   0x13
 The attribute parameter value was not allowed.
 
#define BT_ATT_ERR_WRITE_REQ_REJECTED   0xfc
 Write Request Rejected.
 
#define BT_ATT_ERR_CCC_IMPROPER_CONF   0xfd
 Client Characteristic Configuration Descriptor Improperly Configured.
 
#define BT_ATT_ERR_PROCEDURE_IN_PROGRESS   0xfe
 Procedure Already in Progress.
 
#define BT_ATT_ERR_OUT_OF_RANGE   0xff
 Out of Range.
 
#define BT_ATT_MAX_ATTRIBUTE_LEN   512
 
#define BT_ATT_FIRST_ATTRIBUTE_HANDLE   0x0001
 
#define BT_ATT_FIRST_ATTTRIBUTE_HANDLE   __DEPRECATED_MACRO BT_ATT_FIRST_ATTRIBUTE_HANDLE
 
#define BT_ATT_LAST_ATTRIBUTE_HANDLE   0xffff
 
#define BT_ATT_LAST_ATTTRIBUTE_HANDLE   __DEPRECATED_MACRO BT_ATT_LAST_ATTRIBUTE_HANDLE
 

Enumerations

enum  bt_att_chan_opt { BT_ATT_CHAN_OPT_NONE = 0x0 , BT_ATT_CHAN_OPT_UNENHANCED_ONLY = BIT(0) , BT_ATT_CHAN_OPT_ENHANCED_ONLY = BIT(1) }
 ATT channel option bit field values. More...
 

Functions

const char * bt_att_err_to_str (uint8_t att_err)
 Converts a ATT error to string.
 
int bt_eatt_connect (struct bt_conn *conn, size_t num_channels)
 Connect Enhanced ATT channels.
 
size_t bt_eatt_count (struct bt_conn *conn)
 Get number of EATT channels connected.
 

Detailed Description

Attribute Protocol (ATT)

Macro Definition Documentation

◆ BT_ATT_ERR_ATTRIBUTE_NOT_FOUND

#define BT_ATT_ERR_ATTRIBUTE_NOT_FOUND   0x0a

#include <include/zephyr/bluetooth/att.h>

No attribute found within the given attribute handle range.

◆ BT_ATT_ERR_ATTRIBUTE_NOT_LONG

#define BT_ATT_ERR_ATTRIBUTE_NOT_LONG   0x0b

#include <include/zephyr/bluetooth/att.h>

The attribute cannot be read using the ATT_READ_BLOB_REQ PDU.

◆ BT_ATT_ERR_AUTHENTICATION

#define BT_ATT_ERR_AUTHENTICATION   0x05

#include <include/zephyr/bluetooth/att.h>

The attribute requires authentication before it can be read or written.

◆ BT_ATT_ERR_AUTHORIZATION

#define BT_ATT_ERR_AUTHORIZATION   0x08

#include <include/zephyr/bluetooth/att.h>

The attribute requires authorization before it can be read or written.

◆ BT_ATT_ERR_CCC_IMPROPER_CONF

#define BT_ATT_ERR_CCC_IMPROPER_CONF   0xfd

#include <include/zephyr/bluetooth/att.h>

Client Characteristic Configuration Descriptor Improperly Configured.

◆ BT_ATT_ERR_DB_OUT_OF_SYNC

#define BT_ATT_ERR_DB_OUT_OF_SYNC   0x12

#include <include/zephyr/bluetooth/att.h>

The server requests the client to rediscover the database.

◆ BT_ATT_ERR_ENCRYPTION_KEY_SIZE

#define BT_ATT_ERR_ENCRYPTION_KEY_SIZE   0x0c

#include <include/zephyr/bluetooth/att.h>

The Encryption Key Size used for encrypting this link is too short.

◆ BT_ATT_ERR_INSUFFICIENT_ENCRYPTION

#define BT_ATT_ERR_INSUFFICIENT_ENCRYPTION   0x0f

#include <include/zephyr/bluetooth/att.h>

The attribute requires encryption before it can be read or written.

◆ BT_ATT_ERR_INSUFFICIENT_RESOURCES

#define BT_ATT_ERR_INSUFFICIENT_RESOURCES   0x11

#include <include/zephyr/bluetooth/att.h>

Insufficient Resources to complete the request.

◆ BT_ATT_ERR_INVALID_ATTRIBUTE_LEN

#define BT_ATT_ERR_INVALID_ATTRIBUTE_LEN   0x0d

#include <include/zephyr/bluetooth/att.h>

The attribute value length is invalid for the operation.

◆ BT_ATT_ERR_INVALID_HANDLE

#define BT_ATT_ERR_INVALID_HANDLE   0x01

#include <include/zephyr/bluetooth/att.h>

The attribute handle given was not valid on the server.

◆ BT_ATT_ERR_INVALID_OFFSET

#define BT_ATT_ERR_INVALID_OFFSET   0x07

#include <include/zephyr/bluetooth/att.h>

Offset specified was past the end of the attribute.

◆ BT_ATT_ERR_INVALID_PDU

#define BT_ATT_ERR_INVALID_PDU   0x04

#include <include/zephyr/bluetooth/att.h>

The attribute PDU was invalid.

◆ BT_ATT_ERR_NOT_SUPPORTED

#define BT_ATT_ERR_NOT_SUPPORTED   0x06

#include <include/zephyr/bluetooth/att.h>

The ATT Server does not support the request received from the client.

◆ BT_ATT_ERR_OUT_OF_RANGE

#define BT_ATT_ERR_OUT_OF_RANGE   0xff

#include <include/zephyr/bluetooth/att.h>

Out of Range.

◆ BT_ATT_ERR_PREPARE_QUEUE_FULL

#define BT_ATT_ERR_PREPARE_QUEUE_FULL   0x09

#include <include/zephyr/bluetooth/att.h>

Too many prepare writes have been queued.

◆ BT_ATT_ERR_PROCEDURE_IN_PROGRESS

#define BT_ATT_ERR_PROCEDURE_IN_PROGRESS   0xfe

#include <include/zephyr/bluetooth/att.h>

Procedure Already in Progress.

◆ BT_ATT_ERR_READ_NOT_PERMITTED

#define BT_ATT_ERR_READ_NOT_PERMITTED   0x02

#include <include/zephyr/bluetooth/att.h>

The attribute cannot be read.

◆ BT_ATT_ERR_SUCCESS

#define BT_ATT_ERR_SUCCESS   0x00

#include <include/zephyr/bluetooth/att.h>

The ATT operation was successful.

◆ BT_ATT_ERR_UNLIKELY

#define BT_ATT_ERR_UNLIKELY   0x0e

#include <include/zephyr/bluetooth/att.h>

The attribute request that was requested has encountered an error that was unlikely.

The attribute request could therefore not be completed as requested

◆ BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE

#define BT_ATT_ERR_UNSUPPORTED_GROUP_TYPE   0x10

#include <include/zephyr/bluetooth/att.h>

The attribute type is not a supported grouping attribute.

The attribute type is not a supported grouping attribute as defined by a higher layer specification.

◆ BT_ATT_ERR_VALUE_NOT_ALLOWED

#define BT_ATT_ERR_VALUE_NOT_ALLOWED   0x13

#include <include/zephyr/bluetooth/att.h>

The attribute parameter value was not allowed.

◆ BT_ATT_ERR_WRITE_NOT_PERMITTED

#define BT_ATT_ERR_WRITE_NOT_PERMITTED   0x03

#include <include/zephyr/bluetooth/att.h>

The attribute cannot be written.

◆ BT_ATT_ERR_WRITE_REQ_REJECTED

#define BT_ATT_ERR_WRITE_REQ_REJECTED   0xfc

#include <include/zephyr/bluetooth/att.h>

Write Request Rejected.

◆ BT_ATT_FIRST_ATTRIBUTE_HANDLE

#define BT_ATT_FIRST_ATTRIBUTE_HANDLE   0x0001

◆ BT_ATT_FIRST_ATTTRIBUTE_HANDLE

#define BT_ATT_FIRST_ATTTRIBUTE_HANDLE   __DEPRECATED_MACRO BT_ATT_FIRST_ATTRIBUTE_HANDLE

◆ BT_ATT_LAST_ATTRIBUTE_HANDLE

#define BT_ATT_LAST_ATTRIBUTE_HANDLE   0xffff

◆ BT_ATT_LAST_ATTTRIBUTE_HANDLE

#define BT_ATT_LAST_ATTTRIBUTE_HANDLE   __DEPRECATED_MACRO BT_ATT_LAST_ATTRIBUTE_HANDLE

◆ BT_ATT_MAX_ATTRIBUTE_LEN

#define BT_ATT_MAX_ATTRIBUTE_LEN   512

Enumeration Type Documentation

◆ bt_att_chan_opt

#include <include/zephyr/bluetooth/att.h>

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.
Enumerator
BT_ATT_CHAN_OPT_NONE 

Both Enhanced and Unenhanced channels can be used

BT_ATT_CHAN_OPT_UNENHANCED_ONLY 

Only Unenhanced channels will be used

BT_ATT_CHAN_OPT_ENHANCED_ONLY 

Only Enhanced channels will be used

Function Documentation

◆ bt_att_err_to_str()

const char * bt_att_err_to_str ( uint8_t  att_err)

#include <include/zephyr/bluetooth/att.h>

Converts a ATT error to string.

The error codes are described in the Bluetooth Core specification, Vol 3, Part F, Section 3.4.1.1 and in The Supplement to the Bluetooth Core Specification (CSS), v11, Part B, Section 1.2.

The ATT and GATT documentation found in Vol 4, Part F and Part G describe when the different error codes are used.

See also the defined BT_ATT_ERR_* macros.

Returns
The string representation of the ATT error code.

◆ bt_eatt_connect()

int bt_eatt_connect ( struct bt_conn *  conn,
size_t  num_channels 
)

#include <include/zephyr/bluetooth/att.h>

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
connThe connection to send the request on
num_channelsThe number of Enhanced ATT beares to request. Must be in the range 1 - CONFIG_BT_EATT_MAX , inclusive.
Returns
0 in case of success or negative value in case of error.
Return values
-EINVALif num_channels is not in the allowed range or conn is NULL.
-ENOMEMif less than num_channels are allocated.
0in case of success

◆ bt_eatt_count()

size_t bt_eatt_count ( struct bt_conn *  conn)

#include <include/zephyr/bluetooth/att.h>

Get number of EATT channels connected.

Parameters
connThe 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.