Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::WifiStorage Class Reference

#include <WifiStorage.h>

Inheritance diagram for uniot::WifiStorage:
[legend]

Public Member Functions

 WifiStorage ()
 Construct a new WifiStorage object.
 
const String & getSsid () const
 Get the stored WiFi SSID.
 
const String & getPassword () const
 Get the stored WiFi password.
 
void setCredentials (const String &ssid, const String &password)
 Set WiFi credentials.
 
bool isCredentialsValid ()
 Check if stored credentials are valid.
 
virtual bool store () override
 Store WiFi credentials to persistent storage.
 
virtual bool restore () override
 Restore WiFi credentials from persistent storage.
 
virtual bool clean () override
 Clear stored WiFi credentials.
 
- Public Member Functions inherited from uniot::CBORStorage
 CBORStorage (const String &path)
 Constructs a new CBORStorage object.
 
virtual ~CBORStorage ()
 Virtual destructor.
 
CBORObjectobject ()
 Get access to the underlying CBORObject.
 
- Public Member Functions inherited from uniot::Storage
 Storage (const String &path)
 Constructs a Storage object for a specific file.
 
virtual ~Storage ()
 Destructor.
 

Additional Inherited Members

- Static Public Member Functions inherited from uniot::Storage
static void unmount ()
 Explicitly unmounts the filesystem.
 
- Protected Member Functions inherited from uniot::Storage
void setPath (const String &path)
 Sets the file path, ensuring it starts with "/".
 
- Protected Attributes inherited from uniot::CBORStorage
CBORObject mCbor
 The CBOR object used for data serialization/deserialization.
 
- Protected Attributes inherited from uniot::Storage
Bytes mData
 The byte array containing the data to be stored or the loaded data.
 
String mPath
 The file path where data is stored.
 

Constructor & Destructor Documentation

◆ WifiStorage()

uniot::WifiStorage::WifiStorage ( )
inline

Construct a new WifiStorage object.

Initializes the storage with the filename "wifi.cbor"

Member Function Documentation

◆ clean()

virtual bool uniot::WifiStorage::clean ( )
inlineoverridevirtual

Clear stored WiFi credentials.

Resets SSID and password to empty strings and cleans the storage.

Return values
trueClean operation was successful
falseClean operation failed (e.g., file system error)

Reimplemented from uniot::CBORStorage.

◆ getPassword()

const String & uniot::WifiStorage::getPassword ( ) const
inline

Get the stored WiFi password.

Return values
String&The stored password

◆ getSsid()

const String & uniot::WifiStorage::getSsid ( ) const
inline

Get the stored WiFi SSID.

Return values
String&The stored SSID

◆ isCredentialsValid()

bool uniot::WifiStorage::isCredentialsValid ( )
inline

Check if stored credentials are valid.

Checks if SSID is not empty, which is considered a minimum requirement for valid credentials.

Return values
trueCredentials are valid
falseCredentials are invalid (SSID is empty)

◆ restore()

virtual bool uniot::WifiStorage::restore ( )
inlineoverridevirtual

Restore WiFi credentials from persistent storage.

Loads the CBOR object from storage and extracts SSID and password.

Return values
trueRestore operation was successful
falseRestore operation failed (e.g., file system error)

Reimplemented from uniot::CBORStorage.

◆ setCredentials()

void uniot::WifiStorage::setCredentials ( const String & ssid,
const String & password )
inline

Set WiFi credentials.

Parameters
ssidThe WiFi network name
passwordThe WiFi network password

◆ store()

virtual bool uniot::WifiStorage::store ( )
inlineoverridevirtual

Store WiFi credentials to persistent storage.

Stores the SSID and password to the CBOR object and persists it to storage.

Return values
trueStorage operation was successful
falseStorage operation failed (e.g., file system error)

Reimplemented from uniot::CBORStorage.


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