449a3a801a
- 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>
56 lines
1.3 KiB
C++
56 lines
1.3 KiB
C++
#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
|