Commit Graph

20 Commits

Author SHA1 Message Date
Tony 555c2ec5bd Refactor GatewayController to integrate DaliGateway types
- Updated GatewayController to use DaliGateway types instead of GatewayCache types for channel flags, targets, and states.
- Modified methods to reflect changes in data structures, including flag checks and state management.
- Adjusted cache handling to utilize DaliGatewayCache for address and group management.
- Ensured compatibility with existing functionality while enhancing clarity and maintainability of the code.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-08-01 01:19:13 +08:00
Tony 886bda43a4 feat(gateway): integrate DALI controller and enhance network service
- Updated `CMakeLists.txt` to require `dali_cpp` for the gateway cache component.
- Enhanced `GatewayCache` class to include DALI state synchronization and management, including new methods for handling DALI address states, settings, and runtime statuses.
- Removed legacy application controller handling from `GatewayController`, simplifying the frame handling logic.
- Introduced `identify` method in `GatewayNetworkService` for Part 103 identity indication, along with task management for LED signaling.
- Added methods in `GatewaySettingsStore` and `GatewayRuntime` for managing application controller short addresses, improving configuration handling.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-07-29 06:05:27 +08:00
Tony 1e8bda56e0 feat: Add cache management and USB configuration support
- Implemented `setCacheEnabled` method in `GatewayCache` to enable/disable caching with state preservation.
- Added `setCacheEnabled` and `cacheEnabled` methods in `GatewayController` to manage cache settings.
- Enhanced `GatewayNetworkService` to include new JSON endpoints for getting and setting gateway settings, including cache and USB configurations.
- Introduced `GatewayUsbMode` enum and related methods for managing USB modes in `GatewayRuntime` and `GatewaySettingsStore`.
- Updated runtime configuration to persist USB mode and channel index.
- Added validation for configured channels in USB setup and Tridonic HID components to ensure proper channel usage.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-07-28 04:02:58 +08:00
Tony 2c96d6b097 feat: Add gateway group management and TCP control support
- Introduced gateway group functionality in GatewayController, allowing for grouping of gateways.
- Added methods to retrieve and set gateway groups for channels in GatewayRuntime and GatewaySettingsStore.
- Implemented TCP control task in GatewayNetworkService to handle control commands over TCP.
- Enhanced JSON handling for control frames, including discovery and configuration commands.
- Updated Ethernet configuration management to support new settings for gateway groups.
- Improved snapshot and reporting mechanisms to include gateway group information.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-06-27 02:16:57 +08:00
Tony c04fc6a856 feat: implement session management for 485 control bridge with enhanced command handling
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-06-27 01:35:35 +08:00
Tony fc4e9016cf Enhance Gateway Network and Runtime Functionality
- Added a check in GatewayNetworkService::handleDaliRawFrame to ensure raw reporting is enabled for the gateway before processing the frame.
- Extended the JSON snapshot in GatewayNetworkService::gatewaySnapshotJson to include additional operation-related fields for each channel, providing more detailed status information.
- Updated GatewayRuntime::classifyCommandPriority to include new opcodes (0x66 and 0x67) in the control command classification, improving command handling.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-06-13 20:13:33 +08:00
Tony be9ff9c2c9 feat: add KNX gateway snapshot and command transaction handling
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-06-13 01:47:36 +08:00
Tony dceede8602 feat: enhance gateway channel management with serial command handling and gateway ID updates
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-06-11 21:04:20 +08:00
Tony 6ffca719d9 feat: add application controller handling and DALI control device commands
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-06-11 18:46:32 +08:00
Tony 078c37a20f feat(gateway): enhance DALI and KNX handling with broadcast management support and configurable task stack size
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-27 21:06:58 +08:00
Tony 865bf8425a feat(gateway): enhance DALI host activity tracking and presence management
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-26 22:21:36 +08:00
Tony 0827befb06 feat(gateway_cache): enhance DALI state management and caching
- Increased flush interval to 10 seconds and added a refresh interval of 120 seconds in GatewayCacheConfig.
- Introduced a new boolean `stale` in GatewayCacheDaliRuntimeStatus to track stale states.
- Added methods for setting actual DALI levels and persisting DALI address states.
- Implemented functions to build and apply DALI state payloads, including handling scene levels.
- Enhanced the GatewayCache class to manage DALI states more effectively, including loading and persisting states.
- Updated GatewayController to support cache refresh operations, including handling cache commands and reporting cache status.
- Added mechanisms for periodic cache refresh based on idle time and configured intervals.

Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-21 15:34:26 +08:00
Tony 226855362b feat(gateway): integrate bridge service into gateway controller for transport handling
Signed-off-by: Tony <tonylu@tony-cloud.com>
2026-05-19 05:52:36 +08:00
Tony fa2eae87cf feat(gateway): enhance DALI command handling with mirroring and new target types 2026-05-02 03:19:02 +08:00
Tony 639fdd860e feat(gateway): implement reconciliation mechanism and command prioritization
- Introduced a reconciliation job structure to manage the reconciliation process for gateway channels.
- Added methods to schedule and run reconciliation steps, including group, scene, and settings reconciliation.
- Implemented a locking mechanism to ensure thread safety during reconciliation operations.
- Enhanced command handling in GatewayRuntime to classify commands by priority (control, normal, maintenance).
- Updated command enqueueing and processing to respect command priorities, ensuring maintenance commands are handled appropriately.
- Added configuration options for enabling/disabling cache functionality in GatewayRuntime.
- Improved logging to include cache status during runtime initialization.

Co-authored-by: Copilot <copilot@github.com>
2026-05-02 03:04:06 +08:00
Tony 70c39ea1e1 Refactor GatewayController to integrate GatewayCache
- Updated CMakeLists.txt to require gateway_cache component.
- Modified gateway_controller.hpp to include GatewayCache and adjust constructor.
- Removed internal scene and group management logic from GatewayController, delegating to GatewayCache.
- Simplified scene and group operations by utilizing GatewayCache methods for enabling, setting details, and deleting.
- Eliminated NVS storage handling code, as scene and group data is now managed by GatewayCache.
- Updated command handling methods to use cached data instead of internal structures.

Co-authored-by: Copilot <copilot@github.com>
2026-05-01 04:39:58 +08:00
Tony 2c1aa28d4f feat(gateway): implement serial communication handling in DaliDomainService and GatewayController
Co-authored-by: Copilot <copilot@github.com>
2026-05-01 01:59:32 +08:00
Tony ae4669e1b3 feat(gateway): add ESP-Touch smartconfig provisioning support and enhance network management
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 18:49:38 +08:00
Tony 3d8d00c3dd feat(gateway): enhance GatewayNetworkService with HTTP and UDP support, add status LED control
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 00:54:53 +08:00
Tony 4433fe97c7 feat(gateway): implement GatewayController and enhance GatewayRuntime
- Added GatewayController class to manage gateway operations, including command handling, scene and group management, and BLE state management.
- Introduced methods for scene and group storage, including loading, saving, and deleting scenes/groups.
- Enhanced GatewayRuntime with BLE management capabilities, including methods to check and set BLE state, and to generate BLE gateway names.
- Implemented utility functions for string normalization and CSV parsing.
- Added notification sinks for various events in the GatewayController.

Co-authored-by: Copilot <copilot@github.com>
2026-04-29 23:02:40 +08:00