Add NVS storage handler and integrate with main application logic

This commit is contained in:
GW_MC
2026-01-18 14:46:25 +08:00
parent e458256193
commit d339a1f4c3
7 changed files with 135 additions and 2 deletions

View File

@@ -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;
};