|
openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
|
— message framing accessors, dispatch and builders. More...
#include "aliro_uwb_internal.h"#include <aliro_uwb_adapter/aliro_uwb_session.h>#include <stdint.h>Go to the source code of this file.
Functions | |
| uint8_t | aliro_uwb_msg_protocol_header (const uint8_t *bytes) |
| Extracts the protocol type from byte 0 of an Aliro message header. | |
| uint8_t | aliro_uwb_msg_message_id (const uint8_t *bytes) |
| Extracts the message type ID from byte 1 of an Aliro message header, used to dispatch M1-M4 setup and ranging messages during parsing. | |
| uint16_t | aliro_uwb_msg_payload_length (const uint8_t *bytes) |
| Extracts the payload length from bytes 2-3 of an Aliro message header as a 16-bit big-endian integer. | |
| enum aliro_uwb_err | aliro_uwb_msg_process_ranging (struct aliro_uwb_session *session, struct aliro_uwb_message *message) |
| Dispatch an inbound ranging-phase message to its handler based on message type. | |
| enum aliro_uwb_err | aliro_uwb_msg_process_notification (struct aliro_uwb_session *session, struct aliro_uwb_message *message) |
| Dispatch a received notification message to its parser by message ID. | |
| enum aliro_uwb_err | aliro_uwb_msg_process_supplementary (struct aliro_uwb_session *session, struct aliro_uwb_message *message) |
| Log every attribute of a Supplementary Service message (protocol 0x03). | |
| struct aliro_uwb_message * | aliro_uwb_msg_build_m1 (struct aliro_uwb_session *session) |
| Builds the M1 ranging-session-setup message advertising configuration IDs, pulse-shape combos, channel bitmask, and session ID. | |
| struct aliro_uwb_message * | aliro_uwb_msg_build_suspend_resume_request (struct aliro_uwb_session *session, bool suspend) |
| Builds a suspend or resume request message carrying the session identifier. | |
| struct aliro_uwb_message * | aliro_uwb_msg_build_general_error (struct aliro_uwb_session *session, uint8_t error_code) |
| Build a general-error message for the given session. | |
| void | aliro_uwb_msg_free (struct aliro_uwb_message *message) |
| Release a message built by this layer. | |
— message framing accessors, dispatch and builders.
| struct aliro_uwb_message * aliro_uwb_msg_build_general_error | ( | struct aliro_uwb_session * | session, |
| uint8_t | error_code | ||
| ) |
Build a general-error message for the given session.
Build a general-error message for the given session.
| session | Unused; reserved for a consistent builder signature. |
| error_code | Error code to encode in the general-error notification attribute. |
| struct aliro_uwb_message * aliro_uwb_msg_build_m1 | ( | struct aliro_uwb_session * | session | ) |
Builds the M1 ranging-session-setup message advertising configuration IDs, pulse-shape combos, channel bitmask, and session ID.
| session | Session whose Aliro capabilities and session ID populate the message. |
| struct aliro_uwb_message * aliro_uwb_msg_build_suspend_resume_request | ( | struct aliro_uwb_session * | session, |
| bool | suspend | ||
| ) |
Builds a suspend or resume request message carrying the session identifier.
| session | Session whose session ID is encoded into the message. |
| suspend | True to build a suspend request, false to build a resume request. |
| void aliro_uwb_msg_free | ( | struct aliro_uwb_message * | message | ) |
Release a message built by this layer.
| message | Message to free. |
Release a message built by this layer.
| uint8_t aliro_uwb_msg_message_id | ( | const uint8_t * | bytes | ) |
Extracts the message type ID from byte 1 of an Aliro message header, used to dispatch M1-M4 setup and ranging messages during parsing.
| bytes | Pointer to the start of the raw message bytes. |
| uint16_t aliro_uwb_msg_payload_length | ( | const uint8_t * | bytes | ) |
Extracts the payload length from bytes 2-3 of an Aliro message header as a 16-bit big-endian integer.
| bytes | Pointer to the start of the raw message bytes. |
| enum aliro_uwb_err aliro_uwb_msg_process_notification | ( | struct aliro_uwb_session * | session, |
| struct aliro_uwb_message * | message | ||
| ) |
Dispatch a received notification message to its parser by message ID.
Reader-status notifications are informational and ignored; unknown IDs are logged and ignored.
| session | Aliro UWB session to update with the parsed notification's effects. |
| message | Received notification message to dispatch. |
| enum aliro_uwb_err aliro_uwb_msg_process_ranging | ( | struct aliro_uwb_session * | session, |
| struct aliro_uwb_message * | message | ||
| ) |
Dispatch an inbound ranging-phase message to its handler based on message type.
| session | Aliro UWB session to update. |
| message | Received ranging message to dispatch. |
| enum aliro_uwb_err aliro_uwb_msg_process_supplementary | ( | struct aliro_uwb_session * | session, |
| struct aliro_uwb_message * | message | ||
| ) |
Log every attribute of a Supplementary Service message (protocol 0x03).
The phone sends one of these at session establishment. Nothing is modelled yet and no response is emitted, so this only surfaces the payload: the semantics are unknown and are being characterised by diffing the attributes across conditions.
| session | Aliro UWB session (unused; no state is driven from here yet). |
| message | Received supplementary-service message to log. |
| uint8_t aliro_uwb_msg_protocol_header | ( | const uint8_t * | bytes | ) |
Extracts the protocol type from byte 0 of an Aliro message header.
| bytes | Pointer to the start of the raw message bytes. |