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 2020/03/17 16:35:46 UTC

[plc4x] 03/04: - Worked on the firmata tests

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

commit 9eaa746df69aed907256f00ae15d080d9fc61fbf
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Mar 17 17:35:06 2020 +0100

    - Worked on the firmata tests
---
 .../main/resources/protocols/firmata/firmata.mspec   | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec b/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec
index 0a522c7..6d57b6c 100644
--- a/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec
+++ b/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec
@@ -17,7 +17,7 @@
 // under the License.
 //
 
-[discriminatedType 'FirmataMessage'
+[discriminatedType 'FirmataMessage' [bit 'response']
     [discriminator uint 4 'messageType']
     [typeSwitch 'messageType'
         // Reading operations
@@ -51,16 +51,16 @@
 
         // Command
         ['0xF' FirmataMessageCommand
-            [simple FirmataCommand 'command']
+            [simple FirmataCommand 'command' ['response']]
         ]
     ]
 ]
 
-[discriminatedType 'FirmataCommand'
+[discriminatedType 'FirmataCommand' [bit 'response']
     [discriminator uint 4 'command']
     [typeSwitch 'command'
         ['0x0' FirmataCommandSysex
-            [simple SysexCommand 'command']
+            [simple SysexCommand 'command' ['response']]
             [reserved uint 8 '0xF7']
         ]
         ['0x4' FirmataCommandSetPinMode
@@ -81,13 +81,15 @@
     ]
 ]
 
-[discriminatedType 'SysexCommand'
+[discriminatedType 'SysexCommand' [bit 'response']
     [discriminator uint 8 'commandType']
-    [typeSwitch 'commandType'
+    [typeSwitch 'commandType','response'
         ['0x00' SysexCommandExendedId
             [array int 8 'id' count '2']
         ]
-        ['0x69' SysexCommandAnalogMappingQuery
+        ['0x69','false' SysexCommandAnalogMappingQueryRequest
+        ]
+        ['0x69','true' SysexCommandAnalogMappingQueryResponse
             [simple uint 8 'pin']
         ]
         ['0x6A' SysexCommandAnalogMappingResponse
@@ -108,7 +110,9 @@
         ]
         ['0x71' SysexCommandStringData
         ]
-        ['0x79' SysexCommandReportFirmware
+        ['0x79','false' SysexCommandReportFirmwareRequest
+        ]
+        ['0x79','true' SysexCommandReportFirmwareResponse
             [simple uint 8 'majorVersion']
             [simple uint 8 'minorVersion']
             [manualArray int 8 'fileName' terminated 'STATIC_CALL("org.apache.plc4x.java.firmata.readwrite.utils.FirmataUtils.isSysexEnd", io)' 'STATIC_CALL("org.apache.plc4x.java.firmata.readwrite.utils.FirmataUtils.parseSysexString", io)' 'STATIC_CALL("org.apache.plc4x.java.firmata.readwrite.utils.FirmataUtils.serializeSysexString", io, element)' 'STATIC_CALL("org.apache.plc4x.java.firmata.readwrite.utils.FirmataUtils.lengthSysexString", fileName)']