modules/woz_uwb/src/ccc/ccc_shim.h
asxeem/openaliro
Module

ccc_shim.h

map a per-frame STS index to the (dURSK, STS-V) pair the DW3000 STS engine…

modules/woz_uwb/src/ccc/ccc_shim.h

Overview

map a per-frame STS index to the (dURSK, STS-V) pair the DW3000 STS engine loads.

depends on ccc_kdf.h  ·  used by ccc_shim.c ccc_shim_rx.c ccc_shim_wrap.c uwb_rxdiag.c uwb_selftest.c woz_uwb_facade.c aliro_shell.c

API

Fint ccc_shim_bind(const uint8_t mursk[CCC_MURSK_LEN], const uint8_t salted_hash[CCC_SALTED_HASH_LEN], uint32_t sts_index0, uint16_t n_slot_per_round)

modules/woz_uwb/src/ccc/ccc_shim.h:14

Bind the shim to a ranging session's derived key material.

Fint ccc_shim_bind_from_ursk(const uint8_t ursk[CCC_URSK_LEN], const uint8_t *ranging_config, size_t rc_len, uint32_t sts_index0, uint16_t n_slot_per_round)

modules/woz_uwb/src/ccc/ccc_shim.h:19

Bind the shim, deriving mURSK + SaltedHash from the URSK + RangingConfiguration.

Fvoid ccc_shim_unbind(void)

modules/woz_uwb/src/ccc/ccc_shim.h:23

Unbind the shim; @ref ccc_shim_active returns false afterward.

Fbool ccc_shim_active(void)

modules/woz_uwb/src/ccc/ccc_shim.h:26

Whether the per-frame STS interception is live (bound AND not suspended).

Fvoid ccc_shim_suspend(bool suspend)

modules/woz_uwb/src/ccc/ccc_shim.h:29

Suspend/resume the per-frame IV wrap without unbinding.

Fint ccc_shim_sts_for_index(uint32_t sts_index, uint8_t dursk[CCC_DURSK_LEN], uint8_t sts_v[CCC_STS_V_LEN])

modules/woz_uwb/src/ccc/ccc_shim.h:32

Map a per-frame STS index to its CCC dURSK (per-cycle) + STS-V (per-PPDU).

Fint ccc_shim_dudsk_for_index(uint32_t sts_index, uint8_t dudsk[CCC_DUDSK_LEN])

modules/woz_uwb/src/ccc/ccc_shim.h:36

Derive the dUDSK (per-cycle Final_Data key) for the ranging cycle containing sts_index.

Fint ccc_shim_sts_for_slot(uint32_t slot, uint8_t dursk[CCC_DURSK_LEN], uint8_t sts_v[CCC_STS_V_LEN])

modules/woz_uwb/src/ccc/ccc_shim.h:39

Map a ranging-slot offset (STS_Index0 + slot) to its CCC dURSK + STS-V.

Fuint32_t ccc_shim_index_from_iv(const uint8_t iv16[16])

modules/woz_uwb/src/ccc/ccc_shim.h:43

Extract the STS index the blob packed into a DW3000 STS IV (index at bytes 7..4).

Fuint32_t ccc_shim_blob_to_ccc_index(uint32_t blob_idx, uint32_t *block, uint32_t *sub)

modules/woz_uwb/src/ccc/ccc_shim.h:47

Map the blob's raw provisioned STS index to a CCC-schedule STS index (origin/stride auto-calibrated from the first two indices).

Fvoid ccc_shim_pin_index(uint32_t ccc_index)

modules/woz_uwb/src/ccc/ccc_shim.h:50

Pin the substituted STS to one fixed CCC index (bench validation).

Fvoid ccc_shim_unpin(void)

modules/woz_uwb/src/ccc/ccc_shim.h:53

Release the debug pin; STS resumes advancing with the blob index.

Fvoid ccc_shim_wrap_log_reset(void)

modules/woz_uwb/src/ccc/ccc_shim.h:56

Reset the wrap's first-N-frame IV log budget (target only).

Fvoid ccc_shim_rx_log_reset(void)

modules/woz_uwb/src/ccc/ccc_shim.h:59

Reset the responder-RX wrap's first-N-arm log budget (target only).

Fvoid ccc_shim_rx_notify_rx(uint32_t status)

modules/woz_uwb/src/ccc/ccc_shim.h:62

Feed each RX event's status word to the empirical STS-index tracker (target only).

Fvoid ccc_shim_rx_try_prepoll(uint16_t datalength)

modules/woz_uwb/src/ccc/ccc_shim.h:65

Decode a received SP0 Pre-POLL frame to read Apple's exact POLL STS index (target only).

Fbool ccc_shim_rx_awaiting_poll(void)

modules/woz_uwb/src/ccc/ccc_shim.h:68

True while an SP3 POLL RX is armed (the next RX-good event is its result). Target only.

##define WOZ_CCC_PREPOLL_LISTEN 1

modules/woz_uwb/src/ccc/ccc_shim.h:71

BENCH toggle — run the standalone SP0 Pre-POLL listener instead of the FiRa session.

Fint ccc_prepoll_listen(uint8_t channel, uint8_t preamble_code)

modules/woz_uwb/src/ccc/ccc_shim.h:74

BENCH: bring up a raw continuous SP0 receiver for the CCC Pre-POLL (target only).

Fint ccc_prepoll_prewarm(uint8_t channel, uint8_t preamble_code)

modules/woz_uwb/src/ccc/ccc_shim.h:78

Pre-apply the expected session PHY (radio configured, TRX off, RX not armed) so a following ccc_prepoll_listen() with the same params skips the dwt_configure long pole.

Fvoid ccc_prepoll_stop(void)

modules/woz_uwb/src/ccc/ccc_shim.h:82

Stop the Pre-POLL listener: close the self-rearm listen-gate, then force the radio off (target only).

Fuint32_t ccc_shim_sts_index0(void)

modules/woz_uwb/src/ccc/ccc_shim.h:85

The bound session's STS_Index0 (for UAD/Pre-POLL derivation); 0 if unbound.