30a96c5125
feat(gateway_bacnet): add functions to clear BACnet objects and set their states feat(gateway_bridge): implement discovery inventory management and scanning functionality fix(gateway_bridge): update handleGet to support new inventory and effective model actions refactor(gateway_bridge): improve BACnet binding handling and reliability reporting Co-authored-by: Copilot <copilot@github.com>
60 lines
1.5 KiB
C++
60 lines
1.5 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "esp_err.h"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/task.h"
|
|
|
|
namespace gateway {
|
|
|
|
class DaliDomainService;
|
|
|
|
struct GatewayBridgeServiceConfig {
|
|
bool bridge_enabled{true};
|
|
bool modbus_enabled{true};
|
|
bool modbus_startup_enabled{false};
|
|
bool bacnet_enabled{false};
|
|
bool bacnet_startup_enabled{false};
|
|
bool cloud_enabled{true};
|
|
bool cloud_startup_enabled{false};
|
|
uint32_t modbus_task_stack_size{6144};
|
|
UBaseType_t modbus_task_priority{4};
|
|
uint32_t bacnet_task_stack_size{8192};
|
|
UBaseType_t bacnet_task_priority{5};
|
|
};
|
|
|
|
struct GatewayBridgeHttpResponse {
|
|
esp_err_t err{ESP_OK};
|
|
std::string body;
|
|
};
|
|
|
|
class GatewayBridgeService {
|
|
public:
|
|
GatewayBridgeService(DaliDomainService& dali_domain,
|
|
GatewayBridgeServiceConfig config = {});
|
|
~GatewayBridgeService();
|
|
|
|
esp_err_t start();
|
|
|
|
GatewayBridgeHttpResponse handleGet(const std::string& action, int gateway_id = -1,
|
|
const std::string& query = {});
|
|
GatewayBridgeHttpResponse handlePost(const std::string& action, int gateway_id,
|
|
const std::string& body);
|
|
|
|
private:
|
|
struct ChannelRuntime;
|
|
|
|
ChannelRuntime* findRuntime(uint8_t gateway_id);
|
|
const ChannelRuntime* findRuntime(uint8_t gateway_id) const;
|
|
|
|
DaliDomainService& dali_domain_;
|
|
GatewayBridgeServiceConfig config_;
|
|
std::vector<std::unique_ptr<ChannelRuntime>> runtimes_;
|
|
};
|
|
|
|
} // namespace gateway
|