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

fira_session.h

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

modules/woz_uwb/src/fira/fira_session.h

Overview

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

used by ccc_shim_rx.c uwb_rxdiag.c woz_uwb_facade.c fira_session.c aliro_shell.c

API

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.h:10

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

Fvoid fira_session_set_provisioned_ursk(const uint8_t *ursk)

modules/woz_uwb/src/fira/fira_session.h:15

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.h:18

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

Fvoid fira_session_set_ccc_range_cm(int32_t cm, uint32_t block)

modules/woz_uwb/src/fira/fira_session.h:21

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

Fuint32_t fira_session_current_slot(void)

modules/woz_uwb/src/fira/fira_session.h:24

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

##define FIRA_RANGE_NEG_TOL_CM 30

modules/woz_uwb/src/fira/fira_session.h:41

##define FIRA_RANGE_MAX_CM 3000

modules/woz_uwb/src/fira/fira_session.h:42

Fbool fira_session_range_plausible(int32_t cm)

modules/woz_uwb/src/fira/fira_session.h:45

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

##define FIRA_STS_QUALITY_MIN 0

modules/woz_uwb/src/fira/fira_session.h:51

Fbool fira_session_sts_quality_ok(int32_t driver_verdict, int16_t quality_index)

modules/woz_uwb/src/fira/fira_session.h:56

Layer 2: true if the STS correlated well enough to trust its timestamp. @param driver_verdict dwt_readstsquality() return (>=0 good, <0 bad). @param quality_index the signed STS quality index it wrote.

##define FIRA_RANGE_TRUST_K 3

modules/woz_uwb/src/fira/fira_session.h:64

##define FIRA_RANGE_SPREAD_CM 50

modules/woz_uwb/src/fira/fira_session.h:65

Fbool fira_session_range_trusted(void)

modules/woz_uwb/src/fira/fira_session.h:69

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.h:73

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.h:77

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.