Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
Loading...
Searching...
No Matches
network_list.h
Go to the documentation of this file.
1
6#pragma once
7
8#include "prov_types.h"
9
10namespace prov
11{
14{
15public:
16 enum class AddResult { Added, Replaced, Evicted, Invalid };
17
19 AddResult add(const char* ssid, size_t ssid_len, const char* pass, size_t pass_len);
21 bool forget(const char* ssid, size_t ssid_len);
23 void mark_joined(size_t index);
25 int find(const char* ssid, size_t ssid_len) const;
26 size_t size() const;
27 const NetworkEntry& at(size_t index) const;
29 bool restore(const NetworkEntry& e);
30 uint32_t seq() const;
31 void clear();
32
33private:
34 NetworkEntry _entries[kMaxNetworks];
35 size_t _count = 0;
36 uint32_t _seq = 0;
37};
38} // namespace prov
Up to kMaxNetworks saved networks; the least recently added or joined one is evicted when full.
Definition network_list.h:14
AddResult add(const char *ssid, size_t ssid_len, const char *pass, size_t pass_len)
Adds or updates a network. SSID 1-32 bytes, password empty or 8-63 printable ASCII bytes.
Definition network_list.cpp:23
bool restore(const NetworkEntry &e)
Appends an entry as loaded from storage; false if full or the entry is invalid.
Definition network_list.cpp:96
void mark_joined(size_t index)
Marks an entry as just joined (last_ok_seq = ++seq).
Definition network_list.cpp:68
int find(const char *ssid, size_t ssid_len) const
Index of the byte-exact SSID, or -1.
Definition network_list.cpp:76
bool forget(const char *ssid, size_t ssid_len)
Removes a network by byte-exact SSID; false if absent.
Definition network_list.cpp:52
Plain value types shared by the WiFi provisioning logic (pure C++20, no heap).
One saved network. Strings are NUL-terminated.
Definition prov_types.h:31