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

21
main/io/nvs_handler.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include "io/io.h"
#include "freertos/FreeRTOS.h"
#include "nvs.h"
class NVSStorageHandler : public KVStorageHandler {
public:
NVSStorageHandler() = default;
~NVSStorageHandler() override;
void init(const EventGroupHandle_t& system_event_group) override;
void put(const char*& key, const char*& value) override;
char* get(const char*& key) const override;
void remove(const char*& key) override;
private:
nvs_handle_t nvsHandle = 0;
};