Add cloud bridge and provisioning support for ESP32 gateway
- 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.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
#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_;
|
||||
};
|
||||
Reference in New Issue
Block a user