roo_wifi
API Documentation for roo_wifi
Loading...
Searching...
No Matches
arduino_preferences_store.h
Go to the documentation of this file.
1#pragma once
2
3#include "roo_prefs.h"
5
6namespace roo_wifi {
7
8/// Store implementation backed by roo_prefs (ESP32 Arduino preferences).
10 public:
12
13 /// Initializes the preferences store (no-op placeholder).
14 void begin() {}
15
16 /// Returns whether the Wi-Fi interface is enabled.
17 bool getIsInterfaceEnabled() override;
18
19 /// Sets whether the Wi-Fi interface is enabled.
20 void setIsInterfaceEnabled(bool enabled) override;
21
22 /// Returns the default SSID, if any.
23 std::string getDefaultSSID() override;
24
25 /// Clears the default SSID.
26 void clearDefaultSSID() override;
27
28 /// Sets the default SSID.
29 void setDefaultSSID(const std::string& ssid) override;
30
31 /// Retrieves a stored password for an SSID.
32 bool getPassword(const std::string& ssid, std::string& password) override;
33
34 /// Stores a password for an SSID.
35 void setPassword(const std::string& ssid, roo::string_view password) override;
36
37 /// Clears a stored password for an SSID.
38 void clearPassword(const std::string& ssid) override;
39
40 private:
41 roo_prefs::Collection collection_;
42 roo_prefs::Bool is_interface_enabled_;
43 roo_prefs::String default_ssid_;
44};
45
46} // namespace roo_wifi
Store implementation backed by roo_prefs (ESP32 Arduino preferences).
bool getIsInterfaceEnabled() override
Returns whether the Wi-Fi interface is enabled.
void setPassword(const std::string &ssid, roo::string_view password) override
Stores a password for an SSID.
bool getPassword(const std::string &ssid, std::string &password) override
Retrieves a stored password for an SSID.
void clearPassword(const std::string &ssid) override
Clears a stored password for an SSID.
void begin()
Initializes the preferences store (no-op placeholder).
void setIsInterfaceEnabled(bool enabled) override
Sets whether the Wi-Fi interface is enabled.
void clearDefaultSSID() override
Clears the default SSID.
void setDefaultSSID(const std::string &ssid) override
Sets the default SSID.
std::string getDefaultSSID() override
Returns the default SSID, if any.
Abstraction for persistently storing Wi-Fi controller data.
Definition store.h:14