feat(gateway_network): integrate GatewayBridgeService and add bridge handling
- Updated CMakeLists.txt to require gateway_bridge component. - Modified GatewayNetworkService to include a pointer to GatewayBridgeService. - Added new HTTP handlers for bridge GET and POST requests. - Implemented query utility functions for handling request parameters. - Enhanced response handling for bridge actions with JSON responses. Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string>
|
||||
@@ -75,6 +76,23 @@ struct DaliRawFrame {
|
||||
std::vector<uint8_t> data;
|
||||
};
|
||||
|
||||
enum class DaliDt8SceneColorMode {
|
||||
kDisabled,
|
||||
kColorTemperature,
|
||||
kRgb,
|
||||
};
|
||||
|
||||
struct DaliDomainSnapshot {
|
||||
uint8_t gateway_id{0};
|
||||
int address{0};
|
||||
std::string kind;
|
||||
std::map<std::string, bool> bools;
|
||||
std::map<std::string, int> ints;
|
||||
std::map<std::string, double> numbers;
|
||||
std::map<std::string, std::vector<int>> int_arrays;
|
||||
std::map<std::string, std::vector<double>> number_arrays;
|
||||
};
|
||||
|
||||
class DaliDomainService {
|
||||
public:
|
||||
DaliDomainService();
|
||||
@@ -97,6 +115,24 @@ class DaliDomainService {
|
||||
bool sendRaw(uint8_t gateway_id, uint8_t raw_addr, uint8_t command) const;
|
||||
bool sendExtRaw(uint8_t gateway_id, uint8_t raw_addr, uint8_t command) const;
|
||||
std::optional<uint8_t> queryRaw(uint8_t gateway_id, uint8_t raw_addr, uint8_t command) const;
|
||||
std::optional<DaliDomainSnapshot> discoverDeviceTypes(
|
||||
uint8_t gateway_id, int short_address, const std::vector<int>& fallback_types = {},
|
||||
int max_next_types = 16) const;
|
||||
std::optional<DaliDomainSnapshot> dt4Snapshot(uint8_t gateway_id, int short_address) const;
|
||||
std::optional<DaliDomainSnapshot> dt5Snapshot(uint8_t gateway_id, int short_address) const;
|
||||
std::optional<DaliDomainSnapshot> dt6Snapshot(uint8_t gateway_id, int short_address) const;
|
||||
std::optional<DaliDomainSnapshot> dt8SceneColorReport(uint8_t gateway_id, int short_address,
|
||||
int scene) const;
|
||||
std::optional<DaliDomainSnapshot> dt8PowerOnLevelColorReport(uint8_t gateway_id,
|
||||
int short_address) const;
|
||||
std::optional<DaliDomainSnapshot> dt8SystemFailureLevelColorReport(uint8_t gateway_id,
|
||||
int short_address) const;
|
||||
bool storeDt8SceneSnapshot(uint8_t gateway_id, int short_address, int scene, int brightness,
|
||||
DaliDt8SceneColorMode color_mode = DaliDt8SceneColorMode::kDisabled,
|
||||
int color_temperature = 0, int red = 0, int green = 0,
|
||||
int blue = 0) const;
|
||||
bool storeDt8PowerOnLevelSnapshot(uint8_t gateway_id, int short_address, int level) const;
|
||||
bool storeDt8SystemFailureLevelSnapshot(uint8_t gateway_id, int short_address, int level) const;
|
||||
bool setBright(uint8_t gateway_id, int short_address, int brightness) const;
|
||||
bool setColTempRaw(uint8_t gateway_id, int short_address, int mirek) const;
|
||||
bool setColTemp(uint8_t gateway_id, int short_address, int kelvin) const;
|
||||
|
||||
Reference in New Issue
Block a user