feat(gateway): add cloud integration for KNX and DALI with configurable transport options
Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -46,8 +46,27 @@ void GatewayKnxTpIpRouter::setOamIpSecureRoutingSequenceStoreHandler(
|
||||
routing_sequence_store_handler_ = std::move(handler);
|
||||
}
|
||||
|
||||
void GatewayKnxTpIpRouter::setCloudCemiPublisher(CloudCemiPublisher publisher) {
|
||||
cloud_cemi_publisher_ = std::move(publisher);
|
||||
}
|
||||
|
||||
const GatewayKnxConfig& GatewayKnxTpIpRouter::config() const { return config_; }
|
||||
|
||||
bool GatewayKnxTpIpRouter::injectCloudCemiFrame(const uint8_t* data, size_t len) {
|
||||
if (data == nullptr || len == 0 || !config_.oam_router.cloud_remote.enabled) {
|
||||
return false;
|
||||
}
|
||||
cloud_cemi_downlink_frames_.fetch_add(1, std::memory_order_relaxed);
|
||||
return handleOpenKnxTunnelFrame(data, len, nullptr, kServiceTunnellingRequest);
|
||||
}
|
||||
|
||||
GatewayKnxTpIpRouter::CloudCemiStats GatewayKnxTpIpRouter::cloudCemiStats() const {
|
||||
return CloudCemiStats{
|
||||
config_.oam_router.cloud_remote.enabled,
|
||||
cloud_cemi_uplink_frames_.load(std::memory_order_relaxed),
|
||||
cloud_cemi_downlink_frames_.load(std::memory_order_relaxed)};
|
||||
}
|
||||
|
||||
bool GatewayKnxTpIpRouter::tpUartOnline() const { return tp_uart_online_; }
|
||||
|
||||
bool GatewayKnxTpIpRouter::programmingMode() {
|
||||
@@ -328,6 +347,7 @@ esp_err_t GatewayKnxTpIpRouter::initializeRuntime() {
|
||||
return result;
|
||||
});
|
||||
ets_device_->setBusFrameSender([this](const uint8_t* data, size_t len) {
|
||||
publishCloudCemiFrame(data, len);
|
||||
sendTunnelIndication(data, len);
|
||||
sendRoutingIndication(data, len);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user