modules/woz_aliro/include/aliro_rssi_gate.h
asxeem/openaliro
Module

aliro_rssi_gate.h

BLE-RSSI ranging power gate: decides when the phone is close enough that arming…

modules/woz_aliro/include/aliro_rssi_gate.h2 documented symbols

Overview

BLE-RSSI ranging power gate: decides when the phone is close enough that arming UWB ranging is worth the radio's RX power. Pure sample-in/state-out logic (EWMA smoothing, open/close hysteresis with a close hold-off, optional rise-rate fast open for fast approaches) so it host-tests without a radio; the reader feeds it connection RSSI samples and defers Reader-Status-AP-Completed until it opens.

used by aliro_reader.c aliro_rssi_gate.c

API

Cstruct aliro_rssi_gate_cfg

modules/woz_aliro/include/aliro_rssi_gate.h:21

Tuning knobs. Kconfig supplies the build defaults (ALIRO_RSSI_GATE_CFG_DEFAULT). The thresholds come from a measured curve on one rig (docs/power-profile.md); they are per-room and per-handset, so re-run the calibration for a new one.

Cstruct aliro_rssi_gate

modules/woz_aliro/include/aliro_rssi_gate.h:64

Gate state. All-zeroes == reset/closed, so a zeroed session slot needs no init call. Internal values are Q4 fixed point (dBm * 16).

##define CONFIG_WOZ_RSSI_GATE_OPEN_DBM (-55)

modules/woz_aliro/include/aliro_rssi_gate.h:33

##define CONFIG_WOZ_RSSI_GATE_CLOSE_DBM (-65)

modules/woz_aliro/include/aliro_rssi_gate.h:36

##define CONFIG_WOZ_RSSI_GATE_CLOSE_HOLD_MS (3000)

modules/woz_aliro/include/aliro_rssi_gate.h:39

##define CONFIG_WOZ_RSSI_GATE_SLOPE_DB (8)

modules/woz_aliro/include/aliro_rssi_gate.h:42

##define CONFIG_WOZ_RSSI_GATE_MAX_HOLD_MS (0)

modules/woz_aliro/include/aliro_rssi_gate.h:45

##define ALIRO_RSSI_UNAVAILABLE 127

modules/woz_aliro/include/aliro_rssi_gate.h:60

Fvoid aliro_rssi_gate_reset(struct aliro_rssi_gate *g)

modules/woz_aliro/include/aliro_rssi_gate.h:86

Fbool aliro_rssi_gate_feed(struct aliro_rssi_gate *g, const struct aliro_rssi_gate_cfg *cfg, int8_t rssi_dbm, uint32_t now_ms)

modules/woz_aliro/include/aliro_rssi_gate.h:90

Fbool aliro_rssi_gate_is_open(const struct aliro_rssi_gate *g)

modules/woz_aliro/include/aliro_rssi_gate.h:94

Fvoid aliro_rssi_gate_hold_begin(struct aliro_rssi_gate *g, uint32_t now_ms)

modules/woz_aliro/include/aliro_rssi_gate.h:106

Fbool aliro_rssi_gate_was_capped(const struct aliro_rssi_gate *g)

modules/woz_aliro/include/aliro_rssi_gate.h:110

Fint16_t aliro_rssi_gate_level_dbm(const struct aliro_rssi_gate *g)

modules/woz_aliro/include/aliro_rssi_gate.h:113