feat: implement LittleFSHandler and FSGuard for improved file management

This commit is contained in:
GW_MC
2026-01-30 15:23:44 +08:00
parent b6c4477c46
commit 2a5088bec3
7 changed files with 821 additions and 85 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include "io/io.h"
#include "freertos/FreeRTOS.h"
#include "io/fs_handler.h"
#include "esp_wifi.h"
#include "freertos/event_groups.h"
@@ -13,7 +14,7 @@ public:
// this handler is used to store/retrieve WiFi credentials
// should have a unique namespace for WiFi credentials
// it will be owned by WifiHandler and deleted in its destructor
std::unique_ptr<KVStorageHandler> kvs
std::shared_ptr<LittleFSHandler> fs_handler_
);
~WifiHandler();
@@ -44,7 +45,7 @@ private:
void get_wifi_credentials(std::string& out_ssid, std::string& out_password);
bool initialized = false;
std::unique_ptr<KVStorageHandler> kvs = nullptr;
std::shared_ptr<LittleFSHandler> fs_handler_ = nullptr;
EventGroupHandle_t s_wifi_event_group = 0;
SemaphoreHandle_t scan_mutex = nullptr;
SemaphoreHandle_t connection_mutex = nullptr;