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

CBORStorage

PreviousStorageNextCrashStorage

Last updated 4 months ago

The CBORStorage class extends the class to handle structured data using CBOR (Concise Binary Object Representation). This allows for efficient serialization and deserialization of complex data structures, making it suitable for storing configuration data and other structured information.

Constructor and Destructor:

  • CBORStorage(const String &path): Constructs a CBORStorage instance with a specified file path.

  • virtual ~CBORStorage(): Destructor that ensures proper cleanup.

Methods:

  • CBORObject &object(): Retrieves a reference to the internal CBOR object.

  • virtual bool store() override: Stores the CBOR data to the specified file.

  • virtual bool restore() override: Restores CBOR data from the specified file.

  • virtual bool clean() override: Cleans the CBOR data by resetting the CBOR object and removing the file.

Protected Members:

  • CBORObject mCbor: Instance of CBORObject used for managing structured CBOR data.

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.

Storage