ble/net/att.h header reference
[Bluetooth Low Energy library module]

The source code of this header can be browsed online.

Description [link] 

This header defines the Network Layer API for Attribute Protocol (ATT).

This layer handles protocol encoding specificities and exposes a request-based asynchronous API.

There may be one layer registered as server, one as client. Unacknowledged ATT operations are forwarded as simple packets with relevant attribute id set in address.

When attribute layer receives a data packet from upper layers, it is converted either to a notification packet (if attribute id is set in source address) or a write without response packet (if attribute id is set in destination address). They are unambiguously forwarded to children layers:

  • an attribute notification / indication packet is forwarded to registered client layer,

  • an attribute write without response packet is forwarded to registered server layer.

  • a packet received from registered client layer is forwarded as write without response,

  • a packet received from registered server layer is forwarded as attribute notification / indication,

Other layers not parented to ATT layer directly may act as client and request any operation to peer's server through this layer. ATT layer will respect sequential aspect of the Attribute protocol.

There is a generic implementation of this layer in the library that can be created through ble_att_create.

Members [link] 

Types [link] 

Function [link] 

Macros [link] 

Members detail [link] 

#define BLE_ATT_CLIENT [link] 

This macro is declared in ble/net/att.h source file, line 80.

Layer type to pass for binding a child layer as client. Client layer explicitly bound to att layer is unique and receives attribute value notifications / indications. Other client layers need not be bound and may only use synchronous requests.

#define BLE_ATT_H_ [link] 

This macro is declared in ble/net/att.h source file, line 21.

#define BLE_ATT_REQUEST [link] 

This macro is declared in ble/net/att.h source file, line 84.

ID for task holding all ATT-based operations, to be used in ble_att_transaction_s::task::query::opcode.

#define BLE_ATT_SERVER [link] 

This macro is declared in ble/net/att.h source file, line 75.

Layer type to pass for binding a child layer as server. Server layer must respond for all queries, and is the only layer able to generate attribute value notifications / indications.

struct ble_att_data_s [link] 

This struct is declared in ble/net/att.h source file, line 106.

struct ble_att_handle_information_s [link] 

This struct is declared in ble/net/att.h source file, line 94.

FieldDescription
uint16_t found;
uint16_t end_group;

struct ble_att_handle_value_s [link] 

This struct is declared in ble/net/att.h source file, line 100.

FieldDescription
uint16_t handle;
uint8_t value[0];

struct ble_att_information_s [link] 

This struct is declared in ble/net/att.h source file, line 88.

FieldDescription
uint16_t handle;
struct ble_uuid_s type;

struct ble_att_transaction_s [link] 

This struct is declared in ble/net/att.h source file, line 116.

this struct inherits struct net_task_s and holds information contained in a request / response transaction at the Attribute Protocol level.

FieldDescription
struct net_task_s task;
enum ble_att_opcode_e command;
uint8_t error;
uint16_t error_handle;
struct buffer_s * packet;Buffer reference associated with this transaction, if any
union <anonymous> {
struct <anonymous> {A Find Information request sequence.
start, end, information and information_max_count need to be set on query.
information_count must be reset before query.
On response, start is updated with next attribute to query from, and information_count is set to count of pairs found.
uint16_t start;
uint16_t end;
struct ble_att_information_s * information;
uint16_t information_max_count;
uint16_t information_count;
} find_information;
struct <anonymous> {A Find By Type Value request sequence.
start, end, type, value, value_size, information and information_max_count need to be set on query.
information_count must be reset before query.
On response, start is updated with next attribute to query from, and information_count is set to count of pairs found.
uint16_t start;
uint16_t end;
struct <anonymous>::<anonymous>::ble_uuid_s type;
uint8_t * value;
uint8_t value_size;
struct ble_att_handle_information_s * information;
uint16_t information_max_count;
uint16_t information_count;
} find_by_type_value;
struct <anonymous> {A Read By Type request sequence.
start, end, type, value_handle, handle_value_size_max need to be set on query.
handle_value_size must be reset before query.
On response, start is updated with next attribute to query from, handle_value_size is set to the total size of the handle_value array, and handle_value_stride is set to offset from an element to the other.
At most handle_value_stride - 2 bytes of read data is filled in each handle_value element.
handle_value_stride is invalid if less than 2, makes no sense if equal to 2.
uint16_t start;
uint16_t end;
struct <anonymous>::<anonymous>::ble_uuid_s type;
struct ble_att_handle_value_s * handle_value;
uint16_t handle_value_size_max;
uint16_t handle_value_size;
uint8_t handle_value_stride;
} read_by_type;
struct <anonymous> {A Read request sequence.
handle, value, value_size and value_size_max need to be set on query.
value_size will be the offset for Read Blob requests. Read data will be written to value + value_size, up to value + value_size_max
On response, value_size is set to actual value size.
On request, responder can replace value, value_size and value_size_max to point to constant data. Actually returned data is data[value_size:value_size_max].
uint16_t handle;
void * value;
uint16_t value_size_max;
uint16_t value_size;
uint16_t offset;
} read;
struct <anonymous> {A Read Multiple request sequence.
handle, handle_count, buffer, buffer_size_max need to be set on query.
buffer_size must be reset before query.
buffer_size gets set in response. It is up to the requester to know how to parse response buffer.
uint16_t * handle;
void * buffer;
uint16_t handle_count;
uint16_t buffer_size_max;
uint16_t buffer_size;
} read_multiple;
struct <anonymous> {A Read By Group Type request sequence.
start, end, type, attribute_data, and attribute_data_size_max need to be set on query.
attribute_data_size must be reset before query.
start, attribute_data_size and attribute_data_stride gets set in response.
uint16_t start;
uint16_t end;
struct <anonymous>::<anonymous>::ble_uuid_s type;
struct ble_att_data_s * attribute_data;
uint16_t attribute_data_size_max;
uint16_t attribute_data_stride;
uint16_t attribute_data_size;
} read_by_group_type;
struct <anonymous> {A Write request.
handle, value, value_size need to be set on query.
Task type may be:
  • BLE_ATT_WRITE_TASK,
  • BLE_ATT_WRITE_PREPARED_TASK,
  • BLE_ATT_INDICATION_TASK.
uint16_t handle;
uint16_t value_size;
void * value;
bool_t authenticated;
bool_t encrypted;
} write;
};

struct ble_att_transaction_s * ble_att_transaction_s_from_task(void *x) [link] 

This function is declared in ble/net/att.h source file, line 303.

Valid XHTML 1.0 StrictGenerated by diaxen on Thu Aug 4 15:44:05 2022 using MkDoc