aliro_uwb_adapter.c
reader-context lifecycle.
Overview
reader-context lifecycle.
depends on woz_log.h aliro_uwb_internal.h aliro_uwb_adapter.h cherry_ccc.h woz_alloc.h
flowchart TD aliro_uwb_adapter_create_reader --> copy_capabilities aliro_uwb_adapter_create_reader --> reader_config_valid
API
Fenum 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.
err- CCC error code to translate.
- returns
- Corresponding
enum aliro_uwb_errvalue, orALIRO_UWB_ERR_INTERNALif unrecognized.
Fstatic enum aliro_uwb_err copy_capabilities(struct aliro_uwb_adapter *adapter, struct cherry_core_event_device_capabilities *caps)
Deep-copy the device CCC capabilities into the adapter.
adapter- Adapter whose
ccc_capsfield receives the copied capabilities. caps- Device capabilities event supplying the source CCC capabilities to copy.
- returns
ALIRO_UWB_ERR_NONEon success, orALIRO_UWB_ERR_INTERNALif the source capabilities are missing or allocation fails.
aliro_uwb_adapter_create_readerFstatic bool reader_config_valid(const struct aliro_uwb_adapter_reader_config *config)
Validate that a reader configuration offers at least one valid hopping sequence and respects configured bounds, returning false if invalid.
config- Reader configuration to validate.
- returns
- true if the configuration's hopping count is within bounds and includes a default sequence, false otherwise.
aliro_uwb_adapter_create_readerFaliro_uwb_adapter_create_reader
Create a reader-mode adapter, copying the peer's CCC capabilities into it and resolving the minimum RAN multiplier against the reader's own configuration.
copy_capabilities, reader_config_validFvoid aliro_uwb_adapter_set_diagnostics(struct aliro_uwb_adapter *aliro_ctx, struct cherry_common_diag_cfg config)
Store a diagnostics configuration in the adapter for later application to CCC sessions, allocating storage if needed.
Fvoid aliro_uwb_adapter_destroy(struct aliro_uwb_adapter *aliro_ctx)
Destroy an Aliro UWB adapter, freeing all associated CCC capabilities arrays and diagnostic configuration.