Enhance bridge operation handling and improve JSON conversion

- Added new bridge operations to the bridgeOperationToString and bridgeOperationFromString functions for better command recognition.
- Implemented a fromCjson function to convert cJSON objects to DaliValue, supporting various data types including arrays and objects.
- Introduced isKnownBridgeRequestKey function to filter out unknown keys in bridge requests.
- Refactored handleDownlink to utilize the new fromCjson function for value and metadata extraction, improving code clarity and maintainability.
- Updated response creation to use a more structured approach with DaliValue's toJson method.

Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
Tony
2026-05-04 09:45:15 +08:00
parent fa4acef881
commit 1550ab15d6
6 changed files with 1062 additions and 276 deletions
+30
View File
@@ -57,6 +57,36 @@ enum class BridgeOperation {
startEmergencyFunctionTest = 18,
stopEmergencyTest = 19,
startEmergencyDurationTest = 20,
setColorTemperatureRaw = 21,
setColourXY = 22,
setColourRGB = 23,
setTemporaryColourTemperature = 24,
setTemporaryColourXY = 25,
setTemporaryRGBDimLevels = 26,
setTemporaryColourMask = 27,
activateTemporaryColour = 28,
copyReportToTemporary = 29,
storeDt8SceneSnapshot = 30,
storeDt8PowerOnLevelSnapshot = 31,
storeDt8SystemFailureLevelSnapshot = 32,
getDt1Snapshot = 33,
getDt4Snapshot = 34,
getDt5Snapshot = 35,
getDt6Snapshot = 36,
getDt8StatusSnapshot = 37,
getGroupMask = 38,
setGroupMask = 39,
getSceneLevel = 40,
setSceneLevel = 41,
removeSceneLevel = 42,
getSceneMap = 43,
getAddressSettings = 44,
setAddressSettings = 45,
searchAddressRange = 46,
allocateAllShortAddresses = 47,
resetAndAllocateShortAddresses = 48,
stopAddressAllocation = 49,
batch = 50,
};
enum class BridgeValueEncoding {