Refactor KNX DALI Gateway Configuration and Update Device Parameters

- Introduced configuration macros for OEM manufacturer ID, application number, and application version in knxprod.h.
- Updated product identity definitions to use the new configuration macros.
- Modified device type enumeration to include additional device types.
- Adjusted color space enumeration values for consistency.
- Defined generated group object layout constants for memory offsets and block sizes.
- Enhanced knx_dali_gw.cpp to utilize the new configuration macros for manufacturer ID and program version.
- Updated the device initialization logic to reflect the new hardware and program version structures.
- Removed obsolete knx_dali_gw subproject and updated related submodules.

Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
Tony
2026-05-16 01:51:01 +08:00
parent 2a3808c1e4
commit e79223c87e
18 changed files with 699 additions and 780 deletions
@@ -1,10 +1,11 @@
#pragma once
// Internal header shared between gateway_knx.cpp and gateway_knx_router.cpp.
// Internal helpers and product identity shared by gateway_knx component sources.
#include "driver/uart.h"
#include "freertos/FreeRTOS.h"
#include "freertos/semphr.h"
#include "sdkconfig.h"
#include "soc/uart_periph.h"
#include <cstdint>
@@ -15,6 +16,46 @@ namespace knx_internal {
constexpr const char* kTag = "gateway_knx";
#ifndef CONFIG_GATEWAY_KNX_OEM_MANUFACTURER_ID
#define CONFIG_GATEWAY_KNX_OEM_MANUFACTURER_ID 0x00A4
#endif
#ifndef CONFIG_GATEWAY_KNX_OEM_APPLICATION_NUMBER
#define CONFIG_GATEWAY_KNX_OEM_APPLICATION_NUMBER 0x0001
#endif
#ifndef CONFIG_GATEWAY_KNX_OEM_APPLICATION_VERSION
#define CONFIG_GATEWAY_KNX_OEM_APPLICATION_VERSION 0x08
#endif
#ifndef CONFIG_GATEWAY_KNX_OEM_HARDWARE_ID
#define CONFIG_GATEWAY_KNX_OEM_HARDWARE_ID 0xA401
#endif
inline constexpr uint16_t kReg1DaliManufacturerId =
static_cast<uint16_t>(CONFIG_GATEWAY_KNX_OEM_MANUFACTURER_ID);
inline constexpr uint16_t kReg1DaliHardwareId =
static_cast<uint16_t>(CONFIG_GATEWAY_KNX_OEM_HARDWARE_ID);
inline constexpr uint16_t kReg1DaliApplicationNumber =
static_cast<uint16_t>(CONFIG_GATEWAY_KNX_OEM_APPLICATION_NUMBER);
inline constexpr uint8_t kReg1DaliApplicationVersion =
static_cast<uint8_t>(CONFIG_GATEWAY_KNX_OEM_APPLICATION_VERSION);
inline constexpr uint8_t kReg1DaliHardwareType[6] = {
0x00,
0x00,
static_cast<uint8_t>((kReg1DaliHardwareId >> 8) & 0xff),
static_cast<uint8_t>(kReg1DaliHardwareId & 0xff),
kReg1DaliApplicationVersion,
0x00};
inline constexpr uint8_t kReg1DaliOrderNumber[10] = {
'R', 'E', 'G', '1', '-', 'D', 'a', 'l', 'i', 0};
inline constexpr uint8_t kReg1DaliProgramVersion[5] = {
static_cast<uint8_t>((kReg1DaliManufacturerId >> 8) & 0xff),
static_cast<uint8_t>(kReg1DaliManufacturerId & 0xff),
static_cast<uint8_t>((kReg1DaliApplicationNumber >> 8) & 0xff),
static_cast<uint8_t>(kReg1DaliApplicationNumber & 0xff),
kReg1DaliApplicationVersion};
// RAII semaphore guard.
class SemaphoreGuard {
public: