diff --git a/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4 b/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4 index c8815401068..820feb6d503 100644 --- a/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4 +++ b/code-generation/protocol-base-mspec/src/main/antlr4/org/apache/plc4x/plugins/codegenerator/language/mspec/MSpec.g4 @@ -27,10 +27,10 @@ complexTypeDefinition ; complexType - : 'type' name=idExpression (attributes=attributeList) (LRBRACKET params=argumentList RRBRACKET)? (fieldDefinition|batchSetDefinition)* - | 'discriminatedType' name=idExpression (attributes=attributeList) (LRBRACKET params=argumentList RRBRACKET)? (fieldDefinition|batchSetDefinition)+ - | 'enum' (type=typeReference)? name=idExpression (attributes=attributeList) (LRBRACKET params=argumentList RRBRACKET)? enumValues=enumValueDefinition+ - | 'dataIo' name=idExpression (attributes=attributeList) (LRBRACKET params=argumentList RRBRACKET)? dataIoTypeSwitch=dataIoDefinition + : 'type' name=idExpression (LRBRACKET params=argumentList RRBRACKET)? attributes=attributeList (fieldDefinition|batchSetDefinition)* + | 'discriminatedType' name=idExpression (LRBRACKET params=argumentList RRBRACKET)? attributes=attributeList (fieldDefinition|batchSetDefinition)+ + | 'enum' (type=typeReference)? name=idExpression (LRBRACKET params=argumentList RRBRACKET)? attributes=attributeList enumValues=enumValueDefinition+ + | 'dataIo' name=idExpression (LRBRACKET params=argumentList RRBRACKET)? (attributes=attributeList) dataIoTypeSwitch=dataIoDefinition ; fieldDefinition diff --git a/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec b/protocols/firmata/src/main/resources/protocols/firmata/firmata.mspec index 1374686c05e..c6aad0d3c15 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(bit 'response') byteOrder='"BIG_ENDIAN"' [discriminator uint 4 'messageType'] [typeSwitch 'messageType' // Reading operations diff --git a/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec b/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec index 66142210c5b..72471a1129b 100644 --- a/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec +++ b/protocols/genericcan/src/main/resources/protocols/can/genericcan.mspec @@ -40,7 +40,7 @@ [REAL64 ['64'] ] ] -[dataIo DataItem byteOrder='"LITTLE_ENDIAN"' (GenericCANDataType 'dataType') +[dataIo DataItem(GenericCANDataType 'dataType') byteOrder='"LITTLE_ENDIAN"' [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 3a0c06fddd1..b762bbaaec9 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(bit 'response') byteOrder='"BIG_ENDIAN"' // 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('response') 'pdu'] ] -[type ModbusSerialADU byteOrder='"LITTLE_ENDIAN"' (bit 'response') +[type ModbusSerialADU(bit 'response') byteOrder='"LITTLE_ENDIAN"' [simple uint 16 'transactionId'] [reserved uint 16 '0x0000'] [simple uint 16 'length'] diff --git a/protocols/opcua/src/main/xslt/opc-manual.xsl b/protocols/opcua/src/main/xslt/opc-manual.xsl index 10d53884a1a..14832d0814d 100644 --- a/protocols/opcua/src/main/xslt/opc-manual.xsl +++ b/protocols/opcua/src/main/xslt/opc-manual.xsl @@ -55,11 +55,11 @@ // Remark: The different fields are encoded in Little-endian. -[type OpcuaAPU byteOrder='"LITTLE_ENDIAN"' (bit 'response') +[type OpcuaAPU(bit 'response') byteOrder='"LITTLE_ENDIAN"' [simple MessagePDU('response') 'message'] ] -[discriminatedType MessagePDU (bit 'response') +[discriminatedType MessagePDU(bit 'response') [discriminator string 24 'messageType'] [typeSwitch 'messageType','response' ['"HEL"','false' OpcuaHelloRequest