a8a82f9627
- Introduced DaliCloudBridge for MQTT communication with backend. - Added GatewayProvisioningStore for persisting cloud connection settings using NVS. - Updated CMakeLists.txt to include new source files. - Enhanced README.md with usage examples and configuration details.
28 lines
569 B
C++
28 lines
569 B
C++
#pragma once
|
|
|
|
#include "gateway_cloud.hpp"
|
|
|
|
#include <string>
|
|
|
|
#ifdef ESP_PLATFORM
|
|
extern "C" {
|
|
#include "esp_err.h"
|
|
}
|
|
#else
|
|
using esp_err_t = int;
|
|
#endif
|
|
|
|
// Stores/loads gateway cloud configuration using ESP-IDF NVS.
|
|
class GatewayProvisioningStore {
|
|
public:
|
|
explicit GatewayProvisioningStore(std::string nvsNamespace = "dali_cloud")
|
|
: nvsNamespace_(std::move(nvsNamespace)) {}
|
|
|
|
esp_err_t save(const GatewayCloudConfig& config) const;
|
|
esp_err_t load(GatewayCloudConfig* config) const;
|
|
esp_err_t clear() const;
|
|
|
|
private:
|
|
std::string nvsNamespace_;
|
|
};
|