Politician 1.0.0
WiFi Auditing Library for ESP32
Loading...
Searching...
No Matches
politician::storage::NvsBssidCache Class Reference

Helper for persistently storing captured BSSIDs in NVS memory. More...

#include <PoliticianStorage.h>

Public Member Functions

 NvsBssidCache (const char *ns="wardrive")
 
void begin ()
 Initializes the NVS memory and loads the cached BSSIDs into RAM.
 
void loadInto (Politician &engine)
 Feeds the loaded BSSIDs into the Politician engine so it knows to ignore them.
 
bool add (const uint8_t *bssid)
 Adds a newly captured BSSID to the cache and saves it to NVS.
 
void clear ()
 Clears the entire cache from NVS.
 

Detailed Description

Helper for persistently storing captured BSSIDs in NVS memory.

This ensures that previously captured networks aren't attacked again after a reboot.

Definition at line 214 of file PoliticianStorage.h.

Constructor & Destructor Documentation

◆ NvsBssidCache()

politician::storage::NvsBssidCache::NvsBssidCache ( const char *  ns = "wardrive")
inline

Definition at line 223 of file PoliticianStorage.h.

Member Function Documentation

◆ add()

bool politician::storage::NvsBssidCache::add ( const uint8_t *  bssid)
inline

Adds a newly captured BSSID to the cache and saves it to NVS.

Parameters
bssidThe 6-byte BSSID to save.
Returns
true if added, false if it already exists or the cache is full.

Definition at line 252 of file PoliticianStorage.h.

◆ begin()

void politician::storage::NvsBssidCache::begin ( )
inline

Initializes the NVS memory and loads the cached BSSIDs into RAM.

Definition at line 230 of file PoliticianStorage.h.

◆ clear()

void politician::storage::NvsBssidCache::clear ( )
inline

Clears the entire cache from NVS.

Definition at line 269 of file PoliticianStorage.h.

◆ loadInto()

void politician::storage::NvsBssidCache::loadInto ( Politician engine)
inline

Feeds the loaded BSSIDs into the Politician engine so it knows to ignore them.

Parameters
engineReference to your active Politician instance

Definition at line 241 of file PoliticianStorage.h.

References engine.


The documentation for this class was generated from the following file: