openaliro
Aliro reader: UWB/CCC core and ESP32-S3/C5/C6 port
Loading...
Searching...
No Matches
aliro_ranging.h
1// Aliro M1-M4 ranging-setup interface: negotiates UWB ranging parameters with the device and
2// produces the BLE ranging-control secure channel used to carry the M1-M4 exchange.
3/*
4 * Copyright (c) 2026 asxeem
5 * SPDX-License-Identifier: ISC
6 *
7 * aliro_ranging — the post-auth Aliro UWB ranging-setup (M1-M4) on ESP32. Thin
8 * glue that drives the engine's reader adapter/session (modules/woz_uwb aliro_uwb_
9 * adapter + session): on a completed credential-auth it creates a session bound to
10 * the derived URSK, emits M1 over the BLE L2CAP channel, feeds inbound M2/M4 back
11 * to the engine, and lets the engine negotiate the ranging parameters and start
12 * the DW3000 responder itself (via cherry_ccc_shim -> woz_uwb_start_aliro). This
13 * replaces the earlier canned-parameter handoff.
14 *
15 * The DW3000 is single-session, so exactly one ranging session runs at a time.
16 * The whole lifecycle stays on the BLE-host task (create/feed/teardown + the
17 * engine's transmit/event callbacks are all synchronous), so no locking is needed.
18 */
19#pragma once
20
21#include <stddef.h>
22#include <stdint.h>
23
24#ifdef __cplusplus
25extern "C" {
26#endif
27
31int aliro_ranging_init(void);
32
33struct aliro_secchan; /* the BleSK ranging channel (from aliro_crypto.h) */
34
44int aliro_ranging_start(uint16_t conn_handle, uint32_t session_id, const uint8_t *ursk,
45 struct aliro_secchan *sc_ble);
46
51int aliro_ranging_feed(uint16_t conn_handle, const uint8_t *data, size_t len);
52
55void aliro_ranging_stop(uint16_t conn_handle);
56
57#ifdef __cplusplus
58}
59#endif