|
Politician 1.0.0
WiFi Auditing Library for ESP32
|
Opt-in passive RSSI-based presence and motion sensing for the Politician engine. More...
#include "Politician.h"#include <freertos/FreeRTOS.h>#include <freertos/portmacro.h>#include <string.h>
Include dependency graph for PoliticianSense.h:Go to the source code of this file.
Classes | |
| class | politician::PoliticianSense |
| Passive RSSI-based motion and presence detector. More... | |
Namespaces | |
| namespace | politician |
Macros | |
| #define | POLITICIAN_SENSE_MAX_WINDOW 64 |
| Maximum ring-buffer capacity (samples). | |
Typedefs | |
| using | politician::SenseCb = std::function< void(SenseEvent event, float variance)> |
| Callback fired on SENSE_STILL ↔ SENSE_MOTION transitions. | |
Enumerations | |
| enum | politician::SenseEvent : uint8_t { politician::SENSE_MOTION = 0 , politician::SENSE_STILL = 1 } |
| State transition delivered to the SenseCb callback. More... | |
Opt-in passive RSSI-based presence and motion sensing for the Politician engine.
Hooks into the engine's promiscuous-mode packet stream and monitors beacon RSSI variance from a fixed anchor AP to detect human presence and motion — device-free, zero mode switching, zero conflicts with the core engine.
A human body walking between the anchor AP and the ESP32 scatters and absorbs 2.4GHz/5GHz radio waves, producing measurable fluctuations in received signal strength. By tracking the statistical variance of beacon RSSI over a sliding window, PoliticianSense classifies the monitored space as SENSE_STILL or SENSE_MOTION.
Usage:
Anchor modes:
Threading: RSSI samples are written from Politician's internal worker task. tick() and all sense callbacks run on your calling task (usually loop()). A FreeRTOS spinlock protects the ring buffer across tasks.
Packet logger chaining: PoliticianSense installs itself as the engine's packet logger. If you also need raw frame access, call sense.setPacketLogger() before begin() to register a pass-through callback that fires on every frame after sensing.
Compile-time tuning: #define POLITICIAN_SENSE_MAX_WINDOW 128 // Enlarge maximum window (default 64)
Definition in file PoliticianSense.h.
| #define POLITICIAN_SENSE_MAX_WINDOW 64 |
Maximum ring-buffer capacity (samples).
Definition at line 93 of file PoliticianSense.h.