modules/woz_uwb/src/fira/fira_session.c
asxeem/openaliro
Module

fira_session.c

Range + URSK store for the CCC Pre-POLL responder.

modules/woz_uwb/src/fira/fira_session.c10 documented symbols

Overview

Range + URSK store for the CCC Pre-POLL responder.

depends on woz_port.h aliro_kdf.h fira_session.h

API

Fvoid fira_session_set_provisioned_ursk(const uint8_t *ursk)

modules/woz_uwb/src/fira/fira_session.c:18

Stash an Aliro URSK for the CCC Pre-POLL STS decode; NULL clears it.

Fconst uint8_t *fira_session_get_ursk(void)

modules/woz_uwb/src/fira/fira_session.c:29

The stashed Aliro URSK (32 bytes), or NULL if none — for the Pre-POLL decode.

Fuint32_t fira_session_current_slot(void)

modules/woz_uwb/src/fira/fira_session.c:34

STS-index slot clock (inert without a MAC time base); returns 0.

Fbool fira_session_last_range(int32_t *cm_out, uint16_t *addr_out, uint8_t *nlos_out, uint32_t *block_out, int64_t *age_ms_out)

modules/woz_uwb/src/fira/fira_session.c:57

Fetch the most recent valid DS-TWR range; out-params optional (NULL to skip).

Fbool fira_session_range_plausible(int32_t cm)

modules/woz_uwb/src/fira/fira_session.c:82

Layer 1: true if @p cm is a physically plausible DS-TWR distance.

called by fira_session_set_ccc_range_cm

Fbool fira_session_sts_quality_ok(int32_t driver_verdict, int16_t quality_index)

modules/woz_uwb/src/fira/fira_session.c:87

Layer 2: true if the STS correlated well enough to trust its timestamp.

driver_verdict
dwt_readstsquality() return (>=0 good, <0 bad).
quality_index
the signed STS quality index it wrote.

Fbool fira_session_range_trusted(void)

modules/woz_uwb/src/fira/fira_session.c:92

Layer 4: true once >= K consecutive plausible, mutually consistent ranges have been latched. Cleared by any implausible or outlier block.

Fuint8_t fira_session_trust_level(void)

modules/woz_uwb/src/fira/fira_session.c:97

Layer 4 diagnostic: the live run length of agreeing plausible blocks (0..FIRA_RANGE_TRUST_K) behind fira_session_range_trusted().

Fvoid fira_session_set_range_listener(void (*cb)(void))

modules/woz_uwb/src/fira/fira_session.c:102

Register a callback fired after each accepted range latch (NULL to clear). Runs on the UWB RX path — keep it to a task wake, nothing heavier.

Fvoid fira_session_set_ccc_range_cm(int32_t cm, uint32_t block)

modules/woz_uwb/src/fira/fira_session.c:107

Latch a CCC DS-TWR range so it flows up the Aliro mRangingData seam.

calls fira_session_range_plausible