openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
aliro_uwb_internal.h File Reference

— private context types and shared helpers. More...

Include dependency graph for aliro_uwb_internal.h:

Go to the source code of this file.

Data Structures

struct  aliro_uwb_adapter
 Session-independent reader state shared across all ranging sessions for an Aliro UWB adapter. More...
 
struct  aliro_uwb_session
 Per-approach ranging-setup session record holding the CCC state machine and derived keys for one Aliro exchange. More...
 

Enumerations

enum  aliro_uwb_session_state
 BLE-handshake state of a session.
 

Functions

enum aliro_uwb_err cherry_err_to_aliro (enum cherry_err err)
 Map a CCC error code to its Aliro UWB equivalent, treating unknown errors as internal failures.
 
enum aliro_uwb_err aliro_uwb_session_init (struct aliro_uwb_session *session)
 Initialize a session by creating and configuring a CCC Aliro responder, setting URSK, protocol version, antennas, and diagnostics, then starting the session.
 
enum aliro_uwb_err aliro_uwb_session_stop (struct aliro_uwb_session *session)
 Stop an active CCC session, transitioning to SUSPENDED state.
 
enum aliro_uwb_err aliro_uwb_session_start (struct aliro_uwb_session *session)
 Start ranging for a per-approach session.
 

Detailed Description

— private context types and shared helpers.

Function Documentation

◆ aliro_uwb_session_init()

enum aliro_uwb_err aliro_uwb_session_init ( struct aliro_uwb_session session)

Initialize a session by creating and configuring a CCC Aliro responder, setting URSK, protocol version, antennas, and diagnostics, then starting the session.

On any error, tears down the session and returns the mapped error code.

Parameters
sessionSession to initialize.
Returns
ALIRO_UWB_ERR_NONE on success, ALIRO_UWB_ERR_INVALID_PARAMETER if session is NULL, or the mapped CCC error on failure.

◆ aliro_uwb_session_start()

enum aliro_uwb_err aliro_uwb_session_start ( struct aliro_uwb_session session)

Start ranging for a per-approach session.

Parameters
sessionThe per-approach ranging-setup session to start.
Returns
Error code indicating whether the session started successfully.

Start ranging for a per-approach session.

On error, tears down the session and returns the mapped error code. the mapped CCC error on failure.

◆ aliro_uwb_session_stop()

enum aliro_uwb_err aliro_uwb_session_stop ( struct aliro_uwb_session session)

Stop an active CCC session, transitioning to SUSPENDED state.

On error, tears down the session and returns the mapped error code.

Parameters
sessionSession to stop.
Returns
ALIRO_UWB_ERR_NONE on success, ALIRO_UWB_ERR_INVALID_PARAMETER if session is NULL, or the mapped CCC error on failure.

◆ cherry_err_to_aliro()

enum aliro_uwb_err cherry_err_to_aliro ( enum cherry_err  err)

Map a CCC error code to its Aliro UWB equivalent, treating unknown errors as internal failures.

Parameters
errCCC error code to translate.
Returns
Corresponding enum aliro_uwb_err value, or ALIRO_UWB_ERR_INTERNAL if unrecognized.