Add KNX DALI Gateway Module and Message Queue Implementation
- Introduced KnxDaliModule class for handling DALI message queuing, commissioning, and KNX group-object dispatch. - Implemented Message and MessageQueue classes for managing message operations. - Removed obsolete OpenKNX IDF component files and CMake configurations. - Updated submodule reference for KNX. Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
// =============================================================================
|
||||
// knx_dali_gw — KNX-to-DALI Gateway Component (ESP-IDF)
|
||||
// =============================================================================
|
||||
|
||||
#include "esp_idf_platform.h"
|
||||
|
||||
#include "dali_domain.hpp"
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Forward declarations.
|
||||
class Bau07B0;
|
||||
|
||||
namespace gateway {
|
||||
namespace knx_dali_gw {
|
||||
|
||||
struct KnxDaliGatewayConfig {
|
||||
std::string nvs_namespace{"knx_dali_gw"};
|
||||
uint16_t fallback_individual_address{0xfffe};
|
||||
int dali_channel{0};
|
||||
};
|
||||
|
||||
class KnxDaliGateway {
|
||||
public:
|
||||
explicit KnxDaliGateway(const KnxDaliGatewayConfig& config);
|
||||
~KnxDaliGateway();
|
||||
|
||||
KnxDaliGateway(const KnxDaliGateway&) = delete;
|
||||
KnxDaliGateway& operator=(const KnxDaliGateway&) = delete;
|
||||
|
||||
bool init();
|
||||
void loop();
|
||||
|
||||
Bau07B0& knxDevice();
|
||||
const Bau07B0& knxDevice() const;
|
||||
|
||||
void setNetworkInterface(esp_netif_t* netif);
|
||||
bool handleTunnelFrame(const uint8_t* data, size_t len);
|
||||
bool handleBusFrame(const uint8_t* data, size_t len);
|
||||
bool emitGroupValue(uint16_t group_object_number, const uint8_t* data,
|
||||
size_t len);
|
||||
|
||||
private:
|
||||
struct Impl;
|
||||
std::unique_ptr<Impl> impl_;
|
||||
};
|
||||
|
||||
} // namespace knx_dali_gw
|
||||
} // namespace gateway
|
||||
Reference in New Issue
Block a user