|
openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
|
— big-endian TLV message builder. More...
#include "aliro_uwb_msg_spec.h"#include <aliro_uwb_adapter/aliro_uwb_session.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | aliro_uwb_msg_builder |
| Accumulates bytes into a heap-allocated Aliro UWB message. More... | |
Functions | |
| bool | aliro_uwb_msg_builder_init (struct aliro_uwb_msg_builder *builder, uint16_t payload_len) |
Allocate a message with room for payload_len payload bytes plus header. | |
| void | aliro_uwb_msg_builder_header (struct aliro_uwb_msg_builder *builder, uint8_t protocol, uint8_t id, uint16_t payload_length) |
| Append the 4-byte header (protocol, id, big-endian payload length). | |
| bool | aliro_uwb_msg_builder_add_u8 (struct aliro_uwb_msg_builder *builder, uint8_t id, uint8_t value) |
| Append a 1-byte-value attribute. | |
| bool | aliro_uwb_msg_builder_add_u16 (struct aliro_uwb_msg_builder *builder, uint8_t id, uint16_t value) |
| Append a 2-byte big-endian attribute. | |
| bool | aliro_uwb_msg_builder_add_u32 (struct aliro_uwb_msg_builder *builder, uint8_t id, uint32_t value) |
| Append a 4-byte big-endian attribute. | |
| bool | aliro_uwb_msg_builder_add_u64 (struct aliro_uwb_msg_builder *builder, uint8_t id, uint64_t value) |
| Append a 8-byte big-endian attribute. | |
| bool | aliro_uwb_msg_builder_add_u16_array (struct aliro_uwb_msg_builder *builder, uint8_t id, size_t count, const uint16_t *values) |
Append an attribute whose value is count big-endian 16-bit words. | |
| bool | aliro_uwb_msg_builder_add_bytes (struct aliro_uwb_msg_builder *builder, uint8_t id, size_t count, const uint8_t *values) |
Append an attribute whose value is count raw bytes. | |
— big-endian TLV message builder.
| bool aliro_uwb_msg_builder_add_bytes | ( | struct aliro_uwb_msg_builder * | builder, |
| uint8_t | id, | ||
| size_t | count, | ||
| const uint8_t * | values | ||
| ) |
Append an attribute whose value is count raw bytes.
Append an attribute whose value is count raw bytes.
| bool aliro_uwb_msg_builder_add_u16 | ( | struct aliro_uwb_msg_builder * | builder, |
| uint8_t | id, | ||
| uint16_t | value | ||
| ) |
Append a 2-byte big-endian attribute.
| builder | Message builder to append the attribute to. |
| id | Attribute identifier byte. |
| value | 16-bit value to append, encoded big-endian. |
| bool aliro_uwb_msg_builder_add_u16_array | ( | struct aliro_uwb_msg_builder * | builder, |
| uint8_t | id, | ||
| size_t | count, | ||
| const uint16_t * | values | ||
| ) |
Append an attribute whose value is count big-endian 16-bit words.
Append an attribute whose value is count big-endian 16-bit words.
| builder | Message builder to append the attribute to. |
| id | Attribute identifier byte. |
| count | Number of 16-bit words in the values array. |
| values | Pointer to the array of 16-bit values to append. |
| bool aliro_uwb_msg_builder_add_u32 | ( | struct aliro_uwb_msg_builder * | builder, |
| uint8_t | id, | ||
| uint32_t | value | ||
| ) |
Append a 4-byte big-endian attribute.
| builder | Message builder to append the attribute to. |
| id | Attribute identifier byte. |
| value | 32-bit value to append, encoded big-endian. |
| bool aliro_uwb_msg_builder_add_u64 | ( | struct aliro_uwb_msg_builder * | builder, |
| uint8_t | id, | ||
| uint64_t | value | ||
| ) |
Append a 8-byte big-endian attribute.
| builder | Message builder to append the attribute to. |
| id | Attribute identifier byte. |
| value | 64-bit value to append, encoded big-endian. |
| bool aliro_uwb_msg_builder_add_u8 | ( | struct aliro_uwb_msg_builder * | builder, |
| uint8_t | id, | ||
| uint8_t | value | ||
| ) |
Append a 1-byte-value attribute.
| builder | Message builder to append the attribute to. |
| id | Attribute identifier byte. |
| value | 1-byte value to append. |
| void aliro_uwb_msg_builder_header | ( | struct aliro_uwb_msg_builder * | builder, |
| uint8_t | protocol, | ||
| uint8_t | id, | ||
| uint16_t | payload_length | ||
| ) |
Append the 4-byte header (protocol, id, big-endian payload length).
| builder | Message builder to append the header to. |
| protocol | Protocol identifier byte. |
| id | Message identifier byte. |
| payload_length | Payload length, written big-endian. |
| bool aliro_uwb_msg_builder_init | ( | struct aliro_uwb_msg_builder * | builder, |
| uint16_t | payload_len | ||
| ) |
Allocate a message with room for payload_len payload bytes plus header.
Allocate a message with room for payload_len payload bytes plus header.
| builder | Message builder to initialize. |
| payload_len | Number of payload bytes to reserve, in addition to the header. |