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 2021/10/22 12:34:35 UTC
[plc4x] branch feature/mspec-ng updated: fix(plc4j/codgen): migrate
the protocols
This is an automated email from the ASF dual-hosted git repository.
sruehl pushed a commit to branch feature/mspec-ng
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/feature/mspec-ng by this push:
new a17dda1 fix(plc4j/codgen): migrate the protocols
a17dda1 is described below
commit a17dda16699ca4cbd214df61bc4163e3b200ab01
Author: Sebastian Rühl <sr...@apache.org>
AuthorDate: Fri Oct 22 14:34:29 2021 +0200
fix(plc4j/codgen): migrate the protocols
---
.../resources/protocols/bacnetip/bacnetip.mspec | 68 +++++++++++-----------
.../src/main/resources/protocols/can/canopen.mspec | 54 ++++++++---------
.../eip/src/main/resources/protocols/eip/eip.mspec | 38 ++++++------
.../main/resources/protocols/firmata/firmata.mspec | 12 ++--
.../main/resources/protocols/can/genericcan.mspec | 4 +-
.../main/resources/protocols/modbus/modbus.mspec | 6 +-
.../resources/protocols/profinet/profinet.mspec | 16 ++---
.../s7/src/main/resources/protocols/s7/s7.mspec | 42 ++++++-------
.../resources/protocols/simulated/simulated.mspec | 4 +-
9 files changed, 122 insertions(+), 122 deletions(-)
diff --git a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
index eea1894..5115306 100644
--- a/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
+++ b/protocols/bacnetip/src/main/resources/protocols/bacnetip/bacnetip.mspec
@@ -30,10 +30,10 @@
]
['0x03' BVLCReadBroadcastDistributionTableAck
]
- ['0x04' BVLCForwardedNPDU [uint 16 'bvlcLength']
+ ['0x04' BVLCForwardedNPDU(uint 16 'bvlcLength')
[array uint 8 'ip' count '4' ]
[simple uint 16 'port' ]
- [simple NPDU 'npdu' ['bvlcLength - 10']]
+ [simple NPDU('bvlcLength - 10') 'npdu' ]
]
['0x05' BVLCRegisterForeignDevice
]
@@ -45,18 +45,18 @@
]
['0x09' BVLCDistributeBroadcastToNetwork
]
- ['0x0A' BVLCOriginalUnicastNPDU [uint 16 'bvlcLength']
- [simple NPDU 'npdu' ['bvlcLength - 4']]
+ ['0x0A' BVLCOriginalUnicastNPDU(uint 16 'bvlcLength')
+ [simple NPDU('bvlcLength - 4') 'npdu']
]
- ['0x0B' BVLCOriginalBroadcastNPDU [uint 16 'bvlcLength']
- [simple NPDU 'npdu' ['bvlcLength - 4']]
+ ['0x0B' BVLCOriginalBroadcastNPDU(uint 16 'bvlcLength')
+ [simple NPDU('bvlcLength - 4') 'npdu']
]
['0x0C' BVLCSecureBVLL
]
]
]
-[type 'NPDU' [uint 16 'npduLength']
+[type 'NPDU'(uint 16 'npduLength')
[simple uint 8 'protocolVersionNumber']
[simple bit 'messageTypeFieldPresent']
[reserved uint 1 '0']
@@ -72,27 +72,27 @@
[optional uint 8 'sourceLength' 'sourceSpecified']
[array uint 8 'sourceAddress' count 'sourceSpecified ? sourceLength : 0']
[optional uint 8 'hopCount' 'destinationSpecified']
- [optional NLM 'nlm' 'messageTypeFieldPresent' ['npduLength - (2 + (sourceSpecified ? 3 + sourceLength : 0) + (destinationSpecified ? 3 + destinationLength: 0) + ((destinationSpecified || sourceSpecified) ? 1 : 0))']]
- [optional APDU 'apdu' '!messageTypeFieldPresent' ['npduLength - (2 + (sourceSpecified ? 3 + sourceLength : 0) + (destinationSpecified ? 3 + destinationLength: 0) + ((destinationSpecified || sourceSpecified) ? 1 : 0))']]
+ [optional NLM('npduLength - (2 + (sourceSpecified ? 3 + sourceLength : 0) + (destinationSpecified ? 3 + destinationLength: 0) + ((destinationSpecified || sourceSpecified) ? 1 : 0))') 'nlm' 'messageTypeFieldPresent' ]
+ [optional APDU('npduLength - (2 + (sourceSpecified ? 3 + sourceLength : 0) + (destinationSpecified ? 3 + destinationLength: 0) + ((destinationSpecified || sourceSpecified) ? 1 : 0))') 'apdu' '!messageTypeFieldPresent' ]
]
-[discriminatedType 'NLM' [uint 16 'apduLength']
+[discriminatedType 'NLM'(uint 16 'apduLength')
[discriminator uint 8 'messageType']
[optional uint 16 'vendorId' '(messageType >= 128) && (messageType <= 255)']
[typeSwitch 'messageType'
- ['0x0' NLMWhoIsRouterToNetwork [uint 16 'apduLength', uint 8 'messageType']
+ ['0x0' NLMWhoIsRouterToNetwork(uint 16 'apduLength', uint 8 'messageType')
[array uint 16 'destinationNetworkAddress' length 'apduLength - (((messageType >= 128) && (messageType <= 255)) ? 3 : 1)']
]
- ['0x1' NLMIAmRouterToNetwork [uint 16 'apduLength', uint 8 'messageType']
+ ['0x1' NLMIAmRouterToNetwork(uint 16 'apduLength', uint 8 'messageType')
[array uint 16 'destinationNetworkAddress' length 'apduLength - (((messageType >= 128) && (messageType <= 255)) ? 3 : 1)']
]
]
]
-[discriminatedType 'APDU' [uint 16 'apduLength']
+[discriminatedType 'APDU'(uint 16 'apduLength')
[discriminator uint 4 'apduType']
[typeSwitch 'apduType'
- ['0x0' APDUConfirmedRequest [uint 16 'apduLength']
+ ['0x0' APDUConfirmedRequest(uint 16 'apduLength')
[simple bit 'segmentedMessage' ]
[simple bit 'moreFollows' ]
[simple bit 'segmentedResponseAccepted' ]
@@ -102,11 +102,11 @@
[simple uint 8 'invokeId' ]
[optional uint 8 'sequenceNumber' 'segmentedMessage']
[optional uint 8 'proposedWindowSize' 'segmentedMessage']
- [simple BACnetConfirmedServiceRequest 'serviceRequest' ['apduLength - (3 + (segmentedMessage ? 2 : 0))']]
+ [simple BACnetConfirmedServiceRequest('apduLength - (3 + (segmentedMessage ? 2 : 0))') 'serviceRequest']
]
- ['0x1' APDUUnconfirmedRequest [uint 16 'apduLength']
+ ['0x1' APDUUnconfirmedRequest(uint 16 'apduLength')
[reserved uint 4 '0' ]
- [simple BACnetUnconfirmedServiceRequest 'serviceRequest' ['apduLength - 1']]
+ [simple BACnetUnconfirmedServiceRequest('apduLength - 1') 'serviceRequest']
]
['0x2' APDUSimpleAck
[reserved uint 4 '0' ]
@@ -149,12 +149,12 @@
]
]
-[discriminatedType 'BACnetConfirmedServiceRequest' [uint 16 'len']
+[discriminatedType 'BACnetConfirmedServiceRequest'(uint 16 'len')
[discriminator uint 8 'serviceChoice']
[typeSwitch 'serviceChoice'
['0x00' BACnetConfirmedServiceRequestAcknowledgeAlarm
]
- ['0x01' BACnetConfirmedServiceRequestConfirmedCOVNotification [uint 16 'len']
+ ['0x01' BACnetConfirmedServiceRequestConfirmedCOVNotification(uint 16 'len')
[const uint 8 'subscriberProcessIdentifierHeader' '0x09' ]
[simple uint 8 'subscriberProcessIdentifier' ]
[const uint 8 'monitoredObjectIdentifierHeader' '0x1C' ]
@@ -212,7 +212,7 @@
]
['0x0E' BACnetConfirmedServiceRequestReadPropertyMultiple
]
- ['0x0F' BACnetConfirmedServiceRequestWriteProperty [uint 16 'len']
+ ['0x0F' BACnetConfirmedServiceRequestWriteProperty(uint 16 'len')
[const uint 8 'objectIdentifierHeader' '0x0C' ]
[simple uint 10 'objectType' ]
[simple uint 22 'objectInstanceNumber' ]
@@ -267,7 +267,7 @@
]
]
-[discriminatedType 'BACnetUnconfirmedServiceRequest' [uint 16 'len']
+[discriminatedType 'BACnetUnconfirmedServiceRequest'(uint 16 'len')
[discriminator uint 8 'serviceChoice']
[typeSwitch 'serviceChoice'
['0x00' BACnetUnconfirmedServiceRequestIAm
@@ -288,7 +288,7 @@
]
['0x03' BACnetUnconfirmedServiceRequestUnconfirmedEventNotification
]
- ['0x04' BACnetUnconfirmedServiceRequestUnconfirmedPrivateTransfer [uint 16 'len']
+ ['0x04' BACnetUnconfirmedServiceRequestUnconfirmedPrivateTransfer(uint 16 'len')
[const uint 8 'vendorIdHeader' '0x09']
[simple uint 8 'vendorId']
[const uint 8 'serviceNumberHeader' '0x1A']
@@ -302,10 +302,10 @@
['0x06' BACnetUnconfirmedServiceRequestTimeSynchronization
]
['0x07' BACnetUnconfirmedServiceRequestWhoHas
- [optional BACnetComplexTagUnsignedInteger ['0', 'BACnetDataType.UNSIGNED_INTEGER' ] 'deviceInstanceRangeLowLimit' ]
- [optional BACnetComplexTagUnsignedInteger ['1', 'BACnetDataType.UNSIGNED_INTEGER' ] 'deviceInstanceRangeHighLimit' 'deviceInstanceRangeLowLimit != null' ]
- [optional BACnetComplexTagOctetString ['2', 'BACnetDataType.OCTET_STRING' ] 'objectIdentifier' ]
- [optional BACnetComplexTagOctetString ['3', 'BACnetDataType.OCTET_STRING' ] 'objectName' 'objectIdentifier == null' ]
+ [optional BACnetComplexTagUnsignedInteger('0', 'BACnetDataType.UNSIGNED_INTEGER') 'deviceInstanceRangeLowLimit' ]
+ [optional BACnetComplexTagUnsignedInteger('1', 'BACnetDataType.UNSIGNED_INTEGER') 'deviceInstanceRangeHighLimit' 'deviceInstanceRangeLowLimit != null' ]
+ [optional BACnetComplexTagOctetString('2', 'BACnetDataType.OCTET_STRING') 'objectIdentifier' ]
+ [optional BACnetComplexTagOctetString('3', 'BACnetDataType.OCTET_STRING') 'objectName' 'objectIdentifier == null' ]
]
['0x08' BACnetUnconfirmedServiceRequestWhoIs
// TODO: here we need proper bacnet tags (like a discriminator etc... see line 494 BACnetTag)
@@ -325,7 +325,7 @@
]
]
-[discriminatedType 'BACnetComplexTag' [uint 4 'tagNumberArgument', BACnetDataType 'dataType']
+[discriminatedType 'BACnetComplexTag'(uint 4 'tagNumberArgument', BACnetDataType 'dataType')
[assert uint 4 'tagNumber' 'tagNumberArgument' ]
[const TagClass 'tagClass' 'TagClass.CONTEXT_SPECIFIC_TAGS' ]
[simple uint 3 'lengthValueType' ]
@@ -341,30 +341,30 @@
]
['BOOLEAN' BACnetComplexTagBoolean
]
- ['UNSIGNED_INTEGER' BACnetComplexTagUnsignedInteger [uint 3 'lengthValueType', uint 8 'extLength']
+ ['UNSIGNED_INTEGER' BACnetComplexTagUnsignedInteger(uint 3 'lengthValueType', uint 8 'extLength')
[array int 8 'data' length '(lengthValueType == 5) ? extLength : lengthValueType']
]
- ['SIGNED_INTEGER' BACnetComplexTagSignedInteger [uint 3 'lengthValueType', uint 8 'extLength']
+ ['SIGNED_INTEGER' BACnetComplexTagSignedInteger(uint 3 'lengthValueType', uint 8 'extLength')
[array int 8 'data' length '(lengthValueType == 5) ? extLength : lengthValueType']
]
- ['REAL' BACnetComplexTagReal [uint 3 'lengthValueType', uint 8 'extLength']
+ ['REAL' BACnetComplexTagReal(uint 3 'lengthValueType', uint 8 'extLength')
[simple float 32 'value']
]
- ['DOUBLE' BACnetComplexTagDouble [uint 3 'lengthValueType', uint 8 'extLength']
+ ['DOUBLE' BACnetComplexTagDouble(uint 3 'lengthValueType', uint 8 'extLength')
[simple float 64 'value']
]
- ['OCTET_STRING' BACnetComplexTagOctetString [uint 32 'actualLength']
+ ['OCTET_STRING' BACnetComplexTagOctetString(uint 32 'actualLength')
// TODO: The reader expects int but uint32 get's mapped to long so even uint32 would easily overflow...
[virtual uint 16 'actualLengthInBit' 'actualLength * 8']
[simple vstring 'actualLengthInBit' 'theString' encoding='ASCII']
]
['CHARACTER_STRING' BACnetComplexTagCharacterString
]
- ['BIT_STRING' BACnetComplexTagBitString [uint 3 'lengthValueType', uint 8 'extLength']
+ ['BIT_STRING' BACnetComplexTagBitString(uint 3 'lengthValueType', uint 8 'extLength')
[simple uint 8 'unusedBits']
[array int 8 'data' length '(lengthValueType == 5) ? (extLength - 1) : (lengthValueType - 1)']
]
- ['ENUMERATED' BACnetComplexTagEnumerated [uint 3 'lengthValueType', uint 8 'extLength']
+ ['ENUMERATED' BACnetComplexTagEnumerated(uint 3 'lengthValueType', uint 8 'extLength')
[array int 8 'data' length '(lengthValueType == 5) ? extLength : lengthValueType']
]
['DATE' BACnetComplexTagDate
diff --git a/protocols/canopen/src/main/resources/protocols/can/canopen.mspec b/protocols/canopen/src/main/resources/protocols/can/canopen.mspec
index 1f0bfab..786b858 100644
--- a/protocols/canopen/src/main/resources/protocols/can/canopen.mspec
+++ b/protocols/canopen/src/main/resources/protocols/can/canopen.mspec
@@ -17,22 +17,22 @@
* under the License.
*/
-[enum uint 4 'CANOpenService' [uint 8 'min', uint 8 'max', bit 'pdo']
- ['0b0000' NMT ['0', '0' , 'false' ] ]
- ['0b0001' SYNC ['0x80', '0x80' , 'false' ] ]
- ['0b0001' EMCY ['0x81', '0xFF' , 'false' ] ]
- ['0b0010' TIME ['0x100', '0x100', 'false' ] ]
- ['0b0011' TRANSMIT_PDO_1 ['0x180', '0x1FF', 'true' ] ]
- ['0b0100' RECEIVE_PDO_1 ['0x200', '0x27F', 'true' ] ]
- ['0b0101' TRANSMIT_PDO_2 ['0x280', '0x2FF', 'true' ] ]
- ['0b0110' RECEIVE_PDO_2 ['0x300', '0x37F', 'true' ] ]
- ['0b0111' TRANSMIT_PDO_3 ['0x380', '0x3FF', 'true' ] ]
- ['0b1000' RECEIVE_PDO_3 ['0x400', '0x47F', 'true' ] ]
- ['0b1001' TRANSMIT_PDO_4 ['0x480', '0x4FF', 'true' ] ]
- ['0b1010' RECEIVE_PDO_4 ['0x500', '0x57F', 'true' ] ]
- ['0b1011' TRANSMIT_SDO ['0x580', '0x5FF', 'false' ] ]
- ['0b1100' RECEIVE_SDO ['0x600', '0x67F', 'false' ] ]
- ['0b1110' HEARTBEAT ['0x700', '0x77F', 'false' ] ]
+[enum uint 4 'CANOpenService'(uint 8 'min', uint 8 'max', bit 'pdo')
+ ['0b0000' NMT ('0', '0' , 'false') ]
+ ['0b0001' SYNC ('0x80', '0x80' , 'false') ]
+ ['0b0001' EMCY ('0x81', '0xFF' , 'false') ]
+ ['0b0010' TIME ('0x100', '0x100', 'false') ]
+ ['0b0011' TRANSMIT_PDO_1 ('0x180', '0x1FF', 'true' ) ]
+ ['0b0100' RECEIVE_PDO_1 ('0x200', '0x27F', 'true' ) ]
+ ['0b0101' TRANSMIT_PDO_2 ('0x280', '0x2FF', 'true' ) ]
+ ['0b0110' RECEIVE_PDO_2 ('0x300', '0x37F', 'true' ) ]
+ ['0b0111' TRANSMIT_PDO_3 ('0x380', '0x3FF', 'true' ) ]
+ ['0b1000' RECEIVE_PDO_3 ('0x400', '0x47F', 'true' ) ]
+ ['0b1001' TRANSMIT_PDO_4 ('0x480', '0x4FF', 'true' ) ]
+ ['0b1010' RECEIVE_PDO_4 ('0x500', '0x57F', 'true' ) ]
+ ['0b1011' TRANSMIT_SDO ('0x580', '0x5FF', 'false') ]
+ ['0b1100' RECEIVE_SDO ('0x600', '0x67F', 'false') ]
+ ['0b1110' HEARTBEAT ('0x700', '0x77F', 'false') ]
]
[enum uint 8 'NMTStateRequest'
@@ -50,7 +50,7 @@
['0x7f' PRE_OPERATIONAL]
]
-[discriminatedType 'CANOpenPayload' [CANOpenService 'service']
+[discriminatedType 'CANOpenPayload'(CANOpenService 'service')
[typeSwitch 'service'
['NMT' CANOpenNetworkPayload
[enum NMTStateRequest 'request']
@@ -61,36 +61,36 @@
[simple CANOpenTime 'timeOfDay']
]
['RECEIVE_PDO_1' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['1', 'true']]
+ [simple CANOpenPDO('1', 'true') 'pdo']
]
['TRANSMIT_PDO_1' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['1', 'false']]
+ [simple CANOpenPDO('1', 'false') 'pdo']
]
['RECEIVE_PDO_2' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['2', 'true']]
+ [simple CANOpenPDO('2', 'true') 'pdo']
]
['TRANSMIT_PDO_2' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['1', 'false']]
+ [simple CANOpenPDO('1', 'false') 'pdo']
]
['RECEIVE_PDO_3' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['3', 'true']]
+ [simple CANOpenPDO('3', 'true') 'pdo']
]
['TRANSMIT_PDO_3' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['1', 'false']]
+ [simple CANOpenPDO('1', 'false') 'pdo']
]
['RECEIVE_PDO_4' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['4', 'true']]
+ [simple CANOpenPDO('4', 'true') 'pdo']
]
['TRANSMIT_PDO_4' CANOpenPDOPayload
- [simple CANOpenPDO 'pdo' ['1', 'false']]
+ [simple CANOpenPDO('1', 'false') 'pdo']
]
['RECEIVE_SDO' CANOpenSDORequest
[enum SDORequestCommand 'command']
- [simple SDORequest 'request' ['command']]
+ [simple SDORequest('command') 'request']
]
['TRANSMIT_SDO' CANOpenSDOResponse
[enum SDOResponseCommand 'command']
- [simple SDOResponse 'response' ['command']]
+ [simple SDOResponse('command') 'response']
]
['HEARTBEAT' CANOpenHeartbeatPayload
[enum NMTState 'state']
diff --git a/protocols/eip/src/main/resources/protocols/eip/eip.mspec b/protocols/eip/src/main/resources/protocols/eip/eip.mspec
index 92bcb90..1b8ac5a 100644
--- a/protocols/eip/src/main/resources/protocols/eip/eip.mspec
+++ b/protocols/eip/src/main/resources/protocols/eip/eip.mspec
@@ -35,7 +35,7 @@
]
['0x0066' EipDisconnectRequest
]
- ['0x006F' CipRRData [uint 16 'len']
+ ['0x006F' CipRRData(uint 16 'len')
[reserved uint 32 '0x00000000']
[reserved uint 16 '0x0000']
[simple CipExchange 'exchange' ['len-6']]
@@ -50,7 +50,7 @@
[simple CipService 'service' ['exchangeLen - 10'] ]
]
-[discriminatedType 'CipService' [uint 16 'serviceLen']
+[discriminatedType 'CipService'(uint 16 'serviceLen')
[discriminator uint 8 'service']
[typeSwitch 'service'
['0x4C' CipReadRequest
@@ -58,7 +58,7 @@
[array int 8 'tag' length '(RequestPathSize*2)']
[simple uint 16 'elementNb']
]
- ['0xCC' CipReadResponse [uint 16 'serviceLen']
+ ['0xCC' CipReadResponse(uint 16 'serviceLen')
[reserved uint 8 '0x00']
[simple uint 8 'status']
[simple uint 8 'extStatus']
@@ -77,12 +77,12 @@
[simple uint 8 'status']
[simple uint 8 'extStatus']
]
- ['0x0A' MultipleServiceRequest [uint 16 'serviceLen']
+ ['0x0A' MultipleServiceRequest(uint 16 'serviceLen')
[const int 8 'RequestPathSize' '0x02']
[const uint 32 'RequestPath' '0x01240220'] //Logical Segment: Class(0x20) 0x02, Instance(0x24) 01 (Message Router)
- [simple Services 'data' ['serviceLen - 6 '] ]
+ [simple Services('serviceLen - 6 ') 'data' ]
]
- ['0x8A' MultipleServiceResponse [uint 16 'serviceLen']
+ ['0x8A' MultipleServiceResponse(uint 16 'serviceLen')
[reserved uint 8 '0x0']
[simple uint 8 'status']
[simple uint 8 'extStatus']
@@ -98,7 +98,7 @@
[reserved uint 8 '0x01'] // setRequestPathInstance
[reserved uint 16 '0x9D05'] //Timeout 5s
[implicit uint 16 'messageSize' 'lengthInBytes - 10 - 4'] //subtract above and routing
- [simple CipService 'unconnectedService' ['messageSize'] ]
+ [simple CipService('messageSize') 'unconnectedService' ]
[const uint 16 'route' '0x0001']
[simple int 8 'backPlane']
[simple int 8 'slot']
@@ -112,19 +112,19 @@
[array CipService 'services' count 'serviceNb' ['servicesLen/serviceNb'] ]
]
-[enum uint 16 'CIPDataTypeCode' [uint 8 'size']
- ['0X00C1' BOOL ['1']]
- ['0X00C2' SINT ['1']]
- ['0X00C3' INT ['2']]
- ['0X00C4' DINT ['4']]
- ['0X00C5' LINT ['8']]
- ['0X00CA' REAL ['4']]
- ['0X00D3' DWORD ['4']]
- ['0X02A0' STRUCTURED ['88']]
- ['0X02A0' STRING ['88']]
- ['0X02A0' STRING36 ['40']]
+[enum uint 16 'CIPDataTypeCode'(uint 8 'size')
+ ['0X00C1' BOOL ('1')]
+ ['0X00C2' SINT ('1')]
+ ['0X00C3' INT ('2')]
+ ['0X00C4' DINT ('4')]
+ ['0X00C5' LINT ('8')]
+ ['0X00CA' REAL ('4')]
+ ['0X00D3' DWORD ('4')]
+ ['0X02A0' STRUCTURED ('88')]
+ ['0X02A0' STRING ('88')]
+ ['0X02A0' STRING36 ('40')]
//TODO: -1 is not a valid value for uint
- //['-1' UNKNOWN ['-1']]
+ //['-1' UNKNOWN ('-1')]
]
[enum uint 16 'EiPCommand'
diff --git a/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec b/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec
index d20d3f4..d2ea88f 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' byteOrder='"BIG_ENDIAN"' [bit 'response']
+[discriminatedType 'FirmataMessage' byteOrder='"BIG_ENDIAN"'(bit 'response')
[discriminator uint 4 'messageType']
[typeSwitch 'messageType'
// Reading operations
@@ -50,17 +50,17 @@
]
// Command
- ['0xF' FirmataMessageCommand [bit 'response']
- [simple FirmataCommand 'command' ['response']]
+ ['0xF' FirmataMessageCommand(bit 'response')
+ [simple FirmataCommand('response') 'command']
]
]
]
-[discriminatedType 'FirmataCommand' [bit 'response']
+[discriminatedType 'FirmataCommand'(bit 'response')
[discriminator uint 4 'commandCode']
[typeSwitch 'commandCode'
['0x0' FirmataCommandSysex [bit 'response']
- [simple SysexCommand 'command' ['response']]
+ [simple SysexCommand('response') 'command']
[reserved uint 8 '0xF7']
]
['0x4' FirmataCommandSetPinMode
@@ -81,7 +81,7 @@
]
]
-[discriminatedType 'SysexCommand' [bit 'response']
+[discriminatedType 'SysexCommand'(bit 'response')
[discriminator uint 8 'commandType']
[typeSwitch 'commandType','response'
['0x00' SysexCommandExendedId
diff --git a/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec b/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec
index 60f1b03..949d489 100644
--- a/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec
+++ b/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec
@@ -17,7 +17,7 @@
* under the License.
*/
-[enum 'GenericCANDataType' [uint 8 'numBits']
+[enum 'GenericCANDataType' (uint 8 'numBits')
[BYTE [ '8'] ]
[BOOLEAN [ '1'] ]
[UNSIGNED8 [ '8'] ]
@@ -40,7 +40,7 @@
[REAL64 ['64'] ]
]
-[dataIo 'DataItem' byteOrder='"LITTLE_ENDIAN"' [GenericCANDataType 'dataType']
+[dataIo 'DataItem' byteOrder='"LITTLE_ENDIAN"' (GenericCANDataType 'dataType')
[typeSwitch 'dataType'
['BYTE' BYTE
[simple byte 'value']
diff --git a/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec b/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
index 750dc76..c697f70 100644
--- a/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
+++ b/protocols/modbus/src/main/resources/protocols/modbus/modbus.mspec
@@ -23,7 +23,7 @@
[const uint 16 'modbusTcpDefaultPort' '502']
]
-[type 'ModbusTcpADU' byteOrder='"BIG_ENDIAN"' [bit 'response']
+[type 'ModbusTcpADU' byteOrder='"BIG_ENDIAN"' (bit 'response')
// It is used for transaction pairing, the MODBUS server copies in the response the transaction
// identifier of the request.
[simple uint 16 'transactionIdentifier']
@@ -45,7 +45,7 @@
[simple ModbusPDU 'pdu' ['response']]
]
-[type 'ModbusSerialADU' byteOrder='"LITTLE_ENDIAN"' [bit 'response']
+[type 'ModbusSerialADU' byteOrder='"LITTLE_ENDIAN"' (bit 'response')
[simple uint 16 'transactionId']
[reserved uint 16 '0x0000']
[simple uint 16 'length']
@@ -55,7 +55,7 @@
[simple ModbusPDU 'pdu' ['response']]
]
-[discriminatedType 'ModbusPDU' [bit 'response']
+[discriminatedType 'ModbusPDU' (bit 'response')
[discriminator bit 'errorFlag']
[discriminator uint 7 'functionFlag']
[typeSwitch 'errorFlag','functionFlag','response'
diff --git a/protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec b/protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec
index d4f49ea..11f64f0 100644
--- a/protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec
+++ b/protocols/profinet/src/main/resources/protocols/profinet/profinet.mspec
@@ -284,12 +284,12 @@
// 1) One containing only an AllSelectorBlock
// 2) One containing optionally either NameOfStationBlock or AliasNameBlock and another optional IdentifyReqBlock
// (I assume, that if in case 2 both optionally aren't used, this might not be valid and option 1 should be sent instead)
- ['DCP_Identify_ReqPDU','IDENTIFY','false' PnDcp_Pdu_IdentifyReq [uint 16 'dcpDataLength']
+ ['DCP_Identify_ReqPDU','IDENTIFY','false' PnDcp_Pdu_IdentifyReq(uint 16 'dcpDataLength')
[array PnDcp_Block 'blocks' length 'dcpDataLength' ]
]
// Response to a Identify request
- ['DCP_Identify_ResPDU','IDENTIFY','true' PnDcp_Pdu_IdentifyRes [uint 16 'dcpDataLength']
+ ['DCP_Identify_ResPDU','IDENTIFY','true' PnDcp_Pdu_IdentifyRes(uint 16 'dcpDataLength')
[array PnDcp_Block 'blocks' length 'dcpDataLength' ]
]
@@ -365,13 +365,13 @@
// DEVICE_PROPERTIES_OPTION
////////////////////////////////////////////////////////////////////////////
- ['DEVICE_PROPERTIES_OPTION','1' PnDcp_Block_DevicePropertiesDeviceVendor [uint 16 'blockLength']
+ ['DEVICE_PROPERTIES_OPTION','1' PnDcp_Block_DevicePropertiesDeviceVendor(uint 16 'blockLength')
[reserved uint 16 '0x0000' ]
// TODO: Figure out how to do this correctly.
[array byte 'deviceVendorValue' count 'blockLength-2' ]
[padding uint 8 'pad' '0x00' 'STATIC_CALL("org.apache.plc4x.java.profinet.utils.StaticHelper.arrayLength", deviceVendorValue) % 2']
]
- ['DEVICE_PROPERTIES_OPTION','2' PnDcp_Block_DevicePropertiesNameOfStation [uint 16 'blockLength']
+ ['DEVICE_PROPERTIES_OPTION','2' PnDcp_Block_DevicePropertiesNameOfStation(uint 16 'blockLength')
[reserved uint 16 '0x0000' ]
// TODO: Figure out how to do this correctly.
[array byte 'nameOfStation' count 'blockLength-2' ]
@@ -391,11 +391,11 @@
[reserved uint 8 '0x00' ]
]
// Contains a list of option combinations the device supports.
- ['DEVICE_PROPERTIES_OPTION','5' PnDcp_Block_DevicePropertiesDeviceOptions [uint 16 'blockLength']
+ ['DEVICE_PROPERTIES_OPTION','5' PnDcp_Block_DevicePropertiesDeviceOptions(uint 16 'blockLength')
[reserved uint 16 '0x0000' ]
[array PnDcp_SupportedDeviceOption 'supportedOptions' length 'blockLength - 2' ]
]
- ['DEVICE_PROPERTIES_OPTION','6' PnDcp_Block_DevicePropertiesAliasName [uint 16 'blockLength']
+ ['DEVICE_PROPERTIES_OPTION','6' PnDcp_Block_DevicePropertiesAliasName(uint 16 'blockLength')
[reserved uint 16 '0x0000' ]
[array byte 'aliasNameValue' count 'blockLength-2' ]
[padding uint 8 'pad' '0x00' 'STATIC_CALL("org.apache.plc4x.java.profinet.utils.StaticHelper.arrayLength", aliasNameValue) % 2']
@@ -566,10 +566,10 @@
// TODO: Check if it's really Little Endian
// 5.1.2
// 5.5.2.2
-[discriminatedType 'PnIoCm_Packet' [DceRpc_PacketType 'packetType']
+[discriminatedType 'PnIoCm_Packet'(DceRpc_PacketType 'packetType')
[typeSwitch 'packetType'
['REQUEST' PnIoCm_Packet_Req
- [simple uint 32 'argsMaximum' ]
+ [simple uint 32 'argsMaximum' ]
]
['RESPONSE' PnIoCm_Packet_Res
[simple uint 8 'errorCode2' ]
diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec
index e478bb2..caa1a61 100644
--- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec
+++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec
@@ -32,7 +32,7 @@
// COTP
////////////////////////////////////////////////////////////////
-[discriminatedType 'COTPPacket' [uint 16 'cotpLen']
+[discriminatedType 'COTPPacket' (uint 16 'cotpLen')
[implicit uint 8 'headerLength' 'lengthInBytes - (((payload != null) ? payload.lengthInBytes : 0) + 1)']
[discriminator uint 8 'tpduCode']
[typeSwitch 'tpduCode'
@@ -64,11 +64,11 @@
[simple uint 8 'rejectCause']
]
]
- [array COTPParameter ['(headerLength + 1) - curPos'] 'parameters' length '(headerLength + 1) - curPos']
+ [array COTPParameter ('(headerLength + 1) - curPos') 'parameters' length '(headerLength + 1) - curPos']
[optional S7Message 'payload' 'curPos < cotpLen']
]
-[discriminatedType 'COTPParameter' [uint 8 'rest']
+[discriminatedType 'COTPParameter' (uint 8 'rest')
[discriminator uint 8 'parameterType']
[implicit uint 8 'parameterLength' 'lengthInBytes - 2']
[typeSwitch 'parameterType'
@@ -115,14 +115,14 @@
['0x07' S7MessageUserData
]
]
- [optional S7Parameter ['messageType'] 'parameter' 'parameterLength > 0']
- [optional S7Payload ['messageType', 'parameter'] 'payload' 'payloadLength > 0' ]
+ [optional S7Parameter ('messageType') 'parameter' 'parameterLength > 0']
+ [optional S7Payload ('messageType', 'parameter') 'payload' 'payloadLength > 0' ]
]
////////////////////////////////////////////////////////////////
// Parameters
-[discriminatedType 'S7Parameter' [uint 8 'messageType']
+[discriminatedType 'S7Parameter' (uint 8 'messageType')
[discriminator uint 8 'parameterType']
[typeSwitch 'parameterType','messageType'
['0xF0' S7ParameterSetupCommunication
@@ -220,25 +220,25 @@
////////////////////////////////////////////////////////////////
// Payloads
-[discriminatedType 'S7Payload' [uint 8 'messageType', S7Parameter 'parameter']
+[discriminatedType 'S7Payload' (uint 8 'messageType', S7Parameter 'parameter')
[typeSwitch 'parameter.parameterType', 'messageType'
- ['0x04','0x03' S7PayloadReadVarResponse [S7Parameter 'parameter']
+ ['0x04','0x03' S7PayloadReadVarResponse(S7Parameter 'parameter')
[array S7VarPayloadDataItem ['lastItem'] 'items' count 'CAST(parameter, S7ParameterReadVarResponse).numItems']
]
- ['0x05','0x01' S7PayloadWriteVarRequest [S7Parameter 'parameter']
+ ['0x05','0x01' S7PayloadWriteVarRequest(S7Parameter 'parameter')
[array S7VarPayloadDataItem ['lastItem'] 'items' count 'COUNT(CAST(parameter, S7ParameterWriteVarRequest).items)']
]
- ['0x05','0x03' S7PayloadWriteVarResponse [S7Parameter 'parameter']
+ ['0x05','0x03' S7PayloadWriteVarResponse(S7Parameter 'parameter')
[array S7VarPayloadStatusItem 'items' count 'CAST(parameter, S7ParameterWriteVarResponse).numItems']
]
- ['0x00','0x07' S7PayloadUserData [S7Parameter 'parameter']
- [array S7PayloadUserDataItem ['CAST(CAST(parameter, S7ParameterUserData).items[0], S7ParameterUserDataItemCPUFunctions).cpuFunctionType', 'CAST(CAST(parameter, S7ParameterUserData).items[0], S7ParameterUserDataItemCPUFunctions).cpuSubfunction'] 'items' count 'COUNT(CAST(parameter, S7ParameterUserData).items)']
+ ['0x00','0x07' S7PayloadUserData (S7Parameter 'parameter')
+ [array S7PayloadUserDataItem('CAST(CAST(parameter, S7ParameterUserData).items[0], S7ParameterUserDataItemCPUFunctions).cpuFunctionType', 'CAST(CAST(parameter, S7ParameterUserData).items[0], S7ParameterUserDataItemCPUFunctions).cpuSubfunction') 'items' count 'COUNT(CAST(parameter, S7ParameterUserData).items)']
]
]
]
// This is actually not quite correct as depending pon the transportSize the length is either defined in bits or bytes.
-[type 'S7VarPayloadDataItem' [bit 'lastItem']
+[type 'S7VarPayloadDataItem'(bit 'lastItem')
[simple DataTransportErrorCode 'returnCode']
[simple DataTransportSize 'transportSize']
[implicit uint 16 'dataLength' 'COUNT(data) * ((transportSize == DataTransportSize.BIT) ? 1 : (transportSize.sizeInBits ? 8 : 1))']
@@ -256,7 +256,7 @@
////////////////////////////////////////////////////////////////
//Under test
-[discriminatedType 'S7DataAlarmMessage' [uint 4 'cpuFunctionType']
+[discriminatedType 'S7DataAlarmMessage'(uint 4 'cpuFunctionType')
[const uint 8 'functionId' '0x00']
[const uint 8 'numberMessageObj' '0x01']
[typeSwitch 'cpuFunctionType'
@@ -412,7 +412,7 @@
// 0x16 NOTIFY8_IND
////////////////////////////////////////////////////////////////
-[discriminatedType 'S7PayloadUserDataItem' [uint 4 'cpuFunctionType', uint 8 'cpuSubfunction']
+[discriminatedType 'S7PayloadUserDataItem'(uint 4 'cpuFunctionType', uint 8 'cpuSubfunction')
[simple DataTransportErrorCode 'returnCode']
[simple DataTransportSize 'transportSize']
[implicit uint 16 'dataLength' 'lengthInBytes - 4']
@@ -521,7 +521,7 @@
]
]
-[dataIo 'DataItem' [vstring 'dataProtocolId', int 32 'stringLength']
+[dataIo 'DataItem'(vstring 'dataProtocolId', int 32 'stringLength')
[typeSwitch 'dataProtocolId'
// -----------------------------------------
// Bit
@@ -647,7 +647,7 @@
]
]
-[enum int 8 'COTPTpduSize' [uint 16 'sizeInBytes']
+[enum int 8 'COTPTpduSize'(uint 16 'sizeInBytes')
['0x07' SIZE_128 ['128']]
['0x08' SIZE_256 ['256']]
['0x09' SIZE_512 ['512']]
@@ -665,7 +665,7 @@
['0x40' CLASS_4]
]
-[enum int 8 'DataTransportSize' [bit 'sizeInBits']
+[enum int 8 'DataTransportSize'(bit 'sizeInBits')
['0x00' NULL ['false']]
['0x03' BIT ['true']]
['0x04' BYTE_WORD_DWORD ['true']]
@@ -681,7 +681,7 @@
['0x03' OTHERS ]
]
-[enum int 8 'TransportSize' [uint 8 'code', uint 8 'shortName', uint 8 'sizeInBytes', TransportSize 'baseType', DataTransportSize 'dataTransportSize', vstring 'dataProtocolId', bit 'supported_S7_300', bit 'supported_S7_400', bit 'supported_S7_1200', bit 'supported_S7_1500', bit 'supported_LOGO']
+[enum int 8 'TransportSize'(uint 8 'code', uint 8 'shortName', uint 8 'sizeInBytes', TransportSize 'baseType', DataTransportSize 'dataTransportSize', vstring 'dataProtocolId', bit 'supported_S7_300', bit 'supported_S7_400', bit 'supported_S7_1200', bit 'supported_S7_1500', bit 'supported_LOGO')
// Bit Strings
['0x01' BOOL ['0x01' , 'X' , '1' , 'null' , 'BIT' , 'IEC61131_BOOL' , 'true' , 'true' , 'true' , 'true' , 'true' ]]
['0x02' BYTE ['0x02' , 'B' , '1' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_BYTE' , 'true' , 'true' , 'true' , 'true' , 'true' ]]
@@ -722,7 +722,7 @@
['0x1B' DT ['0x0F' , 'X' , '12' , 'null' , 'null' , 'IEC61131_DATE_AND_TIME', 'true' , 'true' , 'false' , 'true' , 'false' ]]
]
-[enum uint 8 'MemoryArea' [string 24 'shortName']
+[enum uint 8 'MemoryArea'(string 24 'shortName')
['0x1C' COUNTERS ['C']]
['0x1D' TIMERS ['T']]
['0x80' DIRECT_PERIPHERAL_ACCESS ['D']]
@@ -734,7 +734,7 @@
['0x86' LOCAL_DATA ['LD']]
]
-[enum uint 8 'DataTransportSize' [bit 'sizeInBits']
+[enum uint 8 'DataTransportSize'(bit 'sizeInBits')
['0x00' NULL ['false']]
['0x03' BIT ['true']]
['0x04' BYTE_WORD_DWORD ['true']]
diff --git a/protocols/simulated/src/main/resources/protocols/simulated/simulated.mspec b/protocols/simulated/src/main/resources/protocols/simulated/simulated.mspec
index 7cd895a..1512728 100644
--- a/protocols/simulated/src/main/resources/protocols/simulated/simulated.mspec
+++ b/protocols/simulated/src/main/resources/protocols/simulated/simulated.mspec
@@ -23,7 +23,7 @@
[simple uint 16 'dummy']
]
-[dataIo 'DataItem' [vstring 'dataType', uint 16 'numberOfValues']
+[dataIo 'DataItem'(vstring 'dataType', uint 16 'numberOfValues')
[typeSwitch 'dataType','numberOfValues'
['BOOL','1' BOOL
[simple bit 'value']
@@ -136,7 +136,7 @@
]
]
-[enum uint 8 'SimulatedDataTypeSizes' [uint 8 'dataTypeSize']
+[enum uint 8 'SimulatedDataTypeSizes'(uint 8 'dataTypeSize')
['1' BOOL ['1']]
['2' BYTE ['1']]
['3' WORD ['2']]