Enhance DaliGatewayCache: add capabilities management for DALI devices

Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
Tony
2026-08-08 08:41:27 +08:00
parent 491b2ede4f
commit d8d0c39630
3 changed files with 56 additions and 3 deletions
+8
View File
@@ -83,6 +83,11 @@ struct DaliGatewayRuntimeStatus {
struct DaliGatewayAddressState {
bool groupMaskKnown{false};
uint16_t groupMask{0};
// Capability data is populated by discovery adapters and persisted with the
// rest of the address cache so bridge planners do not need a live bus scan
// on every boot.
std::optional<uint16_t> daliDeviceTypeMask;
std::optional<uint8_t> dt8ColorTypeFeatures;
std::array<std::optional<uint8_t>, 16> sceneLevels{};
DaliGatewaySettingsSnapshot settings;
DaliGatewayRuntimeStatus status;
@@ -143,6 +148,9 @@ class DaliGatewayCache {
void markAddressPresence(uint8_t channel, uint8_t shortAddress, DaliGatewayPresence presence);
bool setGroupMask(uint8_t channel, uint8_t shortAddress, std::optional<uint16_t> groupMask);
bool setCapabilities(uint8_t channel, uint8_t shortAddress,
std::optional<uint16_t> daliDeviceTypeMask,
std::optional<uint8_t> dt8ColorTypeFeatures);
bool setSceneLevel(uint8_t channel, uint8_t shortAddress, uint8_t scene,
std::optional<uint8_t> level);
bool setSettings(uint8_t channel, uint8_t shortAddress,