chrisdutz commented on a change in pull request #174:
URL: https://github.com/apache/plc4x/pull/174#discussion_r462148742



##########
File path: protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
##########
@@ -247,9 +247,9 @@
 ]
 
 [type 'ModbusPDUReadFileRecordResponseItem'
-    [implicit   uint 8     'dataLength'     '(COUNT(data) * 2) + 1']
+    [simple   uint 8     'dataLength']

Review comment:
       But if there is no 100% link between the dataLength and the length of 
the data ... we will be having trouble during the parsing of the messages.
   
   Do I understand this correctly, that if in the "data" part there are 3 short 
items then you want to set this to 3 instead of 6? If the problem is that you 
need to know the request in order to decode the response, you can treat the 
response as a raw byte-array payload and split things up in the driver. For S7 
I don't know how to decode the response unless I know the request ... same with 
the KNX protocol, where you even need to pull in some external data structures 
in order to know how to decode the payload ... It's not that uncommon.

##########
File path: protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
##########
@@ -247,9 +247,9 @@
 ]
 
 [type 'ModbusPDUReadFileRecordResponseItem'
-    [implicit   uint 8     'dataLength'     '(COUNT(data) * 2) + 1']
+    [simple   uint 8     'dataLength']

Review comment:
       Woudln't this exactly match my proposed: "(COUNT(data) + 1)"?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to