|
Zephyr API Documentation 4.4.99
A Scalable Open Source RTOS
|
Bluetooth data types and helpers. More...
Go to the source code of this file.
Data Structures | |
| struct | bt_data |
| Bluetooth data. More... | |
Macros | |
| #define | BT_DATA_SERIALIZED_SIZE(data_len) |
| Get the size of a serialized bt_data given its data length. | |
| #define | BT_DATA(_type, _data, _data_len) |
| Helper to declare elements of bt_data arrays. | |
| #define | BT_DATA_BYTES(_type, _bytes...) |
| Helper to declare elements of bt_data arrays. | |
Functions | |
| size_t | bt_data_get_len (const struct bt_data data[], size_t data_count) |
| Get the total size (in octets) of a given set of bt_data structures. | |
| size_t | bt_data_serialize (const struct bt_data *input, uint8_t *output) |
| Serialize a bt_data struct into an advertising structure (a flat array). | |
Bluetooth data types and helpers.
| #define BT_DATA | ( | _type, | |
| _data, | |||
| _data_len ) |
Helper to declare elements of bt_data arrays.
This macro is mainly for creating an array of struct bt_data elements which is then passed to e.g. bt_le_adv_start function.
| _type | Type of advertising data field |
| _data | Pointer to the data field payload |
| _data_len | Number of octets behind the _data pointer |
| #define BT_DATA_BYTES | ( | _type, | |
| _bytes... ) |
Helper to declare elements of bt_data arrays.
This macro is mainly for creating an array of struct bt_data elements which is then passed to e.g. bt_le_adv_start function.
| _type | Type of advertising data field |
| _bytes | Variable number of single-byte parameters |
| #define BT_DATA_SERIALIZED_SIZE | ( | data_len | ) |
Get the size of a serialized bt_data given its data length.
Size of 'AD Structure'->'Length' field, equal to 1. Size of 'AD Structure'->'Data'->'AD Type' field, equal to 1. Size of 'AD Structure'->'Data'->'AD Data' field, equal to data_len.
See Core Specification Version 5.4 Vol. 3 Part C, 11, Figure 11.1.
Serialize a bt_data struct into an advertising structure (a flat array).
The data are formatted according to the Bluetooth Core Specification v. 5.4, vol. 3, part C, 11.
| [in] | input | Single bt_data structure to read from. |
| [out] | output | Buffer large enough to store the advertising structure in input. The size of it must be at least the size of the input->data_len + 2 (for the type and the length). |
output.