|
openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
|
— CCC/Aliro-session interface (seam the adapter drives). More...
#include <cherry/cherry.h>#include <cherry/cherry_common.h>#include <cherry/cherry_session.h>#include <stdbool.h>#include <stddef.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | cherry_ccc_capabilities |
| Device CCC/Aliro capability set advertised to the peer. More... | |
| struct | cherry_ccc_session_event_session_status |
| Payload of a SESSION_STATUS event, giving the new session state and the reason for the change. More... | |
| struct | cherry_ccc_session_event_error |
| Payload of a SESSION_ERROR event, giving the error status that triggered it. More... | |
| struct | cherry_ccc_event |
| CCC notification delivered to the adapter. More... | |
| struct | cherry_ccc_aliro_session_config |
| Negotiated Aliro ranging params (filled in-place across M1-M4). More... | |
Macros | |
| #define | CHERRY_CCC_HOP_MODE_KEY_SIZE 4 |
| Length in bytes of the hopping-sequence key carried in M4. | |
Typedefs | |
| typedef void(* | cherry_ccc_cb_t) (struct cherry_ccc_event *event, void *user_data) |
| CCC notification callback type. | |
Enumerations | |
| enum | cherry_ccc_event_type |
| CCC session event kinds. | |
| enum | cherry_ccc_session_state |
| Lifecycle state of a CCC session. | |
| enum | cherry_ccc_state_change_reason |
| Why a session changed state. | |
| enum | cherry_ccc_hopping_mode |
| Selected hopping mode. | |
Functions | |
| struct cherry_ccc_session * | cherry_ccc_session_create_aliro_responder (struct cherry *ctx, cherry_ccc_cb_t callback, void *user_data, struct cherry_ccc_aliro_session_config *config) |
Create an Aliro responder session bound to config (NULL on error). | |
| struct cherry_session * | cherry_ccc_session_to_base (struct cherry_ccc_session *session) |
| Return the base session for a CCC session (the base is the first member). | |
| static void * | cherry_ccc_session_get_user_data (struct cherry_ccc_session *session) |
| Fetch the CCC session's user_data via its base session. | |
| void | cherry_ccc_event_free (struct cherry_ccc_event *event) |
| Release a CCC event and any heap payload it owns. | |
| static void | cherry_ccc_session_destroy (struct cherry_ccc_session *session) |
| Destroy a CCC session (delegates to the base). | |
| static enum cherry_err | cherry_ccc_session_start (struct cherry_ccc_session *session) |
| Start a CCC session (delegates to the base). | |
| static enum cherry_err | cherry_ccc_session_stop (struct cherry_ccc_session *session) |
| Stop a CCC session (delegates to the base). | |
| static enum cherry_err | cherry_ccc_session_set_antennas (struct cherry_ccc_session *session, uint8_t tx_antenna_set, uint8_t rx_antenna_set) |
| Select round-1 antennas for a CCC session (delegates to the base). | |
| enum cherry_err | cherry_ccc_session_set_ursk (struct cherry_ccc_session *session, const uint8_t *ursk) |
| Provide the 32-byte URSK (host-provided STS root key). | |
| enum cherry_err | cherry_ccc_session_set_protocol_version (struct cherry_ccc_session *session, uint16_t selected_protocol_version) |
| Record the selected BLE/UWB protocol version. | |
| enum cherry_err | cherry_ccc_session_set_round2_antennas (struct cherry_ccc_session *session, uint8_t tx_antenna_set, uint8_t rx_antenna_set) |
| Select antennas for the Aliro second ranging round. | |
| enum cherry_err | cherry_ccc_session_set_sts_index (struct cherry_ccc_session *session, uint32_t sts_index) |
| Set the starting STS index (resume path). | |
| enum cherry_err | cherry_ccc_session_set_initiation_time (struct cherry_ccc_session *session, uint64_t initiation_time_us) |
| Set the ranging initiation time on the UWBS time base (resume path). | |
| static enum cherry_err | cherry_ccc_session_set_diagnostics (struct cherry_ccc_session *session, struct cherry_common_diag_cfg config) |
| Enable/disable diagnostics for a CCC session (delegates to the base). | |
— CCC/Aliro-session interface (seam the adapter drives).
| void cherry_ccc_event_free | ( | struct cherry_ccc_event * | event | ) |
Release a CCC event and any heap payload it owns.
| event | Event to free. |
Release a CCC event and any heap payload it owns.
| struct cherry_ccc_session * cherry_ccc_session_create_aliro_responder | ( | struct cherry * | ctx, |
| cherry_ccc_cb_t | callback, | ||
| void * | user_data, | ||
| struct cherry_ccc_aliro_session_config * | config | ||
| ) |
Create an Aliro responder session bound to config (NULL on error).
Create an Aliro responder session bound to config (NULL on error).
| ctx | Cherry context (unused). |
| callback | CCC notification callback. |
| user_data | User context to pass to callback. |
| config | Session configuration (channel, session ID, STS index, timing, slot geometry). |
|
inlinestatic |
Destroy a CCC session (delegates to the base).
Destroy a CCC session, delegating to the base session.
| session | CCC session to destroy. |
|
inlinestatic |
Fetch the CCC session's user_data via its base session.
| session | CCC session to query. |
|
inlinestatic |
Select round-1 antennas for a CCC session (delegates to the base).
Select round-1 antennas for a CCC session, delegating to the base session.
| session | CCC session to configure. |
| tx_antenna_set | Antenna set to use for transmission. |
| rx_antenna_set | Antenna set to use for reception. |
|
inlinestatic |
Enable/disable diagnostics for a CCC session (delegates to the base).
Opaque CCC session being configured, defined by the shim.
| enum cherry_err cherry_ccc_session_set_initiation_time | ( | struct cherry_ccc_session * | session, |
| uint64_t | initiation_time_us | ||
| ) |
Set the ranging initiation time on the UWBS time base (resume path).
Set the ranging initiation time on the UWBS time base (resume path).
| session | CCC session. |
| initiation_time_us | Initiation timestamp in microseconds. |
| enum cherry_err cherry_ccc_session_set_protocol_version | ( | struct cherry_ccc_session * | session, |
| uint16_t | selected_protocol_version | ||
| ) |
Record the selected BLE/UWB protocol version.
Record the selected BLE/UWB protocol version.
| session | CCC session. |
| selected_protocol_version | Protocol version (ignored). |
| enum cherry_err cherry_ccc_session_set_round2_antennas | ( | struct cherry_ccc_session * | session, |
| uint8_t | tx_antenna_set, | ||
| uint8_t | rx_antenna_set | ||
| ) |
Select antennas for the Aliro second ranging round.
Select antennas for the Aliro second ranging round.
| session | CCC session. |
| tx_antenna_set | TX antenna set (ignored). |
| rx_antenna_set | RX antenna set (ignored). |
| enum cherry_err cherry_ccc_session_set_sts_index | ( | struct cherry_ccc_session * | session, |
| uint32_t | sts_index | ||
| ) |
Set the starting STS index (resume path).
Set the starting STS index (resume path).
| session | CCC session. |
| sts_index | STS index value. |
| enum cherry_err cherry_ccc_session_set_ursk | ( | struct cherry_ccc_session * | session, |
| const uint8_t * | ursk | ||
| ) |
Provide the 32-byte URSK (host-provided STS root key).
Provide the 32-byte URSK (host-provided STS root key).
| session | CCC session. |
| ursk | 16-byte Unique Responder Session Key. |
|
inlinestatic |
Start a CCC session (delegates to the base).
Start a CCC session, delegating to the base session.
| session | CCC session to start. |
|
inlinestatic |
Stop a CCC session (delegates to the base).
Stop a CCC session, delegating to the base session.
| session | CCC session to stop. |
| struct cherry_session * cherry_ccc_session_to_base | ( | struct cherry_ccc_session * | session | ) |
Return the base session for a CCC session (the base is the first member).
Return the base session for a CCC session (the base is the first member).
| session | CCC session. |