|
openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
|
— TLV attribute iteration and big-endian reads. 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_attribute |
| A single type/length/value attribute overlaid on message bytes. More... | |
| struct | aliro_uwb_msg_parser |
| Cursor walking the attributes of one message payload. More... | |
Macros | |
| #define | ALIRO_UWB_MSG_PARSER_INIT(msg_) |
| Initialize a parser positioned just past the 4-byte header. | |
Functions | |
| struct aliro_uwb_msg_attribute * | aliro_uwb_msg_next_attribute (struct aliro_uwb_msg_parser *parser) |
| Advance to the next attribute; NULL at end-of-payload or on overrun. | |
| bool | aliro_uwb_msg_read_u8 (const struct aliro_uwb_msg_attribute *attr, const char *name, uint8_t *out) |
| Decodes an 8-bit big-endian integer from an attribute; returns false on width mismatch or parse error. | |
| bool | aliro_uwb_msg_read_u16 (const struct aliro_uwb_msg_attribute *attr, const char *name, uint16_t *out) |
| Decodes a 16-bit big-endian integer from an attribute; returns false on width mismatch or parse error. | |
| bool | aliro_uwb_msg_read_u32 (const struct aliro_uwb_msg_attribute *attr, const char *name, uint32_t *out) |
| Decodes a 32-bit big-endian integer from an attribute; returns false on width mismatch or parse error. | |
| bool | aliro_uwb_msg_read_u64 (const struct aliro_uwb_msg_attribute *attr, const char *name, uint64_t *out) |
| Decodes a 64-bit big-endian integer from an attribute. | |
— TLV attribute iteration and big-endian reads.
| struct aliro_uwb_msg_attribute * aliro_uwb_msg_next_attribute | ( | struct aliro_uwb_msg_parser * | parser | ) |
Advance to the next attribute; NULL at end-of-payload or on overrun.
Advance to the next attribute; NULL at end-of-payload or on overrun.
| parser | Parser cursor to advance. |
| bool aliro_uwb_msg_read_u16 | ( | const struct aliro_uwb_msg_attribute * | attr, |
| const char * | name, | ||
| uint16_t * | out | ||
| ) |
Decodes a 16-bit big-endian integer from an attribute; returns false on width mismatch or parse error.
| attr | Attribute whose value bytes are decoded. |
| name | Attribute name, used for error logging. |
| out | Destination for the decoded value. |
| bool aliro_uwb_msg_read_u32 | ( | const struct aliro_uwb_msg_attribute * | attr, |
| const char * | name, | ||
| uint32_t * | out | ||
| ) |
Decodes a 32-bit big-endian integer from an attribute; returns false on width mismatch or parse error.
| attr | Attribute whose value bytes are decoded. |
| name | Attribute name, used for error logging. |
| out | Destination for the decoded value. |
| bool aliro_uwb_msg_read_u64 | ( | const struct aliro_uwb_msg_attribute * | attr, |
| const char * | name, | ||
| uint64_t * | out | ||
| ) |
Decodes a 64-bit big-endian integer from an attribute.
| attr | Attribute holding the encoded value. |
| name | Attribute name, used only in the mismatch log line. |
| out | Receives the decoded value on success. |
| bool aliro_uwb_msg_read_u8 | ( | const struct aliro_uwb_msg_attribute * | attr, |
| const char * | name, | ||
| uint8_t * | out | ||
| ) |
Decodes an 8-bit big-endian integer from an attribute; returns false on width mismatch or parse error.
| attr | Attribute whose value bytes are decoded. |
| name | Attribute name, used for error logging. |
| out | Destination for the decoded value. |