Add NVS storage handler and integrate with main application logic
This commit is contained in:
20
main/io/io.h
20
main/io/io.h
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/event_groups.h"
|
||||
|
||||
class KVStorageHandler {
|
||||
public:
|
||||
virtual ~KVStorageHandler() = default;
|
||||
|
||||
virtual void init(const EventGroupHandle_t& system_event_group) = 0;
|
||||
|
||||
// Store a key-value pair
|
||||
virtual void put(const char*& key, const char*& value) = 0;
|
||||
|
||||
// Retrieve a value by key, returns nullptr if key not found
|
||||
// The caller is responsible for freeing the returned memory
|
||||
virtual char* get(const char*& key) const = 0;
|
||||
|
||||
// Delete a key-value pair
|
||||
virtual void remove(const char*& key) = 0;
|
||||
};
|
||||
Reference in New Issue
Block a user