You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/03/01 10:35:27 UTC
[plc4x] branch develop updated: feat(protocol/c-bus): Fleshed out the SALData Header
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new a55c297 feat(protocol/c-bus): Fleshed out the SALData Header
a55c297 is described below
commit a55c2974946144a09c27941d5acedf08f3abcb81
Author: cdutz <ch...@c-ware.de>
AuthorDate: Tue Mar 1 11:35:07 2022 +0100
feat(protocol/c-bus): Fleshed out the SALData Header
---
.../src/main/resources/protocols/cbus/c-bus.mspec | 47 ++++++++++++++++++----
1 file changed, 40 insertions(+), 7 deletions(-)
diff --git a/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec b/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec
index 2a5f3b8..0e06b11 100644
--- a/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec
+++ b/protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec
@@ -223,21 +223,54 @@
]
[type SALData
- [simple CommandHeader commandHeader]
- [typeSwitch commandHeader.value
- ['0x01' SALDataOff
+ [simple SALCommandTypeContainer commandTypeContainer ]
+ [virtual SALCommandType commandType 'commandTypeContainer.commandType']
+ [typeSwitch commandType
+ ['OFF' SALDataOff
[simple byte group]
]
- ['0x79' SALDataOn
+ ['ON' SALDataOn
[simple byte group]
]
- ['0x0' SALDataRampToLevel
- [simple byte groupLevel]
+ ['RAMP_TO_LEVEL' SALDataRampToLevel
+ [simple byte group]
+ [simple byte level]
]
- ['0x09' SALDataTerminateRamp
+ ['TERMINATE_RAMP' SALDataTerminateRamp
[simple byte group]
]
]
+ // TODO: According to spec this could be recursive
+ //[optional SALData salData 'what decides if this is present?']
+]
+
+[enum uint 8 SALCommandTypeContainer(SALCommandType commandType)
+ ['0x01' SALCommandOff ['OFF' ]]
+ ['0x79' SALCommandOn ['ON' ]]
+ ['0x02' SALCommandRampToLevel_Instantaneous ['RAMP_TO_LEVEL' ]]
+ ['0x0A' SALCommandRampToLevel_4Second ['RAMP_TO_LEVEL' ]]
+ ['0x12' SALCommandRampToLevel_8Second ['RAMP_TO_LEVEL' ]]
+ ['0x1A' SALCommandRampToLevel_12Second ['RAMP_TO_LEVEL' ]]
+ ['0x22' SALCommandRampToLevel_20Second ['RAMP_TO_LEVEL' ]]
+ ['0x2A' SALCommandRampToLevel_30Second ['RAMP_TO_LEVEL' ]]
+ ['0x32' SALCommandRampToLevel_40Second ['RAMP_TO_LEVEL' ]]
+ ['0x3A' SALCommandRampToLevel_60Second ['RAMP_TO_LEVEL' ]]
+ ['0x42' SALCommandRampToLevel_90Second ['RAMP_TO_LEVEL' ]]
+ ['0x4A' SALCommandRampToLevel_120Second ['RAMP_TO_LEVEL' ]]
+ ['0x52' SALCommandRampToLevel_180Second ['RAMP_TO_LEVEL' ]]
+ ['0x5A' SALCommandRampToLevel_300Second ['RAMP_TO_LEVEL' ]]
+ ['0x62' SALCommandRampToLevel_420Second ['RAMP_TO_LEVEL' ]]
+ ['0x6A' SALCommandRampToLevel_600Second ['RAMP_TO_LEVEL' ]]
+ ['0x72' SALCommandRampToLevel_900Second ['RAMP_TO_LEVEL' ]]
+ ['0x7A' SALCommandRampToLevel_1020Second ['RAMP_TO_LEVEL' ]]
+ ['0x09' SALCommandTerminateRamp ['TERMINATE_RAMP']]
+]
+
+[enum uint 4 SALCommandType
+ ['0x00' OFF ]
+ ['0x01' ON ]
+ ['0x02' RAMP_TO_LEVEL ]
+ ['0x03' TERMINATE_RAMP]
]
[type CommandHeader