21struct aliro_rssi_gate_cfg {
24 uint16_t close_hold_ms;
26 uint8_t slope_open_db;
27 uint16_t slope_window_ms;
32#ifndef CONFIG_WOZ_RSSI_GATE_OPEN_DBM
33#define CONFIG_WOZ_RSSI_GATE_OPEN_DBM (-55)
35#ifndef CONFIG_WOZ_RSSI_GATE_CLOSE_DBM
36#define CONFIG_WOZ_RSSI_GATE_CLOSE_DBM (-65)
38#ifndef CONFIG_WOZ_RSSI_GATE_CLOSE_HOLD_MS
39#define CONFIG_WOZ_RSSI_GATE_CLOSE_HOLD_MS (3000)
41#ifndef CONFIG_WOZ_RSSI_GATE_SLOPE_DB
42#define CONFIG_WOZ_RSSI_GATE_SLOPE_DB (8)
44#ifndef CONFIG_WOZ_RSSI_GATE_MAX_HOLD_MS
45#define CONFIG_WOZ_RSSI_GATE_MAX_HOLD_MS (0)
48#define ALIRO_RSSI_GATE_CFG_DEFAULT \
50 .open_dbm = CONFIG_WOZ_RSSI_GATE_OPEN_DBM, \
51 .close_dbm = CONFIG_WOZ_RSSI_GATE_CLOSE_DBM, \
52 .close_hold_ms = CONFIG_WOZ_RSSI_GATE_CLOSE_HOLD_MS, \
54 .slope_open_db = CONFIG_WOZ_RSSI_GATE_SLOPE_DB, \
55 .slope_window_ms = 1500u, \
56 .max_hold_ms = CONFIG_WOZ_RSSI_GATE_MAX_HOLD_MS, \
60#define ALIRO_RSSI_UNAVAILABLE 127
64struct aliro_rssi_gate {
71 uint32_t hold_since_ms;
75 uint32_t below_since_ms;
86void aliro_rssi_gate_reset(
struct aliro_rssi_gate *
g);
90bool aliro_rssi_gate_feed(
struct aliro_rssi_gate *
g,
const struct aliro_rssi_gate_cfg *cfg,
91 int8_t rssi_dbm, uint32_t now_ms);
94bool aliro_rssi_gate_is_open(
const struct aliro_rssi_gate *
g);
106void aliro_rssi_gate_hold_begin(
struct aliro_rssi_gate *
g, uint32_t now_ms);
110bool aliro_rssi_gate_was_capped(
const struct aliro_rssi_gate *
g);
113int16_t aliro_rssi_gate_level_dbm(
const struct aliro_rssi_gate *
g);
static struct @5 g
The bound session's key material, schedule anchor, and dURSK cache.