You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by sr...@apache.org on 2022/07/15 15:44:11 UTC

[plc4x] branch develop updated: fix(cbus): relaxed the options parsing for labels

This is an automated email from the ASF dual-hosted git repository.

sruehl 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 84c732de6 fix(cbus): relaxed the options parsing for labels
84c732de6 is described below

commit 84c732de6190c51a7234c995db3422d7d960306c
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Jul 15 17:44:05 2022 +0200

    fix(cbus): relaxed the options parsing for labels
---
 .../test/java/org/apache/plc4x/java/cbus/RandomPackagesTest.java   | 6 +-----
 protocols/c-bus/src/main/resources/protocols/cbus/c-bus.mspec      | 7 ++++---
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/plc4j/drivers/c-bus/src/test/java/org/apache/plc4x/java/cbus/RandomPackagesTest.java b/plc4j/drivers/c-bus/src/test/java/org/apache/plc4x/java/cbus/RandomPackagesTest.java
index 499ff33ac..be9a3a202 100644
--- a/plc4j/drivers/c-bus/src/test/java/org/apache/plc4x/java/cbus/RandomPackagesTest.java
+++ b/plc4j/drivers/c-bus/src/test/java/org/apache/plc4x/java/cbus/RandomPackagesTest.java
@@ -630,7 +630,7 @@ public class RandomPackagesTest {
         // 2.9.6.4.4 Command Sequence
         @Nested
         class CommandSquence {
-            @Disabled("This seems to be a bad example... neither 08 for options nor 00 for language make any sense")
+
             @Test
             void StartDynamicIcon() throws Exception {
                 byte[] bytes = "\\053800A412080020\r".getBytes(StandardCharsets.UTF_8);
@@ -643,7 +643,6 @@ public class RandomPackagesTest {
                 assertMessageMatches(bytes, msg);
             }
 
-            @Disabled("This seems to be a bad example... neither 08 for options nor 00 for language make any sense")
             @Test
             void IconBitmap() throws Exception {
                 byte[] bytes = "\\053800A412080021\r".getBytes(StandardCharsets.UTF_8);
@@ -656,7 +655,6 @@ public class RandomPackagesTest {
                 assertMessageMatches(bytes, msg);
             }
 
-            @Disabled("This seems to be a bad example... neither 08 for options nor 00 for language make any sense")
             @Test
             void CompleteDynamicIcon() throws Exception {
                 byte[] bytes = "\\053800A412080022\r".getBytes(StandardCharsets.UTF_8);
@@ -672,7 +670,6 @@ public class RandomPackagesTest {
             @Nested
             class ChineseTable {
 
-                @Disabled("This seems to be a bad example... neither 08 for options nor 00 for language make any sense")
                 @Test
                 void StartDynamicIcon() throws Exception {
                     byte[] bytes = "\\053800A401080020\r".getBytes(StandardCharsets.UTF_8);
@@ -697,7 +694,6 @@ public class RandomPackagesTest {
                     assertMessageMatches(bytes, msg);
                 }
 
-                @Disabled("This seems to be a bad example... neither 08 for options nor 00 for language make any sense")
                 @Test
                 void AppendDynamicIcon() throws Exception {
                     byte[] bytes = "\\053800A401080021\r".getBytes(StandardCharsets.UTF_8);
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 651b7c10b..b07a44763 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
@@ -1326,12 +1326,12 @@
 ]
 
 [type LabelOptions
-    [reserved bit           'false'     ] // only for dynamic icon loading can switch to 1
+    [simple   bit           reservedBit7] // only for dynamic icon loading can switch to 1 (note this could use mspec reserved field but sadly this discards data)
     [simple   LabelFlavour  labelFlavour]
     [reserved bit           'false'     ]
-    [reserved bit           'false'     ] // For Lighting, this bit must be 0
+    [simple   bit           reservedBit4] // For Lighting, this bit must be 0 (note this could use mspec reserved field but sadly this discards data)
     [simple   LabelType     labelType   ]
-    [reserved bit           'false'     ] // For Lighting, this bit must be 0
+    [simple   bit           reservedBit0] // For Lighting, this bit must be 0 (note this could use mspec reserved field but sadly this discards data)
 ]
 
 [enum uint 2 LabelFlavour
@@ -1349,6 +1349,7 @@
 ]
 
 [enum uint 8 Language
+    ['0x00' NO_LANGUAGE                 ]
     ['0x01' ENGLISH                     ]
     ['0x02' ENGLISH_AUSTRALIA           ]
     ['0x03' ENGLISH_BELIZE              ]