Refactor channel binding configuration and validation
- Introduced `NativeChannelConfig` and `SerialChannelConfig` functions to streamline the creation of `ChannelBindingConfig` instances. - Replaced manual channel configuration with macros `GATEWAY_CONFIGURE_NATIVE_CHANNEL` and `GATEWAY_CONFIGURE_SERIAL_CHANNEL` for better maintainability. - Updated `BuildChannelBindings` to utilize the new configuration functions, reducing redundancy. - Enhanced `ValidateChannelBindings` to check for required TX and RX GPIO pins for native channels. - Simplified `BindConfiguredChannels` to iterate over the built channel bindings, improving readability and reducing code duplication. - Adjusted the handling of reserved UART ports in `app_main` to dynamically include all serial channels. - Updated SDK configuration for channel 1 gateway ID and modified KNX-related configurations for enhanced functionality. - Removed obsolete NVS flash initialization code and replaced it with a more streamlined approach for managing runtime data. - Added a new command in `GatewayController` to publish gateway IDs when requested. - Defined a constant for maximum KNX instance count to improve clarity in the codebase. Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -72,8 +72,9 @@ inline constexpr uint8_t kReg1DaliProgramVersion[5] = {
|
||||
static_cast<uint8_t>(kReg1DaliApplicationNumber & 0xff),
|
||||
kReg1DaliApplicationVersion};
|
||||
|
||||
inline constexpr uint32_t kDaliMaxKnxInstanceCount = 16;
|
||||
inline constexpr uint32_t kReg1DaliSerialMacIncrement = 0;
|
||||
inline constexpr uint32_t kOamRouterSerialMacIncrement = 1;
|
||||
inline constexpr uint32_t kOamRouterSerialMacIncrement = kDaliMaxKnxInstanceCount;
|
||||
inline constexpr uint16_t kOamRouterDeviceDescriptor = 0x091A;
|
||||
inline constexpr uint16_t kOamRouterManufacturerId =
|
||||
static_cast<uint16_t>(CONFIG_GATEWAY_KNX_OAM_ROUTER_OEM_MANUFACTURER_ID);
|
||||
|
||||
Reference in New Issue
Block a user