openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
woz_uwb_facade.h
1// Public header for UWB facade: exposes Aliro DS-TWR responder lifecycle and range query; the CCC
2// engine is bound and unbound via internal ursk and stop calls.
3/*
4 * Copyright (c) 2026 asxeem
5 * SPDX-License-Identifier: ISC
6 * C shim bridging the add-on UWB impl to the Woz FiRa/CCC engine.
7 */
8#pragma once
9#include <stddef.h>
10#include <stdint.h>
11#include <stdbool.h>
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
18int woz_uwb_bind_ursk(const uint8_t *ursk, size_t ursk_len);
19
36 uint32_t session_id;
37 uint8_t channel;
42 uint32_t sts_index0;
43 uint64_t uwb_time_us;
44 const uint8_t *ursk;
46 const uint8_t *ranging_config;
47 size_t rc_len;
48};
49
51int woz_uwb_start_aliro(const struct woz_uwb_aliro_cfg *cfg);
52
55int woz_uwb_prewarm(uint8_t channel, uint8_t sync_code_index);
56
58void woz_uwb_stop(void);
59
61bool woz_uwb_last_range_cm(int32_t *cm_out);
62
71bool woz_uwb_trusted_range_cm(int32_t *cm_out);
72
81bool woz_uwb_trusted_range_age_cm(int32_t *cm_out, int64_t *age_ms_out);
82
84uint32_t woz_uwb_range_generation(void);
85
89bool woz_uwb_trusted_range_after_cm(int32_t *cm_out, uint32_t after);
90
93 bool sts_ok;
94 int16_t sts_quality;
95 uint8_t trust_level;
96};
97
106bool woz_uwb_trusted_range_after_checked_cm(int32_t *cm_out, uint32_t after,
107 struct woz_uwb_range_integrity *ig_out);
108
115void woz_uwb_set_range_listener(void (*cb)(void));
116
117#ifdef __cplusplus
118}
119#endif
Aliro UWB ranging parameters negotiated during M1-M4 handshake.
Definition woz_uwb_facade.h:35
const uint8_t * ranging_config
Serialized RangingConfiguration (CCC SaltedHash input), or NULL for URSK fallback.
Definition woz_uwb_facade.h:46
uint64_t uwb_time_us
UWB_Time0 initiation reference, µs.
Definition woz_uwb_facade.h:43
uint16_t slot_duration_rstu
Slot duration, RSTU (1200 = 1 ms).
Definition woz_uwb_facade.h:39
const uint8_t * ursk
32-byte URSK (provisioned STS root).
Definition woz_uwb_facade.h:44
uint8_t channel
UWB channel: 5 or 9.
Definition woz_uwb_facade.h:37
uint32_t session_id
Aliro UWB session id (any non-zero).
Definition woz_uwb_facade.h:36
uint32_t sts_index0
Starting STS index.
Definition woz_uwb_facade.h:42
size_t rc_len
RangingConfiguration length, bytes (17).
Definition woz_uwb_facade.h:47
uint8_t sync_code_index
SYNC/preamble code index (1..32).
Definition woz_uwb_facade.h:38
uint8_t slot_per_round
Slots per ranging round.
Definition woz_uwb_facade.h:41
uint32_t block_duration_ms
Ranging block period, ms.
Definition woz_uwb_facade.h:40
Layer-2 evidence for a latched range, for a consumer that must fail closed.
Definition woz_uwb_facade.h:92
uint8_t trust_level
how many agreeing blocks stand behind the distance
Definition woz_uwb_facade.h:95
int16_t sts_quality
worst STS quality index in that run
Definition woz_uwb_facade.h:94
bool sts_ok
every block in the agreeing run passed the STS floor
Definition woz_uwb_facade.h:93