Uniot Docs
  • Introduction
  • Guides
    • Getting Started
    • Uniot Badge
    • Device Network
  • Foundations
    • Edge Logic Deployment
  • General Concepts
    • Primitives
    • Scripting
  • Platform
    • Dashboard
    • Sandbox
      • Visual Editor
        • Special
        • Logic
        • Math
        • Loops
        • Text
        • Variables
        • Functions
        • Primitives
      • Logger
      • Emulator
      • Control Panel
  • Advanced
    • Uniot Core
      • Scheduler
        • TaskScheduler
        • IExecutor
        • ISchedulerConnectionKit
        • Task
        • SchedulerTask
      • AppKit
        • AppKit
        • LispDevice
        • LispPrimitives
        • TopDevice
      • CBORWrapper
        • CBORObject
        • COSE
        • COSEMessage
        • ICOSESigner
      • Date
        • Date
        • SimpleNTP
      • EventBus
        • EventBus
        • IEventBusConnectionKit
        • DataChannels
        • EventEmitter
        • EventListener
        • EventEntity
        • CallbackEventListener
      • Hardware
        • Button
      • LispWrapper
        • DefaultPrimitives
        • LispHelper
        • PrimitiveExpeditor
        • unLisp
      • MQTTWrapper
        • CallbackMQTTDevice
        • MQTTDevice
        • MQTTKit
        • MQTTPath
      • Network
        • ConfigCaptivePortal
        • NetworkController
        • NetworkScheduler
      • Register
        • GpioRegister
        • ObjectRegister
        • ObjectRegisterRecord
        • Register
        • RegisterManager
        • RegisterManagerProxy
      • Storage
        • CBORStorage
        • CrashStorage
        • Storage
        • WifiStorage
      • Utils
        • Array
        • Bytes
        • ClearQueue
        • IterableQueue
        • LimitedQueue
        • GlobalBufferMemoryManager
        • Map
        • Singleton
        • TypeId
      • Credentials
    • Uniot Lisp
      • Language Description
      • Embedding Instructions
  • API
    • MQTT Convention
Powered by GitBook
On this page
  1. Advanced
  2. Uniot Core
  3. Storage

WifiStorage

PreviousStorageNextUtils

Last updated 4 months ago

The WifiStorage class extends the class to manage WiFi credentials securely and efficiently within the Uniot project. It handles the storage, retrieval, and validation of WiFi SSIDs and passwords, facilitating seamless network connections. By leveraging CBOR for data serialization, WifiStorage ensures that WiFi credentials are stored in a structured and compact format. This class provides methods to set, get, and verify the validity of stored credentials, enabling reliable network configuration and reconnection processes.

Constructor and Destructor:

  • WifiStorage() Constructs a WifiStorage instance with a predefined file path for storing WiFi credentials.

  • virtual ~WifiStorage() Destructor that ensures proper cleanup.

Methods:

  • const String& getSsid() const Retrieves the stored WiFi SSID.

  • const String& getPassword() const Retrieves the stored WiFi password.

  • void setCredentials(const String& ssid, const String& password) Sets the WiFi credentials.

  • bool isCredentialsValid() Checks the validity of the stored WiFi credentials.

  • virtual bool store() override Stores the WiFi credentials to the specified file.

  • virtual bool restore() override Restores WiFi credentials from the specified file.

  • virtual bool clean() override Cleans the stored WiFi credentials.

Private Members:

  • String mSsid Stores the WiFi SSID (network name).

  • String mPassword Stores the WiFi password.

Type Definitions:

  • using SchedulerTaskCallback = std::function<void(SchedulerTask &, short)> Type alias for a callback function that takes a reference to a SchedulerTask and a short indicating remaining executions.

  • using spSchedulerTaskCallback = SharedPointer<SchedulerTaskCallback> Type alias for a shared pointer to a SchedulerTaskCallback.

CBORStorage