Adding NVS to project

This commit is contained in:
2025-01-01 21:15:01 +01:00
parent dd9f59e418
commit 968d078c07
19 changed files with 812 additions and 28 deletions
@@ -0,0 +1,38 @@
/**
* @file nvsFunctions.hpp
* @author Gustice
* @brief NVS-Diagnosis utility
*
* @copyright Copyright (c) 2024
*/
#pragma once
#include <string>
class NvsApi {
public:
/// @brief Init and mount file system
/// @param mount rooted SubType of partition eg "nvs"
static void init(std::string mount = std::string{"nvs"});
/// @brief Get instance, ensure initialization
/// @param mount rooted SubType of partition eg "nvs"
/// @return Instance reference
static NvsApi &getInstance(std::string mount = std::string{"nvs"});
void setValue(const std::string &key, const std::string &value);
std::string getValue(const std::string &key);
// Disable move and assignment
NvsApi(NvsApi &other) = delete;
void operator=(const NvsApi &) = delete;
protected:
NvsApi(std::string mount);
~NvsApi();
private:
static NvsApi *_instance;
const std::string _mountingPoint;
};