From b9b9307baa094e23447fc5e3671de10d0d821875 Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Tue, 28 Nov 2023 20:33:24 -0400 Subject: [PATCH 01/21] Support for reading and writing to STRING type memory areas. Example of use is included. --- .../s7/readwrite/optimizer/S7Optimizer.java | 27 +- .../readwrite/protocol/S7ProtocolLogic.java | 332 +++++++++++++- .../plc4x/java/s7/readwrite/tag/S7ClkTag.java | 2 +- .../s7/readwrite/tag/S7PlcTagHandler.java | 6 +- .../java/s7/readwrite/tag/S7StringTag.java | 131 ++++++ .../plc4x/java/s7/readwrite/tag/S7Tag.java | 105 ++--- .../plc4j/s7event/PlcReadWriteStrings.java | 434 ++++++++++++++++++ 7 files changed, 961 insertions(+), 76 deletions(-) create mode 100644 plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadWriteStrings.java diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java index 47bc4b8821e..0487f65f942 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java @@ -38,6 +38,8 @@ import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; +import java.util.Map; +import org.apache.plc4x.java.s7.readwrite.tag.S7StringTag; public class S7Optimizer extends BaseOptimizer { @@ -63,16 +65,26 @@ protected List processReadRequest(PlcReadRequest readRequest, Dr int curResponseSize = EMPTY_READ_RESPONSE_SIZE; // List of all items in the current request. + LinkedHashMap curTags = new LinkedHashMap<>(); for (String tagName : readRequest.getTagNames()) { - + + //TODO: Individual processing of these types of tags. like S7StringTag if ((readRequest.getTag(tagName) instanceof S7SzlTag) || (readRequest.getTag(tagName) instanceof S7ClkTag)) { curTags.put(tagName, readRequest.getTag(tagName)); continue; } - + + if ((readRequest.getTag(tagName) instanceof S7StringTag)) { + LinkedHashMap strTags = new LinkedHashMap<>(); + strTags.put(tagName, readRequest.getTag(tagName)); + processedRequests.add(new DefaultPlcReadRequest( + ((DefaultPlcReadRequest) readRequest).getReader(), strTags)); + continue; + } + S7Tag tag = (S7Tag) readRequest.getTag(tagName); int readRequestItemSize = S7_ADDRESS_ANY_SIZE; @@ -142,6 +154,17 @@ protected List processWriteRequest(PlcWriteRequest writeRequest LinkedHashMap curTags = new LinkedHashMap<>(); for (String tagName : writeRequest.getTagNames()) { + + if ((writeRequest.getTag(tagName) instanceof S7StringTag)) { + LinkedHashMap strTags = new LinkedHashMap<>(); + strTags.put(tagName, + new TagValueItem(writeRequest.getTag(tagName), + writeRequest.getPlcValue(tagName))); + processedRequests.add(new DefaultPlcWriteRequest( + ((DefaultPlcWriteRequest) writeRequest).getWriter(), strTags)); + continue; + } + S7Tag tag = (S7Tag) writeRequest.getTag(tagName); PlcValue value = writeRequest.getPlcValue(tagName); diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java index 032948be18a..4bfed9bb732 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java @@ -54,6 +54,7 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.LocalDateTime; import java.util.*; @@ -61,6 +62,7 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiConsumer; import java.util.function.Consumer; +import java.util.logging.Level; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -306,6 +308,17 @@ public CompletableFuture read(PlcReadRequest readRequest) { new S7PayloadUserData(payloadItems)); return toPlcReadResponse(readRequest, readInternal(s7MessageRequest)); + } else if (request.getTags().get(0) instanceof S7StringTag) { + + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); + encodePlcStringReadRequest(request, parameterItems, payloadItems); + + final S7MessageRequest s7MessageRequest = new S7MessageRequest(-1, + parameterItems.get(0), + null); + + return toPlcReadResponse(readRequest, readInternal(s7MessageRequest)); } @@ -414,6 +427,13 @@ public CompletableFuture write(PlcWriteRequest writeRequest) { if (!clkTags.isEmpty()) { return writeClk(writeRequest); } + + List strTags = request.getTagNames().stream() + .filter(t -> request.getTag(t) instanceof S7StringTag) + .collect(Collectors.toList()); + if (!strTags.isEmpty()) { + return writeString(writeRequest); + } List parameterItems = new ArrayList<>(request.getNumberOfTags()); List payloadItems = new ArrayList<>(request.getNumberOfTags()); @@ -524,6 +544,56 @@ public CompletableFuture writeClk(PlcWriteRequest writeRequest return future; } + //TODO: Clean code + public CompletableFuture writeString(PlcWriteRequest writeRequest) { + CompletableFuture future = new CompletableFuture<>(); + DefaultPlcWriteRequest request = (DefaultPlcWriteRequest) writeRequest; + + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); + + encodePlcStringWriteRequest((DefaultPlcWriteRequest) writeRequest, + parameterItems, payloadItems); + + final int tpduId = tpduGenerator.getAndIncrement(); + // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 + if (tpduGenerator.get() == 0xFFFF) { + tpduGenerator.set(1); + } + + TPKTPacket tpktPacket = new TPKTPacket( + new COTPPacketData( + null, + new S7MessageRequest(tpduId, + new S7ParameterWriteVarRequest(parameterItems), + new S7PayloadWriteVarRequest(payloadItems) + ), + true, + (byte) tpduId + ) + ); + + // Start a new request-transaction (Is ended in the response-handler) + RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); + transaction.submit(() -> context.sendRequest(tpktPacket) + .onTimeout(new TransactionErrorCallback<>(future, transaction)) + .onError(new TransactionErrorCallback<>(future, transaction)) + .expectResponse(TPKTPacket.class, REQUEST_TIMEOUT) + .check(p -> p.getPayload() instanceof COTPPacketData) + .unwrap(p -> ((COTPPacketData) p.getPayload())) + .unwrap(COTPPacket::getPayload) + .check(p -> p.getTpduReference() == tpduId) + .handle(p -> { + try { + future.complete(((PlcWriteResponse) decodeWriteResponse(p, writeRequest))); + } catch (PlcProtocolException e) { + logger.warn("Error sending 'write' message: '{}'", e.getMessage(), e); + } + // Finish the request-transaction. + transaction.endRequest(); + })); + return future; + } @Override public CompletableFuture subscribe(PlcSubscriptionRequest subscriptionRequest) { @@ -1340,6 +1410,9 @@ private void encodeCycledUnSubscriptionRequest(DefaultPlcUnsubscriptionRequest r // }); } + /* + * + */ private void encodePlcClkRequest(DefaultPlcReadRequest request, List parameterItems, List payloadItems) { @@ -1370,12 +1443,13 @@ private void encodePlcClkRequest(DefaultPlcReadRequest request, payloadItems.add(payload); } - + /* + * + */ private void encodePlcClkSetRequest(DefaultPlcWriteRequest request, List parameterItems, List payloadItems) { - S7ParameterUserDataItemCPUFunctions parameter = new S7ParameterUserDataItemCPUFunctions( (short) 0x11, //Method (byte) 0x04, //FunctionType @@ -1404,6 +1478,207 @@ private void encodePlcClkSetRequest(DefaultPlcWriteRequest request, } + /* + * +-------------------+ + * Byte n | Maximum length | (intMaxChars) + * +-------------------+ + * Byte n+1 | Current Length | (intActualChars) + * +-------------------+ + * Byte n+2 | 1st character | \ \ + * +-------------------+ | | + * Byte n+3 | 2st character | | Current | + * +-------------------+ > | + * Byte ... | ... | | length | Maximum + * +-------------------+ | > + * Byte n+m+1 | mth character | / | length + * +-------------------+ | + * Byte ... | ... | | + * +-------------------+ | + * Byte ... | ... | / + * +-------------------+ + * Reading text strings in two steps: + * 1. For the operation on texts, you must first evaluate the + * space created on DB of type STRING or WSTRING. + * 2. The first two bytes have the maximum number of characters (bytes) + * available to store text strings (intMaxChars) and the number of + * characters available (intActualChars). + * 3. In the specific case of reading, only the characters defined + * by "intActualChars" are recovered. + * TODO: Maximum waiting time managed by system variables. + */ + private void encodePlcStringReadRequest(DefaultPlcReadRequest request, + List parameterItems, + List payloadItems) { + + int intMaxChars = 0; + int intActualChars = 0; + + final S7StringTag tag = (S7StringTag) request.getTags().get(0); + + //Read the max length and actual size. + + final S7MessageRequest readRequest = new S7MessageRequest(1,new S7ParameterReadVarRequest( + List.of(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + 2, + tag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + tag.getByteOffset(), + tag.getBitOffset() + )) + + )), null); + + CompletableFuture future = readInternal(readRequest); + + try { + S7Message get = future.get(2000, TimeUnit.MILLISECONDS); + final S7VarPayloadDataItem payload = (S7VarPayloadDataItem)((S7PayloadReadVarResponse) get.getPayload()).getItems().get(0); + //intMaxChars = Byte.toUnsignedInt(payload.getData()[0]); + intActualChars = Byte.toUnsignedInt(payload.getData()[1]); + } catch (InterruptedException ex) { + logger.info(ex.getMessage()); + } catch (ExecutionException ex) { + logger.info(ex.getMessage()); + } catch (TimeoutException ex) { + logger.info(ex.getMessage()); + } + + //Create the message structure for the user request. + + S7ParameterReadVarRequest parameter = new S7ParameterReadVarRequest( + List.of(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + intActualChars, + tag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + tag.getByteOffset()+2, + tag.getBitOffset() + )) + + )); + + parameterItems.clear(); + parameterItems.add(parameter); + + payloadItems.clear(); + + } + + + /* + * +-------------------+ + * Byte n | Maximum length | (intMaxChars) + * +-------------------+ + * Byte n+1 | Current Length | (intActualChars) + * +-------------------+ + * Byte n+2 | 1st character | \ \ + * +-------------------+ | | + * Byte n+3 | 2st character | | Current | + * +-------------------+ > | + * Byte ... | ... | | length | Maximum + * +-------------------+ | > + * Byte n+m+1 | mth character | / | length + * +-------------------+ | + * Byte ... | ... | | + * +-------------------+ | + * Byte ... | ... | / + * +-------------------+ + * Reading text strings in two steps: + * 1. For the operation on texts, you must first evaluate the + * space created on DB of type STRING or WSTRING. + * 2. The first two bytes have the maximum number of characters (bytes) + * available to store text strings (intMaxChars) and the number of + * characters available (intActualChars). + * 3. In the specific case of write string, only the max characters defined + * by "intMaxChars" are writed. + * TODO: Maximum waiting time managed by system variables. + */ + private void encodePlcStringWriteRequest(DefaultPlcWriteRequest request, + List parameterItems, + List payloadItems) { + + int intMaxChars = 0; + int intActualChars = 0; + + final S7StringTag tag = (S7StringTag) request.getTags().get(0); + + //Read the max length and actual size. + + final S7MessageRequest readRequest = new S7MessageRequest(1,new S7ParameterReadVarRequest( + List.of(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + 2, + tag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + tag.getByteOffset(), + tag.getBitOffset() + )) + + )), null); + + CompletableFuture future = readInternal(readRequest); + + try { + S7Message get = future.get(2000, TimeUnit.MILLISECONDS); + final S7VarPayloadDataItem payload = (S7VarPayloadDataItem)((S7PayloadReadVarResponse) get.getPayload()).getItems().get(0); + intMaxChars = Byte.toUnsignedInt(payload.getData()[0]); //payload.getData()[0] & 0xFF + intActualChars = Byte.toUnsignedInt(payload.getData()[1]); + } catch (InterruptedException ex) { + logger.info(ex.getMessage()); + } catch (ExecutionException ex) { + logger.info(ex.getMessage()); + } catch (TimeoutException ex) { + logger.info(ex.getMessage()); + } + + //Create the message structure for the user request. + + parameterItems.clear(); + payloadItems.clear(); + + Iterator iter = request.getTagNames().iterator(); + + String tagName; + PlcValue plcValue; + while (iter.hasNext()) { + tagName = iter.next(); + final S7StringTag tagRef = (S7StringTag) request.getTag(tagName); + plcValue = request.getPlcValue(tagName); + + //Check if String + String strValue = plcValue.getString(); + if (strValue.length() > intMaxChars) { + strValue = strValue.substring(0, intMaxChars); + plcValue = new PlcSTRING(strValue); + } + + S7Address s7Address = new S7AddressAny( + tagRef.getDataType().BYTE, + strValue.length() + 2, + tagRef.getBlockNumber(), + tagRef.getMemoryArea(), + tagRef.getByteOffset(), + tagRef.getBitOffset()); + + parameterItems.add(new S7VarRequestParameterItemAddress(s7Address)); + + ByteBuffer byteBuffer = ByteBuffer.allocate(strValue.length() + 2); + byteBuffer.put((byte) intMaxChars); + byteBuffer.put((byte) strValue.length()); + byteBuffer.put(strValue.getBytes()); + + DataTransportSize transportSize = DataTransportSize.BYTE_WORD_DWORD; + + payloadItems.add(new S7VarPayloadDataItem(DataTransportErrorCode.OK, transportSize, byteBuffer.array()/*, hasNext*/)); + } + + } + + /** * This method is only called when there is no Response Handler. */ @@ -1622,7 +1897,17 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest } //TODO: Reemsambling message. - if (responseMessage instanceof S7MessageUserData) { + if (responseMessage instanceof S7MessageResponseData) { + for (String tagName : plcReadRequest.getTagNames()) { + if (plcReadRequest.getTag(tagName) instanceof S7StringTag) { + PlcValue plcValue = null; + PlcResponseCode responseCode = PlcResponseCode.INTERNAL_ERROR; + List plcValues = new LinkedList<>(); + ResponseItem result = new ResponseItem<>(responseCode, plcValue); + values.put(tagName, result); + } + } + } else if (responseMessage instanceof S7MessageUserData) { S7PayloadUserData payload = (S7PayloadUserData) responseMessage.getPayload(); if (plcReadRequest.getNumberOfTags() != payload.getItems().size()) { @@ -1725,15 +2010,18 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest dt.getMsec() * 1000000))); plcValue = new PlcList(plcValues); } - + ResponseItem result = new ResponseItem<>(responseCode, plcValue); values.put(tagName, result); index++; } + + return new DefaultPlcReadResponse(plcReadRequest, values); } + // In all other cases all went well. S7PayloadReadVarResponse payload = (S7PayloadReadVarResponse) responseMessage.getPayload(); @@ -1748,20 +2036,32 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest List payloadItems = payload.getItems(); int index = 0; + PlcResponseCode responseCode = null; + PlcValue plcValue = null; for (String tagName : plcReadRequest.getTagNames()) { - S7Tag tag = (S7Tag) plcReadRequest.getTag(tagName); - S7VarPayloadDataItem payloadItem = payloadItems.get(index); - - PlcResponseCode responseCode = decodeResponseCode(payloadItem.getReturnCode()); - PlcValue plcValue = null; - ByteBuf data = Unpooled.wrappedBuffer(payloadItem.getData()); - if (responseCode == PlcResponseCode.OK) { - try { - plcValue = parsePlcValue(tag, data); - } catch (Exception e) { - throw new PlcProtocolException("Error decoding PlcValue", e); + + if (plcReadRequest.getTag(tagName) instanceof S7StringTag) { + + final S7VarPayloadDataItem payloadItem = payloadItems.get(index); + responseCode = decodeResponseCode(payloadItem.getReturnCode()); + plcValue = new PlcSTRING(new String(payloadItem.getData(), StandardCharsets.UTF_8)); + + } else { + S7Tag tag = (S7Tag) plcReadRequest.getTag(tagName); + S7VarPayloadDataItem payloadItem = payloadItems.get(index); + + responseCode = decodeResponseCode(payloadItem.getReturnCode()); + plcValue = null; + + ByteBuf data = Unpooled.wrappedBuffer(payloadItem.getData()); + if (responseCode == PlcResponseCode.OK) { + try { + plcValue = parsePlcValue(tag, data); + } catch (Exception e) { + throw new PlcProtocolException("Error decoding PlcValue", e); + } } - } + }; ResponseItem result = new ResponseItem<>(responseCode, plcValue); values.put(tagName, result); index++; diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7ClkTag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7ClkTag.java index 2644737efb9..c998d6f12fe 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7ClkTag.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7ClkTag.java @@ -84,7 +84,7 @@ public void setDateAndTime(LocalDateTime ldt) { public static boolean matches(String address) { return CLK_ADDRESS_PATTERN.matcher(address).matches() || - CLKF_ADDRESS_PATTERN.matcher(address).matches(); + CLKF_ADDRESS_PATTERN.matcher(address).matches(); } public static S7ClkTag of(String address) { diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java index 05b748df0b4..4a43836a3a6 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java @@ -27,14 +27,16 @@ public class S7PlcTagHandler implements PlcTagHandler { @Override public PlcTag parseTag(String tagAddress) { - if (S7Tag.matches(tagAddress)) { - return S7Tag.of(tagAddress); + if (S7StringTag.matches(tagAddress)) { + return S7StringTag.of(tagAddress); } else if (S7SubscriptionTag.matches(tagAddress)) { return S7SubscriptionTag.of(tagAddress); } else if (S7ClkTag.matches(tagAddress)) { return S7ClkTag.of(tagAddress); } else if (S7SzlTag.matches(tagAddress)) { return S7SzlTag.of(tagAddress); + } else if (S7Tag.matches(tagAddress)) { + return S7Tag.of(tagAddress); } throw new PlcInvalidTagException(tagAddress); } diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java index 23614677ec2..4e81fb0da2e 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java @@ -25,8 +25,35 @@ import org.apache.plc4x.java.spi.generation.WriteBuffer; import java.nio.charset.StandardCharsets; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.plc4x.java.api.exceptions.PlcInvalidTagException; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.BIT_OFFSET; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.BLOCK_NUMBER; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.BYTE_OFFSET; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.DATA_TYPE; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.NUM_ELEMENTS; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.STRING_LENGTH; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.TRANSFER_SIZE_CODE; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.checkByteOffset; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.checkDataBlockNumber; +import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.getSizeCode; public class S7StringTag extends S7Tag { + + private static final Pattern DATA_BLOCK_STRING = + Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)?"); + + private static final Pattern DATA_BLOCK_STRING_SHORT = + Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)?"); + + private static final Pattern DATA_BLOCK_STRING_ADDRESS_PATTERN = + Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); + + private static final Pattern DATA_BLOCK_STRING_SHORT_PATTERN = + Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); + + private final int stringLength; @@ -42,6 +69,14 @@ public int getStringLength() { return stringLength; } + public static boolean matches(String address) { + return DATA_BLOCK_STRING.matcher(address).matches() || + DATA_BLOCK_STRING_SHORT.matcher(address).matches() || + DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(address).matches() || + DATA_BLOCK_STRING_SHORT_PATTERN.matcher(address).matches(); + } + + @Override public void serialize(WriteBuffer writeBuffer) throws SerializationException { writeBuffer.pushContext(getClass().getSimpleName()); @@ -64,5 +99,101 @@ public void serialize(WriteBuffer writeBuffer) throws SerializationException { writeBuffer.popContext(getClass().getSimpleName()); } + + public static S7StringTag of(String address) { + Matcher matcher; + + if ((matcher = DATA_BLOCK_STRING_SHORT.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + int stringLength = -1; + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + if (matcher.group(BIT_OFFSET) != null) { + bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); + } else if (dataType == TransportSize.BOOL) { + throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); + } + int numElements = 1; +// if (matcher.group(NUM_ELEMENTS) != null) { +// numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); +// } + + if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { + throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + + "' doesn't match specified data type '" + dataType.name() + "'"); + } + + return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); + + } else if ((matcher = DATA_BLOCK_STRING.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + if (matcher.group(BIT_OFFSET) != null) { + bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); + } else if (dataType == TransportSize.BOOL) { + throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); + } + int numElements = 1; + if (matcher.group(NUM_ELEMENTS) != null) { + numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); + } + + if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { + throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + + "' doesn't match specified data type '" + dataType.name() + "'"); + } + + return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); + + } else if ((matcher = DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + if (matcher.group(BIT_OFFSET) != null) { + bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); + } else if (dataType == TransportSize.BOOL) { + throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); + } + int numElements = 1; + if (matcher.group(NUM_ELEMENTS) != null) { + numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); + } + + if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { + throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + + "' doesn't match specified data type '" + dataType.name() + "'"); + } + + return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); + } else if ((matcher = DATA_BLOCK_STRING_SHORT_PATTERN.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + int numElements = 1; + if (matcher.group(NUM_ELEMENTS) != null) { + numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); + } + + return new S7StringTag(dataType, memoryArea, blockNumber, + byteOffset, bitOffset, numElements, stringLength); + } + + return null; + } } diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java index 31ff6e34923..26c7917ac4f 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java @@ -52,23 +52,19 @@ public class S7Tag implements PlcTag, Serializable { private static final Pattern DATA_BLOCK_SHORT_PATTERN = Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?[a-zA-Z_]+)(\\[(?\\d+)])?"); - private static final Pattern DATA_BLOCK_STRING_ADDRESS_PATTERN = - Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); - private static final Pattern DATA_BLOCK_STRING_SHORT_PATTERN = - Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); private static final Pattern PLC_PROXY_ADDRESS_PATTERN = Pattern.compile("[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}"); - private static final String DATA_TYPE = "dataType"; - private static final String STRING_LENGTH = "stringLength"; - private static final String TRANSFER_SIZE_CODE = "transferSizeCode"; - private static final String BLOCK_NUMBER = "blockNumber"; - private static final String BYTE_OFFSET = "byteOffset"; - private static final String BIT_OFFSET = "bitOffset"; - private static final String NUM_ELEMENTS = "numElements"; - private static final String MEMORY_AREA = "memoryArea"; + protected static final String DATA_TYPE = "dataType"; + protected static final String STRING_LENGTH = "stringLength"; + protected static final String TRANSFER_SIZE_CODE = "transferSizeCode"; + protected static final String BLOCK_NUMBER = "blockNumber"; + protected static final String BYTE_OFFSET = "byteOffset"; + protected static final String BIT_OFFSET = "bitOffset"; + protected static final String NUM_ELEMENTS = "numElements"; + protected static final String MEMORY_AREA = "memoryArea"; private final TransportSize dataType; private final MemoryArea memoryArea; @@ -136,8 +132,6 @@ public int getNumberOfElements() { public static boolean matches(String tagString) { return - DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(tagString).matches() || - DATA_BLOCK_STRING_SHORT_PATTERN.matcher(tagString).matches() || DATA_BLOCK_ADDRESS_PATTERN.matcher(tagString).matches() || DATA_BLOCK_SHORT_PATTERN.matcher(tagString).matches() || PLC_PROXY_ADDRESS_PATTERN.matcher(tagString).matches() || @@ -146,45 +140,46 @@ public static boolean matches(String tagString) { public static S7Tag of(String tagString) { Matcher matcher; - if ((matcher = DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(tagString)).matches()) { - TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); - int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); - MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; - int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); - Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); - int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); - byte bitOffset = 0; - if (matcher.group(BIT_OFFSET) != null) { - bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); - } else if (dataType == TransportSize.BOOL) { - throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); - } - int numElements = 1; - if (matcher.group(NUM_ELEMENTS) != null) { - numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); - } - - if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { - throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + - "' doesn't match specified data type '" + dataType.name() + "'"); - } - - return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); - } else if ((matcher = DATA_BLOCK_STRING_SHORT_PATTERN.matcher(tagString)).matches()) { - TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); - int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); - MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; - int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); - int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); - byte bitOffset = 0; - int numElements = 1; - if (matcher.group(NUM_ELEMENTS) != null) { - numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); - } - - return new S7StringTag(dataType, memoryArea, blockNumber, - byteOffset, bitOffset, numElements, stringLength); - } else if ((matcher = DATA_BLOCK_ADDRESS_PATTERN.matcher(tagString)).matches()) { +// if ((matcher = DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(tagString)).matches()) { +// TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); +// int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); +// MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; +// int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); +// Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); +// int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); +// byte bitOffset = 0; +// if (matcher.group(BIT_OFFSET) != null) { +// bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); +// } else if (dataType == TransportSize.BOOL) { +// throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); +// } +// int numElements = 1; +// if (matcher.group(NUM_ELEMENTS) != null) { +// numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); +// } +// +// if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { +// throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + +// "' doesn't match specified data type '" + dataType.name() + "'"); +// } +// +// return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); +//// } else if ((matcher = DATA_BLOCK_STRING_SHORT_PATTERN.matcher(tagString)).matches()) { +//// TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); +//// int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); +//// MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; +//// int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); +//// int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); +//// byte bitOffset = 0; +//// int numElements = 1; +//// if (matcher.group(NUM_ELEMENTS) != null) { +//// numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); +//// } +//// +//// return new S7StringTag(dataType, memoryArea, blockNumber, +//// byteOffset, bitOffset, numElements, stringLength); +// } else + if ((matcher = DATA_BLOCK_ADDRESS_PATTERN.matcher(tagString)).matches()) { TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); @@ -280,7 +275,7 @@ public static S7Tag of(String tagString) { * @param blockNumber given DataBlockNumber * @return given blockNumber if Ok, throws PlcInvalidTagException otherwise */ - private static int checkDataBlockNumber(int blockNumber) { + protected static int checkDataBlockNumber(int blockNumber) { // TODO: check the value or add reference - limit eventually depending on active S7 --> make a case selection if (blockNumber > 64000 || blockNumber < 1) { throw new PlcInvalidTagException("DataBlock numbers larger than 64000 or smaller than 1 are not supported."); @@ -294,7 +289,7 @@ private static int checkDataBlockNumber(int blockNumber) { * @param byteOffset given byteOffset * @return given byteOffset if Ok, throws PlcInvalidTagException otherwise */ - private static int checkByteOffset(int byteOffset) { + protected static int checkByteOffset(int byteOffset) { // TODO: check the value or add reference if (byteOffset > 2097151 || byteOffset < 0) { throw new PlcInvalidTagException("ByteOffset must be smaller than 2097151 and positive."); diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadWriteStrings.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadWriteStrings.java new file mode 100644 index 00000000000..e86f296effd --- /dev/null +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadWriteStrings.java @@ -0,0 +1,434 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.examples.plc4j.s7event; + +import java.io.IOException; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import org.apache.commons.lang3.time.StopWatch; +import org.apache.plc4x.java.DefaultPlcDriverManager; +import org.apache.plc4x.java.api.exceptions.PlcConnectionException; +import org.apache.plc4x.java.api.listener.ConnectionStateListener; +import org.apache.plc4x.java.api.messages.PlcReadRequest; +import org.apache.plc4x.java.api.messages.PlcReadResponse; +import org.apache.plc4x.java.api.messages.PlcWriteRequest; +import org.apache.plc4x.java.api.messages.PlcWriteResponse; +import org.apache.plc4x.java.api.types.PlcResponseCode; +import org.apache.plc4x.java.s7.readwrite.protocol.S7HPlcConnection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/* +* +* Example of connection to a S7-400. +* The connection is supervised. +* Plc: SIMATIC S7-400 +* Model: CPU 417 +* Part number: 6ES7 417-4XT05-0AB0 +* Firmware version: 5.1.0 +* CP1: 6GK7 443-1EX11-0XE0 +* CP2: 6GK7 443-1EX20-0XB0 +* +* For the following program, the DB400 must be installed in the PLC, +* with the following chains and the indicated lengths. +* +* DB400 +* STRING001 - STRING[254] +* STRING002 - STRING[172] +* STRING003 - STRING[1] +* STRING004 - STRING[0] +* STRING005 - STRING[32] +* STRING006 - STRING[64] +* STRING007 - STRING[0] +* STRING008 - STRING[1] +* STRING009 - STRING[2] +* STRING010 - STRING[3] +* STRING011 - STRING[4] +* STRING012 - STRING[5] +* STRING013 - STRING[6] +* STRING014 - STRING[7] +* STRING015 - STRING[8] +*/ +public class PlcReadWriteStrings implements ConnectionStateListener { + + private static final Logger logger = LoggerFactory.getLogger(PlcReadWriteStrings.class); + private static final long DELAY = 1000L; + + private static String TEST_STRING00 = ""; + private static String TEST_STRING01 = "Y"; + private static String TEST_STRING02 = "YZ"; + private static String TEST_STRING08 = "01234567"; + private static String TEST_STRING254 = + "01234567890123456789012345678901234567890123456789"+ + "01234567890123456789012345678901234567890123456789"+ + "01234567890123456789012345678901234567890123456789"+ + "01234567890123456789012345678901234567890123456789"+ + "01234567890123456789012345678901234567890123456789"+ + "0123"; + + private S7HPlcConnection connection = null; + private AtomicBoolean isConnected = new AtomicBoolean(false); + + private String[] tags = new String[]{"STRING007","STRING008","STRING009", + "STRING010","STRING011","STRING012", + "STRING013","STRING014","STRING015"}; + + /** + * @param args the command line arguments + */ + public static void main(String[] args) throws Exception { + System.setProperty(org.slf4j.simple.SimpleLogger.DEFAULT_LOG_LEVEL_KEY, "Debug"); + + PlcReadWriteStrings device = new PlcReadWriteStrings(); + device.run(); + } + + public void run() throws IOException { + logger.info("*****************************************************"); + logger.info("* Example of connection and read to a Simatic S7-400H"); + logger.info("* Plc: SIMATIC S7-400"); + logger.info("* Model: CPU 417"); + logger.info("* Part number: 6ES7 417-4XT05-0AB0"); + logger.info("* Firmware version: 5.1.0"); + logger.info("* CP1: 6GK7 443-1EX11-0XE0"); + logger.info("* CP2: 6GK7 443-1EX20-0XB0"); + logger.info("*"); + logger.info("* Note: . "); + logger.info("* . "); + logger.info("*****************************************************"); + + OpenConnection("s7://10.10.1.80/10.10.1.81?remote-rack=0&" + + "remote-slot=3&remote-rack2=0&remote-slot=4&" + + "controller-type=S7_400&read-timeout=16&" + + "ping=true&ping-time=8&retry-time=3"); //(01) + + logger.info("*****************************************************"); + logger.info("* 1. Once the connection is executed, it must read"); + logger.info("* the data contained in the address."); + logger.info("* URL to:s7://10.10.1.80/10.10.1.81?remote-rack=0&"); + logger.info(" remote-slot=3&remote-rack2=0&remote-slot=4&"); + logger.info(" controller-type=S7_400&read-timeout=8&"); + logger.info(" ping=true&ping-time=2&retry-time=3"); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + + Read(); //(01.1) + + logger.info("*****************************************************"); + logger.info("* 2. Turn off/on PLC! This will cause the connection"); + logger.info("* handlers to be lost. "); + logger.info("* This simulates connection loss due to lack of "); + logger.info("* traffic, which is handled by OS. "); + logger.info("* When reading is executed, the driver must activate"); + logger.info("* the reconnection process internally."); + logger.info("* In this operation the reading is lost, but "); + logger.info("* the reconnection process begins."); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + System.in.read(); + + Write(); + + logger.info("*****************************************************"); + logger.info("* Write null string.. Clean the DB in ST7/TIA."); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + System.in.read(); + SafeWrite(TEST_STRING00); + SafeRead(TEST_STRING00); + + + logger.info("*****************************************************"); + logger.info("* Write one character string.. Clean the DB in ST7/TIA."); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + System.in.read(); + SafeWrite(TEST_STRING01); + SafeRead(TEST_STRING01); + + + logger.info("*****************************************************"); + logger.info("* Write two character string.. Clean the DB in ST7/TIA."); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + System.in.read(); + SafeWrite(TEST_STRING02); + SafeRead(TEST_STRING02); + + + logger.info("*****************************************************"); + logger.info("* Write eigth character string.. Clean the DB in ST7/TIA"); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + System.in.read(); + SafeWrite(TEST_STRING08); + SafeRead(TEST_STRING08); + + + logger.info("*****************************************************"); + logger.info("* Write 254 character string.. Clean the DB in ST7/TIA"); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + System.in.read(); + SafeWrite(TEST_STRING254); + SafeRead(TEST_STRING254); + + + logger.info("*****************************************************"); + logger.info("* 8. And we close the connection."); + logger.info("* Press [ENTER]"); + logger.info("*****************************************************"); + System.in.read(); + + CloseConnection(); //(08.1) + + } + + + /*************************************************************************** + * Under normal conditions, the driver expects you to have the PLC + * connected to the network to start operations. + * If a connection to the PLC cannot be established, an exception of type + * "PlcConnectionException" is generated, which must be handled by your + * application. In this example it waits for a connection to exist. + * When you disconnect the "connection", the S7 driver will take care of the + * connection and reconnection process if necessary. + * The internal wait time for the connection is one (01) second. + ***************************************************************************/ + private void OpenConnection(String url) { + int retrys = 0; + StopWatch watch = new StopWatch(); + watch.start(); + while (null == connection) { + try { + connection =(S7HPlcConnection) new DefaultPlcDriverManager(). + getConnection(url); + connection.addEventListener(this); + while (!connection.isConnected()); + watch.stop(); + + isConnected.set( connection.isConnected()); + + logger.info("Time elapse for connection: {} in ms, with " + + "rettrys: {}",watch.getTime(), retrys); + + } catch (PlcConnectionException ex) { + logger.info(ex.getMessage()); + //Avoid excessive CPU consumption + try { + TimeUnit.MILLISECONDS.sleep(DELAY); + } catch (InterruptedException ie) { + Thread.currentThread().interrupt(); + } + retrys++; + } + } + + } + + /*************************************************************************** + * When the connection is closed, pending tasks and transactions are + * completed. + * The rest of the work should be sent to the GC. + ***************************************************************************/ + private void CloseConnection() { + if (null == connection) return; + isConnected.set(false); + try { + connection.close(); + connection = null; //GC do you job!. + + } catch (PlcConnectionException ex) { + logger.info("CloseConnection: " + ex.getMessage()); + } + } + + /*************************************************************************** + * The reading process is standard. In case of an exception, + * the user must take the appropriate actions, but "do not close + * the connection": + ***************************************************************************/ + private void Read() { + if (!isConnected.get()) return; + try { + final PlcReadRequest.Builder readrequest = connection.readRequestBuilder(); //(01) + readrequest.addTagAddress("TAG01", "%DB400.DBX0.0:STRING"); //(02) + readrequest.addTagAddress("TAG06", "%DB400.DBX470.0:STRING"); //(02) + readrequest.addTagAddress("TAG02", "%MB190:BYTE"); //(02) + + final PlcReadRequest rr = readrequest.build(); //(03) + final PlcReadResponse response; //(04) + response = rr.execute().get(); //(05) + + if (response.getResponseCode("TAG01") == PlcResponseCode.OK) { //(06) + logger.info("Value1: " + response.getString("TAG01")); + logger.info("Value2: " + response.getString("TAG06")); + logger.info("Value3: " + response.getString("TAG02")); + } else { + logger.info("Problem reading..."); + } + } catch (Exception ex) { //(07) + logger.info("Read: " + ex.getMessage()); + }; + } + + /*************************************************************************** + * The reading process is standard. In case of an exception, + * the user must take the appropriate actions, but "do not close + * the connection": + ***************************************************************************/ + private void Write() { + if (!isConnected.get()) return; + try { + final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) + writeRequest.addTagAddress("TAG01", "%DB400.DBX0.0:STRING",TEST_STRING254 ); //(02) + writeRequest.addTagAddress("TAG06", "%DB400.DBX470.0:STRING",TEST_STRING254 ); //(02) + writeRequest.addTagAddress("TAG08", "%DB400.DBX436.0:STRING",TEST_STRING254 ); //(02) + + final PlcWriteRequest wr = writeRequest.build(); //(03) + final PlcWriteResponse response; //(04) + response = wr.execute().get(); //(05) + + if (response.getResponseCode("TAG01") == PlcResponseCode.OK) { //(06) + logger.info("TAG01 Write sucefull..."); + } else { + logger.info("TAG01 Problem reading..."); + } + + if (response.getResponseCode("TAG06") == PlcResponseCode.OK) { //(06) + logger.info("TAG06 Write sucefull..."); + } else { + logger.info("TAG06 Problem reading..."); + } + + if (response.getResponseCode("TAG08") == PlcResponseCode.OK) { //(06) + logger.info("TAG07 Write sucefull..."); + } else { + logger.info("TAG07 Problem reading..."); + } + + } catch (Exception ex) { //(07) + logger.info("Read: " + ex.getMessage()); + }; + } + + /*************************************************************************** + * Write the String "str" to the different test memory areas. + * No overlap of contents should be shown. + ***************************************************************************/ + private void SafeWrite(String str) { + if (!isConnected.get()) return; + try { + final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) + writeRequest.addTagAddress(tags[0], "%DB400.DBX536.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[1], "%DB400.DBX538.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[2], "%DB400.DBX542.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[3], "%DB400.DBX546.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[4], "%DB400.DBX552.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[5], "%DB400.DBX558.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[6], "%DB400.DBX566.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[7], "%DB400.DBX574.0:STRING",str); //(02) + writeRequest.addTagAddress(tags[8], "%DB400.DBX584.0:STRING",str); //(02) + + final PlcWriteRequest wr = writeRequest.build(); //(03) + final PlcWriteResponse response; //(04) + response = wr.execute().get(); //(05) + + for (String tag:tags) { + if (response.getResponseCode(tag) == PlcResponseCode.OK) //(06) + logger.info(tag + " Write sucefull..."); + } + + } catch (Exception ex) { //(07) + logger.info("Read: " + ex.getMessage()); + }; + } + + /*************************************************************************** + * The reading process is standard. + * Each "value" obtained from the PLC is compared with "str". + * If everything is fine, it should indicate a successful reading. + ***************************************************************************/ + private void SafeRead(String str) { + int index = 0; + int pos = 0; + if (!isConnected.get()) return; + try { + final PlcReadRequest.Builder readRequest = connection.readRequestBuilder(); //(01) + readRequest.addTagAddress(tags[0], "%DB400.DBX536.0:STRING"); //(02) + readRequest.addTagAddress(tags[1], "%DB400.DBX538.0:STRING"); //(02) + readRequest.addTagAddress(tags[2], "%DB400.DBX542.0:STRING"); //(02) + readRequest.addTagAddress(tags[3], "%DB400.DBX546.0:STRING"); //(02) + readRequest.addTagAddress(tags[4], "%DB400.DBX552.0:STRING"); //(02) + readRequest.addTagAddress(tags[5], "%DB400.DBX558.0:STRING"); //(02) + readRequest.addTagAddress(tags[6], "%DB400.DBX566.0:STRING"); //(02) + readRequest.addTagAddress(tags[7], "%DB400.DBX574.0:STRING"); //(02) + readRequest.addTagAddress(tags[8], "%DB400.DBX584.0:STRING"); //(02) + + final PlcReadRequest rr = readRequest.build(); //(03) + final PlcReadResponse response; //(04) + response = rr.execute().get(); //(05) + + + for (String tag:tags) { + if (response.getResponseCode(tag) == PlcResponseCode.OK){ + pos = (index <= str.length())?index:str.length(); + if (response.getString(tag).equals(str.substring(0, pos))){ + logger.info(tag + " Read sucefull..."); + } else { + logger.info(tag + ": " + response.getString(tag) + " : " + str.substring(0, index)); + } + } + index++; + } + + } catch (Exception ex) { //(07) + logger.info("Read: " + ex.getMessage()); + }; + } + + /*************************************************************************** + * This method is called when the driver makes an internal TCP connection. + * The first connection of the driver does not generate this event. + * In the case of high availability systems, this signal should be used + * to restart subscriptions to events, alarms, etc. + ***************************************************************************/ + @Override + public void connected() { + logger.info("*****************************************************"); + logger.info("*************** Plc is connected. *******************"); + logger.info("*****************************************************"); + isConnected.set(true); + } + + /*************************************************************************** + * This method is called when there is a physical disconnection of the driver + * Check the monitoring parameters given in the URL during connection. + ***************************************************************************/ + @Override + public void disconnected() { + logger.info("*****************************************************"); + logger.info("*************** Plc is disconnected. ****************"); + logger.info("*****************************************************"); + isConnected.set(false); + } + + + +} From c93b723a575c2c00a703a4af298144887e021417 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 16:02:46 +0100 Subject: [PATCH 02/21] fix: Updated the var-length string handling code and made it work with WSTRING too. --- .../s7/readwrite/optimizer/S7Optimizer.java | 8 +- .../readwrite/protocol/S7ProtocolLogic.java | 731 ++++++++---------- .../s7/readwrite/tag/S7PlcTagHandler.java | 6 +- .../readwrite/tag/S7StringFixedLengthTag.java | 129 ++++ .../java/s7/readwrite/tag/S7StringTag.java | 199 ----- .../readwrite/tag/S7StringVarLengthTag.java | 119 +++ .../plc4x/java/s7/readwrite/tag/S7Tag.java | 50 +- .../java/s7/readwrite/ManualS7DriverTest.java | 6 + .../java/s7/readwrite/tag/S7TagTest.java | 2 +- 9 files changed, 571 insertions(+), 679 deletions(-) create mode 100644 plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTag.java delete mode 100644 plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java create mode 100644 plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringVarLengthTag.java diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java index 0487f65f942..57ebcd9a4e2 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/optimizer/S7Optimizer.java @@ -38,8 +38,8 @@ import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; -import org.apache.plc4x.java.s7.readwrite.tag.S7StringTag; + +import org.apache.plc4x.java.s7.readwrite.tag.S7StringVarLengthTag; public class S7Optimizer extends BaseOptimizer { @@ -77,7 +77,7 @@ protected List processReadRequest(PlcReadRequest readRequest, Dr continue; } - if ((readRequest.getTag(tagName) instanceof S7StringTag)) { + if ((readRequest.getTag(tagName) instanceof S7StringVarLengthTag)) { LinkedHashMap strTags = new LinkedHashMap<>(); strTags.put(tagName, readRequest.getTag(tagName)); processedRequests.add(new DefaultPlcReadRequest( @@ -155,7 +155,7 @@ protected List processWriteRequest(PlcWriteRequest writeRequest for (String tagName : writeRequest.getTagNames()) { - if ((writeRequest.getTag(tagName) instanceof S7StringTag)) { + if ((writeRequest.getTag(tagName) instanceof S7StringVarLengthTag)) { LinkedHashMap strTags = new LinkedHashMap<>(); strTags.put(tagName, new TagValueItem(writeRequest.getTag(tagName), diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java index 4bfed9bb732..b450981b404 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java @@ -23,6 +23,7 @@ import io.netty.buffer.Unpooled; import org.apache.commons.lang3.concurrent.BasicThreadFactory; import org.apache.commons.lang3.tuple.MutablePair; +import org.apache.plc4x.java.api.exceptions.PlcInvalidTagException; import org.apache.plc4x.java.api.exceptions.PlcProtocolException; import org.apache.plc4x.java.api.exceptions.PlcRuntimeException; import org.apache.plc4x.java.api.messages.*; @@ -54,7 +55,6 @@ import java.nio.ByteBuffer; import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.LocalDateTime; import java.util.*; @@ -62,7 +62,6 @@ import java.util.concurrent.atomic.AtomicInteger; import java.util.function.BiConsumer; import java.util.function.Consumer; -import java.util.logging.Level; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -247,93 +246,67 @@ public void onConnect(ConversationContext context) { */ @Override public void onDisconnect(ConversationContext context) { - //1. Clear all pending requests and their associated transaction + // 1. Clear all pending requests and their associated transaction cleanFutures(); - //2. Here we shutdown the local task executor. + // 2. Here we shut down the local task executor. clientExecutorService.shutdown(); - //3. Performs the shutdown of the transaction executor. + // 3. Performs the shutdown of the transaction executor. tm.shutdown(); - //4. Finish the execution of the tasks for the handling of Events. + // 4. Finish the execution of the tasks for the handling of Events. EventLogic.stop(); - //5. Executes the closing of the main channel. + // 5. Executes the closing of the main channel. context.getChannel().close(); - //6. Here is the stop of any task or state machine that is added. + // 6. Here is the stop of any task or state machine that is added. } @Override public CompletableFuture read(PlcReadRequest readRequest) { + // If we're not connected, just abort with an error. if (!isConnected()) { - CompletableFuture future = new CompletableFuture(); + CompletableFuture future = new CompletableFuture<>(); future.completeExceptionally(new PlcRuntimeException("Disconnected")); return future; } - DefaultPlcReadRequest request = (DefaultPlcReadRequest) readRequest; - List requestItems = new ArrayList<>(request.getNumberOfTags()); - - if (request.getTags().get(0) instanceof S7SzlTag) { - S7SzlTag szltag = (S7SzlTag) request.getTags().get(0); - final S7MessageUserData s7SzlMessageRequest = new S7MessageUserData(1, new S7ParameterUserData(List.of( + DefaultPlcReadRequest request = (DefaultPlcReadRequest) readRequest; + S7Message s7Message; + if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7SzlTag)) { + S7SzlTag szlTag = (S7SzlTag) request.getTags().get(0); + // TODO: Is the tpduReference of 1 correct here? + s7Message = new S7MessageUserData(1, new S7ParameterUserData(List.of( new S7ParameterUserDataItemCPUFunctions((short) 0x11, (byte) 0x4, (byte) 0x4, (short) 0x01, (short) 0x00, null, null, null) )), new S7PayloadUserData(List.of( new S7PayloadUserDataItemCpuFunctionReadSzlRequest(DataTransportErrorCode.OK, DataTransportSize.OCTET_STRING, 0x04, - new SzlId(SzlModuleTypeClass.enumForValue((byte) ((szltag.getSzlId() & 0xf000) >> 12)), - (byte) ((szltag.getSzlId() & 0x0f00) >> 8), - SzlSublist.enumForValue((short) (szltag.getSzlId() & 0x00ff))), - szltag.getIndex()) + new SzlId(SzlModuleTypeClass.enumForValue((byte) ((szlTag.getSzlId() & 0xf000) >> 12)), + (byte) ((szlTag.getSzlId() & 0x0f00) >> 8), + SzlSublist.enumForValue((short) (szlTag.getSzlId() & 0x00ff))), + szlTag.getIndex()) ))); + } - return toPlcReadResponse(readRequest, readInternal(s7SzlMessageRequest)); - - } else if (request.getTags().get(0) instanceof S7AckTag) { - - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); - encodeAlarmAckRequest(request, parameterItems, payloadItems); - final S7MessageUserData s7MessageRequest = new S7MessageUserData(-1, - new S7ParameterUserData(parameterItems), - new S7PayloadUserData(payloadItems)); - return toPlcReadResponse(readRequest, readInternal(s7MessageRequest)); - - } else if (request.getTags().get(0) instanceof S7ClkTag) { - - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); - encodePlcClkRequest(request, parameterItems, payloadItems); - final S7MessageUserData s7MessageRequest = new S7MessageUserData(-1, - new S7ParameterUserData(parameterItems), - new S7PayloadUserData(payloadItems)); - return toPlcReadResponse(readRequest, readInternal(s7MessageRequest)); - - } else if (request.getTags().get(0) instanceof S7StringTag) { - - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); - encodePlcStringReadRequest(request, parameterItems, payloadItems); - - final S7MessageRequest s7MessageRequest = new S7MessageRequest(-1, - parameterItems.get(0), - null); - - return toPlcReadResponse(readRequest, readInternal(s7MessageRequest)); + else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7AckTag)) { + s7Message = encodeAlarmAckRequest(request); } + else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7ClkTag)) { + s7Message = encodePlcClkRequest(request); + } - for (PlcTag tag : request.getTags()) { - requestItems.add(new S7VarRequestParameterItemAddress(encodeS7Address(tag))); + // If the request contains at least one var-length string field, we need to get the real length first. + else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7StringVarLengthTag)) { + s7Message = encodePlcVarLengthStringReadRequest(request); } - // Create a read request template. - // tpuId will be inserted before sending in #readInternal so we insert -1 as dummy here - final S7MessageRequest s7MessageRequest = new S7MessageRequest(-1, - new S7ParameterReadVarRequest(requestItems), - null); + // This is a "normal" read request. + else { + s7Message = encodePlcReadRequest(request); + } // Just send a single response and chain it as Response - return toPlcReadResponse(readRequest, readInternal(s7MessageRequest)); + return toPlcReadResponse(readRequest, readInternal(s7Message)); } /** @@ -357,16 +330,6 @@ private CompletableFuture toPlcReadResponse(PlcReadRequest read } return clientFuture; - - -// return response -// .thenApply(p -> { -// try { -// return ((PlcReadResponse) decodeReadResponse(p, readRequest)); -// } catch (PlcProtocolException e) { -// throw new PlcRuntimeException("Unable to decode Response", e); -// } -// }); } /** @@ -378,17 +341,10 @@ private CompletableFuture toPlcReadResponse(PlcReadRequest read */ private CompletableFuture readInternal(S7Message request) { CompletableFuture future = new CompletableFuture<>(); - int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); - } - S7Message message = (request instanceof S7MessageUserData) ? - new S7MessageUserData(tpduId, request.getParameter(), request.getPayload()) : - new S7MessageRequest(tpduId, request.getParameter(), request.getPayload()); + int tpduId = request.getTpduReference(); - TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, message, true, (byte) tpduId)); + TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, request, true, (byte) tpduId)); // Start a new request-transaction (Is ended in the response-handler) @@ -414,165 +370,30 @@ private CompletableFuture readInternal(S7Message request) { return future; } - //TODO: Clean code @Override public CompletableFuture write(PlcWriteRequest writeRequest) { - - CompletableFuture future = new CompletableFuture<>(); - DefaultPlcWriteRequest request = (DefaultPlcWriteRequest) writeRequest; - - List clkTags = request.getTagNames().stream() - .filter(t -> request.getTag(t) instanceof S7ClkTag) - .collect(Collectors.toList()); - if (!clkTags.isEmpty()) { - return writeClk(writeRequest); - } - - List strTags = request.getTagNames().stream() - .filter(t -> request.getTag(t) instanceof S7StringTag) - .collect(Collectors.toList()); - if (!strTags.isEmpty()) { - return writeString(writeRequest); - } - - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); - - Iterator iter = request.getTagNames().iterator(); - - String tagName; - while (iter.hasNext()) { - tagName = iter.next(); - final S7Tag tag = (S7Tag) request.getTag(tagName); - final PlcValue plcValue = request.getPlcValue(tagName); - parameterItems.add(new S7VarRequestParameterItemAddress(encodeS7Address(tag))); - payloadItems.add(serializePlcValue(tag, plcValue, iter.hasNext())); - } - - -// for (String tagName : request.getTagNames()) { -// final S7Tag tag = (S7Tag) request.getTag(tagName); -// final PlcValue plcValue = request.getPlcValue(tagName); -// parameterItems.add(new S7VarRequestParameterItemAddress(encodeS7Address(tag))); -// payloadItems.add(serializePlcValue(tag, plcValue)); -// -// } - - - final int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); - } - - TPKTPacket tpktPacket = new TPKTPacket( - new COTPPacketData( - null, - new S7MessageRequest(tpduId, - new S7ParameterWriteVarRequest(parameterItems), - new S7PayloadWriteVarRequest(payloadItems) - ), - true, - (byte) tpduId - ) - ); - - // Start a new request-transaction (Is ended in the response-handler) - RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); - transaction.submit(() -> context.sendRequest(tpktPacket) - .onTimeout(new TransactionErrorCallback<>(future, transaction)) - .onError(new TransactionErrorCallback<>(future, transaction)) - .expectResponse(TPKTPacket.class, REQUEST_TIMEOUT) - .check(p -> p.getPayload() instanceof COTPPacketData) - .unwrap(p -> ((COTPPacketData) p.getPayload())) - .unwrap(COTPPacket::getPayload) - .check(p -> p.getTpduReference() == tpduId) - .handle(p -> { - try { - future.complete(((PlcWriteResponse) decodeWriteResponse(p, writeRequest))); - } catch (PlcProtocolException e) { - logger.warn("Error sending 'write' message: '{}'", e.getMessage(), e); - } - // Finish the request-transaction. - transaction.endRequest(); - })); - return future; - } - - //TODO: Clean code - public CompletableFuture writeClk(PlcWriteRequest writeRequest) { CompletableFuture future = new CompletableFuture<>(); DefaultPlcWriteRequest request = (DefaultPlcWriteRequest) writeRequest; - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); - - encodePlcClkSetRequest((DefaultPlcWriteRequest) writeRequest, - parameterItems, payloadItems); + int tpduId = getTpduId(); - final int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); + TPKTPacket tpktPacket; + // TODO: Write one or two lines on what happens here ... to me it looks as if there's at least on S7ClkTag, then all is handled by the writeClk method, but what happens if a request would contain mixed tag types? + if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7ClkTag)) { + tpktPacket = encodePlcClkSetRequest((DefaultPlcWriteRequest) writeRequest, tpduId); } - TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, - new S7MessageUserData(tpduId, - new S7ParameterUserData(parameterItems), - new S7PayloadUserData(payloadItems)), - true, (byte) tpduId)); - - // Start a new request-transaction (Is ended in the response-handler) - RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); - transaction.submit(() -> context.sendRequest(tpktPacket) - .onTimeout(new TransactionErrorCallback<>(future, transaction)) - .onError(new TransactionErrorCallback<>(future, transaction)) - .expectResponse(TPKTPacket.class, REQUEST_TIMEOUT) - .check(p -> p.getPayload() instanceof COTPPacketData) - .unwrap(p -> ((COTPPacketData) p.getPayload())) - .unwrap(COTPPacket::getPayload) - .check(p -> p.getTpduReference() == tpduId) - .handle(p -> { - try { - future.complete(((PlcWriteResponse) decodeWriteResponse(p, writeRequest))); - } catch (PlcProtocolException e) { - logger.warn("Error sending 'write' message: '{}'", e.getMessage(), e); - } - // Finish the request-transaction. - transaction.endRequest(); - })); - return future; - } - - //TODO: Clean code - public CompletableFuture writeString(PlcWriteRequest writeRequest) { - CompletableFuture future = new CompletableFuture<>(); - DefaultPlcWriteRequest request = (DefaultPlcWriteRequest) writeRequest; - - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); - - encodePlcStringWriteRequest((DefaultPlcWriteRequest) writeRequest, - parameterItems, payloadItems); + // If the list of tags contains at least one STRING/WSTRING element, + // we need to check the sizes of the string fields in a first request. + else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7StringVarLengthTag)) { + tpktPacket = encodePlcStringWriteRequest((DefaultPlcWriteRequest) writeRequest, tpduId); + } - final int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); + // This is a request only containing ordinary tags + else { + tpktPacket = encodeOrdinaryWriteRequest(request, tpduId); } - TPKTPacket tpktPacket = new TPKTPacket( - new COTPPacketData( - null, - new S7MessageRequest(tpduId, - new S7ParameterWriteVarRequest(parameterItems), - new S7PayloadWriteVarRequest(payloadItems) - ), - true, - (byte) tpduId - ) - ); - // Start a new request-transaction (Is ended in the response-handler) RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); transaction.submit(() -> context.sendRequest(tpktPacket) @@ -616,25 +437,21 @@ public CompletableFuture subscribe(PlcSubscriptionReque CompletableFuture response = new CompletableFuture<>(); subscriptionRequest.getTagNames().forEach(fieldName -> futures.put(fieldName, new CompletableFuture<>())); - // futures.put("DATA_", new CompletableFuture<>()); DefaultPlcSubscriptionRequest request = (DefaultPlcSubscriptionRequest) subscriptionRequest; - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); + int tpduId = getTpduId(); //The main task that runs the subscriptions. Thread t1 = new Thread(() -> { - - //for (String tagName : request.getTagNames()) { - //final DefaultPlcSubscriptionTag sf = (DefaultPlcSubscriptionTag) request.getTag(tagName); final DefaultPlcSubscriptionTag sf = (DefaultPlcSubscriptionTag) request.getTags().get(0); final S7SubscriptionTag tag = (S7SubscriptionTag) sf.getTag(); + S7Message s7Message = null; switch (tag.getTagType()) { case EVENT_SUBSCRIPTION: - encodeEventSubscriptionRequest(request, parameterItems, payloadItems); + s7Message = encodeEventSubscriptionRequest(request, tpduId); break; case EVENT_UNSUBSCRIPTION: //encodeEventUnSubscriptionRequest(request, parameterItems, payloadItems); @@ -643,35 +460,24 @@ public CompletableFuture subscribe(PlcSubscriptionReque //encodeAlarmAckRequest(request, parameterItems, payloadItems); break; case ALARM_QUERY: - encodeAlarmQueryRequest(request, parameterItems, payloadItems); + s7Message = encodeAlarmQueryRequest(request, tpduId); break; case CYCLIC_SUBSCRIPTION: - encodeCycledS7ANYSubscriptionRequest(request, parameterItems, payloadItems); + s7Message = encodeCycledS7ANYSubscriptionRequest(request, tpduId); break; case CYCLIC_DB_SUBSCRIPTION: - encodeCycledDBREADSubscriptionRequest(request, parameterItems, payloadItems); + s7Message = encodeCycledDBREADSubscriptionRequest(request, tpduId); break; case CYCLIC_UNSUBSCRIPTION: //encodeCycledUnSubscriptionRequest(request, parameterItems, payloadItems); break; default: } - //} //Next - - //final PlcValue plcValue = request.getPlcValue(tagName); - //parameterItems.add(new S7VarRequestParameterItemAddress(encodeS7Address(tag))); - //payloadItems.add(serializePlcValue(tag, plcValue)); - final int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); + if(s7Message == null) { + throw new PlcInvalidTagException("Unsupported tag of type: " + tag.getTagType()); } - TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, - new S7MessageUserData(tpduId, - new S7ParameterUserData(parameterItems), - new S7PayloadUserData(payloadItems)), - true, (byte) tpduId)); + TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, s7Message,true, (byte) tpduId)); // Start a new request-transaction (Is ended in the response-handler) RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); @@ -697,10 +503,10 @@ public CompletableFuture subscribe(PlcSubscriptionReque try { S7Message responseMessage = futures.get("DATA_").get(); S7ParameterUserData parameter = (S7ParameterUserData) responseMessage.getParameter(); - S7ParameterUserDataItemCPUFunctions msgparameter = (S7ParameterUserDataItemCPUFunctions) parameter.getItems().get(0); + S7ParameterUserDataItemCPUFunctions msgParameter = (S7ParameterUserDataItemCPUFunctions) parameter.getItems().get(0); - valuesResponse.put(Integer.toString(msgparameter.getSequenceNumber()), - decodeEventSubscriptionRequest(Integer.toString(msgparameter.getSequenceNumber()), subscriptionRequest, futures.get("DATA_").get())); + valuesResponse.put(Integer.toString(msgParameter.getSequenceNumber()), + decodeEventSubscriptionResponse(Integer.toString(msgParameter.getSequenceNumber()), subscriptionRequest, futures.get("DATA_").get())); } catch (Exception ex) { logger.warn(ex.toString()); @@ -708,7 +514,6 @@ public CompletableFuture subscribe(PlcSubscriptionReque try { - ///maintask.get(); HashMap> values = new HashMap<>(); valuesResponse.forEach((s, p) -> { @@ -750,11 +555,7 @@ public CompletableFuture unsubscribe(PlcUnsubscriptio encodeCycledUnSubscriptionRequest(request, parameterItems, payloadItems); - final int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); - } + int tpduId = getTpduId(); TPKTPacket tpktPacket = new TPKTPacket( new COTPPacketData(null, @@ -788,9 +589,10 @@ public CompletableFuture unsubscribe(PlcUnsubscriptio return future; } - private void encodeEventSubscriptionRequest(DefaultPlcSubscriptionRequest request, - List parameterItems, - List payloadItems) { + private S7Message encodeEventSubscriptionRequest(DefaultPlcSubscriptionRequest request, int tpduId) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); + byte subsEvent = 0x00; for (String tagName : request.getTagNames()) { if (request.getTag(tagName) instanceof DefaultPlcSubscriptionTag) { @@ -812,12 +614,9 @@ private void encodeEventSubscriptionRequest(DefaultPlcSubscriptionRequest reques null, //LastDataUnit null //errorCode ); - parameterItems.clear(); parameterItems.add(parameter); - S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest payload; - if (subsEvent > 0) { payload = new S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest( DataTransportErrorCode.OK, @@ -847,13 +646,14 @@ private void encodeEventSubscriptionRequest(DefaultPlcSubscriptionRequest reques alarmType, (short) 0x00); } - - payloadItems.clear(); payloadItems.add(payload); + return new S7MessageUserData(tpduId, + new S7ParameterUserData(parameterItems), + new S7PayloadUserData(payloadItems)); } - private PlcSubscriptionResponse decodeEventSubscriptionRequest(String strTagName, + private PlcSubscriptionResponse decodeEventSubscriptionResponse(String strTagName, PlcSubscriptionRequest plcSubscriptionRequest, S7Message responseMessage) throws PlcProtocolException { @@ -1118,9 +918,9 @@ private PlcSubscriptionResponse decodeEventSubscriptionRequest(String strTagName return null; } - private void encodeAlarmAckRequest(DefaultPlcReadRequest request, - List parameterItems, - List payloadItems) { + private S7Message encodeAlarmAckRequest(DefaultPlcReadRequest request) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); S7ParameterUserDataItemCPUFunctions parameter = new S7ParameterUserDataItemCPUFunctions( (short) 0x11, //Method @@ -1132,7 +932,6 @@ private void encodeAlarmAckRequest(DefaultPlcReadRequest request, null, //LastDataUnit null //errorCode ); - parameterItems.clear(); parameterItems.add(parameter); ArrayList messageObjects = null; @@ -1160,22 +959,22 @@ private void encodeAlarmAckRequest(DefaultPlcReadRequest request, } } - S7PayloadUserDataItemCpuFunctionAlarmAckRequest payload = new S7PayloadUserDataItemCpuFunctionAlarmAckRequest( DataTransportErrorCode.OK, DataTransportSize.OCTET_STRING, 0x0c, messageObjects); -// - payloadItems.clear(); payloadItems.add(payload); + return new S7MessageUserData(getTpduId(), + new S7ParameterUserData(parameterItems), + new S7PayloadUserData(payloadItems)); } - private void encodeAlarmQueryRequest(DefaultPlcSubscriptionRequest request, - List parameterItems, - List payloadItems) { + private S7Message encodeAlarmQueryRequest(DefaultPlcSubscriptionRequest request, int tpduId) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); S7ParameterUserDataItemCPUFunctions parameter = new S7ParameterUserDataItemCPUFunctions( (short) 0x11, //Method @@ -1187,8 +986,6 @@ private void encodeAlarmQueryRequest(DefaultPlcSubscriptionRequest request, null, //LastDataUnit null //errorCode ); - - parameterItems.clear(); parameterItems.add(parameter); //TODO: Chequear el tipo dfe larma. @@ -1200,20 +997,21 @@ private void encodeAlarmQueryRequest(DefaultPlcSubscriptionRequest request, SyntaxIdType.ALARM_QUERYREQSET, QueryType.ALARM_8P, AlarmType.ALARM_8); - - payloadItems.clear(); payloadItems.add(payload); + + return new S7MessageUserData(tpduId, + new S7ParameterUserData(parameterItems), + new S7PayloadUserData(payloadItems)); } - private void encodeCycledSubscriptionRequest(DefaultPlcSubscriptionRequest request, - List parameterItems, - List payloadItem) { + private void encodeCycledSubscriptionRequest(DefaultPlcSubscriptionRequest request, int tpduId) { } - private void encodeCycledS7ANYSubscriptionRequest(DefaultPlcSubscriptionRequest request, - List parameterItems, - List payloadItems) { + private S7Message encodeCycledS7ANYSubscriptionRequest(DefaultPlcSubscriptionRequest request, int tpduId) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); + S7ParameterUserDataItemCPUFunctions parameter = new S7ParameterUserDataItemCPUFunctions( (short) 0x11, //Method (byte) 0x04, //FunctionType @@ -1224,8 +1022,6 @@ private void encodeCycledS7ANYSubscriptionRequest(DefaultPlcSubscriptionRequest null, //LastDataUnit null //errorCode ); - - parameterItems.clear(); parameterItems.add(parameter); //TODO: Chequear la asignacionde tipo @@ -1284,15 +1080,18 @@ private void encodeCycledS7ANYSubscriptionRequest(DefaultPlcSubscriptionRequest s7tag_base.getMultiplier(), items ); - - payloadItems.clear(); payloadItems.add(payload); + + return new S7MessageUserData(tpduId, + new S7ParameterUserData(parameterItems), + new S7PayloadUserData(payloadItems)); } - private void encodeCycledDBREADSubscriptionRequest(DefaultPlcSubscriptionRequest request, - List parameterItems, - List payloadItems) { + private S7Message encodeCycledDBREADSubscriptionRequest(DefaultPlcSubscriptionRequest request, int tpduId) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); + S7ParameterUserDataItemCPUFunctions parameter = new S7ParameterUserDataItemCPUFunctions( (short) 0x11, //Method (byte) 0x04, //FunctionType @@ -1303,8 +1102,6 @@ private void encodeCycledDBREADSubscriptionRequest(DefaultPlcSubscriptionRequest null, //LastDataUnit null //errorCode ); - - parameterItems.clear(); parameterItems.add(parameter); //TODO: Chequear la asignacionde tipo @@ -1317,10 +1114,10 @@ private void encodeCycledDBREADSubscriptionRequest(DefaultPlcSubscriptionRequest //CycServiceItemDbReadType[] cycitems = new CycServiceItemDbReadType[(int) cycitemcount]; List cycItems = new ArrayList<>(); ArrayList subItems = new ArrayList<>(); - for (S7Tag userfield : s7tag.getS7Tags()) { - subItems.add(new SubItem((short) userfield.getNumberOfElements(), - userfield.getBlockNumber(), - userfield.getByteOffset())); + for (S7Tag userTag : s7tag.getS7Tags()) { + subItems.add(new SubItem((short) userTag.getNumberOfElements(), + userTag.getBlockNumber(), + userTag.getByteOffset())); } int initPos = 0; @@ -1353,9 +1150,11 @@ private void encodeCycledDBREADSubscriptionRequest(DefaultPlcSubscriptionRequest s7tag.getMultiplier(), cycItems ); - - payloadItems.clear(); payloadItems.add(payload); + + return new S7MessageUserData(tpduId, + new S7ParameterUserData(parameterItems), + new S7PayloadUserData(payloadItems)); } @@ -1413,9 +1212,10 @@ private void encodeCycledUnSubscriptionRequest(DefaultPlcUnsubscriptionRequest r /* * */ - private void encodePlcClkRequest(DefaultPlcReadRequest request, - List parameterItems, - List payloadItems) { + private S7Message encodePlcClkRequest(DefaultPlcReadRequest request) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); + final S7ClkTag tag = (S7ClkTag) request.getTags().get(0); int subFunction = tag.getAddressString().equals("CLK") ? 1 : 3; @@ -1429,8 +1229,6 @@ private void encodePlcClkRequest(DefaultPlcReadRequest request, null, //LastDataUnit null //errorCode ); - - parameterItems.clear(); parameterItems.add(parameter); S7PayloadUserDataItemClkRequest payload; @@ -1438,17 +1236,19 @@ private void encodePlcClkRequest(DefaultPlcReadRequest request, DataTransportErrorCode.NOT_FOUND, DataTransportSize.NULL, 0x00); - - payloadItems.clear(); payloadItems.add(payload); + + return new S7MessageUserData(getTpduId(), + new S7ParameterUserData(parameterItems), + new S7PayloadUserData(payloadItems)); } /* * */ - private void encodePlcClkSetRequest(DefaultPlcWriteRequest request, - List parameterItems, - List payloadItems) { + private TPKTPacket encodePlcClkSetRequest(DefaultPlcWriteRequest request, int tpduId) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); S7ParameterUserDataItemCPUFunctions parameter = new S7ParameterUserDataItemCPUFunctions( (short) 0x11, //Method @@ -1460,8 +1260,6 @@ private void encodePlcClkSetRequest(DefaultPlcWriteRequest request, null, //LastDataUnit null //errorCode ); - - parameterItems.clear(); parameterItems.add(parameter); S7ClkTag tag = (S7ClkTag) request.getTags().get(0); @@ -1472,9 +1270,13 @@ private void encodePlcClkSetRequest(DefaultPlcWriteRequest request, DataTransportSize.OCTET_STRING, 0x0A, tag.getDateAndTime()); - - payloadItems.clear(); payloadItems.add(payload); + + return new TPKTPacket(new COTPPacketData(null, + new S7MessageUserData(tpduId, + new S7ParameterUserData(parameterItems), + new S7PayloadUserData(payloadItems)), + true, (byte) tpduId)); } @@ -1506,65 +1308,115 @@ private void encodePlcClkSetRequest(DefaultPlcWriteRequest request, * by "intActualChars" are recovered. * TODO: Maximum waiting time managed by system variables. */ - private void encodePlcStringReadRequest(DefaultPlcReadRequest request, - List parameterItems, - List payloadItems) { - - int intMaxChars = 0; - int intActualChars = 0; - - final S7StringTag tag = (S7StringTag) request.getTags().get(0); - - //Read the max length and actual size. - - final S7MessageRequest readRequest = new S7MessageRequest(1,new S7ParameterReadVarRequest( - List.of(new S7VarRequestParameterItemAddress( - new S7AddressAny( - TransportSize.BYTE, - 2, - tag.getBlockNumber(), - MemoryArea.DATA_BLOCKS, - tag.getByteOffset(), - tag.getBitOffset() - )) - - )), null); - + private S7Message encodePlcVarLengthStringReadRequest(DefaultPlcReadRequest request) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + + // Build a request to read the length information for every var-length string in the request. + List varLengthStringTags = request.getTags().stream() + .filter(plcTag -> plcTag instanceof S7StringVarLengthTag) + .map(plcTag -> (S7StringVarLengthTag) plcTag) + .collect(Collectors.toList()); + List stringFields = new ArrayList<>(varLengthStringTags.size()); + for (S7StringVarLengthTag varLengthStringTag : varLengthStringTags) { + // For STRING, the header is 2 bytes (first byte contains the max length and the second the actual length) + if(varLengthStringTag.getDataType() == TransportSize.STRING) { + stringFields.add(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + 2, + varLengthStringTag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + varLengthStringTag.getByteOffset(), + varLengthStringTag.getBitOffset() + ))); + } + // For WSTRING, the header is 4 bytes (first word contains the max length and the second the actual length) + else if(varLengthStringTag.getDataType() == TransportSize.WSTRING) { + stringFields.add(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + 4, + varLengthStringTag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + varLengthStringTag.getByteOffset(), + varLengthStringTag.getBitOffset() + ))); + } else { + throw new PlcInvalidTagException("Only STRING and WSTRING allowed here."); + } + } + final S7MessageRequest readRequest = new S7MessageRequest( + getTpduId(), new S7ParameterReadVarRequest(stringFields), null); + + // Read the max length and actual size for each of the var-length strings. CompletableFuture future = readInternal(readRequest); - + + Map stringLengths = new HashMap<>(varLengthStringTags.size()); try { - S7Message get = future.get(2000, TimeUnit.MILLISECONDS); - final S7VarPayloadDataItem payload = (S7VarPayloadDataItem)((S7PayloadReadVarResponse) get.getPayload()).getItems().get(0); - //intMaxChars = Byte.toUnsignedInt(payload.getData()[0]); - intActualChars = Byte.toUnsignedInt(payload.getData()[1]); + // TODO: Check if we're not blocking the execute method here ... + S7Message getLengthsResponseMessage = future.get(2000, TimeUnit.MILLISECONDS); + S7PayloadReadVarResponse getLengthsResponse = (S7PayloadReadVarResponse) getLengthsResponseMessage.getPayload(); + int curItemIndex = 0; + for (S7StringVarLengthTag varLengthStringTag : varLengthStringTags) { + S7VarPayloadDataItem s7VarPayloadDataItem = getLengthsResponse.getItems().get(curItemIndex); + ReadBufferByteBased readBuffer = new ReadBufferByteBased(s7VarPayloadDataItem.getData()); + try { + if (varLengthStringTag.getDataType() == TransportSize.STRING) { + /*int maxChars = */readBuffer.readUnsignedInt("maxLength", 8); + int actualChars = readBuffer.readUnsignedInt("maxLength", 8); + stringLengths.put(varLengthStringTag, actualChars); + } else if (varLengthStringTag.getDataType() == TransportSize.WSTRING) { + /*int maxChars = */readBuffer.readUnsignedInt("maxLength", 16); + int actualChars = readBuffer.readUnsignedInt("maxLength", 16); + stringLengths.put(varLengthStringTag, actualChars); + } else { + throw new PlcInvalidTagException("Only STRING and WSTRING allowed here."); + } + } catch (ParseException e) { + throw new PlcInvalidTagException("Error reading var-length string actual lengths."); + } + } } catch (InterruptedException ex) { logger.info(ex.getMessage()); - } catch (ExecutionException ex) { - logger.info(ex.getMessage()); - } catch (TimeoutException ex) { + Thread.currentThread().interrupt(); + } catch (ExecutionException | TimeoutException ex) { logger.info(ex.getMessage()); } - - //Create the message structure for the user request. - - S7ParameterReadVarRequest parameter = new S7ParameterReadVarRequest( - List.of(new S7VarRequestParameterItemAddress( - new S7AddressAny( - TransportSize.BYTE, - intActualChars, - tag.getBlockNumber(), - MemoryArea.DATA_BLOCKS, - tag.getByteOffset()+2, - tag.getBitOffset() - )) - - )); - parameterItems.clear(); - parameterItems.add(parameter); + // Create an alternative list of request items, where all var-length string tags are replaced with + // fixed-length string tags using the string length returned by the previous request. + LinkedHashMap updatedRequestItems = new LinkedHashMap<>(request.getNumberOfTags()); + for (String tagName : request.getTagNames()) { + PlcTag tag = request.getTag(tagName); + if(tag instanceof S7StringVarLengthTag) { + S7StringVarLengthTag varLengthTag = (S7StringVarLengthTag) tag; + int stringLength = stringLengths.get(varLengthTag); + S7StringFixedLengthTag newTag = new S7StringFixedLengthTag(varLengthTag.getDataType(), varLengthTag.getMemoryArea(), + varLengthTag.getBlockNumber(), varLengthTag.getByteOffset(), varLengthTag.getBitOffset(), + varLengthTag.getNumberOfElements(), stringLength); + updatedRequestItems.put(tagName, newTag); + } else { + updatedRequestItems.put(tagName, tag); + } + } - payloadItems.clear(); + // Use the normal functionality to execute the read request. + // TODO: Here technically the request object in the response will not match the original request. + return encodePlcReadRequest(new DefaultPlcReadRequest(request.getReader(), updatedRequestItems)); + } + + private S7Message encodePlcReadRequest(DefaultPlcReadRequest request) { + // Convert each tag in the request into a corresponding item used in the S7 protocol. + List requestItems = new ArrayList<>(request.getNumberOfTags()); + for (PlcTag tag : request.getTags()) { + requestItems.add(new S7VarRequestParameterItemAddress(encodeS7Address(tag))); + } + // Create a read request template. + // tpuId will be inserted before sending in #readInternal, so we insert -1 as dummy here + return new S7MessageRequest(getTpduId(), + new S7ParameterReadVarRequest(requestItems), + null); } @@ -1596,17 +1448,18 @@ private void encodePlcStringReadRequest(DefaultPlcReadRequest request, * by "intMaxChars" are writed. * TODO: Maximum waiting time managed by system variables. */ - private void encodePlcStringWriteRequest(DefaultPlcWriteRequest request, - List parameterItems, - List payloadItems) { + private TPKTPacket encodePlcStringWriteRequest(DefaultPlcWriteRequest request, + int tpduId) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); int intMaxChars = 0; int intActualChars = 0; - - final S7StringTag tag = (S7StringTag) request.getTags().get(0); + + final S7StringVarLengthTag tag = (S7StringVarLengthTag) request.getTags().get(0); //Read the max length and actual size. - + // TODO: Is the tpduId of 1 correct here? final S7MessageRequest readRequest = new S7MessageRequest(1,new S7ParameterReadVarRequest( List.of(new S7VarRequestParameterItemAddress( new S7AddressAny( @@ -1636,17 +1489,14 @@ private void encodePlcStringWriteRequest(DefaultPlcWriteRequest request, } //Create the message structure for the user request. - - parameterItems.clear(); - payloadItems.clear(); - + Iterator iter = request.getTagNames().iterator(); String tagName; PlcValue plcValue; while (iter.hasNext()) { tagName = iter.next(); - final S7StringTag tagRef = (S7StringTag) request.getTag(tagName); + final S7StringVarLengthTag tagRef = (S7StringVarLengthTag) request.getTag(tagName); plcValue = request.getPlcValue(tagName); //Check if String @@ -1675,10 +1525,45 @@ private void encodePlcStringWriteRequest(DefaultPlcWriteRequest request, payloadItems.add(new S7VarPayloadDataItem(DataTransportErrorCode.OK, transportSize, byteBuffer.array()/*, hasNext*/)); } - - } - - + + return new TPKTPacket( + new COTPPacketData( + null, + new S7MessageRequest(tpduId, + new S7ParameterWriteVarRequest(parameterItems), + new S7PayloadWriteVarRequest(payloadItems) + ), + true, + (byte) tpduId + ) + ); + } + + private TPKTPacket encodeOrdinaryWriteRequest(DefaultPlcWriteRequest request, + int tpduId) { + List parameterItems = new ArrayList<>(request.getNumberOfTags()); + List payloadItems = new ArrayList<>(request.getNumberOfTags()); + + for (String tagName : request.getTagNames()) { + final S7Tag tag = (S7Tag) request.getTag(tagName); + final PlcValue plcValue = request.getPlcValue(tagName); + parameterItems.add(new S7VarRequestParameterItemAddress(encodeS7Address(tag))); + payloadItems.add(serializePlcValue(tag, plcValue)); + } + + return new TPKTPacket( + new COTPPacketData( + null, + new S7MessageRequest(tpduId, + new S7ParameterWriteVarRequest(parameterItems), + new S7PayloadWriteVarRequest(payloadItems) + ), + true, + (byte) tpduId + ) + ); + } + /** * This method is only called when there is no Response Handler. */ @@ -1885,7 +1770,7 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest } else { logger.warn("Got an unknown error response from the PLC. Error Class: {}, Error Code {}. " + "We probably need to implement explicit handling for this, so please file a bug-report " + - "on https://issues.apache.org/jira/projects/PLC4X and ideally attach a WireShark dump " + + "on https://github.com/apache/plc4x/issues and ideally attach a WireShark dump " + "containing a capture of the communication.", errorClass, errorCode); for (String tagName : plcReadRequest.getTagNames()) { @@ -1896,13 +1781,12 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest } } - //TODO: Reemsambling message. + //TODO: Reassembling message. if (responseMessage instanceof S7MessageResponseData) { for (String tagName : plcReadRequest.getTagNames()) { - if (plcReadRequest.getTag(tagName) instanceof S7StringTag) { + if (plcReadRequest.getTag(tagName) instanceof S7StringVarLengthTag) { PlcValue plcValue = null; PlcResponseCode responseCode = PlcResponseCode.INTERNAL_ERROR; - List plcValues = new LinkedList<>(); ResponseItem result = new ResponseItem<>(responseCode, plcValue); values.put(tagName, result); } @@ -2036,32 +1920,24 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest List payloadItems = payload.getItems(); int index = 0; - PlcResponseCode responseCode = null; - PlcValue plcValue = null; + PlcResponseCode responseCode; + PlcValue plcValue; for (String tagName : plcReadRequest.getTagNames()) { - - if (plcReadRequest.getTag(tagName) instanceof S7StringTag) { - - final S7VarPayloadDataItem payloadItem = payloadItems.get(index); - responseCode = decodeResponseCode(payloadItem.getReturnCode()); - plcValue = new PlcSTRING(new String(payloadItem.getData(), StandardCharsets.UTF_8)); - - } else { - S7Tag tag = (S7Tag) plcReadRequest.getTag(tagName); - S7VarPayloadDataItem payloadItem = payloadItems.get(index); + S7Tag tag = (S7Tag) plcReadRequest.getTag(tagName); + S7VarPayloadDataItem payloadItem = payloadItems.get(index); - responseCode = decodeResponseCode(payloadItem.getReturnCode()); - plcValue = null; - - ByteBuf data = Unpooled.wrappedBuffer(payloadItem.getData()); - if (responseCode == PlcResponseCode.OK) { - try { - plcValue = parsePlcValue(tag, data); - } catch (Exception e) { - throw new PlcProtocolException("Error decoding PlcValue", e); - } + responseCode = decodeResponseCode(payloadItem.getReturnCode()); + plcValue = null; + + ByteBuf data = Unpooled.wrappedBuffer(payloadItem.getData()); + if (responseCode == PlcResponseCode.OK) { + try { + plcValue = parsePlcValue(tag, data); + } catch (Exception e) { + throw new PlcProtocolException("Error decoding PlcValue", e); } - }; + } + ResponseItem result = new ResponseItem<>(responseCode, plcValue); values.put(tagName, result); index++; @@ -2137,10 +2013,10 @@ private PlcResponse decodeWriteResponse(S7Message responseMessage, PlcWriteReque return new DefaultPlcWriteResponse(plcWriteRequest, responses); } - private S7VarPayloadDataItem serializePlcValue(S7Tag tag, PlcValue plcValue, Boolean hasNext) { + private S7VarPayloadDataItem serializePlcValue(S7Tag tag, PlcValue plcValue) { try { DataTransportSize transportSize = tag.getDataType().getDataTransportSize(); - int stringLength = (tag instanceof S7StringTag) ? ((S7StringTag) tag).getStringLength() : 254; + int stringLength = (tag instanceof S7StringFixedLengthTag) ? ((S7StringFixedLengthTag) tag).getStringLength() : 254; ByteBuffer byteBuffer = null; for (int i = 0; i < tag.getNumberOfElements(); i++) { final int lengthInBits = DataItem.getLengthInBits(plcValue.getIndex(i), tag.getDataType().getDataProtocolId(), stringLength); @@ -2165,7 +2041,7 @@ private S7VarPayloadDataItem serializePlcValue(S7Tag tag, PlcValue plcValue, Boo private PlcValue parsePlcValue(S7Tag tag, ByteBuf data) { ReadBuffer readBuffer = new ReadBufferByteBased(data.array()); try { - int stringLength = (tag instanceof S7StringTag) ? ((S7StringTag) tag).getStringLength() : 254; + int stringLength = (tag instanceof S7StringFixedLengthTag) ? ((S7StringFixedLengthTag) tag).getStringLength() : 254; if (tag.getNumberOfElements() == 1) { return DataItem.staticParse(readBuffer, tag.getDataType().getDataProtocolId(), stringLength); @@ -2265,11 +2141,11 @@ protected S7Address encodeS7Address(PlcTag tag) { } if (transportSize == TransportSize.STRING) { transportSize = TransportSize.CHAR; - int stringLength = (s7Tag instanceof S7StringTag) ? ((S7StringTag) s7Tag).getStringLength() : 254; + int stringLength = (s7Tag instanceof S7StringFixedLengthTag) ? ((S7StringFixedLengthTag) s7Tag).getStringLength() : 254; numElements = numElements * (stringLength + 2); } else if (transportSize == TransportSize.WSTRING) { transportSize = TransportSize.CHAR; - int stringLength = (s7Tag instanceof S7StringTag) ? ((S7StringTag) s7Tag).getStringLength() : 254; + int stringLength = (s7Tag instanceof S7StringFixedLengthTag) ? ((S7StringFixedLengthTag) s7Tag).getStringLength() : 254; numElements = numElements * (stringLength + 2) * 2; } return new S7AddressAny(transportSize, numElements, s7Tag.getBlockNumber(), @@ -2328,12 +2204,8 @@ private CompletableFuture reassembledMessage(short sequenceNu CompletableFuture future = new CompletableFuture<>(); - //TODO: PDU id is the same, we need check. - int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); - } + //TODO: We need to verify that the returned tpdu id is the same in the response. + int tpduId = getTpduId(); TPKTPacket request = createSzlReassembledRequest(tpduId, sequenceNumber); @@ -2372,12 +2244,8 @@ private TPKTPacket createSzlReassembledRequest(int tpduId, short sequenceNumber) private CompletableFuture reassembledAlarmEvents(short sequenceNumber) { CompletableFuture future = new CompletableFuture<>(); - //TODO: PDU id is the same, we need check. - int tpduId = tpduGenerator.getAndIncrement(); - // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 - if (tpduGenerator.get() == 0xFFFF) { - tpduGenerator.set(1); - } + //TODO: We need to verify that the returned tpdu id is the same in the response. + int tpduId = getTpduId(); TPKTPacket request = createAlarmQueryReassembledRequest(tpduId, sequenceNumber); @@ -2411,6 +2279,15 @@ private TPKTPacket createAlarmQueryReassembledRequest(int tpduId, short sequence return new TPKTPacket(cotpPacketData); } + private int getTpduId() { + int tpduId = tpduGenerator.getAndIncrement(); + // If we've reached the max value for a 16 bit transaction identifier, reset back to 1 + if (tpduGenerator.get() == 0xFFFF) { + tpduGenerator.set(1); + } + return tpduId; + } + /** * A generic purpose error handler which terminates transaction and calls back given future with error message. diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java index 4a43836a3a6..0a9cdddeafd 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7PlcTagHandler.java @@ -27,8 +27,10 @@ public class S7PlcTagHandler implements PlcTagHandler { @Override public PlcTag parseTag(String tagAddress) { - if (S7StringTag.matches(tagAddress)) { - return S7StringTag.of(tagAddress); + if (S7StringVarLengthTag.matches(tagAddress)) { + return S7StringVarLengthTag.of(tagAddress); + } else if (S7StringFixedLengthTag.matches(tagAddress)) { + return S7StringFixedLengthTag.of(tagAddress); } else if (S7SubscriptionTag.matches(tagAddress)) { return S7SubscriptionTag.of(tagAddress); } else if (S7ClkTag.matches(tagAddress)) { diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTag.java new file mode 100644 index 00000000000..b573a8cefc2 --- /dev/null +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTag.java @@ -0,0 +1,129 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite.tag; + +import org.apache.plc4x.java.api.exceptions.PlcInvalidTagException; +import org.apache.plc4x.java.s7.readwrite.MemoryArea; +import org.apache.plc4x.java.s7.readwrite.TransportSize; +import org.apache.plc4x.java.spi.codegen.WithOption; +import org.apache.plc4x.java.spi.generation.SerializationException; +import org.apache.plc4x.java.spi.generation.WriteBuffer; + +import java.nio.charset.StandardCharsets; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class S7StringFixedLengthTag extends S7Tag { + + public static final Pattern DATA_BLOCK_STRING_FIXED_LENGTH_ADDRESS_PATTERN = + Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); + + public static final Pattern DATA_BLOCK_STRING_FIXED_LENGTH_SHORT_PATTERN = + Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); + + private final int stringLength; + + public S7StringFixedLengthTag(TransportSize dataType, MemoryArea memoryArea, + int blockNumber, int byteOffset, + byte bitOffset, int numElements, + int stringLength) { + super(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements); + this.stringLength = stringLength; + } + + public int getStringLength() { + return stringLength; + } + + public static boolean matches(String address) { + return DATA_BLOCK_STRING_FIXED_LENGTH_ADDRESS_PATTERN.matcher(address).matches() || + DATA_BLOCK_STRING_FIXED_LENGTH_SHORT_PATTERN.matcher(address).matches(); + } + + + @Override + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + writeBuffer.pushContext(getClass().getSimpleName()); + + String memoryArea = getMemoryArea().name(); + writeBuffer.writeString("memoryArea", + memoryArea.getBytes(StandardCharsets.UTF_8).length * 8, + memoryArea, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); + + writeBuffer.writeUnsignedInt("blockNumber", 16, getBlockNumber()); + writeBuffer.writeUnsignedInt("byteOffset", 16, getByteOffset()); + writeBuffer.writeUnsignedInt("bitOffset", 8, getBitOffset()); + writeBuffer.writeUnsignedInt("numElements", 16, getNumberOfElements()); + writeBuffer.writeInt("stringLength", 64, getStringLength()); + + String dataType = getDataType().name(); + writeBuffer.writeString("dataType", + dataType.getBytes(StandardCharsets.UTF_8).length * 8, + dataType, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); + + writeBuffer.popContext(getClass().getSimpleName()); + } + + public static S7StringFixedLengthTag of(String address) { + Matcher matcher; + + if ((matcher = DATA_BLOCK_STRING_FIXED_LENGTH_ADDRESS_PATTERN.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + if (matcher.group(BIT_OFFSET) != null) { + bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); + } else if (dataType == TransportSize.BOOL) { + throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); + } + int numElements = 1; + if (matcher.group(NUM_ELEMENTS) != null) { + numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); + } + + if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { + throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + + "' doesn't match specified data type '" + dataType.name() + "'"); + } + + return new S7StringFixedLengthTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); + } else if ((matcher = DATA_BLOCK_STRING_FIXED_LENGTH_SHORT_PATTERN.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + int numElements = 1; + if (matcher.group(NUM_ELEMENTS) != null) { + numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); + } + + return new S7StringFixedLengthTag(dataType, memoryArea, blockNumber, + byteOffset, bitOffset, numElements, stringLength); + } + + return null; + } + +} diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java deleted file mode 100644 index 4e81fb0da2e..00000000000 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringTag.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite.tag; - -import org.apache.plc4x.java.s7.readwrite.MemoryArea; -import org.apache.plc4x.java.s7.readwrite.TransportSize; -import org.apache.plc4x.java.spi.codegen.WithOption; -import org.apache.plc4x.java.spi.generation.SerializationException; -import org.apache.plc4x.java.spi.generation.WriteBuffer; - -import java.nio.charset.StandardCharsets; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import org.apache.plc4x.java.api.exceptions.PlcInvalidTagException; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.BIT_OFFSET; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.BLOCK_NUMBER; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.BYTE_OFFSET; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.DATA_TYPE; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.NUM_ELEMENTS; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.STRING_LENGTH; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.TRANSFER_SIZE_CODE; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.checkByteOffset; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.checkDataBlockNumber; -import static org.apache.plc4x.java.s7.readwrite.tag.S7Tag.getSizeCode; - -public class S7StringTag extends S7Tag { - - private static final Pattern DATA_BLOCK_STRING = - Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)?"); - - private static final Pattern DATA_BLOCK_STRING_SHORT = - Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)?"); - - private static final Pattern DATA_BLOCK_STRING_ADDRESS_PATTERN = - Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); - - private static final Pattern DATA_BLOCK_STRING_SHORT_PATTERN = - Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)\\((?\\d{1,3})\\)(\\[(?\\d+)])?"); - - - - private final int stringLength; - - protected S7StringTag(TransportSize dataType, MemoryArea memoryArea, - int blockNumber, int byteOffset, - byte bitOffset, int numElements, - int stringLength) { - super(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements); - this.stringLength = stringLength; - } - - public int getStringLength() { - return stringLength; - } - - public static boolean matches(String address) { - return DATA_BLOCK_STRING.matcher(address).matches() || - DATA_BLOCK_STRING_SHORT.matcher(address).matches() || - DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(address).matches() || - DATA_BLOCK_STRING_SHORT_PATTERN.matcher(address).matches(); - } - - - @Override - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - writeBuffer.pushContext(getClass().getSimpleName()); - - String memoryArea = getMemoryArea().name(); - writeBuffer.writeString("memoryArea", - memoryArea.getBytes(StandardCharsets.UTF_8).length * 8, - memoryArea, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); - - writeBuffer.writeUnsignedInt("blockNumber", 16, getBlockNumber()); - writeBuffer.writeUnsignedInt("byteOffset", 16, getByteOffset()); - writeBuffer.writeUnsignedInt("bitOffset", 8, getBitOffset()); - writeBuffer.writeUnsignedInt("numElements", 16, getNumberOfElements()); - writeBuffer.writeInt("stringLength", 64, getStringLength()); - - String dataType = getDataType().name(); - writeBuffer.writeString("dataType", - dataType.getBytes(StandardCharsets.UTF_8).length * 8, - dataType, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); - - writeBuffer.popContext(getClass().getSimpleName()); - } - - public static S7StringTag of(String address) { - Matcher matcher; - - if ((matcher = DATA_BLOCK_STRING_SHORT.matcher(address)).matches()) { - TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); - int stringLength = -1; - MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; - int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); - Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); - int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); - byte bitOffset = 0; - if (matcher.group(BIT_OFFSET) != null) { - bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); - } else if (dataType == TransportSize.BOOL) { - throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); - } - int numElements = 1; -// if (matcher.group(NUM_ELEMENTS) != null) { -// numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); -// } - - if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { - throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + - "' doesn't match specified data type '" + dataType.name() + "'"); - } - - return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); - - } else if ((matcher = DATA_BLOCK_STRING.matcher(address)).matches()) { - TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); - int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); - MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; - int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); - Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); - int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); - byte bitOffset = 0; - if (matcher.group(BIT_OFFSET) != null) { - bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); - } else if (dataType == TransportSize.BOOL) { - throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); - } - int numElements = 1; - if (matcher.group(NUM_ELEMENTS) != null) { - numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); - } - - if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { - throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + - "' doesn't match specified data type '" + dataType.name() + "'"); - } - - return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); - - } else if ((matcher = DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(address)).matches()) { - TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); - int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); - MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; - int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); - Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); - int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); - byte bitOffset = 0; - if (matcher.group(BIT_OFFSET) != null) { - bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); - } else if (dataType == TransportSize.BOOL) { - throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); - } - int numElements = 1; - if (matcher.group(NUM_ELEMENTS) != null) { - numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); - } - - if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { - throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + - "' doesn't match specified data type '" + dataType.name() + "'"); - } - - return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); - } else if ((matcher = DATA_BLOCK_STRING_SHORT_PATTERN.matcher(address)).matches()) { - TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); - int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); - MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; - int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); - int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); - byte bitOffset = 0; - int numElements = 1; - if (matcher.group(NUM_ELEMENTS) != null) { - numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); - } - - return new S7StringTag(dataType, memoryArea, blockNumber, - byteOffset, bitOffset, numElements, stringLength); - } - - return null; - } - -} diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringVarLengthTag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringVarLengthTag.java new file mode 100644 index 00000000000..b8039444812 --- /dev/null +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringVarLengthTag.java @@ -0,0 +1,119 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite.tag; + +import org.apache.plc4x.java.s7.readwrite.MemoryArea; +import org.apache.plc4x.java.s7.readwrite.TransportSize; +import org.apache.plc4x.java.spi.codegen.WithOption; +import org.apache.plc4x.java.spi.generation.SerializationException; +import org.apache.plc4x.java.spi.generation.WriteBuffer; + +import java.nio.charset.StandardCharsets; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import org.apache.plc4x.java.api.exceptions.PlcInvalidTagException; + +public class S7StringVarLengthTag extends S7Tag { + + public static final Pattern DATA_BLOCK_STRING_VAR_LENGTH_ADDRESS_PATTERN = + Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)(\\[(?\\d+)])?"); + + public static final Pattern DATA_BLOCK_STRING_VAR_LENGTH_SHORT_PATTERN = + Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?STRING|WSTRING)(\\[(?\\d+)])?"); + + + protected S7StringVarLengthTag(TransportSize dataType, MemoryArea memoryArea, + int blockNumber, int byteOffset, + byte bitOffset, int numElements) { + super(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements); + } + + public static boolean matches(String address) { + return DATA_BLOCK_STRING_VAR_LENGTH_ADDRESS_PATTERN.matcher(address).matches() || + DATA_BLOCK_STRING_VAR_LENGTH_SHORT_PATTERN.matcher(address).matches(); + } + + + @Override + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + writeBuffer.pushContext(getClass().getSimpleName()); + + String memoryArea = getMemoryArea().name(); + writeBuffer.writeString("memoryArea", + memoryArea.getBytes(StandardCharsets.UTF_8).length * 8, + memoryArea, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); + + writeBuffer.writeUnsignedInt("blockNumber", 16, getBlockNumber()); + writeBuffer.writeUnsignedInt("byteOffset", 16, getByteOffset()); + writeBuffer.writeUnsignedInt("bitOffset", 8, getBitOffset()); + writeBuffer.writeUnsignedInt("numElements", 16, getNumberOfElements()); + + String dataType = getDataType().name(); + writeBuffer.writeString("dataType", + dataType.getBytes(StandardCharsets.UTF_8).length * 8, + dataType, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); + + writeBuffer.popContext(getClass().getSimpleName()); + } + + public static S7StringVarLengthTag of(String address) { + Matcher matcher; + + if ((matcher = DATA_BLOCK_STRING_VAR_LENGTH_ADDRESS_PATTERN.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + if (matcher.group(BIT_OFFSET) != null) { + bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); + } else if (dataType == TransportSize.BOOL) { + throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); + } + int numElements = 1; + if (matcher.group(NUM_ELEMENTS) != null) { + numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); + } + + if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { + throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + + "' doesn't match specified data type '" + dataType.name() + "'"); + } + + return new S7StringVarLengthTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements); + } else if ((matcher = DATA_BLOCK_STRING_VAR_LENGTH_SHORT_PATTERN.matcher(address)).matches()) { + TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); + MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; + int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); + int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); + byte bitOffset = 0; + int numElements = 1; + if (matcher.group(NUM_ELEMENTS) != null) { + numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); + } + + return new S7StringVarLengthTag(dataType, memoryArea, blockNumber, + byteOffset, bitOffset, numElements); + } + + return null; + } + +} diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java index 26c7917ac4f..552555e56f6 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java @@ -52,8 +52,6 @@ public class S7Tag implements PlcTag, Serializable { private static final Pattern DATA_BLOCK_SHORT_PATTERN = Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?[a-zA-Z_]+)(\\[(?\\d+)])?"); - - private static final Pattern PLC_PROXY_ADDRESS_PATTERN = Pattern.compile("[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}"); @@ -131,54 +129,14 @@ public int getNumberOfElements() { } public static boolean matches(String tagString) { - return - DATA_BLOCK_ADDRESS_PATTERN.matcher(tagString).matches() || - DATA_BLOCK_SHORT_PATTERN.matcher(tagString).matches() || - PLC_PROXY_ADDRESS_PATTERN.matcher(tagString).matches() || - ADDRESS_PATTERN.matcher(tagString).matches(); + return DATA_BLOCK_ADDRESS_PATTERN.matcher(tagString).matches() || + DATA_BLOCK_SHORT_PATTERN.matcher(tagString).matches() || + PLC_PROXY_ADDRESS_PATTERN.matcher(tagString).matches() || + ADDRESS_PATTERN.matcher(tagString).matches(); } public static S7Tag of(String tagString) { Matcher matcher; -// if ((matcher = DATA_BLOCK_STRING_ADDRESS_PATTERN.matcher(tagString)).matches()) { -// TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); -// int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); -// MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; -// int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); -// Short transferSizeCode = getSizeCode(matcher.group(TRANSFER_SIZE_CODE)); -// int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); -// byte bitOffset = 0; -// if (matcher.group(BIT_OFFSET) != null) { -// bitOffset = Byte.parseByte(matcher.group(BIT_OFFSET)); -// } else if (dataType == TransportSize.BOOL) { -// throw new PlcInvalidTagException("Expected bit offset for BOOL parameters."); -// } -// int numElements = 1; -// if (matcher.group(NUM_ELEMENTS) != null) { -// numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); -// } -// -// if ((transferSizeCode != null) && (dataType.getShortName() != transferSizeCode)) { -// throw new PlcInvalidTagException("Transfer size code '" + transferSizeCode + -// "' doesn't match specified data type '" + dataType.name() + "'"); -// } -// -// return new S7StringTag(dataType, memoryArea, blockNumber, byteOffset, bitOffset, numElements, stringLength); -//// } else if ((matcher = DATA_BLOCK_STRING_SHORT_PATTERN.matcher(tagString)).matches()) { -//// TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); -//// int stringLength = Integer.parseInt(matcher.group(STRING_LENGTH)); -//// MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; -//// int blockNumber = checkDataBlockNumber(Integer.parseInt(matcher.group(BLOCK_NUMBER))); -//// int byteOffset = checkByteOffset(Integer.parseInt(matcher.group(BYTE_OFFSET))); -//// byte bitOffset = 0; -//// int numElements = 1; -//// if (matcher.group(NUM_ELEMENTS) != null) { -//// numElements = Integer.parseInt(matcher.group(NUM_ELEMENTS)); -//// } -//// -//// return new S7StringTag(dataType, memoryArea, blockNumber, -//// byteOffset, bitOffset, numElements, stringLength); -// } else if ((matcher = DATA_BLOCK_ADDRESS_PATTERN.matcher(tagString)).matches()) { TransportSize dataType = TransportSize.valueOf(matcher.group(DATA_TYPE)); MemoryArea memoryArea = MemoryArea.DATA_BLOCKS; diff --git a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java index 5632798e977..954080d23f5 100644 --- a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java +++ b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java @@ -93,6 +93,8 @@ public static void main(String[] args) throws Exception { test.addTestCase("%DB4:138:WCHAR", new PlcWCHAR("w")); test.addTestCase("%DB4:140:STRING(10)", new PlcSTRING("hurz")); test.addTestCase("%DB4:396:WSTRING(10)", new PlcWSTRING("wolf")); + test.addTestCase("%DB4:140:STRING", new PlcSTRING("hurz")); + test.addTestCase("%DB4:396:WSTRING", new PlcWSTRING("wolf")); //test.addTestCase("%DB4:70:TIME", new PlcTIME(Duration.parse("PT1.234S")); // Not supported in S7 1200 //test.addTestCase("%DB4:62:LTIME", new PlcLTIME(Duration.parse("PT24015H23M12.034002044S")); @@ -107,7 +109,11 @@ public static void main(String[] args) throws Exception { //test.addTestCase("%DB4:112:LDATE_AND_TIME", "1978-03-28T15:36:30"); // Not supported in S7 1200 //test.addTestCase("%DB4:124:LDT", "1978-03-28T15:36:30"); + + long start = System.currentTimeMillis(); test.run(); + long end = System.currentTimeMillis(); + System.out.printf("Finished in %d ms", end - start); } } diff --git a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java index 3127dbe34a0..3c4a672c3a5 100644 --- a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java +++ b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java @@ -49,7 +49,7 @@ public void testStringAddress() { Assertions.assertEquals(38, s7Tag.getByteOffset()); Assertions.assertEquals(0, s7Tag.getBitOffset()); Assertions.assertEquals("S7StringTag", s7Tag.getClass().getSimpleName()); - S7StringTag s7StringTag = (S7StringTag) s7Tag; + S7StringFixedLengthTag s7StringTag = (S7StringFixedLengthTag) s7Tag; Assertions.assertEquals(8, s7StringTag.getStringLength()); } From 3c5266c4901ce0882165e07f5b1d2d7ef01810c2 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 19:37:27 +0100 Subject: [PATCH 03/21] fix: Major refactoring of mostly the write code. --- .../readwrite/protocol/S7ProtocolLogic.java | 673 +++++++++--------- 1 file changed, 324 insertions(+), 349 deletions(-) diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java index b450981b404..4b176256e1d 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java @@ -22,7 +22,6 @@ import io.netty.buffer.ByteBufUtil; import io.netty.buffer.Unpooled; import org.apache.commons.lang3.concurrent.BasicThreadFactory; -import org.apache.commons.lang3.tuple.MutablePair; import org.apache.plc4x.java.api.exceptions.PlcInvalidTagException; import org.apache.plc4x.java.api.exceptions.PlcProtocolException; import org.apache.plc4x.java.api.exceptions.PlcRuntimeException; @@ -102,16 +101,6 @@ public class S7ProtocolLogic extends Plc4xProtocolBase { private final S7PlcSubscriptionHandle almHandle = new S7PlcSubscriptionHandle(EventType.ALM, EventLogic); //private final S7PlcSubscriptionHandle cycHandle = new S7PlcSubscriptionHandle(EventType.CYC, EventLogic); - /* - * For the reconnection functionality by a "TimeOut" of the connection, - * you must keep track of open transactions. In general, an S7 device - * supports a couple of simultaneous requests. - * The rhythm of execution must be determined by the TransactionManager. - * So far it is the way to indicate to the user that he must redo - * his request. - */ - private final HashMap, MutablePair>> activeRequests = new HashMap<>(); - /* * This array stores the cyclic subscription requests between the driver * and the PLC. The purpose is to document the tags associated with the @@ -149,10 +138,6 @@ public void onConnect(ConversationContext context) { return; } - // If the call is for a reconnection, we must clean up - // the queued messages so that they release the transaction handler. - cleanFutures(); - //Set feature for all handlers in the pipeline from //the driver configuration. setChannelFeatures(); @@ -233,33 +218,28 @@ public void onConnect(ConversationContext context) { logger.debug("Got S7 Identification Response"); S7PayloadUserData payloadUserData = (S7PayloadUserData) messageUserData.getPayload(); extractControllerTypeAndFireConnected(context, payloadUserData); - cleanFutures(); }); }); }); } - /* * It performs the sequential and safe shutdown of the driver. * Completion of pending requests, executors and associated tasks. */ @Override public void onDisconnect(ConversationContext context) { - // 1. Clear all pending requests and their associated transaction - cleanFutures(); - // 2. Here we shut down the local task executor. + // 1. Here we shut down the local task executor. clientExecutorService.shutdown(); - // 3. Performs the shutdown of the transaction executor. + // 2. Performs the shutdown of the transaction executor. tm.shutdown(); - // 4. Finish the execution of the tasks for the handling of Events. + // 3. Finish the execution of the tasks for the handling of Events. EventLogic.stop(); - // 5. Executes the closing of the main channel. + // 4. Executes the closing of the main channel. context.getChannel().close(); - // 6. Here is the stop of any task or state machine that is added. + // 5. Here is the stop of any task or state machine that is added. } - @Override public CompletableFuture read(PlcReadRequest readRequest) { // If we're not connected, just abort with an error. @@ -270,61 +250,55 @@ public CompletableFuture read(PlcReadRequest readRequest) { } DefaultPlcReadRequest request = (DefaultPlcReadRequest) readRequest; - S7Message s7Message; + CompletableFuture responseFuture; if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7SzlTag)) { S7SzlTag szlTag = (S7SzlTag) request.getTags().get(0); // TODO: Is the tpduReference of 1 correct here? - s7Message = new S7MessageUserData(1, new S7ParameterUserData(List.of( - new S7ParameterUserDataItemCPUFunctions((short) 0x11, (byte) 0x4, (byte) 0x4, (short) 0x01, (short) 0x00, null, null, null) - )), new S7PayloadUserData(List.of( + S7Message s7Message = new S7MessageUserData(getTpduId(), + new S7ParameterUserData(List.of( + new S7ParameterUserDataItemCPUFunctions( + (short) 0x11, (byte) 0x4, (byte) 0x4, (short) 0x01, (short) 0x00, + null, null, null) + )), + new S7PayloadUserData(List.of( new S7PayloadUserDataItemCpuFunctionReadSzlRequest(DataTransportErrorCode.OK, - DataTransportSize.OCTET_STRING, - 0x04, - new SzlId(SzlModuleTypeClass.enumForValue((byte) ((szlTag.getSzlId() & 0xf000) >> 12)), - (byte) ((szlTag.getSzlId() & 0x0f00) >> 8), - SzlSublist.enumForValue((short) (szlTag.getSzlId() & 0x00ff))), + DataTransportSize.OCTET_STRING, + 0x04, + new SzlId(SzlModuleTypeClass.enumForValue((byte) ((szlTag.getSzlId() & 0xf000) >> 12)), + (byte) ((szlTag.getSzlId() & 0x0f00) >> 8), + SzlSublist.enumForValue((short) (szlTag.getSzlId() & 0x00ff))), szlTag.getIndex()) - ))); - } - - else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7AckTag)) { - s7Message = encodeAlarmAckRequest(request); - } - - else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7ClkTag)) { - s7Message = encodePlcClkRequest(request); + ))); + responseFuture = sendInternal(s7Message); + } else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7AckTag)) { + responseFuture = performAlarmAckRequest(request); + } else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7ClkTag)) { + responseFuture = performClkRequest(request); } // If the request contains at least one var-length string field, we need to get the real length first. else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7StringVarLengthTag)) { - s7Message = encodePlcVarLengthStringReadRequest(request); + responseFuture = performVarLengthStringReadRequest(request); } // This is a "normal" read request. else { - s7Message = encodePlcReadRequest(request); + responseFuture = performOrdinaryReadRequest(request); } // Just send a single response and chain it as Response - return toPlcReadResponse(readRequest, readInternal(s7Message)); + return toPlcReadResponse(readRequest, responseFuture); } /** * Maps the S7ReadResponse of a PlcReadRequest to a PlcReadResponse */ - private CompletableFuture toPlcReadResponse(PlcReadRequest readRequest, CompletableFuture response) { + private CompletableFuture toPlcReadResponse(PlcReadRequest readRequest, CompletableFuture responseFuture) { CompletableFuture clientFuture = new CompletableFuture<>(); - activeRequests.get(response).setRight(clientFuture); try { - clientExecutorService.execute(() -> { - try { - PlcReadResponse plcItems = (PlcReadResponse) decodeReadResponse(response.get(), readRequest); - clientFuture.complete(plcItems); - } catch (Exception ex) { - logger.info(ex.toString()); - } - }); + PlcReadResponse response = (PlcReadResponse) decodeReadResponse(responseFuture.get(), readRequest); + clientFuture.complete(response); } catch (Exception ex) { logger.info(ex.toString()); } @@ -332,88 +306,47 @@ private CompletableFuture toPlcReadResponse(PlcReadRequest read return clientFuture; } - /** - * Sends one Read over the Wire and internally returns the Response - * Do sending of normally sized single-message request. - *

- * Assumes that the {@link S7MessageRequest} and its expected {@link S7MessageResponseData} - * and does not further check that! - */ - private CompletableFuture readInternal(S7Message request) { - CompletableFuture future = new CompletableFuture<>(); - - int tpduId = request.getTpduReference(); - - TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, request, true, (byte) tpduId)); - - // Start a new request-transaction (Is ended in the response-handler) - - RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); - - transaction.submit(() -> context.sendRequest(tpktPacket) - .onTimeout(new TransactionErrorCallback<>(future, transaction)) - .onError(new TransactionErrorCallback<>(future, transaction)) - .expectResponse(TPKTPacket.class, REQUEST_TIMEOUT) - .check(p -> p.getPayload() instanceof COTPPacketData) - .unwrap(p -> (COTPPacketData) p.getPayload()) - .check(p -> p.getPayload() != null) - .unwrap(COTPPacket::getPayload) - .check(p -> p.getTpduReference() == tpduId) - .handle(p -> { - activeRequests.remove(future); - future.complete(p); - // Finish the request-transaction. - transaction.endRequest(); - })); - activeRequests.put(future, new MutablePair<>(transaction, null)); - - return future; - } - @Override public CompletableFuture write(PlcWriteRequest writeRequest) { - CompletableFuture future = new CompletableFuture<>(); - DefaultPlcWriteRequest request = (DefaultPlcWriteRequest) writeRequest; - - int tpduId = getTpduId(); + // If we're not connected, just abort with an error. + if (!isConnected()) { + CompletableFuture future = new CompletableFuture<>(); + future.completeExceptionally(new PlcRuntimeException("Disconnected")); + return future; + } - TPKTPacket tpktPacket; + DefaultPlcWriteRequest request = (DefaultPlcWriteRequest) writeRequest; + CompletableFuture responseFuture = new CompletableFuture<>(); // TODO: Write one or two lines on what happens here ... to me it looks as if there's at least on S7ClkTag, then all is handled by the writeClk method, but what happens if a request would contain mixed tag types? if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7ClkTag)) { - tpktPacket = encodePlcClkSetRequest((DefaultPlcWriteRequest) writeRequest, tpduId); + responseFuture = performClkSetRequest((DefaultPlcWriteRequest) writeRequest); } // If the list of tags contains at least one STRING/WSTRING element, // we need to check the sizes of the string fields in a first request. else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7StringVarLengthTag)) { - tpktPacket = encodePlcStringWriteRequest((DefaultPlcWriteRequest) writeRequest, tpduId); - } + responseFuture = performVarLengthStringWriteRequest((DefaultPlcWriteRequest) writeRequest); + } // This is a request only containing ordinary tags else { - tpktPacket = encodeOrdinaryWriteRequest(request, tpduId); + responseFuture = performOrdinaryWriteRequest(request); } - // Start a new request-transaction (Is ended in the response-handler) - RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); - transaction.submit(() -> context.sendRequest(tpktPacket) - .onTimeout(new TransactionErrorCallback<>(future, transaction)) - .onError(new TransactionErrorCallback<>(future, transaction)) - .expectResponse(TPKTPacket.class, REQUEST_TIMEOUT) - .check(p -> p.getPayload() instanceof COTPPacketData) - .unwrap(p -> ((COTPPacketData) p.getPayload())) - .unwrap(COTPPacket::getPayload) - .check(p -> p.getTpduReference() == tpduId) - .handle(p -> { - try { - future.complete(((PlcWriteResponse) decodeWriteResponse(p, writeRequest))); - } catch (PlcProtocolException e) { - logger.warn("Error sending 'write' message: '{}'", e.getMessage(), e); - } - // Finish the request-transaction. - transaction.endRequest(); - })); - return future; + return toPlcWriteResponse(writeRequest, responseFuture); + } + + private CompletableFuture toPlcWriteResponse(PlcWriteRequest writeRequest, CompletableFuture responseFuture) { + CompletableFuture clientFuture = new CompletableFuture<>(); + + try { + PlcWriteResponse response = (PlcWriteResponse) decodeWriteResponse(responseFuture.get(), writeRequest); + clientFuture.complete(response); + } catch (Exception ex) { + logger.info(ex.toString()); + } + + return clientFuture; } @Override @@ -473,11 +406,11 @@ public CompletableFuture subscribe(PlcSubscriptionReque break; default: } - if(s7Message == null) { + if (s7Message == null) { throw new PlcInvalidTagException("Unsupported tag of type: " + tag.getTagType()); } - TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, s7Message,true, (byte) tpduId)); + TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, s7Message, true, (byte) tpduId)); // Start a new request-transaction (Is ended in the response-handler) RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); @@ -654,8 +587,8 @@ private S7Message encodeEventSubscriptionRequest(DefaultPlcSubscriptionRequest r } private PlcSubscriptionResponse decodeEventSubscriptionResponse(String strTagName, - PlcSubscriptionRequest plcSubscriptionRequest, - S7Message responseMessage) + PlcSubscriptionRequest plcSubscriptionRequest, + S7Message responseMessage) throws PlcProtocolException { Map> values = new HashMap<>(); @@ -918,7 +851,7 @@ private PlcSubscriptionResponse decodeEventSubscriptionResponse(String strTagNam return null; } - private S7Message encodeAlarmAckRequest(DefaultPlcReadRequest request) { + private CompletableFuture performAlarmAckRequest(DefaultPlcReadRequest request) { List parameterItems = new ArrayList<>(request.getNumberOfTags()); List payloadItems = new ArrayList<>(request.getNumberOfTags()); @@ -967,9 +900,9 @@ private S7Message encodeAlarmAckRequest(DefaultPlcReadRequest request) { messageObjects); payloadItems.add(payload); - return new S7MessageUserData(getTpduId(), + return sendInternal(new S7MessageUserData(getTpduId(), new S7ParameterUserData(parameterItems), - new S7PayloadUserData(payloadItems)); + new S7PayloadUserData(payloadItems))); } private S7Message encodeAlarmQueryRequest(DefaultPlcSubscriptionRequest request, int tpduId) { @@ -988,7 +921,7 @@ private S7Message encodeAlarmQueryRequest(DefaultPlcSubscriptionRequest request, ); parameterItems.add(parameter); - //TODO: Chequear el tipo dfe larma. + //TODO: Check the type of alarm S7PayloadUserDataItemCpuFunctionAlarmQueryRequest payload = new S7PayloadUserDataItemCpuFunctionAlarmQueryRequest( DataTransportErrorCode.OK, @@ -1210,9 +1143,9 @@ private void encodeCycledUnSubscriptionRequest(DefaultPlcUnsubscriptionRequest r } /* - * - */ - private S7Message encodePlcClkRequest(DefaultPlcReadRequest request) { + * + */ + private CompletableFuture performClkRequest(DefaultPlcReadRequest request) { List parameterItems = new ArrayList<>(request.getNumberOfTags()); List payloadItems = new ArrayList<>(request.getNumberOfTags()); @@ -1238,15 +1171,15 @@ private S7Message encodePlcClkRequest(DefaultPlcReadRequest request) { 0x00); payloadItems.add(payload); - return new S7MessageUserData(getTpduId(), + return sendInternal(new S7MessageUserData(getTpduId(), new S7ParameterUserData(parameterItems), - new S7PayloadUserData(payloadItems)); + new S7PayloadUserData(payloadItems))); } /* - * - */ - private TPKTPacket encodePlcClkSetRequest(DefaultPlcWriteRequest request, int tpduId) { + * + */ + private CompletableFuture performClkSetRequest(DefaultPlcWriteRequest request) { List parameterItems = new ArrayList<>(request.getNumberOfTags()); List payloadItems = new ArrayList<>(request.getNumberOfTags()); @@ -1272,15 +1205,17 @@ private TPKTPacket encodePlcClkSetRequest(DefaultPlcWriteRequest request, int tp tag.getDateAndTime()); payloadItems.add(payload); - return new TPKTPacket(new COTPPacketData(null, - new S7MessageUserData(tpduId, + return sendInternal( + new S7MessageUserData(getTpduId(), new S7ParameterUserData(parameterItems), - new S7PayloadUserData(payloadItems)), - true, (byte) tpduId)); + new S7PayloadUserData(payloadItems))); } /* + * Encoding of STRING types ... for WSTRING types the "Maximum length" and + * "Current length" are both 16 bit unsigned integer values: + * * +-------------------+ * Byte n | Maximum length | (intMaxChars) * +-------------------+ @@ -1298,114 +1233,59 @@ private TPKTPacket encodePlcClkSetRequest(DefaultPlcWriteRequest request, int tp * +-------------------+ | * Byte ... | ... | / * +-------------------+ + * * Reading text strings in two steps: - * 1. For the operation on texts, you must first evaluate the + * 1. For the operation on texts, you must first evaluate the * space created on DB of type STRING or WSTRING. - * 2. The first two bytes have the maximum number of characters (bytes) - * available to store text strings (intMaxChars) and the number of + * 2. The first two bytes have the maximum number of characters (bytes) + * available to store text strings (intMaxChars) and the number of * characters available (intActualChars). - * 3. In the specific case of reading, only the characters defined + * 3. In the specific case of reading, only the characters defined * by "intActualChars" are recovered. - * TODO: Maximum waiting time managed by system variables. - */ - private S7Message encodePlcVarLengthStringReadRequest(DefaultPlcReadRequest request) { - List parameterItems = new ArrayList<>(request.getNumberOfTags()); + */ + private CompletableFuture performVarLengthStringReadRequest(DefaultPlcReadRequest request) { + CompletableFuture future = new CompletableFuture<>(); - // Build a request to read the length information for every var-length string in the request. - List varLengthStringTags = request.getTags().stream() - .filter(plcTag -> plcTag instanceof S7StringVarLengthTag) - .map(plcTag -> (S7StringVarLengthTag) plcTag) - .collect(Collectors.toList()); - List stringFields = new ArrayList<>(varLengthStringTags.size()); - for (S7StringVarLengthTag varLengthStringTag : varLengthStringTags) { - // For STRING, the header is 2 bytes (first byte contains the max length and the second the actual length) - if(varLengthStringTag.getDataType() == TransportSize.STRING) { - stringFields.add(new S7VarRequestParameterItemAddress( - new S7AddressAny( - TransportSize.BYTE, - 2, - varLengthStringTag.getBlockNumber(), - MemoryArea.DATA_BLOCKS, - varLengthStringTag.getByteOffset(), - varLengthStringTag.getBitOffset() - ))); - } - // For WSTRING, the header is 4 bytes (first word contains the max length and the second the actual length) - else if(varLengthStringTag.getDataType() == TransportSize.WSTRING) { - stringFields.add(new S7VarRequestParameterItemAddress( - new S7AddressAny( - TransportSize.BYTE, - 4, - varLengthStringTag.getBlockNumber(), - MemoryArea.DATA_BLOCKS, - varLengthStringTag.getByteOffset(), - varLengthStringTag.getBitOffset() - ))); + // Resolve the lengths of all var-length string fields in the request. + CompletableFuture> stringSizesFuture = getStringSizes(request); + stringSizesFuture.whenComplete((s7StringVarLengthTagStringSizesMap, throwable) -> { + if (throwable != null) { + future.completeExceptionally(new PlcProtocolException("Error resolving string sizes", throwable)); } else { - throw new PlcInvalidTagException("Only STRING and WSTRING allowed here."); - } - } - final S7MessageRequest readRequest = new S7MessageRequest( - getTpduId(), new S7ParameterReadVarRequest(stringFields), null); - - // Read the max length and actual size for each of the var-length strings. - CompletableFuture future = readInternal(readRequest); - - Map stringLengths = new HashMap<>(varLengthStringTags.size()); - try { - // TODO: Check if we're not blocking the execute method here ... - S7Message getLengthsResponseMessage = future.get(2000, TimeUnit.MILLISECONDS); - S7PayloadReadVarResponse getLengthsResponse = (S7PayloadReadVarResponse) getLengthsResponseMessage.getPayload(); - int curItemIndex = 0; - for (S7StringVarLengthTag varLengthStringTag : varLengthStringTags) { - S7VarPayloadDataItem s7VarPayloadDataItem = getLengthsResponse.getItems().get(curItemIndex); - ReadBufferByteBased readBuffer = new ReadBufferByteBased(s7VarPayloadDataItem.getData()); - try { - if (varLengthStringTag.getDataType() == TransportSize.STRING) { - /*int maxChars = */readBuffer.readUnsignedInt("maxLength", 8); - int actualChars = readBuffer.readUnsignedInt("maxLength", 8); - stringLengths.put(varLengthStringTag, actualChars); - } else if (varLengthStringTag.getDataType() == TransportSize.WSTRING) { - /*int maxChars = */readBuffer.readUnsignedInt("maxLength", 16); - int actualChars = readBuffer.readUnsignedInt("maxLength", 16); - stringLengths.put(varLengthStringTag, actualChars); + // Create an alternative list of request items, where all var-length string tags are replaced with + // fixed-length string tags using the string length returned by the previous request. + LinkedHashMap updatedRequestItems = new LinkedHashMap<>(request.getNumberOfTags()); + for (String tagName : request.getTagNames()) { + PlcTag tag = request.getTag(tagName); + if (tag instanceof S7StringVarLengthTag) { + S7StringVarLengthTag varLengthTag = (S7StringVarLengthTag) tag; + int stringLength = s7StringVarLengthTagStringSizesMap.get(varLengthTag).getCurLength(); + S7StringFixedLengthTag newTag = new S7StringFixedLengthTag(varLengthTag.getDataType(), varLengthTag.getMemoryArea(), + varLengthTag.getBlockNumber(), varLengthTag.getByteOffset(), varLengthTag.getBitOffset(), + varLengthTag.getNumberOfElements(), stringLength); + updatedRequestItems.put(tagName, newTag); } else { - throw new PlcInvalidTagException("Only STRING and WSTRING allowed here."); + updatedRequestItems.put(tagName, tag); } - } catch (ParseException e) { - throw new PlcInvalidTagException("Error reading var-length string actual lengths."); } - } - } catch (InterruptedException ex) { - logger.info(ex.getMessage()); - Thread.currentThread().interrupt(); - } catch (ExecutionException | TimeoutException ex) { - logger.info(ex.getMessage()); - } - // Create an alternative list of request items, where all var-length string tags are replaced with - // fixed-length string tags using the string length returned by the previous request. - LinkedHashMap updatedRequestItems = new LinkedHashMap<>(request.getNumberOfTags()); - for (String tagName : request.getTagNames()) { - PlcTag tag = request.getTag(tagName); - if(tag instanceof S7StringVarLengthTag) { - S7StringVarLengthTag varLengthTag = (S7StringVarLengthTag) tag; - int stringLength = stringLengths.get(varLengthTag); - S7StringFixedLengthTag newTag = new S7StringFixedLengthTag(varLengthTag.getDataType(), varLengthTag.getMemoryArea(), - varLengthTag.getBlockNumber(), varLengthTag.getByteOffset(), varLengthTag.getBitOffset(), - varLengthTag.getNumberOfElements(), stringLength); - updatedRequestItems.put(tagName, newTag); - } else { - updatedRequestItems.put(tagName, tag); + // Use the normal functionality to execute the read request. + // TODO: Here technically the request object in the response will not match the original request. + CompletableFuture s7MessageCompletableFuture = performOrdinaryReadRequest(new DefaultPlcReadRequest(request.getReader(), updatedRequestItems)); + s7MessageCompletableFuture.whenComplete((s7Message, throwable1) -> { + if (throwable1 != null) { + future.completeExceptionally(throwable1); + } else { + future.complete(s7Message); + } + }); } - } + }); - // Use the normal functionality to execute the read request. - // TODO: Here technically the request object in the response will not match the original request. - return encodePlcReadRequest(new DefaultPlcReadRequest(request.getReader(), updatedRequestItems)); + return future; } - private S7Message encodePlcReadRequest(DefaultPlcReadRequest request) { + private CompletableFuture performOrdinaryReadRequest(DefaultPlcReadRequest request) { // Convert each tag in the request into a corresponding item used in the S7 protocol. List requestItems = new ArrayList<>(request.getNumberOfTags()); for (PlcTag tag : request.getTags()) { @@ -1414,13 +1294,18 @@ private S7Message encodePlcReadRequest(DefaultPlcReadRequest request) { // Create a read request template. // tpuId will be inserted before sending in #readInternal, so we insert -1 as dummy here - return new S7MessageRequest(getTpduId(), + S7Message requestMessage = new S7MessageRequest(getTpduId(), new S7ParameterReadVarRequest(requestItems), null); + + return sendInternal(requestMessage); } /* + * Encoding of STRING types ... for WSTRING types the "Maximum length" and + * "Current length" are both 16 bit unsigned integer values: + * * +-------------------+ * Byte n | Maximum length | (intMaxChars) * +-------------------+ @@ -1438,18 +1323,18 @@ private S7Message encodePlcReadRequest(DefaultPlcReadRequest request) { * +-------------------+ | * Byte ... | ... | / * +-------------------+ + * * Reading text strings in two steps: - * 1. For the operation on texts, you must first evaluate the + * 1. For the operation on texts, you must first evaluate the * space created on DB of type STRING or WSTRING. - * 2. The first two bytes have the maximum number of characters (bytes) - * available to store text strings (intMaxChars) and the number of + * 2. The first two bytes have the maximum number of characters (bytes) + * available to store text strings (intMaxChars) and the number of * characters available (intActualChars). - * 3. In the specific case of write string, only the max characters defined - * by "intMaxChars" are writed. + * 3. In the specific case of write string, only the max characters defined + * by "intMaxChars" are written. * TODO: Maximum waiting time managed by system variables. - */ - private TPKTPacket encodePlcStringWriteRequest(DefaultPlcWriteRequest request, - int tpduId) { + */ + private CompletableFuture performVarLengthStringWriteRequest(DefaultPlcWriteRequest request) { List parameterItems = new ArrayList<>(request.getNumberOfTags()); List payloadItems = new ArrayList<>(request.getNumberOfTags()); @@ -1457,34 +1342,34 @@ private TPKTPacket encodePlcStringWriteRequest(DefaultPlcWriteRequest request, int intActualChars = 0; final S7StringVarLengthTag tag = (S7StringVarLengthTag) request.getTags().get(0); - + //Read the max length and actual size. // TODO: Is the tpduId of 1 correct here? - final S7MessageRequest readRequest = new S7MessageRequest(1,new S7ParameterReadVarRequest( - List.of(new S7VarRequestParameterItemAddress( - new S7AddressAny( - TransportSize.BYTE, - 2, - tag.getBlockNumber(), - MemoryArea.DATA_BLOCKS, - tag.getByteOffset(), - tag.getBitOffset() - )) - - )), null); - - CompletableFuture future = readInternal(readRequest); - + final S7MessageRequest readRequest = new S7MessageRequest(1, new S7ParameterReadVarRequest( + List.of(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + 2, + tag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + tag.getByteOffset(), + tag.getBitOffset() + )) + + )), null); + + CompletableFuture future = sendInternal(readRequest); + try { S7Message get = future.get(2000, TimeUnit.MILLISECONDS); - final S7VarPayloadDataItem payload = (S7VarPayloadDataItem)((S7PayloadReadVarResponse) get.getPayload()).getItems().get(0); + final S7VarPayloadDataItem payload = (S7VarPayloadDataItem) ((S7PayloadReadVarResponse) get.getPayload()).getItems().get(0); intMaxChars = Byte.toUnsignedInt(payload.getData()[0]); //payload.getData()[0] & 0xFF - intActualChars = Byte.toUnsignedInt(payload.getData()[1]); + intActualChars = Byte.toUnsignedInt(payload.getData()[1]); } catch (InterruptedException ex) { logger.info(ex.getMessage()); } catch (ExecutionException ex) { logger.info(ex.getMessage()); - } catch (TimeoutException ex) { + } catch (TimeoutException ex) { logger.info(ex.getMessage()); } @@ -1498,49 +1383,42 @@ private TPKTPacket encodePlcStringWriteRequest(DefaultPlcWriteRequest request, tagName = iter.next(); final S7StringVarLengthTag tagRef = (S7StringVarLengthTag) request.getTag(tagName); plcValue = request.getPlcValue(tagName); - + //Check if String String strValue = plcValue.getString(); if (strValue.length() > intMaxChars) { strValue = strValue.substring(0, intMaxChars); plcValue = new PlcSTRING(strValue); } - + S7Address s7Address = new S7AddressAny( - tagRef.getDataType().BYTE, - strValue.length() + 2, - tagRef.getBlockNumber(), - tagRef.getMemoryArea(), - tagRef.getByteOffset(), - tagRef.getBitOffset()); - - parameterItems.add(new S7VarRequestParameterItemAddress(s7Address)); - + tagRef.getDataType().BYTE, + strValue.length() + 2, + tagRef.getBlockNumber(), + tagRef.getMemoryArea(), + tagRef.getByteOffset(), + tagRef.getBitOffset()); + + parameterItems.add(new S7VarRequestParameterItemAddress(s7Address)); + ByteBuffer byteBuffer = ByteBuffer.allocate(strValue.length() + 2); byteBuffer.put((byte) intMaxChars); byteBuffer.put((byte) strValue.length()); byteBuffer.put(strValue.getBytes()); - + DataTransportSize transportSize = DataTransportSize.BYTE_WORD_DWORD; - + payloadItems.add(new S7VarPayloadDataItem(DataTransportErrorCode.OK, transportSize, byteBuffer.array()/*, hasNext*/)); } - return new TPKTPacket( - new COTPPacketData( - null, - new S7MessageRequest(tpduId, - new S7ParameterWriteVarRequest(parameterItems), - new S7PayloadWriteVarRequest(payloadItems) - ), - true, - (byte) tpduId - ) - ); + return sendInternal( + new S7MessageRequest(getTpduId(), + new S7ParameterWriteVarRequest(parameterItems), + new S7PayloadWriteVarRequest(payloadItems) + )); } - private TPKTPacket encodeOrdinaryWriteRequest(DefaultPlcWriteRequest request, - int tpduId) { + private CompletableFuture performOrdinaryWriteRequest(DefaultPlcWriteRequest request) { List parameterItems = new ArrayList<>(request.getNumberOfTags()); List payloadItems = new ArrayList<>(request.getNumberOfTags()); @@ -1551,17 +1429,47 @@ private TPKTPacket encodeOrdinaryWriteRequest(DefaultPlcWriteRequest request, payloadItems.add(serializePlcValue(tag, plcValue)); } - return new TPKTPacket( - new COTPPacketData( - null, - new S7MessageRequest(tpduId, - new S7ParameterWriteVarRequest(parameterItems), - new S7PayloadWriteVarRequest(payloadItems) - ), - true, - (byte) tpduId - ) - ); + return sendInternal( + new S7MessageRequest(getTpduId(), + new S7ParameterWriteVarRequest(parameterItems), + new S7PayloadWriteVarRequest(payloadItems) + )); + } + + /** + * Sends one Read over the Wire and internally returns the Response + * Do sending of normally sized single-message request. + *

+ * Assumes that the {@link S7MessageRequest} and its expected {@link S7MessageResponseData} + * and does not further check that! + */ + private CompletableFuture sendInternal(S7Message request) { + CompletableFuture future = new CompletableFuture<>(); + + // Get the tpduId from the S7 message. + int tpduId = request.getTpduReference(); + + TPKTPacket tpktPacket = new TPKTPacket(new COTPPacketData(null, request, true, (byte) tpduId)); + + // Start a new request-transaction (Is ended in the response-handler) + RequestTransactionManager.RequestTransaction transaction = tm.startRequest(); + // Send the request. + transaction.submit(() -> context.sendRequest(tpktPacket) + .onTimeout(new TransactionErrorCallback<>(future, transaction)) + .onError(new TransactionErrorCallback<>(future, transaction)) + .expectResponse(TPKTPacket.class, REQUEST_TIMEOUT) + .check(p -> p.getPayload() instanceof COTPPacketData) + .unwrap(p -> (COTPPacketData) p.getPayload()) + .check(p -> p.getPayload() != null) + .unwrap(COTPPacket::getPayload) + .check(p -> p.getTpduReference() == tpduId) + .handle(p -> { + future.complete(p); + // Finish the request-transaction. + transaction.endRequest(); + })); + + return future; } /** @@ -1783,14 +1691,14 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest //TODO: Reassembling message. if (responseMessage instanceof S7MessageResponseData) { - for (String tagName : plcReadRequest.getTagNames()) { + for (String tagName : plcReadRequest.getTagNames()) { if (plcReadRequest.getTag(tagName) instanceof S7StringVarLengthTag) { - PlcValue plcValue = null; + PlcValue plcValue = null; PlcResponseCode responseCode = PlcResponseCode.INTERNAL_ERROR; ResponseItem result = new ResponseItem<>(responseCode, plcValue); - values.put(tagName, result); - } - } + values.put(tagName, result); + } + } } else if (responseMessage instanceof S7MessageUserData) { S7PayloadUserData payload = (S7PayloadUserData) responseMessage.getPayload(); @@ -1894,18 +1802,14 @@ private PlcResponse decodeReadResponse(S7Message responseMessage, PlcReadRequest dt.getMsec() * 1000000))); plcValue = new PlcList(plcValues); } - + ResponseItem result = new ResponseItem<>(responseCode, plcValue); values.put(tagName, result); index++; } - - return new DefaultPlcReadResponse(plcReadRequest, values); - } - // In all other cases all went well. S7PayloadReadVarResponse payload = (S7PayloadReadVarResponse) responseMessage.getPayload(); @@ -2152,32 +2056,6 @@ protected S7Address encodeS7Address(PlcTag tag) { s7Tag.getMemoryArea(), s7Tag.getByteOffset(), s7Tag.getBitOffset()); } - /* - * In the case of a reconnection, there may be requests waiting, - * for which the operation must be terminated by exception and canceled - * in the transaction manager. If this does not happen, - * the driver operation can be frozen. - */ - private void cleanFutures() { - //TODO: Debe ser ejecutado si la conexion esta levanta. - activeRequests.forEach((f, p) -> { - try { - if (!f.isDone()) { - logger.info("CF"); - f.cancel(true); - logger.info("ClientCF"); - p.getRight().completeExceptionally(new PlcRuntimeException("Disconnected")); - logger.info("TM"); - p.getLeft().endRequest(); - } - - } catch (Exception ex) { - logger.info(ex.toString()); - } - }); - activeRequests.clear(); - } - private boolean isConnected() { return context.getChannel().attr(S7HMuxImpl.IS_CONNECTED).get(); //return true; @@ -2197,7 +2075,7 @@ private void setChannelFeatures() { private boolean isFeatureSupported() { return (s7DriverContext.getControllerType() == S7ControllerType.S7_300) || - (s7DriverContext.getControllerType() == S7ControllerType.S7_400); + (s7DriverContext.getControllerType() == S7ControllerType.S7_400); } private CompletableFuture reassembledMessage(short sequenceNumber, List plcValues) { @@ -2230,12 +2108,12 @@ private CompletableFuture reassembledMessage(short sequenceNu */ private TPKTPacket createSzlReassembledRequest(int tpduId, short sequenceNumber) { S7MessageUserData identifyRemoteMessage = new S7MessageUserData(tpduId, new S7ParameterUserData(List.of( - new S7ParameterUserDataItemCPUFunctions((short) 0x12, (byte) 0x4, (byte) 0x4, (short) 0x01, sequenceNumber, (short) 0x00, (short) 0x00, 0) + new S7ParameterUserDataItemCPUFunctions((short) 0x12, (byte) 0x4, (byte) 0x4, (short) 0x01, sequenceNumber, (short) 0x00, (short) 0x00, 0) )), new S7PayloadUserData(List.of( - new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( - DataTransportErrorCode.NOT_FOUND, - DataTransportSize.NULL, - 0x00) + new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( + DataTransportErrorCode.NOT_FOUND, + DataTransportSize.NULL, + 0x00) ))); COTPPacketData cotpPacketData = new COTPPacketData(null, identifyRemoteMessage, true, (byte) 2); return new TPKTPacket(cotpPacketData); @@ -2268,12 +2146,12 @@ private CompletableFuture reassembledAlarmEvents(short sequen //TODO: S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest to S7PayloadUserDataItemCpuFunctionAlarmQueryNoDataRequest private TPKTPacket createAlarmQueryReassembledRequest(int tpduId, short sequenceNumber) { S7MessageUserData identifyRemoteMessage = new S7MessageUserData(tpduId, new S7ParameterUserData(List.of( - new S7ParameterUserDataItemCPUFunctions((short) 0x12, (byte) 0x4, (byte) 0x4, (short) 0x13, sequenceNumber, (short) 0x00, (short) 0x00, 0) + new S7ParameterUserDataItemCPUFunctions((short) 0x12, (byte) 0x4, (byte) 0x4, (short) 0x13, sequenceNumber, (short) 0x00, (short) 0x00, 0) )), new S7PayloadUserData(List.of( - new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( - DataTransportErrorCode.NOT_FOUND, - DataTransportSize.NULL, - 0x00) + new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( + DataTransportErrorCode.NOT_FOUND, + DataTransportSize.NULL, + 0x00) ))); COTPPacketData cotpPacketData = new COTPPacketData(null, identifyRemoteMessage, true, (byte) 2); return new TPKTPacket(cotpPacketData); @@ -2323,4 +2201,101 @@ public void accept(TPKTPacket tpktPacket, E e) { } } + protected CompletableFuture> getStringSizes(PlcTagRequest request) { + CompletableFuture> future = new CompletableFuture<>(); + + // Build a request to read the length information for every var-length string in the request. + List varLengthStringTags = request.getTags().stream() + .filter(plcTag -> plcTag instanceof S7StringVarLengthTag) + .map(plcTag -> (S7StringVarLengthTag) plcTag) + .collect(Collectors.toList()); + List stringFields = new ArrayList<>(varLengthStringTags.size()); + for (S7StringVarLengthTag varLengthStringTag : varLengthStringTags) { + // For STRING, the header is 2 bytes (first byte contains the max length and the second the actual length) + if (varLengthStringTag.getDataType() == TransportSize.STRING) { + stringFields.add(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + 2, + varLengthStringTag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + varLengthStringTag.getByteOffset(), + varLengthStringTag.getBitOffset() + ))); + } + // For WSTRING, the header is 4 bytes (first word contains the max length and the second the actual length) + else if (varLengthStringTag.getDataType() == TransportSize.WSTRING) { + stringFields.add(new S7VarRequestParameterItemAddress( + new S7AddressAny( + TransportSize.BYTE, + 4, + varLengthStringTag.getBlockNumber(), + MemoryArea.DATA_BLOCKS, + varLengthStringTag.getByteOffset(), + varLengthStringTag.getBitOffset() + ))); + } else { + throw new PlcInvalidTagException("Only STRING and WSTRING allowed here."); + } + } + final S7MessageRequest readRequest = new S7MessageRequest( + getTpduId(), new S7ParameterReadVarRequest(stringFields), null); + + // Read the max length and actual size for each of the var-length strings. + CompletableFuture resolveSizesRequestFuture = sendInternal(readRequest); + resolveSizesRequestFuture.whenComplete((s7Message, throwable) -> { + if (throwable != null) { + future.completeExceptionally(new PlcProtocolException("Error resolving string sizes", throwable)); + return; + } + + Map stringLengths = new HashMap<>(varLengthStringTags.size()); + S7PayloadReadVarResponse getLengthsResponse = (S7PayloadReadVarResponse) s7Message.getPayload(); + int curItemIndex = 0; + for (S7StringVarLengthTag varLengthStringTag : varLengthStringTags) { + S7VarPayloadDataItem s7VarPayloadDataItem = getLengthsResponse.getItems().get(curItemIndex); + ReadBufferByteBased readBuffer = new ReadBufferByteBased(s7VarPayloadDataItem.getData()); + try { + if (varLengthStringTag.getDataType() == TransportSize.STRING) { + int maxChars = readBuffer.readUnsignedInt("maxLength", 8); + int actualChars = readBuffer.readUnsignedInt("maxLength", 8); + stringLengths.put(varLengthStringTag, new StringSizes(maxChars, actualChars)); + } else if (varLengthStringTag.getDataType() == TransportSize.WSTRING) { + int maxChars = readBuffer.readUnsignedInt("maxLength", 16); + int actualChars = readBuffer.readUnsignedInt("maxLength", 16); + stringLengths.put(varLengthStringTag, new StringSizes(maxChars, actualChars)); + } else { + throw new PlcInvalidTagException("Only STRING and WSTRING allowed here."); + } + } catch (ParseException e) { + throw new PlcInvalidTagException("Error reading var-length string actual lengths."); + } + } + + future.complete(stringLengths); + }); + + return future; + } + + public static class StringSizes { + + private final int maxLength; + private final int curLength; + + public StringSizes(int maxLength, int curLength) { + this.maxLength = maxLength; + this.curLength = curLength; + } + + public int getMaxLength() { + return maxLength; + } + + public int getCurLength() { + return curLength; + } + + } + } From cefb32a5ea3b1b3ae0ed514f63a95d0305b30845 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 19:41:50 +0100 Subject: [PATCH 04/21] fix: Fixed some tests. --- .../tag/S7StringFixedLengthTagTest.java | 44 +++++++++++++++++++ .../java/s7/readwrite/tag/S7TagTest.java | 17 ------- 2 files changed, 44 insertions(+), 17 deletions(-) create mode 100644 plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTagTest.java diff --git a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTagTest.java b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTagTest.java new file mode 100644 index 00000000000..e2670017245 --- /dev/null +++ b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7StringFixedLengthTagTest.java @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.plc4x.java.s7.readwrite.tag; + +import org.apache.plc4x.java.s7.readwrite.MemoryArea; +import org.apache.plc4x.java.s7.readwrite.TransportSize; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; + +public class S7StringFixedLengthTagTest { + /** + * PLC4X-312 - CAN NOT READ STRING FROM S7 PLC + */ + @Test + public void testStringAddress() { + final S7StringFixedLengthTag s7StringFixedLengthTag = S7StringFixedLengthTag.of("%DB145.DBX38:STRING(8)[1]"); + Assertions.assertEquals(TransportSize.STRING, s7StringFixedLengthTag.getDataType()); + Assertions.assertEquals(1, s7StringFixedLengthTag.getNumberOfElements()); + Assertions.assertEquals(145, s7StringFixedLengthTag.getBlockNumber()); + Assertions.assertEquals(MemoryArea.DATA_BLOCKS, s7StringFixedLengthTag.getMemoryArea()); + Assertions.assertEquals(38, s7StringFixedLengthTag.getByteOffset()); + Assertions.assertEquals(0, s7StringFixedLengthTag.getBitOffset()); + Assertions.assertEquals("S7StringFixedLengthTag", s7StringFixedLengthTag.getClass().getSimpleName()); + Assertions.assertEquals(8, s7StringFixedLengthTag.getStringLength()); + } + +} diff --git a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java index 3c4a672c3a5..3f14d47608d 100644 --- a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java +++ b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/tag/S7TagTest.java @@ -36,21 +36,4 @@ public void testPlcProxyAddress() { Assertions.assertEquals(0, s7Tag.getBitOffset()); } - /** - * PLC4X-312 - CAN NOT READ STRING FROM S7 PLC - */ - @Test - public void testStringAddress() { - final S7Tag s7Tag = S7Tag.of("%DB145.DBX38:STRING(8)[1]"); - Assertions.assertEquals(TransportSize.STRING, s7Tag.getDataType()); - Assertions.assertEquals(1, s7Tag.getNumberOfElements()); - Assertions.assertEquals(145, s7Tag.getBlockNumber()); - Assertions.assertEquals(MemoryArea.DATA_BLOCKS, s7Tag.getMemoryArea()); - Assertions.assertEquals(38, s7Tag.getByteOffset()); - Assertions.assertEquals(0, s7Tag.getBitOffset()); - Assertions.assertEquals("S7StringTag", s7Tag.getClass().getSimpleName()); - S7StringFixedLengthTag s7StringTag = (S7StringFixedLengthTag) s7Tag; - Assertions.assertEquals(8, s7StringTag.getStringLength()); - } - } From bb1922389fcde14b1174cae3b7e22572aa4fb663 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 19:51:34 +0100 Subject: [PATCH 05/21] fix: Fixed some tests. --- .../plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java index 4b176256e1d..efec77a2fc8 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java @@ -252,8 +252,8 @@ public CompletableFuture read(PlcReadRequest readRequest) { DefaultPlcReadRequest request = (DefaultPlcReadRequest) readRequest; CompletableFuture responseFuture; if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instanceof S7SzlTag)) { + // TODO: Is it correct, that there can only be one szl tag? S7SzlTag szlTag = (S7SzlTag) request.getTags().get(0); - // TODO: Is the tpduReference of 1 correct here? S7Message s7Message = new S7MessageUserData(getTpduId(), new S7ParameterUserData(List.of( new S7ParameterUserDataItemCPUFunctions( @@ -440,26 +440,20 @@ public CompletableFuture subscribe(PlcSubscriptionReque valuesResponse.put(Integer.toString(msgParameter.getSequenceNumber()), decodeEventSubscriptionResponse(Integer.toString(msgParameter.getSequenceNumber()), subscriptionRequest, futures.get("DATA_").get())); - } catch (Exception ex) { logger.warn(ex.toString()); } - try { HashMap> values = new HashMap<>(); - valuesResponse.forEach((s, p) -> { if (p != null) values.putAll(((DefaultPlcSubscriptionResponse) p).getValues()); }); - response.complete(new DefaultPlcSubscriptionResponse(subscriptionRequest, values)); - } catch (Exception ex) { logger.warn(ex.getMessage()); } - }); t1.start(); From 845fd8108af8e06325e30e187e5032c7ca91c851 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 21:43:55 +0100 Subject: [PATCH 06/21] fix: Fixed some issues with writing values in S7 --- .../plc4x/java/s7/readwrite/DataItem.java | 4 +- .../java/s7/readwrite/TransportSize.java | 8 +- .../readwrite/protocol/S7ProtocolLogic.java | 162 ++++++++---------- .../java/s7/readwrite/utils/StaticHelper.java | 49 ++++-- .../java/s7/readwrite/ManualS7DriverTest.java | 7 +- .../apache/plc4x/java/spi/values/PlcTIME.java | 2 +- .../src/main/resources/protocols/s7/s7.mspec | 14 +- 7 files changed, 123 insertions(+), 123 deletions(-) diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java index 66f58e40f42..40dfd1d4d61 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -491,10 +491,10 @@ public static int getLengthInBits(PlcValue _value, String dataProtocolId, Intege sizeInBits += 16; } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_STRING")) { // STRING // Manual Field (value) - sizeInBits += (STR_LEN(_value)) + (2); + sizeInBits += (((stringLength) * (8))) + (16); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WSTRING")) { // STRING // Manual Field (value) - sizeInBits += (((STR_LEN(_value)) * (2))) + (2); + sizeInBits += (((stringLength) * (16))) + (32); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME // Simple Field (milliseconds) sizeInBits += 32; diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java index d99705e7540..bdab50692d3 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java @@ -231,7 +231,7 @@ public enum TransportSize { (boolean) true, (short) 'B', (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, + DataTransportSize.OCTET_STRING, (String) "IEC61131_CHAR", null), WCHAR( @@ -244,7 +244,7 @@ public enum TransportSize { (boolean) true, (short) 'X', (boolean) true, - null, + DataTransportSize.OCTET_STRING, (String) "IEC61131_WCHAR", null), STRING( @@ -257,7 +257,7 @@ public enum TransportSize { (boolean) true, (short) 'X', (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, + DataTransportSize.OCTET_STRING, (String) "IEC61131_STRING", null), WSTRING( @@ -270,7 +270,7 @@ public enum TransportSize { (boolean) true, (short) 'X', (boolean) true, - null, + DataTransportSize.OCTET_STRING, (String) "IEC61131_WSTRING", null), TIME( diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java index efec77a2fc8..20af57c8734 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java @@ -46,6 +46,7 @@ import org.apache.plc4x.java.spi.generation.*; import org.apache.plc4x.java.spi.messages.*; import org.apache.plc4x.java.spi.messages.utils.ResponseItem; +import org.apache.plc4x.java.spi.messages.utils.TagValueItem; import org.apache.plc4x.java.spi.model.DefaultPlcSubscriptionTag; import org.apache.plc4x.java.spi.transaction.RequestTransactionManager; import org.apache.plc4x.java.spi.values.*; @@ -296,12 +297,18 @@ else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instance private CompletableFuture toPlcReadResponse(PlcReadRequest readRequest, CompletableFuture responseFuture) { CompletableFuture clientFuture = new CompletableFuture<>(); - try { - PlcReadResponse response = (PlcReadResponse) decodeReadResponse(responseFuture.get(), readRequest); - clientFuture.complete(response); - } catch (Exception ex) { - logger.info(ex.toString()); - } + responseFuture.whenComplete((s7Message, throwable) -> { + if(throwable != null) { + clientFuture.completeExceptionally(new PlcProtocolException("Error reading", throwable)); + } else { + try { + PlcReadResponse response = (PlcReadResponse) decodeReadResponse(s7Message, readRequest); + clientFuture.complete(response); + } catch (Exception ex) { + logger.info(ex.toString()); + } + } + }); return clientFuture; } @@ -339,12 +346,18 @@ else if (request.getTagNames().stream().anyMatch(t -> request.getTag(t) instance private CompletableFuture toPlcWriteResponse(PlcWriteRequest writeRequest, CompletableFuture responseFuture) { CompletableFuture clientFuture = new CompletableFuture<>(); - try { - PlcWriteResponse response = (PlcWriteResponse) decodeWriteResponse(responseFuture.get(), writeRequest); - clientFuture.complete(response); - } catch (Exception ex) { - logger.info(ex.toString()); - } + responseFuture.whenComplete((s7Message, throwable) -> { + if(throwable != null) { + clientFuture.completeExceptionally(new PlcProtocolException("Error writing", throwable)); + } else { + try { + PlcWriteResponse response = (PlcWriteResponse) decodeWriteResponse(s7Message, writeRequest); + clientFuture.complete(response); + } catch (Exception ex) { + logger.info(ex.toString()); + } + } + }); return clientFuture; } @@ -1329,87 +1342,47 @@ private CompletableFuture performOrdinaryReadRequest(DefaultPlcReadRe * TODO: Maximum waiting time managed by system variables. */ private CompletableFuture performVarLengthStringWriteRequest(DefaultPlcWriteRequest request) { - List parameterItems = new ArrayList<>(request.getNumberOfTags()); - List payloadItems = new ArrayList<>(request.getNumberOfTags()); - - int intMaxChars = 0; - int intActualChars = 0; - - final S7StringVarLengthTag tag = (S7StringVarLengthTag) request.getTags().get(0); - - //Read the max length and actual size. - // TODO: Is the tpduId of 1 correct here? - final S7MessageRequest readRequest = new S7MessageRequest(1, new S7ParameterReadVarRequest( - List.of(new S7VarRequestParameterItemAddress( - new S7AddressAny( - TransportSize.BYTE, - 2, - tag.getBlockNumber(), - MemoryArea.DATA_BLOCKS, - tag.getByteOffset(), - tag.getBitOffset() - )) - - )), null); - - CompletableFuture future = sendInternal(readRequest); - - try { - S7Message get = future.get(2000, TimeUnit.MILLISECONDS); - final S7VarPayloadDataItem payload = (S7VarPayloadDataItem) ((S7PayloadReadVarResponse) get.getPayload()).getItems().get(0); - intMaxChars = Byte.toUnsignedInt(payload.getData()[0]); //payload.getData()[0] & 0xFF - intActualChars = Byte.toUnsignedInt(payload.getData()[1]); - } catch (InterruptedException ex) { - logger.info(ex.getMessage()); - } catch (ExecutionException ex) { - logger.info(ex.getMessage()); - } catch (TimeoutException ex) { - logger.info(ex.getMessage()); - } - - //Create the message structure for the user request. + CompletableFuture future = new CompletableFuture<>(); - Iterator iter = request.getTagNames().iterator(); + // Resolve the lengths of all var-length string fields in the request. + CompletableFuture> stringSizesFuture = getStringSizes(request); + stringSizesFuture.whenComplete((s7StringVarLengthTagStringSizesMap, throwable) -> { + if (throwable != null) { + future.completeExceptionally(new PlcProtocolException("Error resolving string sizes", throwable)); + } else { + // Create an alternative list of request items, where all var-length string tags are replaced with + // fixed-length string tags using the string length returned by the previous request. + LinkedHashMap updatedRequestItems = new LinkedHashMap<>(request.getNumberOfTags()); + for (String tagName : request.getTagNames()) { + PlcTag tag = request.getTag(tagName); + PlcValue value = request.getPlcValue(tagName); + if (tag instanceof S7StringVarLengthTag) { + S7StringVarLengthTag varLengthTag = (S7StringVarLengthTag) tag; + int stringLength = s7StringVarLengthTagStringSizesMap.get(varLengthTag).getCurLength(); + S7StringFixedLengthTag newTag = new S7StringFixedLengthTag(varLengthTag.getDataType(), varLengthTag.getMemoryArea(), + varLengthTag.getBlockNumber(), varLengthTag.getByteOffset(), varLengthTag.getBitOffset(), + varLengthTag.getNumberOfElements(), stringLength); + updatedRequestItems.put(tagName, new TagValueItem(newTag, value)); + } else { + updatedRequestItems.put(tagName, new TagValueItem(tag, value)); + } + } - String tagName; - PlcValue plcValue; - while (iter.hasNext()) { - tagName = iter.next(); - final S7StringVarLengthTag tagRef = (S7StringVarLengthTag) request.getTag(tagName); - plcValue = request.getPlcValue(tagName); - - //Check if String - String strValue = plcValue.getString(); - if (strValue.length() > intMaxChars) { - strValue = strValue.substring(0, intMaxChars); - plcValue = new PlcSTRING(strValue); + // Use the normal functionality to execute the read request. + // TODO: Here technically the request object in the response will not match the original request. + CompletableFuture s7MessageCompletableFuture = performOrdinaryWriteRequest( + new DefaultPlcWriteRequest(request.getWriter(), updatedRequestItems)); + s7MessageCompletableFuture.whenComplete((s7Message, throwable1) -> { + if (throwable1 != null) { + future.completeExceptionally(throwable1); + } else { + future.complete(s7Message); + } + }); } + }); - S7Address s7Address = new S7AddressAny( - tagRef.getDataType().BYTE, - strValue.length() + 2, - tagRef.getBlockNumber(), - tagRef.getMemoryArea(), - tagRef.getByteOffset(), - tagRef.getBitOffset()); - - parameterItems.add(new S7VarRequestParameterItemAddress(s7Address)); - - ByteBuffer byteBuffer = ByteBuffer.allocate(strValue.length() + 2); - byteBuffer.put((byte) intMaxChars); - byteBuffer.put((byte) strValue.length()); - byteBuffer.put(strValue.getBytes()); - - DataTransportSize transportSize = DataTransportSize.BYTE_WORD_DWORD; - - payloadItems.add(new S7VarPayloadDataItem(DataTransportErrorCode.OK, transportSize, byteBuffer.array()/*, hasNext*/)); - } - - return sendInternal( - new S7MessageRequest(getTpduId(), - new S7ParameterWriteVarRequest(parameterItems), - new S7PayloadWriteVarRequest(payloadItems) - )); + return future; } private CompletableFuture performOrdinaryWriteRequest(DefaultPlcWriteRequest request) { @@ -1917,18 +1890,25 @@ private S7VarPayloadDataItem serializePlcValue(S7Tag tag, PlcValue plcValue) { int stringLength = (tag instanceof S7StringFixedLengthTag) ? ((S7StringFixedLengthTag) tag).getStringLength() : 254; ByteBuffer byteBuffer = null; for (int i = 0; i < tag.getNumberOfElements(); i++) { - final int lengthInBits = DataItem.getLengthInBits(plcValue.getIndex(i), tag.getDataType().getDataProtocolId(), stringLength); + int lengthInBits = DataItem.getLengthInBits(plcValue.getIndex(i), tag.getDataType().getDataProtocolId(), stringLength); + // Cap the length of the string with the maximum allowed size. + if(tag.getDataType() == TransportSize.STRING) { + lengthInBits = Math.min(lengthInBits, (stringLength * 8) + 16); + } else if(tag.getDataType() == TransportSize.WSTRING) { + lengthInBits = Math.min(lengthInBits, (stringLength * 16) + 32); + } final WriteBufferByteBased writeBuffer = new WriteBufferByteBased((int) Math.ceil(((float) lengthInBits) / 8.0f)); DataItem.staticSerialize(writeBuffer, plcValue.getIndex(i), tag.getDataType().getDataProtocolId(), stringLength); // Allocate enough space for all items. if (byteBuffer == null) { + // TODO: This logic will cause problems when reading arrays of strings. byteBuffer = ByteBuffer.allocate(writeBuffer.getBytes().length * tag.getNumberOfElements()); } byteBuffer.put(writeBuffer.getBytes()); } if (byteBuffer != null) { byte[] data = byteBuffer.array(); - return new S7VarPayloadDataItem(DataTransportErrorCode.OK, transportSize, data/*, hasNext*/); + return new S7VarPayloadDataItem(DataTransportErrorCode.OK, transportSize, data); } } catch (SerializationException e) { logger.warn("Error serializing tag item of type: '{}'", tag.getDataType().name(), e); diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java index 3b2cf1fd184..f57948ff65b 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java @@ -2715,7 +2715,7 @@ public static String parseS7String(ReadBuffer io, int stringLength, String encod break; } } - return new String(byteArray, StandardCharsets.UTF_16); + return new String(byteArray, StandardCharsets.UTF_16BE); } else { throw new PlcRuntimeException("Unsupported string encoding " + encoding); } @@ -2763,22 +2763,41 @@ public static void serializeS7Char(WriteBuffer io, PlcValue value, String encodi * the String as char arrays from your application. */ public static void serializeS7String(WriteBuffer io, PlcValue value, int stringLength, String encoding) { - int k = 0xFF & ((stringLength > 250) ? 250 : stringLength); - int m = 0xFF & value.getString().length(); - m = (m > k) ? k : m; - byte[] chars = new byte[m]; - for (int i = 0; i < m; ++i) { - char c = value.getString().charAt(i); - chars[i] = (byte) c; + int maxStringLength = 0xFF & Math.min(stringLength, 250); + int actStringLength = 0xFF & value.getString().length(); + actStringLength = Math.min(maxStringLength, actStringLength); + + switch (encoding) { + case "UTF-8": { + byte[] chars = new byte[maxStringLength]; + byte[] actChars = value.getString().substring(0, actStringLength).getBytes(StandardCharsets.UTF_8); + System.arraycopy(actChars, 0, chars, 0, actChars.length); + try { + io.writeUnsignedInt(8, maxStringLength); + io.writeUnsignedInt(8, actStringLength); + io.writeByteArray(chars); + } catch (SerializationException ex) { + Logger.getLogger(StaticHelper.class.getName()).log(Level.SEVERE, null, ex); + } + break; + } + case "UTF-16": { + byte[] chars = new byte[maxStringLength * 2]; + byte[] actChars = value.getString().substring(0, actStringLength).getBytes(StandardCharsets.UTF_16BE); + System.arraycopy(actChars, 0, chars, 0, actChars.length); + try { + io.writeUnsignedInt(16, maxStringLength); + io.writeUnsignedInt(16, actStringLength); + io.writeByteArray(chars); + } catch (SerializationException ex) { + Logger.getLogger(StaticHelper.class.getName()).log(Level.SEVERE, null, ex); + } + break; + } + default: + throw new PlcRuntimeException("Unsupported encoding: " + encoding); } - try { - io.writeByte((byte) (k & 0xFF)); - io.writeByte((byte) (m & 0xFF)); - io.writeByteArray(chars); - } catch (SerializationException ex) { - Logger.getLogger(StaticHelper.class.getName()).log(Level.SEVERE, null, ex); - } } } diff --git a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java index 954080d23f5..8d8c5e11faa 100644 --- a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java +++ b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java @@ -21,6 +21,7 @@ import org.apache.plc4x.java.spi.values.*; import org.apache.plc4x.test.manual.ManualTest; +import java.time.Duration; import java.time.LocalDate; import java.time.LocalTime; @@ -66,7 +67,7 @@ public class ManualS7DriverTest extends ManualTest { */ public ManualS7DriverTest(String connectionString) { - super(connectionString); + super(connectionString, true); } public static void main(String[] args) throws Exception { @@ -88,7 +89,8 @@ public static void main(String[] args) throws Exception { test.addTestCase("%DB4:46:REAL", new PlcREAL(3.141593F)); // Not supported in S7 1200 //test.addTestCase("%DB4:50:LREAL", new PlcLREAL(2.71828182846D)); - test.addTestCase("%DB4:58:TIME", "PT1.234S"); + // TODO: There seems to be some odd error here ... I keep on getting timeouts from the future that I'm completing successfully. + //test.addTestCase("%DB4:58:TIME", new PlcTIME(Duration.parse("PT1.234S"))); test.addTestCase("%DB4:136:CHAR", new PlcCHAR("H")); test.addTestCase("%DB4:138:WCHAR", new PlcWCHAR("w")); test.addTestCase("%DB4:140:STRING(10)", new PlcSTRING("hurz")); @@ -100,7 +102,6 @@ public static void main(String[] args) throws Exception { //test.addTestCase("%DB4:62:LTIME", new PlcLTIME(Duration.parse("PT24015H23M12.034002044S")); test.addTestCase("%DB4:70:DATE", new PlcDATE(LocalDate.parse("1998-03-28"))); test.addTestCase("%DB4:72:TIME_OF_DAY", new PlcTIME_OF_DAY(LocalTime.parse("15:36:30.123"))); - test.addTestCase("%DB4:76:TOD", new PlcTIME_OF_DAY(LocalTime.parse("16:17:18.123"))); // Not supported in S7 1200 //test.addTestCase("%DB4:96:DATE_AND_TIME", new PlcDATE_AND_TIME(LocalDateTime.parse("1996-05-06T15:36:30"))); // Not supported in S7 1200 diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java index c792ea45d6a..ff35f6b9dc2 100644 --- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java +++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java @@ -89,7 +89,7 @@ public int getInteger() { @Override public long getLong() { - return value.get(ChronoUnit.NANOS) / 1000000; + return value.toMillis(); } @Override diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec index f3945c05eaf..599d089c21f 100644 --- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec +++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec @@ -760,11 +760,11 @@ ] ['"IEC61131_STRING"' STRING // TODO: Fix this length - [manual vstring value 'STATIC_CALL("parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' 'STR_LEN(_value) + 2' encoding='"UTF-8"'] + [manual vstring value 'STATIC_CALL("parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' '(stringLength * 8) + 16' encoding='"UTF-8"'] ] ['"IEC61131_WSTRING"' STRING // TODO: Fix this length - [manual vstring value 'STATIC_CALL("parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' '(STR_LEN(_value) * 2) + 2' encoding='"UTF-16"'] + [manual vstring value 'STATIC_CALL("parseS7String", readBuffer, stringLength, _type.encoding)' 'STATIC_CALL("serializeS7String", writeBuffer, _value, stringLength, _type.encoding)' '(stringLength * 16) + 32' encoding='"UTF-16"'] ] // ----------------------------------------- @@ -879,10 +879,10 @@ ['0x0F' LREAL ['0x30' , 'X' , '8' , 'REAL' , 'null' , 'IEC61131_LREAL' , 'false' , 'false' , 'true' , 'true' , 'false' ]] // Characters and Strings - ['0x10' CHAR ['0x03' , 'B' , '1' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_CHAR' , 'true' , 'true' , 'true' , 'true' , 'true' ]] - ['0x11' WCHAR ['0x13' , 'X' , '2' , 'null' , 'null' , 'IEC61131_WCHAR' , 'false' , 'false' , 'true' , 'true' , 'true' ]] - ['0x12' STRING ['0x03' , 'X' , '1' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_STRING' , 'true' , 'true' , 'true' , 'true' , 'true' ]] - ['0x13' WSTRING ['0x00' , 'X' , '2' , 'null' , 'null' , 'IEC61131_WSTRING' , 'false' , 'false' , 'true' , 'true' , 'true' ]] + ['0x10' CHAR ['0x03' , 'B' , '1' , 'null' , 'OCTET_STRING' , 'IEC61131_CHAR' , 'true' , 'true' , 'true' , 'true' , 'true' ]] + ['0x11' WCHAR ['0x13' , 'X' , '2' , 'null' , 'OCTET_STRING' , 'IEC61131_WCHAR' , 'false' , 'false' , 'true' , 'true' , 'true' ]] + ['0x12' STRING ['0x03' , 'X' , '1' , 'null' , 'OCTET_STRING' , 'IEC61131_STRING' , 'true' , 'true' , 'true' , 'true' , 'true' ]] + ['0x13' WSTRING ['0x00' , 'X' , '2' , 'null' , 'OCTET_STRING' , 'IEC61131_WSTRING' , 'false' , 'false' , 'true' , 'true' , 'true' ]] // Dates and time values (Please note that we seem to have to rewrite queries for these types to reading bytes or we'll get "Data type not supported" errors) ['0x14' TIME ['0x0B' , 'X' , '4' , 'null' , 'null' , 'IEC61131_TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] @@ -1027,7 +1027,7 @@ ['0x12' UPDATE] ] -[enum uint 8 'TimeBase' +[enum uint 8 TimeBase ['0x00' B01SEC] ['0x01' B1SEC] ['0X02' B10SEC] From 4bfda20cd343668d8cd90402f7b9300c0979c4e6 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 21:44:40 +0100 Subject: [PATCH 07/21] chore: Updated the apache parent to the latest released version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 0efdda77617..bd5f419431d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.apache apache - 30 + 31 org.apache.plc4x From a5e854dc489968c3b12f9b23ef362231f7a30aa3 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 21:51:15 +0100 Subject: [PATCH 08/21] fix: Fixed some issues with writing values in S7 --- plc4c/generated-sources/s7/src/data_item.c | 10 ++-------- plc4c/generated-sources/s7/src/transport_size.c | 11 +++++++---- plc4go/protocols/s7/readwrite/model/TransportSize.go | 8 ++++---- 3 files changed, 13 insertions(+), 16 deletions(-) diff --git a/plc4c/generated-sources/s7/src/data_item.c b/plc4c/generated-sources/s7/src/data_item.c index c0e09c4108a..b02d7f210c7 100644 --- a/plc4c/generated-sources/s7/src/data_item.c +++ b/plc4c/generated-sources/s7/src/data_item.c @@ -687,17 +687,11 @@ uint16_t plc4c_s7_read_write_data_item_length_in_bits(plc4x_spi_context ctx, plc } else if(strcmp(dataProtocolId, "IEC61131_STRING") == 0) { /* STRING */ // Manual Field (value) - { - char* _value = data_item->data.string_value; - lengthInBits += (plc4c_spi_evaluation_helper_str_len(_value)) + (2); - } + lengthInBits += (((stringLength) * (8))) + (16); } else if(strcmp(dataProtocolId, "IEC61131_WSTRING") == 0) { /* STRING */ // Manual Field (value) - { - char* _value = data_item->data.string_value; - lengthInBits += (((plc4c_spi_evaluation_helper_str_len(_value)) * (2))) + (2); - } + lengthInBits += (((stringLength) * (16))) + (32); } else if(strcmp(dataProtocolId, "IEC61131_TIME") == 0) { /* TIME */ // Simple field (milliseconds) diff --git a/plc4c/generated-sources/s7/src/transport_size.c b/plc4c/generated-sources/s7/src/transport_size.c index b681e48047f..adffef17cc5 100644 --- a/plc4c/generated-sources/s7/src/transport_size.c +++ b/plc4c/generated-sources/s7/src/transport_size.c @@ -1105,16 +1105,16 @@ plc4c_s7_read_write_data_transport_size plc4c_s7_read_write_transport_size_get_d return -1; } case plc4c_s7_read_write_transport_size_CHAR: { /* '0x10' */ - return plc4c_s7_read_write_data_transport_size_BYTE_WORD_DWORD; + return plc4c_s7_read_write_data_transport_size_OCTET_STRING; } case plc4c_s7_read_write_transport_size_WCHAR: { /* '0x11' */ - return -1; + return plc4c_s7_read_write_data_transport_size_OCTET_STRING; } case plc4c_s7_read_write_transport_size_STRING: { /* '0x12' */ - return plc4c_s7_read_write_data_transport_size_BYTE_WORD_DWORD; + return plc4c_s7_read_write_data_transport_size_OCTET_STRING; } case plc4c_s7_read_write_transport_size_WSTRING: { /* '0x13' */ - return -1; + return plc4c_s7_read_write_data_transport_size_OCTET_STRING; } case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return -1; @@ -1154,6 +1154,9 @@ plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_get_first_ case plc4c_s7_read_write_transport_size_INT: /* '0x06' */{ return plc4c_s7_read_write_transport_size_INT; } + case plc4c_s7_read_write_transport_size_CHAR: /* '0x10' */{ + return plc4c_s7_read_write_transport_size_CHAR; + } case plc4c_s7_read_write_transport_size_REAL: /* '0x0E' */{ return plc4c_s7_read_write_transport_size_REAL; } diff --git a/plc4go/protocols/s7/readwrite/model/TransportSize.go b/plc4go/protocols/s7/readwrite/model/TransportSize.go index bae86742630..e3d65199f8b 100644 --- a/plc4go/protocols/s7/readwrite/model/TransportSize.go +++ b/plc4go/protocols/s7/readwrite/model/TransportSize.go @@ -1154,19 +1154,19 @@ func (e TransportSize) DataTransportSize() DataTransportSize { } case 0x10: { /* '0x10' */ - return DataTransportSize_BYTE_WORD_DWORD + return DataTransportSize_OCTET_STRING } case 0x11: { /* '0x11' */ - return 0 + return DataTransportSize_OCTET_STRING } case 0x12: { /* '0x12' */ - return DataTransportSize_BYTE_WORD_DWORD + return DataTransportSize_OCTET_STRING } case 0x13: { /* '0x13' */ - return 0 + return DataTransportSize_OCTET_STRING } case 0x14: { /* '0x14' */ From a5d850defe74aace9d09de33113b79988ebced8d Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 21:51:36 +0100 Subject: [PATCH 09/21] chore: Updated KNX manufacturer ids --- .../readwrite/model/KnxManufacturer.go | 58 +++++++++++++++++-- .../knxnetip/readwrite/KnxManufacturer.java | 7 ++- .../protocols/knxnetip/knx-master-data.mspec | 7 ++- 3 files changed, 63 insertions(+), 9 deletions(-) diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go b/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go index 0dd6a3d9f92..2a7509e17f7 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go @@ -694,8 +694,11 @@ const ( KnxManufacturer_M_ATOUCH KnxManufacturer = 648 KnxManufacturer_M_PANASONIC_LIFE_SOLUTIONS_INDIA_PVT__LTD KnxManufacturer = 649 KnxManufacturer_M_WALLYONS KnxManufacturer = 650 - KnxManufacturer_M_ABB___RESERVED KnxManufacturer = 651 - KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED KnxManufacturer = 652 + KnxManufacturer_M_ZIMMEX KnxManufacturer = 651 + KnxManufacturer_M_RHOMBUS_EUROPE KnxManufacturer = 652 + KnxManufacturer_M_TURING_THINK KnxManufacturer = 653 + KnxManufacturer_M_ABB___RESERVED KnxManufacturer = 654 + KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED KnxManufacturer = 655 ) var KnxManufacturerValues []KnxManufacturer @@ -1354,6 +1357,9 @@ func init() { KnxManufacturer_M_ATOUCH, KnxManufacturer_M_PANASONIC_LIFE_SOLUTIONS_INDIA_PVT__LTD, KnxManufacturer_M_WALLYONS, + KnxManufacturer_M_ZIMMEX, + KnxManufacturer_M_RHOMBUS_EUROPE, + KnxManufacturer_M_TURING_THINK, KnxManufacturer_M_ABB___RESERVED, KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED, } @@ -3819,10 +3825,22 @@ func (e KnxManufacturer) Number() uint16 { } case 651: { /* '651' */ - return 43954 + return 709 } case 652: { /* '652' */ + return 710 + } + case 653: + { /* '653' */ + return 711 + } + case 654: + { /* '654' */ + return 43954 + } + case 655: + { /* '655' */ return 43959 } case 66: @@ -6449,10 +6467,22 @@ func (e KnxManufacturer) Name() string { } case 651: { /* '651' */ - return "ABB - reserved" + return "Zimmex" } case 652: { /* '652' */ + return "Rhombus Europe" + } + case 653: + { /* '653' */ + return "Turing-Think" + } + case 654: + { /* '654' */ + return "ABB - reserved" + } + case 655: + { /* '655' */ return "Busch-Jaeger Elektro - reserved" } case 66: @@ -7849,8 +7879,14 @@ func KnxManufacturerByValue(value uint16) (enum KnxManufacturer, ok bool) { case 650: return KnxManufacturer_M_WALLYONS, true case 651: - return KnxManufacturer_M_ABB___RESERVED, true + return KnxManufacturer_M_ZIMMEX, true case 652: + return KnxManufacturer_M_RHOMBUS_EUROPE, true + case 653: + return KnxManufacturer_M_TURING_THINK, true + case 654: + return KnxManufacturer_M_ABB___RESERVED, true + case 655: return KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED, true case 66: return KnxManufacturer_M_RTS_AUTOMATION, true @@ -9160,6 +9196,12 @@ func KnxManufacturerByName(value string) (enum KnxManufacturer, ok bool) { return KnxManufacturer_M_JEPAZ, true case "M_WALLYONS": return KnxManufacturer_M_WALLYONS, true + case "M_ZIMMEX": + return KnxManufacturer_M_ZIMMEX, true + case "M_RHOMBUS_EUROPE": + return KnxManufacturer_M_RHOMBUS_EUROPE, true + case "M_TURING_THINK": + return KnxManufacturer_M_TURING_THINK, true case "M_ABB___RESERVED": return KnxManufacturer_M_ABB___RESERVED, true case "M_BUSCH_JAEGER_ELEKTRO___RESERVED": @@ -10533,6 +10575,12 @@ func (e KnxManufacturer) PLC4XEnumName() string { return "M_JEPAZ" case KnxManufacturer_M_WALLYONS: return "M_WALLYONS" + case KnxManufacturer_M_ZIMMEX: + return "M_ZIMMEX" + case KnxManufacturer_M_RHOMBUS_EUROPE: + return "M_RHOMBUS_EUROPE" + case KnxManufacturer_M_TURING_THINK: + return "M_TURING_THINK" case KnxManufacturer_M_ABB___RESERVED: return "M_ABB___RESERVED" case KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED: diff --git a/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java b/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java index d5c00a5f0af..f3a424a3f27 100644 --- a/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java +++ b/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java @@ -748,9 +748,12 @@ public enum KnxManufacturer { M_PANASONIC_LIFE_SOLUTIONS_INDIA_PVT__LTD( (int) 649, (int) 707, (String) "Panasonic Life Solutions India Pvt. Ltd"), M_WALLYONS((int) 650, (int) 708, (String) "WallYons"), - M_ABB___RESERVED((int) 651, (int) 43954, (String) "ABB - reserved"), + M_ZIMMEX((int) 651, (int) 709, (String) "Zimmex"), + M_RHOMBUS_EUROPE((int) 652, (int) 710, (String) "Rhombus Europe"), + M_TURING_THINK((int) 653, (int) 711, (String) "Turing-Think"), + M_ABB___RESERVED((int) 654, (int) 43954, (String) "ABB - reserved"), M_BUSCH_JAEGER_ELEKTRO___RESERVED( - (int) 652, (int) 43959, (String) "Busch-Jaeger Elektro - reserved"); + (int) 655, (int) 43959, (String) "Busch-Jaeger Elektro - reserved"); private static final Map map; static { diff --git a/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec b/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec index 3a8ca262def..ec189777225 100644 --- a/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec +++ b/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec @@ -1399,8 +1399,11 @@ ['648' M_ATOUCH ['706', '"Atouch"']] ['649' M_PANASONIC_LIFE_SOLUTIONS_INDIA_PVT__LTD ['707', '"Panasonic Life Solutions India Pvt. Ltd"']] ['650' M_WALLYONS ['708', '"WallYons"']] - ['651' M_ABB___RESERVED ['43954', '"ABB - reserved"']] - ['652' M_BUSCH_JAEGER_ELEKTRO___RESERVED ['43959', '"Busch-Jaeger Elektro - reserved"']] + ['651' M_ZIMMEX ['709', '"Zimmex"']] + ['652' M_RHOMBUS_EUROPE ['710', '"Rhombus Europe"']] + ['653' M_TURING_THINK ['711', '"Turing-Think"']] + ['654' M_ABB___RESERVED ['43954', '"ABB - reserved"']] + ['655' M_BUSCH_JAEGER_ELEKTRO___RESERVED ['43959', '"Busch-Jaeger Elektro - reserved"']] ] From bf619ae0f2000f18371a7a6c4ae72a322359abe8 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 21:59:31 +0100 Subject: [PATCH 10/21] chore: Turned on the write-tests per default in the ManualTest --- .../src/main/java/org/apache/plc4x/test/manual/ManualTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/manual/ManualTest.java b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/manual/ManualTest.java index 924e614ae97..e9d81e8a4a0 100644 --- a/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/manual/ManualTest.java +++ b/plc4j/utils/test-utils/src/main/java/org/apache/plc4x/test/manual/ManualTest.java @@ -42,7 +42,7 @@ public abstract class ManualTest { private final List testCases; public ManualTest(String connectionString) { - this(connectionString, false); + this(connectionString, true); } public ManualTest(String connectionString, boolean testWrite) { From ccf1aced76f0d3bd837a9b8f4113ec7132a3aa27 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 30 Nov 2023 22:54:49 +0100 Subject: [PATCH 11/21] feat: Re-added the manual test for my local S7-Modbus and added the ModbusPal version in parallel --- .../java/modbus/ManualModbusDriverTest.java | 59 +++++----- .../ManualModbusDriverTestModbusPal.java | 101 ++++++++++++++++++ 2 files changed, 133 insertions(+), 27 deletions(-) create mode 100644 plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTestModbusPal.java diff --git a/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTest.java b/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTest.java index 6342100c776..743585aad5d 100644 --- a/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTest.java +++ b/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTest.java @@ -22,6 +22,8 @@ import org.apache.plc4x.test.manual.ManualTest; import org.junit.jupiter.api.Disabled; +import java.util.Arrays; + @Disabled("Manual Test") public class ManualModbusDriverTest extends ManualTest { @@ -65,36 +67,39 @@ public class ManualModbusDriverTest extends ManualTest { */ public ManualModbusDriverTest(String connectionString) { - super(connectionString, true); + super(connectionString); } public static void main(String[] args) throws Exception { - // ! See modbus-pal-project.xmpp for a config made to be used by this test - // Tested with ModbusPal - ManualModbusDriverTest test = new ManualModbusDriverTest("modbus-tcp://127.0.0.1"); - test.addTestCase("holding-register:1000:BOOL", new PlcBOOL(true)); // 0001 # 1 - test.addTestCase("holding-register:1001:BYTE", new PlcBYTE(42)); // 2A # 42 - test.addTestCase("holding-register:1002:WORD", new PlcWORD(42424)); // A5B8 # 42424 - test.addTestCase("holding-register:1003:DWORD", new PlcDWORD(4242442424L)); // FCDE 88B8 # 64734 35000 - test.addTestCase("holding-register:1005:LWORD", new PlcLWORD(4242442424242424242L)); // 3AE0 2EE8 4D04 49B2 # 15072 12008 19716 18866 - test.addTestCase("holding-register:1009:SINT", new PlcSINT(-42)); // D6 # 214 - test.addTestCase("holding-register:1010:USINT", new PlcUSINT(42)); // 2A # 42 - test.addTestCase("holding-register:1011:INT", new PlcINT(-2424)); // F688 # 63112 - test.addTestCase("holding-register:1012:UINT", new PlcUINT(42424)); // A5B8 # 42424 - test.addTestCase("holding-register:1013:DINT", new PlcDINT(-242442424)); // F18C 9F48 # 61836 40776 - test.addTestCase("holding-register:1015:UDINT", new PlcUDINT(4242442424L));// FCDE 88B8 # 64734 35000 - test.addTestCase("holding-register:1017:LINT", new PlcLINT(-4242442424242424242L));// C51F D117 B2FB B64E # 50463 53527 45819 46670 - test.addTestCase("holding-register:1021:ULINT", new PlcULINT(4242442424242424242L));// 3AE0 2EE8 4D04 49B2 # 15072 12008 19716 18866 - test.addTestCase("holding-register:1025:REAL", new PlcREAL(3.141593F));// 4049 0FDC # 16457 4060 - test.addTestCase("holding-register:1027:LREAL", new PlcLREAL(2.71828182846D)); // 4005 BF0A 8B14 5FCF # 16389 48906 35604 24527 -// TODO: These datatypes are not yet fully implemented -// test.addTestCase("holding-register:1031:STRING", new PlcSTRING("hurz")); // 6875 727A # 26741 29306 -// test.addTestCase("holding-register:1033:WSTRING", new PlcWSTRING("wolf")); // 0068 0075 0072 007A # 104 117 114 122 -// test.addTestCase("holding-register:1037:TIME", new PlcTIME(Duration.parse("PT1.234S"))); // 04D2 # 1234 -// test.addTestCase("holding-register::LTIME", new PlcLTIME(Duration.parse("PT24015H23M12.034002044S"))); -// test.addTestCase("holding-register::DATE", new PlcDATE(LocalDate.parse("1978-03-28"))); -// test.addTestCase("holding-register::TIME_OF_DAY", new PlcTIME_OF_DAY(LocalTime.parse("15:36:30.123"))); -// test.addTestCase("holding-register::DATE_AND_TIME", new PlcDATE_AND_TIME(LocalDateTime.parse("1996-05-06T15:36:30"))); + ManualModbusDriverTest test = new ManualModbusDriverTest("modbus-tcp://192.168.23.30"); + test.addTestCase("holding-register:1:BOOL", new PlcBOOL(true)); // 0001 + test.addTestCase("holding-register:2:BYTE", new PlcBYTE(42)); // 2A + test.addTestCase("holding-register:3:WORD", new PlcWORD(42424)); // A5B8 + test.addTestCase("holding-register:4:DWORD", new PlcDWORD(4242442424L)); // FCDE 88B8 +// test.addTestCase("holding-register:6:LWORD", new PlcLWORD(4242442424242424242L)); // FCDE 88B8 FCDE 88B8 + test.addTestCase("holding-register:10:SINT", new PlcSINT(-42)); // D6 + test.addTestCase("holding-register:11:USINT", new PlcUSINT(42)); // 2A + test.addTestCase("holding-register:12:INT", new PlcINT(-2424)); // F688 + test.addTestCase("holding-register:13:UINT", new PlcUINT(42424)); // A5B8 + test.addTestCase("holding-register:14:DINT", new PlcDINT(-242442424)); // F18C 9F48 + test.addTestCase("holding-register:16:UDINT", new PlcUDINT(4242442424L));// FCDE 88B8 + test.addTestCase("holding-register:18:LINT", new PlcLINT(-4242442424242424242L));// C51F D117 B2FB B64E + test.addTestCase("holding-register:22:ULINT", new PlcULINT(4242442424242424242L));// 3AE0 2EE8 4D04 49B2 + test.addTestCase("holding-register:26:REAL", new PlcREAL(3.141593F));// 4049 0FDC + test.addTestCase("holding-register:28:LREAL", new PlcLREAL(2.71828182846D)); // 4005 BF0A 8B14 5FCF + //test.addTestCase("holding-register:32:TIME", "PT1.234S"); // 04D2 + //test.addTestCase("holding-register::LTIME", "PT24015H23M12.034002044S"); + //test.addTestCase("holding-register::DATE", "1998-03-28"); + //test.addTestCase("holding-register::TIME_OF_DAY", "15:36:30.123"); + //test.addTestCase("holding-register::TOD", "16:17:18.123"); + //test.addTestCase("holding-register::DATE_AND_TIME", "1996-05-06T15:36:30"); + //test.addTestCase("holding-register::DT", "1992-03-29T00:00"); + //test.addTestCase("holding-register::LDATE_AND_TIME", "1978-03-28T15:36:30"); + //test.addTestCase("holding-register::LDT", "1978-03-28T15:36:30"); + //test.addTestCase("holding-register::CHAR", "H"); + //test.addTestCase("holding-register::WCHAR", "w"); + //test.addTestCase("holding-register::STRING(10)", "hurz"); + //test.addTestCase("holding-register::WSTRING(10)", "wolf"); test.run(); } diff --git a/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTestModbusPal.java b/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTestModbusPal.java new file mode 100644 index 00000000000..5e52c33fff8 --- /dev/null +++ b/plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualModbusDriverTestModbusPal.java @@ -0,0 +1,101 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.modbus; + +import org.apache.plc4x.java.spi.values.*; +import org.apache.plc4x.test.manual.ManualTest; +import org.junit.jupiter.api.Disabled; + +@Disabled("Manual Test") +public class ManualModbusDriverTestModbusPal extends ManualTest { + + /* + * Test program code on the PLC with the test-data. + * + * Located in "main" + * + + hurz_BOOL := TRUE; + hurz_BYTE := 42; + hurz_WORD := 42424; + hurz_DWORD := 4242442424; + hurz_LWORD := 4242442424242424242; + hurz_SINT := -42; + hurz_USINT := 42; + hurz_INT := -2424; + hurz_UINT := 42424; + hurz_DINT := -242442424; + hurz_UDINT := 4242442424; + hurz_LINT := -4242442424242424242; + hurz_ULINT := 4242442424242424242; + hurz_REAL := 3.14159265359; + hurz_LREAL := 2.71828182846; + hurz_TIME := T#1S234MS; + hurz_LTIME := LTIME#1000D15H23M12S34MS2US44NS; + hurz_DATE := D#1998-03-28; + //hurz_LDATE:LDATE; + hurz_TIME_OF_DAY := TIME_OF_DAY#15:36:30.123; + hurz_TOD := TOD#16:17:18.123; + //hurz_LTIME_OF_DAY:LTIME_OF_DAY; + //hurz_LTOD:LTOD; + hurz_DATE_AND_TIME := DATE_AND_TIME#1996-05-06-15:36:30; + hurz_DT := DT#1972-03-29-00:00:00; + //hurz_LDATE_AND_TIME:LDATE_AND_TIME; + //hurz_LDT:LDT; + hurz_STRING := 'hurz'; + hurz_WSTRING := "wolf"; + + * + */ + + public ManualModbusDriverTestModbusPal(String connectionString) { + super(connectionString, true); + } + + public static void main(String[] args) throws Exception { + // ! See modbus-pal-project.xmpp for a config made to be used by this test + // Tested with ModbusPal + ManualModbusDriverTestModbusPal test = new ManualModbusDriverTestModbusPal("modbus-tcp://127.0.0.1"); + test.addTestCase("holding-register:1000:BOOL", new PlcBOOL(true)); // 0001 # 1 + test.addTestCase("holding-register:1001:BYTE", new PlcBYTE(42)); // 2A # 42 + test.addTestCase("holding-register:1002:WORD", new PlcWORD(42424)); // A5B8 # 42424 + test.addTestCase("holding-register:1003:DWORD", new PlcDWORD(4242442424L)); // FCDE 88B8 # 64734 35000 + test.addTestCase("holding-register:1005:LWORD", new PlcLWORD(4242442424242424242L)); // 3AE0 2EE8 4D04 49B2 # 15072 12008 19716 18866 + test.addTestCase("holding-register:1009:SINT", new PlcSINT(-42)); // D6 # 214 + test.addTestCase("holding-register:1010:USINT", new PlcUSINT(42)); // 2A # 42 + test.addTestCase("holding-register:1011:INT", new PlcINT(-2424)); // F688 # 63112 + test.addTestCase("holding-register:1012:UINT", new PlcUINT(42424)); // A5B8 # 42424 + test.addTestCase("holding-register:1013:DINT", new PlcDINT(-242442424)); // F18C 9F48 # 61836 40776 + test.addTestCase("holding-register:1015:UDINT", new PlcUDINT(4242442424L));// FCDE 88B8 # 64734 35000 + test.addTestCase("holding-register:1017:LINT", new PlcLINT(-4242442424242424242L));// C51F D117 B2FB B64E # 50463 53527 45819 46670 + test.addTestCase("holding-register:1021:ULINT", new PlcULINT(4242442424242424242L));// 3AE0 2EE8 4D04 49B2 # 15072 12008 19716 18866 + test.addTestCase("holding-register:1025:REAL", new PlcREAL(3.141593F));// 4049 0FDC # 16457 4060 + test.addTestCase("holding-register:1027:LREAL", new PlcLREAL(2.71828182846D)); // 4005 BF0A 8B14 5FCF # 16389 48906 35604 24527 +// TODO: These datatypes are not yet fully implemented +// test.addTestCase("holding-register:1031:STRING", new PlcSTRING("hurz")); // 6875 727A # 26741 29306 +// test.addTestCase("holding-register:1033:WSTRING", new PlcWSTRING("wolf")); // 0068 0075 0072 007A # 104 117 114 122 +// test.addTestCase("holding-register:1037:TIME", new PlcTIME(Duration.parse("PT1.234S"))); // 04D2 # 1234 +// test.addTestCase("holding-register::LTIME", new PlcLTIME(Duration.parse("PT24015H23M12.034002044S"))); +// test.addTestCase("holding-register::DATE", new PlcDATE(LocalDate.parse("1978-03-28"))); +// test.addTestCase("holding-register::TIME_OF_DAY", new PlcTIME_OF_DAY(LocalTime.parse("15:36:30.123"))); +// test.addTestCase("holding-register::DATE_AND_TIME", new PlcDATE_AND_TIME(LocalDateTime.parse("1996-05-06T15:36:30"))); + test.run(); + } + +} From 2da3dd477c6308d1eb106a91f49fe3a23db32e96 Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Fri, 1 Dec 2023 19:39:35 -0400 Subject: [PATCH 12/21] Corrects reading of the TIME format. --- .../plc4x/java/s7/readwrite/DataItem.java | 4 +- .../plc4j/s7event/PlcReadDataS7400H.java | 38 +++++++++++++++++-- .../src/main/resources/protocols/s7/s7.mspec | 2 +- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java index 40dfd1d4d61..051dedaa117 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -181,7 +181,7 @@ public static PlcValue staticParse( // Simple Field (milliseconds) Long milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedLong("", 32); + readBuffer.readLong("", 32); return PlcTIME.ofMilliseconds(milliseconds); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME @@ -367,7 +367,7 @@ public static void staticSerialize( // Simple Field (milliseconds) long milliseconds = (long) _value.getLong(); /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( + /*TODO: migrate me*/ writeBuffer.writeLong( "", 32, ((Number) (milliseconds)).longValue()); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME // Simple Field (nanoseconds) diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java index 604ab800456..8222917bc69 100644 --- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java @@ -19,6 +19,7 @@ package org.apache.plc4x.examples.plc4j.s7event; import java.io.IOException; +import java.time.Duration; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.lang3.time.StopWatch; import org.apache.plc4x.java.DefaultPlcDriverManager; @@ -26,6 +27,8 @@ import org.apache.plc4x.java.api.listener.ConnectionStateListener; import org.apache.plc4x.java.api.messages.PlcReadRequest; import org.apache.plc4x.java.api.messages.PlcReadResponse; +import org.apache.plc4x.java.api.messages.PlcWriteRequest; +import org.apache.plc4x.java.api.messages.PlcWriteResponse; import org.apache.plc4x.java.api.types.PlcResponseCode; import org.apache.plc4x.java.s7.readwrite.protocol.S7HPlcConnection; import org.slf4j.Logger; @@ -78,7 +81,7 @@ public void run() throws IOException { OpenConnection("s7://10.10.1.80/10.10.1.81?remote-rack=0&" + "remote-slot=3&remote-rack2=0&remote-slot=4&" + "controller-type=S7_400&read-timeout=8&" - + "ping=true&ping-time=2&retry-time=3"); //(01) + + "ping=false&ping-time=2&retry-time=3"); //(01) logger.info("*****************************************************"); logger.info("* 1. Once the connection is executed, it must read"); @@ -90,7 +93,7 @@ public void run() throws IOException { logger.info("* Press [ENTER]"); logger.info("*****************************************************"); System.in.read(); - + Write(); Read(); //(01.1) logger.info("*****************************************************"); @@ -146,7 +149,7 @@ public void run() throws IOException { logger.info("* Press [ENTER]"); logger.info("*****************************************************"); System.in.read(); - + Read(); //(07.1) @@ -221,7 +224,7 @@ private void Read() { if (!isConnected.get()) return; try { final PlcReadRequest.Builder readrequest = connection.readRequestBuilder(); //(01) - readrequest.addTagAddress("TEST", "%DB1000:4:INT"); //(02) + readrequest.addTagAddress("TEST", "%DB406:4:TIME"); //(02) final PlcReadRequest rr = readrequest.build(); //(03) final PlcReadResponse response; //(04) @@ -237,6 +240,33 @@ private void Read() { }; } + + /*************************************************************************** + * The reading process is standard. In case of an exception, + * the user must take the appropriate actions, but "do not close + * the connection": + ***************************************************************************/ + private void Write() { + if (!isConnected.get()) return; + try { + final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) + writeRequest.addTagAddress("TAG01", "%DB400:4:TIME",Duration.ofDays(5)); //(02) + + + final PlcWriteRequest wr = writeRequest.build(); //(03) + final PlcWriteResponse response; //(04) + response = wr.execute().get(); //(05) + + if (response.getResponseCode("TAG01") == PlcResponseCode.OK) { //(06) + logger.info("TAG01 Write sucefull..."); + } else { + logger.info("TAG01 Problem reading..."); + } + + } catch (Exception ex) { //(07) + logger.info("Read: " + ex.getMessage()); + }; + } /*************************************************************************** * This method is called when the driver makes an internal TCP connection. * The first connection of the driver does not generate this event. diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec index 599d089c21f..bba452cdab7 100644 --- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec +++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec @@ -772,7 +772,7 @@ // ----------------------------------------- // - Duration: Interpreted as "milliseconds" ['"IEC61131_TIME"' TIME - [simple uint 32 milliseconds] + [simple int 32 milliseconds] ] //['"S7_S5TIME"' TIME // [reserved uint 2 '0x00'] From c031ec6d60d2c44faa915430aab4b2d1ee92397f Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Sun, 3 Dec 2023 13:08:19 +0100 Subject: [PATCH 13/21] fix: Made it possible to use signed integers for creating PlcTIME values in Go (Needed to add explicit casts to the generated Go gode) --- .../language/go/GoLanguageTemplateHelper.java | 16 +- .../templates/go/data-io-template.go.ftlh | 2 +- plc4c/generated-sources/s7/src/data_item.c | 6 +- .../readwrite/model/CIPEncapsulationPacket.go | 14 +- ...esponseMessageProtectedTypedLogicalRead.go | 2 +- .../readwrite/model/DF1RequestCommand.go | 2 +- .../readwrite/model/DF1RequestMessage.go | 12 +- .../DF1RequestProtectedTypedLogicalRead.go | 10 +- .../readwrite/model/DF1ResponseMessage.go | 14 +- .../discovery/readwrite/model/AdsDiscovery.go | 6 +- .../model/AdsDiscoveryBlockAmsNetId.go | 2 +- .../model/AdsDiscoveryBlockFingerprint.go | 2 +- .../model/AdsDiscoveryBlockOsData.go | 2 +- .../model/AdsDiscoveryBlockStatus.go | 2 +- .../readwrite/model/AdsDiscoveryBlockType.go | 2 +- .../model/AdsDiscoveryBlockVersion.go | 2 +- .../readwrite/model/AdsDiscoveryConstants.go | 2 +- .../readwrite/model/AdsPortNumbers.go | 2 +- .../ads/discovery/readwrite/model/AmsNetId.go | 12 +- .../discovery/readwrite/model/AmsString.go | 4 +- .../discovery/readwrite/model/Operation.go | 2 +- .../ads/discovery/readwrite/model/Status.go | 2 +- .../model/AdsAddDeviceNotificationRequest.go | 14 +- .../model/AdsAddDeviceNotificationResponse.go | 2 +- .../ads/readwrite/model/AdsConstants.go | 2 +- .../ads/readwrite/model/AdsDataType.go | 2 +- .../readwrite/model/AdsDataTypeArrayInfo.go | 4 +- .../model/AdsDataTypeTableChildEntry.go | 32 +- .../readwrite/model/AdsDataTypeTableEntry.go | 32 +- .../AdsDeleteDeviceNotificationRequest.go | 2 +- .../model/AdsDeviceNotificationRequest.go | 4 +- .../model/AdsMultiRequestItemRead.go | 6 +- .../model/AdsMultiRequestItemReadWrite.go | 8 +- .../model/AdsMultiRequestItemWrite.go | 6 +- .../readwrite/model/AdsNotificationSample.go | 4 +- .../model/AdsReadDeviceInfoResponse.go | 6 +- .../ads/readwrite/model/AdsReadRequest.go | 6 +- .../ads/readwrite/model/AdsReadResponse.go | 2 +- .../readwrite/model/AdsReadStateResponse.go | 4 +- .../readwrite/model/AdsReadWriteRequest.go | 8 +- .../readwrite/model/AdsReadWriteResponse.go | 2 +- .../ads/readwrite/model/AdsStampHeader.go | 4 +- .../readwrite/model/AdsSymbolTableEntry.go | 26 +- .../ads/readwrite/model/AdsTableSizes.go | 12 +- .../ads/readwrite/model/AdsTransMode.go | 2 +- .../readwrite/model/AdsWriteControlRequest.go | 6 +- .../ads/readwrite/model/AdsWriteRequest.go | 6 +- .../protocols/ads/readwrite/model/AmsNetId.go | 12 +- .../ads/readwrite/model/AmsPacket.go | 12 +- .../model/AmsSerialAcknowledgeFrame.go | 12 +- .../ads/readwrite/model/AmsSerialFrame.go | 12 +- .../readwrite/model/AmsSerialResetFrame.go | 12 +- .../ads/readwrite/model/AmsTCPPacket.go | 4 +- .../ads/readwrite/model/CommandId.go | 2 +- .../protocols/ads/readwrite/model/DataItem.go | 48 +- .../ads/readwrite/model/DefaultAmsPorts.go | 2 +- .../ads/readwrite/model/PlcValueType.go | 2 +- .../readwrite/model/ReservedIndexGroups.go | 2 +- .../ads/readwrite/model/ReturnCode.go | 2 +- .../bacnetip/readwrite/model/APDUAbort.go | 4 +- .../readwrite/model/APDUComplexAck.go | 8 +- .../readwrite/model/APDUConfirmedRequest.go | 8 +- .../bacnetip/readwrite/model/APDUError.go | 4 +- .../bacnetip/readwrite/model/APDUReject.go | 4 +- .../readwrite/model/APDUSegmentAck.go | 8 +- .../bacnetip/readwrite/model/APDUSimpleAck.go | 4 +- .../readwrite/model/APDUUnconfirmedRequest.go | 2 +- .../bacnetip/readwrite/model/APDUUnknown.go | 2 +- .../bacnetip/readwrite/model/ApduType.go | 2 +- .../readwrite/model/BACnetAbortReason.go | 2 +- ...BACnetAccessAuthenticationFactorDisable.go | 2 +- .../model/BACnetAccessCredentialDisable.go | 2 +- .../BACnetAccessCredentialDisableReason.go | 2 +- .../readwrite/model/BACnetAccessEvent.go | 2 +- .../model/BACnetAccessPassbackMode.go | 2 +- .../BACnetAccessRuleLocationSpecifier.go | 2 +- .../BACnetAccessRuleTimeRangeSpecifier.go | 2 +- .../readwrite/model/BACnetAccessUserType.go | 2 +- .../model/BACnetAccessZoneOccupancyState.go | 2 +- ...ACnetAccumulatorRecordAccumulatorStatus.go | 2 +- .../bacnetip/readwrite/model/BACnetAction.go | 2 +- .../model/BACnetAuthenticationFactorType.go | 2 +- .../model/BACnetAuthenticationStatus.go | 2 +- .../model/BACnetAuthorizationExemption.go | 2 +- .../model/BACnetAuthorizationMode.go | 2 +- .../readwrite/model/BACnetBackupState.go | 2 +- .../readwrite/model/BACnetBinaryLightingPV.go | 2 +- .../readwrite/model/BACnetBinaryPV.go | 2 +- .../model/BACnetConfirmedServiceChoice.go | 2 +- ...uestConfirmedTextMessageMessagePriority.go | 2 +- ...DeviceCommunicationControlEnableDisable.go | 2 +- ...tEnrollmentSummaryAcknowledgementFilter.go | 2 +- ...estGetEnrollmentSummaryEventStateFilter.go | 2 +- ...tializeDeviceReinitializedStateOfDevice.go | 2 +- .../model/BACnetContextTagBoolean.go | 2 +- .../readwrite/model/BACnetDataType.go | 2 +- .../readwrite/model/BACnetDaysOfWeek.go | 2 +- .../readwrite/model/BACnetDeviceStatus.go | 2 +- .../readwrite/model/BACnetDoorAlarmState.go | 2 +- .../model/BACnetDoorSecuredStatus.go | 2 +- .../readwrite/model/BACnetDoorStatus.go | 2 +- .../readwrite/model/BACnetDoorValue.go | 2 +- .../readwrite/model/BACnetEngineeringUnits.go | 2 +- .../readwrite/model/BACnetEscalatorFault.go | 2 +- .../readwrite/model/BACnetEscalatorMode.go | 2 +- .../BACnetEscalatorOperationDirection.go | 2 +- .../readwrite/model/BACnetEventState.go | 2 +- .../model/BACnetEventTransitionBits.go | 2 +- .../readwrite/model/BACnetEventType.go | 2 +- .../readwrite/model/BACnetFaultType.go | 2 +- .../readwrite/model/BACnetFileAccessMethod.go | 2 +- .../bacnetip/readwrite/model/BACnetIPMode.go | 2 +- .../readwrite/model/BACnetLifeSafetyMode.go | 2 +- .../model/BACnetLifeSafetyOperation.go | 2 +- .../readwrite/model/BACnetLifeSafetyState.go | 2 +- .../readwrite/model/BACnetLiftCarDirection.go | 2 +- .../model/BACnetLiftCarDoorCommand.go | 2 +- .../model/BACnetLiftCarDriveStatus.go | 2 +- .../readwrite/model/BACnetLiftCarMode.go | 2 +- .../readwrite/model/BACnetLiftFault.go | 2 +- .../readwrite/model/BACnetLiftGroupMode.go | 2 +- .../model/BACnetLightingInProgress.go | 2 +- .../model/BACnetLightingOperation.go | 2 +- .../model/BACnetLightingTransition.go | 2 +- .../readwrite/model/BACnetLimitEnable.go | 2 +- .../readwrite/model/BACnetLockStatus.go | 2 +- .../readwrite/model/BACnetLogStatus.go | 2 +- .../readwrite/model/BACnetLoggingType.go | 2 +- .../readwrite/model/BACnetMaintenance.go | 2 +- .../model/BACnetNetworkNumberQuality.go | 2 +- .../model/BACnetNetworkPortCommand.go | 2 +- .../readwrite/model/BACnetNetworkType.go | 2 +- .../readwrite/model/BACnetNodeType.go | 2 +- .../readwrite/model/BACnetNotifyType.go | 2 +- .../readwrite/model/BACnetObjectType.go | 2 +- .../model/BACnetObjectTypesSupported.go | 2 +- .../readwrite/model/BACnetPolarity.go | 2 +- .../readwrite/model/BACnetProgramError.go | 2 +- .../readwrite/model/BACnetProgramRequest.go | 2 +- .../readwrite/model/BACnetProgramState.go | 2 +- .../model/BACnetPropertyIdentifier.go | 2 +- .../readwrite/model/BACnetProtocolLevel.go | 2 +- .../readwrite/model/BACnetRejectReason.go | 2 +- .../readwrite/model/BACnetRelationship.go | 2 +- .../readwrite/model/BACnetReliability.go | 2 +- .../readwrite/model/BACnetRestartReason.go | 2 +- .../readwrite/model/BACnetResultFlags.go | 2 +- .../model/BACnetRouterEntryStatus.go | 2 +- .../readwrite/model/BACnetSecurityLevel.go | 2 +- .../readwrite/model/BACnetSecurityPolicy.go | 2 +- .../readwrite/model/BACnetSegmentation.go | 2 +- .../model/BACnetServicesSupported.go | 2 +- .../readwrite/model/BACnetShedState.go | 2 +- .../readwrite/model/BACnetSilencedState.go | 2 +- .../readwrite/model/BACnetStatusFlags.go | 2 +- .../readwrite/model/BACnetTagHeader.go | 12 +- .../model/BACnetTagPayloadBitString.go | 2 +- .../readwrite/model/BACnetTagPayloadDate.go | 8 +- .../model/BACnetTagPayloadObjectIdentifier.go | 2 +- .../model/BACnetTagPayloadSignedInteger.go | 16 +- .../readwrite/model/BACnetTagPayloadTime.go | 8 +- .../model/BACnetTagPayloadUnsignedInteger.go | 16 +- .../readwrite/model/BACnetTimerState.go | 2 +- .../readwrite/model/BACnetTimerTransition.go | 2 +- .../model/BACnetUnconfirmedServiceChoice.go | 2 +- .../bacnetip/readwrite/model/BACnetVTClass.go | 2 +- .../readwrite/model/BACnetVendorId.go | 50 +- .../readwrite/model/BACnetWeekNDayTagged.go | 6 +- .../readwrite/model/BACnetWriteStatus.go | 2 +- .../bacnetip/readwrite/model/BVLC.go | 6 +- .../BVLCBroadcastDistributionTableEntry.go | 6 +- .../BVLCDeleteForeignDeviceTableEntry.go | 4 +- .../model/BVLCForeignDeviceTableEntry.go | 8 +- .../readwrite/model/BVLCForwardedNPDU.go | 4 +- .../model/BVLCRegisterForeignDevice.go | 2 +- .../readwrite/model/BVLCResultCode.go | 2 +- .../readwrite/model/BacnetConstants.go | 2 +- .../bacnetip/readwrite/model/ErrorClass.go | 2 +- .../bacnetip/readwrite/model/ErrorCode.go | 2 +- .../readwrite/model/MaxApduLengthAccepted.go | 2 +- .../readwrite/model/MaxSegmentsAccepted.go | 2 +- .../protocols/bacnetip/readwrite/model/NLM.go | 2 +- .../readwrite/model/NLMChallengeRequest.go | 4 +- .../model/NLMDisconnectConnectionToNetwork.go | 2 +- .../model/NLMEstablishConnectionToNetwork.go | 4 +- .../readwrite/model/NLMIAmRouterToNetwork.go | 2 +- .../model/NLMICouldBeRouterToNetwork.go | 4 +- .../model/NLMInitalizeRoutingTable.go | 2 +- .../model/NLMInitalizeRoutingTableAck.go | 2 +- .../NLMInitalizeRoutingTablePortMapping.go | 6 +- .../readwrite/model/NLMNetworkNumberIs.go | 4 +- .../model/NLMRejectRouterToNetwork.go | 2 +- .../NLMRejectRouterToNetworkRejectReason.go | 2 +- .../readwrite/model/NLMRequestKeyUpdate.go | 8 +- .../readwrite/model/NLMRequestMasterKey.go | 2 +- .../model/NLMRouterAvailableToNetwork.go | 2 +- .../readwrite/model/NLMRouterBusyToNetwork.go | 2 +- .../readwrite/model/NLMSecurityPayload.go | 2 +- .../readwrite/model/NLMSecurityResponse.go | 4 +- .../readwrite/model/NLMUpdateKeyUpdate.go | 12 +- .../model/NLMUpdateKeyUpdateKeyEntry.go | 4 +- .../model/NLMWhoIsRouterToNetwork.go | 2 +- .../bacnetip/readwrite/model/NPDU.go | 16 +- .../bacnetip/readwrite/model/NPDUControl.go | 4 +- .../readwrite/model/NPDUNetworkPriority.go | 2 +- .../readwrite/model/SecurityResponseCode.go | 2 +- .../bacnetip/readwrite/model/TagClass.go | 2 +- .../readwrite/model/AccessControlCategory.go | 2 +- .../model/AccessControlCommandType.go | 2 +- .../AccessControlCommandTypeContainer.go | 2 +- .../readwrite/model/AccessControlDirection.go | 2 +- .../model/AirConditioningCommandType.go | 2 +- .../AirConditioningCommandTypeContainer.go | 2 +- ...irConditioningDataHumidityScheduleEntry.go | 2 +- .../AirConditioningDataHvacScheduleEntry.go | 2 +- .../cbus/readwrite/model/ApplicationId.go | 2 +- .../readwrite/model/ApplicationIdContainer.go | 2 +- .../cbus/readwrite/model/Attribute.go | 2 +- .../cbus/readwrite/model/BaudRateSelector.go | 2 +- .../cbus/readwrite/model/CALCommandType.go | 2 +- .../model/CALCommandTypeContainer.go | 2 +- .../readwrite/model/CALDataAcknowledge.go | 2 +- .../cbus/readwrite/model/CALDataGetStatus.go | 2 +- .../cbus/readwrite/model/CALDataRecall.go | 2 +- .../cbus/readwrite/model/CALDataStatus.go | 2 +- .../readwrite/model/CALDataStatusExtended.go | 2 +- .../cbus/readwrite/model/CBusConstants.go | 2 +- .../cbus/readwrite/model/CBusHeader.go | 2 +- .../model/CBusPointToPointCommandDirect.go | 2 +- .../cbus/readwrite/model/ChannelStatus.go | 2 +- .../model/ClockAndTimekeepingCommandType.go | 2 +- ...ClockAndTimekeepingCommandTypeContainer.go | 2 +- .../ClockAndTimekeepingDataUpdateDate.go | 6 +- .../ClockAndTimekeepingDataUpdateTime.go | 6 +- .../readwrite/model/DestinationAddressType.go | 2 +- .../readwrite/model/DialInFailureReason.go | 2 +- .../readwrite/model/DialOutFailureReason.go | 2 +- .../model/EnableControlCommandType.go | 2 +- .../EnableControlCommandTypeContainer.go | 2 +- .../model/ErrorReportingCommandType.go | 2 +- .../ErrorReportingCommandTypeContainer.go | 2 +- .../model/ErrorReportingDataGeneric.go | 6 +- .../readwrite/model/ErrorReportingSeverity.go | 2 +- .../ErrorReportingSystemCategoryClass.go | 2 +- ...ategoryTypeForBuildingManagementSystems.go | 2 +- ...SystemCategoryTypeForClimateControllers.go | 2 +- ...eportingSystemCategoryTypeForInputUnits.go | 2 +- ...portingSystemCategoryTypeForOutputUnits.go | 2 +- ...ortingSystemCategoryTypeForSupportUnits.go | 2 +- ...rrorReportingSystemCategoryTypeReserved.go | 2 +- .../ErrorReportingSystemCategoryVariant.go | 2 +- .../cbus/readwrite/model/GAVState.go | 2 +- .../readwrite/model/HVACAuxiliaryLevel.go | 2 +- .../cbus/readwrite/model/HVACError.go | 2 +- .../cbus/readwrite/model/HVACHumidity.go | 2 +- .../cbus/readwrite/model/HVACHumidityError.go | 2 +- .../model/HVACHumidityModeAndFlagsMode.go | 2 +- .../cbus/readwrite/model/HVACHumidityType.go | 2 +- .../readwrite/model/HVACModeAndFlagsMode.go | 2 +- .../cbus/readwrite/model/HVACRawLevels.go | 2 +- .../cbus/readwrite/model/HVACSensorStatus.go | 2 +- .../cbus/readwrite/model/HVACStartTime.go | 2 +- .../cbus/readwrite/model/HVACTemperature.go | 2 +- .../cbus/readwrite/model/HVACType.go | 2 +- ...fyReplyCommandExtendedDiagnosticSummary.go | 10 +- .../IdentifyReplyCommandOutputUnitSummary.go | 2 +- .../cbus/readwrite/model/Language.go | 2 +- .../readwrite/model/LevelInformationAbsent.go | 2 +- .../model/LevelInformationCorrupted.go | 8 +- .../model/LevelInformationNibblePair.go | 2 +- .../readwrite/model/LightingCommandType.go | 2 +- .../model/LightingCommandTypeContainer.go | 2 +- .../readwrite/model/LightingCompatible.go | 2 +- .../readwrite/model/LightingLabelFlavour.go | 2 +- .../cbus/readwrite/model/LightingLabelType.go | 2 +- .../cbus/readwrite/model/LineOffHookReason.go | 2 +- .../readwrite/model/MeasurementCommandType.go | 2 +- .../model/MeasurementCommandTypeContainer.go | 2 +- .../MeasurementDataChannelMeasurementData.go | 10 +- .../cbus/readwrite/model/MeasurementUnits.go | 2 +- .../model/MediaTransportControlCommandType.go | 2 +- ...diaTransportControlCommandTypeContainer.go | 2 +- ...lDataEnumerateCategoriesSelectionTracks.go | 2 +- ...diaTransportControlDataEnumerationsSize.go | 4 +- .../MediaTransportControlDataSetCategory.go | 2 +- .../readwrite/model/MeteringCommandType.go | 2 +- .../model/MeteringCommandTypeContainer.go | 2 +- .../MeteringDataDrinkingWaterConsumption.go | 2 +- .../MeteringDataElectricityConsumption.go | 2 +- .../model/MeteringDataGasConsumption.go | 2 +- .../model/MeteringDataOilConsumption.go | 2 +- .../MeteringDataOtherWaterConsumption.go | 2 +- .../model/MonitoredSALShortFormBasicMode.go | 4 +- .../NetworkProtocolControlInformation.go | 6 +- .../cbus/readwrite/model/PanicStatus.go | 2 +- .../cbus/readwrite/model/Parameter.go | 2 +- .../cbus/readwrite/model/ParameterType.go | 2 +- .../cbus/readwrite/model/PriorityClass.go | 2 +- .../cbus/readwrite/model/ProtectionLevel.go | 2 +- .../cbus/readwrite/model/RequestNull.go | 2 +- .../cbus/readwrite/model/RequestType.go | 2 +- .../cbus/readwrite/model/SecurityArmCode.go | 2 +- .../readwrite/model/SecurityCommandType.go | 2 +- .../model/SecurityCommandTypeContainer.go | 2 +- .../model/SecurityDataArmReadyNotReady.go | 2 +- .../model/SecurityDataRequestZoneName.go | 2 +- .../model/SecurityDataZoneIsolated.go | 2 +- .../readwrite/model/SecurityDataZoneName.go | 2 +- .../readwrite/model/SecurityDataZoneOpen.go | 2 +- .../readwrite/model/SecurityDataZoneSealed.go | 2 +- .../readwrite/model/SecurityDataZoneShort.go | 2 +- .../model/SecurityDataZoneUnsealed.go | 2 +- .../cbus/readwrite/model/TamperStatus.go | 2 +- .../readwrite/model/TelephonyCommandType.go | 2 +- .../model/TelephonyCommandTypeContainer.go | 2 +- .../model/TemperatureBroadcastCommandType.go | 2 +- ...emperatureBroadcastCommandTypeContainer.go | 2 +- .../model/TriggerControlCommandType.go | 2 +- .../TriggerControlCommandTypeContainer.go | 2 +- .../model/TriggerControlLabelFlavour.go | 2 +- .../model/TriggerControlLabelType.go | 2 +- .../cbus/readwrite/model/UnitStatus.go | 2 +- .../cbus/readwrite/model/ZoneStatusTemp.go | 2 +- .../df1/readwrite/model/DF1Command.go | 6 +- .../df1/readwrite/model/DF1Symbol.go | 4 +- .../readwrite/model/DF1SymbolMessageFrame.go | 10 +- .../model/DF1UnprotectedReadRequest.go | 4 +- .../model/AnsiExtendedSymbolSegment.go | 4 +- .../eip/readwrite/model/CIPAttributes.go | 8 +- .../eip/readwrite/model/CIPClassID.go | 2 +- .../eip/readwrite/model/CIPDataConnected.go | 4 +- .../eip/readwrite/model/CIPDataTypeCode.go | 2 +- .../eip/readwrite/model/CIPStatus.go | 2 +- .../eip/readwrite/model/CIPStructTypeCode.go | 2 +- .../readwrite/model/CipConnectedRequest.go | 6 +- .../readwrite/model/CipConnectedResponse.go | 6 +- .../model/CipConnectionManagerCloseRequest.go | 16 +- .../CipConnectionManagerCloseResponse.go | 16 +- .../model/CipConnectionManagerRequest.go | 28 +- .../model/CipConnectionManagerResponse.go | 20 +- .../eip/readwrite/model/CipIdentity.go | 32 +- .../eip/readwrite/model/CipRRData.go | 6 +- .../eip/readwrite/model/CipReadRequest.go | 4 +- .../eip/readwrite/model/CipReadResponse.go | 6 +- .../readwrite/model/CipSecurityInformation.go | 4 +- .../eip/readwrite/model/CipService.go | 2 +- .../readwrite/model/CipUnconnectedRequest.go | 12 +- .../eip/readwrite/model/CipWriteRequest.go | 4 +- .../eip/readwrite/model/CipWriteResponse.go | 6 +- .../protocols/eip/readwrite/model/ClassID.go | 4 +- .../eip/readwrite/model/ClassSegment.go | 8 +- .../model/CommandSpecificDataItem.go | 2 +- .../readwrite/model/ConnectedAddressItem.go | 4 +- .../eip/readwrite/model/ConnectedDataItem.go | 4 +- .../eip/readwrite/model/DataSegmentType.go | 2 +- .../eip/readwrite/model/EiPCommand.go | 2 +- .../readwrite/model/EipConnectionRequest.go | 4 +- .../readwrite/model/EipConnectionResponse.go | 4 +- .../eip/readwrite/model/EipConstants.go | 4 +- .../model/EipListIdentityResponse.go | 2 +- .../eip/readwrite/model/EipPacket.go | 10 +- .../readwrite/model/GetAttributeAllRequest.go | 2 +- .../model/GetAttributeAllResponse.go | 6 +- .../eip/readwrite/model/InstanceID.go | 4 +- .../eip/readwrite/model/InstanceSegment.go | 8 +- .../readwrite/model/ListServicesResponse.go | 2 +- .../eip/readwrite/model/LogicalSegmentType.go | 2 +- .../protocols/eip/readwrite/model/MemberID.go | 4 +- .../readwrite/model/MultipleServiceRequest.go | 4 +- .../model/MultipleServiceResponse.go | 10 +- .../model/NetworkConnectionParameters.go | 8 +- .../eip/readwrite/model/NullAddressItem.go | 2 +- .../eip/readwrite/model/PathSegment.go | 2 +- .../readwrite/model/PortSegmentExtended.go | 4 +- .../eip/readwrite/model/PortSegmentNormal.go | 4 +- .../eip/readwrite/model/SendUnitData.go | 6 +- .../protocols/eip/readwrite/model/Services.go | 4 +- .../eip/readwrite/model/ServicesResponse.go | 8 +- .../eip/readwrite/model/TransportType.go | 4 +- .../protocols/eip/readwrite/model/TypeId.go | 2 +- .../readwrite/model/UnConnectedDataItem.go | 2 +- .../firmata/readwrite/model/FirmataCommand.go | 2 +- .../model/FirmataCommandProtocolVersion.go | 4 +- .../model/FirmataCommandSetDigitalPinValue.go | 4 +- .../model/FirmataCommandSetPinMode.go | 2 +- .../readwrite/model/FirmataCommandSysex.go | 2 +- .../firmata/readwrite/model/FirmataMessage.go | 2 +- .../readwrite/model/FirmataMessageAnalogIO.go | 4 +- .../model/FirmataMessageDigitalIO.go | 4 +- .../FirmataMessageSubscribeAnalogPinValue.go | 4 +- .../FirmataMessageSubscribeDigitalPinValue.go | 4 +- .../firmata/readwrite/model/PinMode.go | 2 +- .../firmata/readwrite/model/SysexCommand.go | 2 +- .../SysexCommandAnalogMappingQueryResponse.go | 2 +- .../readwrite/model/SysexCommandExtendedId.go | 2 +- .../model/SysexCommandPinStateQuery.go | 2 +- .../model/SysexCommandPinStateResponse.go | 6 +- .../SysexCommandReportFirmwareResponse.go | 4 +- .../knxnetip/readwrite/model/AccessLevel.go | 2 +- .../knxnetip/readwrite/model/Apdu.go | 4 +- .../knxnetip/readwrite/model/ApduControl.go | 2 +- .../knxnetip/readwrite/model/ApduData.go | 2 +- .../model/ApduDataDeviceDescriptorRead.go | 2 +- .../model/ApduDataDeviceDescriptorResponse.go | 2 +- .../knxnetip/readwrite/model/ApduDataExt.go | 2 +- .../model/ApduDataExtAuthorizeRequest.go | 2 +- .../model/ApduDataExtAuthorizeResponse.go | 2 +- .../ApduDataExtPropertyDescriptionRead.go | 6 +- .../ApduDataExtPropertyDescriptionResponse.go | 12 +- .../model/ApduDataExtPropertyValueRead.go | 8 +- .../model/ApduDataExtPropertyValueResponse.go | 8 +- .../model/ApduDataExtPropertyValueWrite.go | 8 +- .../readwrite/model/ApduDataGroupValueRead.go | 2 +- .../model/ApduDataGroupValueResponse.go | 2 +- .../model/ApduDataGroupValueWrite.go | 2 +- .../readwrite/model/ApduDataMemoryRead.go | 4 +- .../readwrite/model/ApduDataMemoryResponse.go | 4 +- .../knxnetip/readwrite/model/CEMI.go | 2 +- .../model/CEMIAdditionalInformation.go | 2 +- ...CEMIAdditionalInformationBusmonitorInfo.go | 4 +- ...IAdditionalInformationRelativeTimestamp.go | 2 +- .../knxnetip/readwrite/model/CEMIPriority.go | 2 +- .../readwrite/model/ChannelInformation.go | 4 +- .../model/ComObjectTableAddresses.go | 2 +- .../model/ComObjectTableRealisationType1.go | 4 +- .../model/ComObjectTableRealisationType2.go | 4 +- .../readwrite/model/ComObjectValueType.go | 2 +- .../model/ConnectionRequestInformation.go | 4 +- ...ctionRequestInformationTunnelConnection.go | 2 +- .../readwrite/model/ConnectionResponse.go | 2 +- .../model/ConnectionResponseDataBlock.go | 4 +- .../readwrite/model/ConnectionStateRequest.go | 4 +- .../model/ConnectionStateResponse.go | 2 +- .../knxnetip/readwrite/model/DIBDeviceInfo.go | 4 +- .../readwrite/model/DIBSuppSvcFamilies.go | 4 +- .../model/DeviceConfigurationAckDataBlock.go | 6 +- .../DeviceConfigurationRequestDataBlock.go | 8 +- .../readwrite/model/DeviceDescriptor.go | 2 +- .../model/DeviceDescriptorMediumType.go | 2 +- .../readwrite/model/DeviceDescriptorType2.go | 8 +- .../knxnetip/readwrite/model/DeviceStatus.go | 2 +- .../readwrite/model/DisconnectRequest.go | 4 +- .../readwrite/model/DisconnectResponse.go | 2 +- .../knxnetip/readwrite/model/FirmwareType.go | 2 +- .../GroupObjectDescriptorRealisationType1.go | 4 +- .../GroupObjectDescriptorRealisationType2.go | 2 +- .../GroupObjectDescriptorRealisationType7.go | 2 +- .../readwrite/model/HPAIControlEndpoint.go | 4 +- .../readwrite/model/HPAIDataEndpoint.go | 4 +- .../readwrite/model/HPAIDiscoveryEndpoint.go | 4 +- .../readwrite/model/HostProtocolCode.go | 2 +- .../knxnetip/readwrite/model/KnxAddress.go | 6 +- .../knxnetip/readwrite/model/KnxDatapoint.go | 1298 ++++++++--------- .../readwrite/model/KnxDatapointMainType.go | 2 +- .../readwrite/model/KnxDatapointType.go | 2 +- .../readwrite/model/KnxGroupAddress2Level.go | 4 +- .../readwrite/model/KnxGroupAddress3Level.go | 6 +- .../model/KnxGroupAddressFreeLevel.go | 2 +- .../model/KnxInterfaceObjectProperty.go | 2 +- .../readwrite/model/KnxInterfaceObjectType.go | 2 +- .../knxnetip/readwrite/model/KnxLayer.go | 2 +- .../readwrite/model/KnxManufacturer.go | 2 +- .../knxnetip/readwrite/model/KnxMedium.go | 2 +- .../knxnetip/readwrite/model/KnxNetIpCore.go | 2 +- .../model/KnxNetIpDeviceManagement.go | 2 +- .../readwrite/model/KnxNetIpMessage.go | 8 +- .../readwrite/model/KnxNetIpRouting.go | 2 +- .../readwrite/model/KnxNetIpTunneling.go | 2 +- .../readwrite/model/KnxNetObjectServer.go | 2 +- .../KnxNetRemoteConfigurationAndDiagnosis.go | 2 +- .../readwrite/model/KnxNetRemoteLogging.go | 2 +- .../knxnetip/readwrite/model/KnxProperty.go | 92 +- .../readwrite/model/KnxPropertyDataType.go | 2 +- .../knxnetip/readwrite/model/LBusmonInd.go | 4 +- .../knxnetip/readwrite/model/LDataCon.go | 2 +- .../knxnetip/readwrite/model/LDataExtended.go | 6 +- .../knxnetip/readwrite/model/LDataInd.go | 2 +- .../knxnetip/readwrite/model/LDataReq.go | 2 +- .../knxnetip/readwrite/model/LPollData.go | 4 +- .../knxnetip/readwrite/model/MPropReadCon.go | 12 +- .../knxnetip/readwrite/model/MPropReadReq.go | 10 +- .../model/ProjectInstallationIdentifier.go | 4 +- .../readwrite/model/RelativeTimestamp.go | 2 +- .../knxnetip/readwrite/model/ServiceId.go | 2 +- .../knxnetip/readwrite/model/Status.go | 2 +- .../readwrite/model/SupportedPhysicalMedia.go | 2 +- .../model/TunnelingRequestDataBlock.go | 8 +- .../model/TunnelingResponseDataBlock.go | 6 +- .../modbus/readwrite/model/DataItem.go | 48 +- .../modbus/readwrite/model/DriverType.go | 2 +- .../modbus/readwrite/model/ModbusAsciiADU.go | 4 +- .../modbus/readwrite/model/ModbusConstants.go | 2 +- .../modbus/readwrite/model/ModbusDataType.go | 2 +- .../ModbusDeviceInformationConformityLevel.go | 2 +- .../model/ModbusDeviceInformationLevel.go | 2 +- .../ModbusDeviceInformationMoreFollows.go | 2 +- .../model/ModbusDeviceInformationObject.go | 4 +- .../modbus/readwrite/model/ModbusErrorCode.go | 2 +- .../modbus/readwrite/model/ModbusPDU.go | 2 +- .../model/ModbusPDUDiagnosticRequest.go | 4 +- .../model/ModbusPDUDiagnosticResponse.go | 4 +- .../ModbusPDUGetComEventCounterResponse.go | 4 +- .../model/ModbusPDUGetComEventLogResponse.go | 8 +- ...odbusPDUMaskWriteHoldingRegisterRequest.go | 6 +- ...dbusPDUMaskWriteHoldingRegisterResponse.go | 6 +- .../model/ModbusPDUReadCoilsRequest.go | 4 +- .../model/ModbusPDUReadCoilsResponse.go | 2 +- ...odbusPDUReadDeviceIdentificationRequest.go | 4 +- ...dbusPDUReadDeviceIdentificationResponse.go | 6 +- .../ModbusPDUReadDiscreteInputsRequest.go | 4 +- .../ModbusPDUReadDiscreteInputsResponse.go | 2 +- .../ModbusPDUReadExceptionStatusResponse.go | 2 +- .../model/ModbusPDUReadFifoQueueRequest.go | 2 +- .../model/ModbusPDUReadFifoQueueResponse.go | 6 +- .../model/ModbusPDUReadFileRecordRequest.go | 2 +- .../ModbusPDUReadFileRecordRequestItem.go | 8 +- .../model/ModbusPDUReadFileRecordResponse.go | 2 +- .../ModbusPDUReadFileRecordResponseItem.go | 4 +- .../ModbusPDUReadHoldingRegistersRequest.go | 4 +- .../ModbusPDUReadHoldingRegistersResponse.go | 2 +- .../ModbusPDUReadInputRegistersRequest.go | 4 +- .../ModbusPDUReadInputRegistersResponse.go | 2 +- ...eadWriteMultipleHoldingRegistersRequest.go | 10 +- ...adWriteMultipleHoldingRegistersResponse.go | 2 +- .../model/ModbusPDUReportServerIdResponse.go | 2 +- .../model/ModbusPDUWriteFileRecordRequest.go | 2 +- .../ModbusPDUWriteFileRecordRequestItem.go | 8 +- .../model/ModbusPDUWriteFileRecordResponse.go | 2 +- .../ModbusPDUWriteFileRecordResponseItem.go | 8 +- .../ModbusPDUWriteMultipleCoilsRequest.go | 6 +- .../ModbusPDUWriteMultipleCoilsResponse.go | 4 +- ...PDUWriteMultipleHoldingRegistersRequest.go | 6 +- ...DUWriteMultipleHoldingRegistersResponse.go | 4 +- .../model/ModbusPDUWriteSingleCoilRequest.go | 4 +- .../model/ModbusPDUWriteSingleCoilResponse.go | 4 +- .../ModbusPDUWriteSingleRegisterRequest.go | 4 +- .../ModbusPDUWriteSingleRegisterResponse.go | 4 +- .../modbus/readwrite/model/ModbusRtuADU.go | 4 +- .../modbus/readwrite/model/ModbusTcpADU.go | 8 +- .../readwrite/model/AccessLevelExType.go | 2 +- .../opcua/readwrite/model/AccessLevelType.go | 2 +- .../readwrite/model/AccessRestrictionType.go | 2 +- .../readwrite/model/ActivateSessionRequest.go | 4 +- .../model/ActivateSessionResponse.go | 4 +- .../opcua/readwrite/model/AddNodesRequest.go | 2 +- .../opcua/readwrite/model/AddNodesResponse.go | 4 +- .../readwrite/model/AddReferencesItem.go | 2 +- .../readwrite/model/AddReferencesRequest.go | 2 +- .../readwrite/model/AddReferencesResponse.go | 4 +- .../model/AdditionalParametersType.go | 2 +- .../readwrite/model/AggregateConfiguration.go | 8 +- .../opcua/readwrite/model/AlarmMask.go | 2 +- .../readwrite/model/AliasNameDataType.go | 2 +- .../opcua/readwrite/model/Annotation.go | 2 +- .../readwrite/model/ApplicationDescription.go | 2 +- .../opcua/readwrite/model/ApplicationType.go | 2 +- .../opcua/readwrite/model/Argument.go | 6 +- .../readwrite/model/AttributeWriteMask.go | 2 +- .../opcua/readwrite/model/AxisInformation.go | 2 +- .../readwrite/model/AxisScaleEnumeration.go | 2 +- .../model/BrokerTransportQualityOfService.go | 2 +- .../readwrite/model/BrowseDescription.go | 6 +- .../opcua/readwrite/model/BrowseDirection.go | 2 +- .../readwrite/model/BrowseNextRequest.go | 4 +- .../readwrite/model/BrowseNextResponse.go | 4 +- .../opcua/readwrite/model/BrowsePathResult.go | 2 +- .../opcua/readwrite/model/BrowsePathTarget.go | 2 +- .../opcua/readwrite/model/BrowseRequest.go | 4 +- .../opcua/readwrite/model/BrowseResponse.go | 4 +- .../opcua/readwrite/model/BrowseResult.go | 2 +- .../opcua/readwrite/model/BrowseResultMask.go | 2 +- .../opcua/readwrite/model/BuildInfo.go | 2 +- .../opcua/readwrite/model/ByteStringArray.go | 4 +- .../opcua/readwrite/model/ByteStringNodeId.go | 2 +- .../readwrite/model/CallMethodRequest.go | 2 +- .../opcua/readwrite/model/CallMethodResult.go | 6 +- .../opcua/readwrite/model/CallRequest.go | 2 +- .../opcua/readwrite/model/CallResponse.go | 4 +- .../opcua/readwrite/model/CancelRequest.go | 2 +- .../opcua/readwrite/model/CancelResponse.go | 2 +- .../readwrite/model/ChannelSecurityToken.go | 8 +- .../readwrite/model/CloseSessionRequest.go | 2 +- .../model/ConfigurationVersionDataType.go | 4 +- .../opcua/readwrite/model/ContentFilter.go | 2 +- .../readwrite/model/ContentFilterElement.go | 2 +- .../model/ContentFilterElementResult.go | 4 +- .../readwrite/model/ContentFilterResult.go | 4 +- .../model/CreateMonitoredItemsRequest.go | 4 +- .../model/CreateMonitoredItemsResponse.go | 4 +- .../readwrite/model/CreateSessionRequest.go | 2 +- .../readwrite/model/CreateSessionResponse.go | 6 +- .../model/CreateSubscriptionRequest.go | 10 +- .../model/CreateSubscriptionResponse.go | 6 +- .../opcua/readwrite/model/CurrencyUnitType.go | 4 +- .../readwrite/model/DataChangeNotification.go | 6 +- .../readwrite/model/DataChangeTrigger.go | 2 +- .../model/DataSetFieldContentMask.go | 2 +- .../readwrite/model/DataSetFieldFlags.go | 2 +- .../readwrite/model/DataSetOrderingType.go | 2 +- .../readwrite/model/DataSetWriterDataType.go | 8 +- .../readwrite/model/DataTypeSchemaHeader.go | 8 +- .../opcua/readwrite/model/DataValue.go | 10 +- .../opcua/readwrite/model/DeadbandType.go | 2 +- .../model/DeleteMonitoredItemsRequest.go | 6 +- .../model/DeleteMonitoredItemsResponse.go | 4 +- .../opcua/readwrite/model/DeleteNodesItem.go | 2 +- .../readwrite/model/DeleteNodesRequest.go | 2 +- .../readwrite/model/DeleteNodesResponse.go | 4 +- .../readwrite/model/DeleteReferencesItem.go | 4 +- .../model/DeleteReferencesRequest.go | 2 +- .../model/DeleteReferencesResponse.go | 4 +- .../model/DeleteSubscriptionsRequest.go | 4 +- .../model/DeleteSubscriptionsResponse.go | 4 +- .../opcua/readwrite/model/DiagnosticInfo.go | 8 +- .../opcua/readwrite/model/DiagnosticsLevel.go | 2 +- .../protocols/opcua/readwrite/model/Duplex.go | 2 +- .../opcua/readwrite/model/EUInformation.go | 2 +- .../readwrite/model/EndpointConfiguration.go | 18 +- .../readwrite/model/EndpointDescription.go | 4 +- .../model/EndpointUrlListDataType.go | 2 +- .../opcua/readwrite/model/EnumValueType.go | 2 +- .../opcua/readwrite/model/EventFieldList.go | 4 +- .../readwrite/model/EventNotificationList.go | 4 +- .../readwrite/model/EventNotifierType.go | 2 +- .../model/ExceptionDeviationFormat.go | 2 +- .../opcua/readwrite/model/ExpandedNodeId.go | 2 +- .../opcua/readwrite/model/ExtensionHeader.go | 2 +- .../model/ExtensionObjectEncodingMask.go | 2 +- .../opcua/readwrite/model/FieldMetaData.go | 12 +- .../readwrite/model/FieldTargetDataType.go | 2 +- .../opcua/readwrite/model/FilterOperator.go | 2 +- .../model/FindServersOnNetworkRequest.go | 6 +- .../model/FindServersOnNetworkResponse.go | 4 +- .../readwrite/model/FindServersRequest.go | 4 +- .../readwrite/model/FindServersResponse.go | 2 +- .../opcua/readwrite/model/FourByteNodeId.go | 4 +- .../readwrite/model/GenericAttributeValue.go | 2 +- .../readwrite/model/GetEndpointsRequest.go | 4 +- .../readwrite/model/GetEndpointsResponse.go | 2 +- .../opcua/readwrite/model/GuidNodeId.go | 2 +- .../opcua/readwrite/model/GuidValue.go | 6 +- .../opcua/readwrite/model/HistoryData.go | 2 +- .../opcua/readwrite/model/HistoryEvent.go | 2 +- .../readwrite/model/HistoryEventFieldList.go | 2 +- .../readwrite/model/HistoryReadRequest.go | 4 +- .../readwrite/model/HistoryReadResponse.go | 4 +- .../readwrite/model/HistoryUpdateRequest.go | 2 +- .../readwrite/model/HistoryUpdateResponse.go | 4 +- .../readwrite/model/HistoryUpdateResult.go | 4 +- .../readwrite/model/HistoryUpdateType.go | 2 +- .../protocols/opcua/readwrite/model/IdType.go | 2 +- .../readwrite/model/IdentityCriteriaType.go | 2 +- .../readwrite/model/InterfaceAdminStatus.go | 2 +- .../readwrite/model/InterfaceOperStatus.go | 2 +- .../model/JsonDataSetMessageContentMask.go | 2 +- .../model/JsonNetworkMessageContentMask.go | 2 +- .../opcua/readwrite/model/LocalizedText.go | 2 +- .../readwrite/model/MessageSecurityMode.go | 2 +- .../model/ModelChangeStructureDataType.go | 2 +- .../model/ModelChangeStructureVerbMask.go | 2 +- .../opcua/readwrite/model/ModificationInfo.go | 2 +- .../model/ModifyMonitoredItemsRequest.go | 4 +- .../model/ModifyMonitoredItemsResponse.go | 4 +- .../model/ModifySubscriptionRequest.go | 10 +- .../model/ModifySubscriptionResponse.go | 4 +- .../model/MonitoredItemCreateResult.go | 4 +- .../model/MonitoredItemModifyRequest.go | 2 +- .../model/MonitoredItemModifyResult.go | 2 +- .../model/MonitoredItemNotification.go | 2 +- .../opcua/readwrite/model/MonitoringMode.go | 2 +- .../readwrite/model/MonitoringParameters.go | 6 +- .../opcua/readwrite/model/NamingRuleType.go | 2 +- .../readwrite/model/NegotiationStatus.go | 2 +- .../readwrite/model/NetworkGroupDataType.go | 2 +- .../opcua/readwrite/model/NodeAttributes.go | 6 +- .../readwrite/model/NodeAttributesMask.go | 2 +- .../opcua/readwrite/model/NodeClass.go | 2 +- .../protocols/opcua/readwrite/model/NodeId.go | 2 +- .../opcua/readwrite/model/NodeIdByteString.go | 2 +- .../opcua/readwrite/model/NodeIdFourByte.go | 4 +- .../opcua/readwrite/model/NodeIdGuid.go | 2 +- .../opcua/readwrite/model/NodeIdNumeric.go | 4 +- .../opcua/readwrite/model/NodeIdString.go | 2 +- .../opcua/readwrite/model/NodeIdTwoByte.go | 2 +- .../opcua/readwrite/model/NodeIdType.go | 2 +- .../opcua/readwrite/model/NodeReference.go | 4 +- .../readwrite/model/NodeTypeDescription.go | 4 +- .../readwrite/model/NotificationMessage.go | 6 +- .../opcua/readwrite/model/NumericNodeId.go | 4 +- .../model/OpcuaAcknowledgeResponse.go | 12 +- .../readwrite/model/OpcuaCloseRequest.go | 10 +- .../readwrite/model/OpcuaHelloRequest.go | 12 +- .../readwrite/model/OpcuaMessageError.go | 2 +- .../readwrite/model/OpcuaMessageRequest.go | 10 +- .../readwrite/model/OpcuaMessageResponse.go | 10 +- .../model/OpcuaNodeIdServicesDataType.go | 2 +- .../model/OpcuaNodeIdServicesMethod.go | 2 +- .../model/OpcuaNodeIdServicesObject.go | 2 +- .../model/OpcuaNodeIdServicesObjectType.go | 2 +- .../model/OpcuaNodeIdServicesReferenceType.go | 2 +- .../OpcuaNodeIdServicesVariableAccess.go | 2 +- ...uaNodeIdServicesVariableAcknowledgeable.go | 2 +- .../model/OpcuaNodeIdServicesVariableAdd.go | 2 +- .../OpcuaNodeIdServicesVariableAddress.go | 2 +- .../OpcuaNodeIdServicesVariableAggregate.go | 2 +- .../model/OpcuaNodeIdServicesVariableAlarm.go | 2 +- .../model/OpcuaNodeIdServicesVariableAlias.go | 2 +- .../OpcuaNodeIdServicesVariableAliases.go | 2 +- .../model/OpcuaNodeIdServicesVariableAllow.go | 2 +- .../OpcuaNodeIdServicesVariableAnalog.go | 2 +- .../OpcuaNodeIdServicesVariableAnnotations.go | 2 +- .../OpcuaNodeIdServicesVariableApplication.go | 2 +- .../model/OpcuaNodeIdServicesVariableArray.go | 2 +- .../OpcuaNodeIdServicesVariableAttribute.go | 2 +- .../model/OpcuaNodeIdServicesVariableAudio.go | 2 +- .../model/OpcuaNodeIdServicesVariableAudit.go | 2 +- ...pcuaNodeIdServicesVariableAuthorization.go | 2 +- .../model/OpcuaNodeIdServicesVariableAxis.go | 2 +- .../model/OpcuaNodeIdServicesVariableBase.go | 2 +- .../OpcuaNodeIdServicesVariableBroker.go | 2 +- .../OpcuaNodeIdServicesVariableBrowse.go | 2 +- .../model/OpcuaNodeIdServicesVariableBuild.go | 2 +- .../OpcuaNodeIdServicesVariableCartesian.go | 2 +- .../OpcuaNodeIdServicesVariableCertificate.go | 2 +- .../OpcuaNodeIdServicesVariableChange.go | 2 +- .../OpcuaNodeIdServicesVariableChoice.go | 2 +- .../model/OpcuaNodeIdServicesVariableClose.go | 2 +- .../OpcuaNodeIdServicesVariableCondition.go | 2 +- .../OpcuaNodeIdServicesVariableConnect.go | 2 +- .../OpcuaNodeIdServicesVariableCreate.go | 2 +- .../model/OpcuaNodeIdServicesVariableCube.go | 2 +- .../OpcuaNodeIdServicesVariableCurrency.go | 2 +- .../model/OpcuaNodeIdServicesVariableData.go | 2 +- .../OpcuaNodeIdServicesVariableDatagram.go | 2 +- .../OpcuaNodeIdServicesVariableDeadband.go | 2 +- .../OpcuaNodeIdServicesVariableDefault.go | 2 +- .../OpcuaNodeIdServicesVariableDelete.go | 2 +- .../OpcuaNodeIdServicesVariableDevice.go | 2 +- .../OpcuaNodeIdServicesVariableDiagnostics.go | 2 +- .../OpcuaNodeIdServicesVariableDialog.go | 2 +- .../OpcuaNodeIdServicesVariableDisconnect.go | 2 +- .../OpcuaNodeIdServicesVariableDiscrepancy.go | 2 +- .../OpcuaNodeIdServicesVariableDiscrete.go | 2 +- .../OpcuaNodeIdServicesVariableDuplex.go | 2 +- .../OpcuaNodeIdServicesVariableEngineering.go | 2 +- .../model/OpcuaNodeIdServicesVariableEnum.go | 2 +- .../model/OpcuaNodeIdServicesVariableEvent.go | 2 +- .../OpcuaNodeIdServicesVariableException.go | 2 +- .../OpcuaNodeIdServicesVariableExclusive.go | 2 +- .../OpcuaNodeIdServicesVariableExpression.go | 2 +- .../OpcuaNodeIdServicesVariableExtension.go | 2 +- .../model/OpcuaNodeIdServicesVariableFile.go | 2 +- .../OpcuaNodeIdServicesVariableFilter.go | 2 +- .../model/OpcuaNodeIdServicesVariableFind.go | 2 +- .../OpcuaNodeIdServicesVariableFinite.go | 2 +- .../model/OpcuaNodeIdServicesVariableFrame.go | 2 +- .../OpcuaNodeIdServicesVariableGeneral.go | 2 +- .../OpcuaNodeIdServicesVariableGenerate.go | 2 +- .../model/OpcuaNodeIdServicesVariableGet.go | 2 +- .../model/OpcuaNodeIdServicesVariableH.go | 2 +- .../OpcuaNodeIdServicesVariableHistorical.go | 2 +- .../OpcuaNodeIdServicesVariableHistory.go | 2 +- .../model/OpcuaNodeIdServicesVariableI.go | 2 +- .../model/OpcuaNodeIdServicesVariableIcon.go | 2 +- .../model/OpcuaNodeIdServicesVariableId.go | 2 +- .../OpcuaNodeIdServicesVariableIdentity.go | 2 +- .../model/OpcuaNodeIdServicesVariableIetf.go | 2 +- .../model/OpcuaNodeIdServicesVariableImage.go | 2 +- .../OpcuaNodeIdServicesVariableInitial.go | 2 +- .../model/OpcuaNodeIdServicesVariableInput.go | 2 +- .../OpcuaNodeIdServicesVariableInstrument.go | 2 +- .../OpcuaNodeIdServicesVariableInterface.go | 2 +- .../model/OpcuaNodeIdServicesVariableJson.go | 2 +- .../model/OpcuaNodeIdServicesVariableKey.go | 2 +- .../model/OpcuaNodeIdServicesVariableLimit.go | 2 +- .../model/OpcuaNodeIdServicesVariableLocal.go | 2 +- .../model/OpcuaNodeIdServicesVariableMax.go | 2 +- .../OpcuaNodeIdServicesVariableMessage.go | 2 +- .../model/OpcuaNodeIdServicesVariableModel.go | 2 +- .../OpcuaNodeIdServicesVariableModify.go | 2 +- .../OpcuaNodeIdServicesVariableMonitoring.go | 2 +- .../model/OpcuaNodeIdServicesVariableMove.go | 2 +- .../model/OpcuaNodeIdServicesVariableMulti.go | 2 +- .../model/OpcuaNodeIdServicesVariableN.go | 2 +- .../OpcuaNodeIdServicesVariableNamespace.go | 2 +- .../OpcuaNodeIdServicesVariableNamespaces.go | 2 +- .../OpcuaNodeIdServicesVariableNaming.go | 2 +- .../OpcuaNodeIdServicesVariableNegotiation.go | 2 +- .../OpcuaNodeIdServicesVariableNetwork.go | 2 +- .../model/OpcuaNodeIdServicesVariableNode.go | 2 +- .../model/OpcuaNodeIdServicesVariableNon.go | 2 +- .../model/OpcuaNodeIdServicesVariableO.go | 2 +- .../model/OpcuaNodeIdServicesVariableOff.go | 2 +- .../model/OpcuaNodeIdServicesVariableOpc.go | 2 +- .../model/OpcuaNodeIdServicesVariableOpen.go | 2 +- .../OpcuaNodeIdServicesVariableOperation.go | 2 +- .../OpcuaNodeIdServicesVariableOption.go | 2 +- .../OpcuaNodeIdServicesVariableOrdered.go | 2 +- .../OpcuaNodeIdServicesVariableOrientation.go | 2 +- .../OpcuaNodeIdServicesVariableOutput.go | 2 +- .../OpcuaNodeIdServicesVariableOverride.go | 2 +- .../OpcuaNodeIdServicesVariablePassword.go | 2 +- .../OpcuaNodeIdServicesVariablePerform.go | 2 +- .../OpcuaNodeIdServicesVariablePermission.go | 2 +- .../OpcuaNodeIdServicesVariablePriority.go | 2 +- .../OpcuaNodeIdServicesVariableProgram.go | 2 +- .../OpcuaNodeIdServicesVariableProgress.go | 2 +- ...pcuaNodeIdServicesVariableProvisionable.go | 2 +- .../model/OpcuaNodeIdServicesVariablePub.go | 2 +- .../OpcuaNodeIdServicesVariablePublish.go | 2 +- .../OpcuaNodeIdServicesVariablePublished.go | 2 +- .../OpcuaNodeIdServicesVariableRational.go | 2 +- .../model/OpcuaNodeIdServicesVariableRead.go | 2 +- .../OpcuaNodeIdServicesVariableReader.go | 2 +- .../OpcuaNodeIdServicesVariableRedundancy.go | 2 +- .../OpcuaNodeIdServicesVariableReference.go | 2 +- .../OpcuaNodeIdServicesVariableRefresh.go | 2 +- .../OpcuaNodeIdServicesVariableRemove.go | 2 +- .../OpcuaNodeIdServicesVariableRequest.go | 2 +- .../OpcuaNodeIdServicesVariableResend.go | 2 +- .../model/OpcuaNodeIdServicesVariableRole.go | 2 +- .../OpcuaNodeIdServicesVariableSampling.go | 2 +- .../OpcuaNodeIdServicesVariableSecurity.go | 2 +- .../OpcuaNodeIdServicesVariableSelection.go | 2 +- .../OpcuaNodeIdServicesVariableSemantic.go | 2 +- .../OpcuaNodeIdServicesVariableServer.go | 2 +- .../OpcuaNodeIdServicesVariableSession.go | 2 +- .../OpcuaNodeIdServicesVariableSessions.go | 2 +- .../model/OpcuaNodeIdServicesVariableSet.go | 2 +- .../OpcuaNodeIdServicesVariableShelved.go | 2 +- .../OpcuaNodeIdServicesVariableStandalone.go | 2 +- .../model/OpcuaNodeIdServicesVariableState.go | 2 +- .../OpcuaNodeIdServicesVariableStructure.go | 2 +- .../OpcuaNodeIdServicesVariableSubscribed.go | 2 +- ...OpcuaNodeIdServicesVariableSubscription.go | 2 +- .../OpcuaNodeIdServicesVariableSystem.go | 2 +- .../model/OpcuaNodeIdServicesVariableTag.go | 2 +- .../OpcuaNodeIdServicesVariableTarget.go | 2 +- .../OpcuaNodeIdServicesVariableTemporary.go | 2 +- .../model/OpcuaNodeIdServicesVariableThree.go | 2 +- .../model/OpcuaNodeIdServicesVariableTimed.go | 2 +- .../OpcuaNodeIdServicesVariableTimestamps.go | 2 +- .../OpcuaNodeIdServicesVariableTopics.go | 2 +- .../OpcuaNodeIdServicesVariableTransaction.go | 2 +- .../OpcuaNodeIdServicesVariableTransition.go | 2 +- .../OpcuaNodeIdServicesVariableTransparent.go | 2 +- .../model/OpcuaNodeIdServicesVariableTrip.go | 2 +- .../model/OpcuaNodeIdServicesVariableTrust.go | 2 +- .../model/OpcuaNodeIdServicesVariableTsn.go | 2 +- .../model/OpcuaNodeIdServicesVariableTwo.go | 2 +- .../model/OpcuaNodeIdServicesVariableType.go | 2 +- .../model/OpcuaNodeIdServicesVariableUadp.go | 2 +- .../OpcuaNodeIdServicesVariableUpdate.go | 2 +- .../model/OpcuaNodeIdServicesVariableUser.go | 2 +- .../model/OpcuaNodeIdServicesVariableValue.go | 2 +- .../OpcuaNodeIdServicesVariableVector.go | 2 +- .../model/OpcuaNodeIdServicesVariableView.go | 2 +- .../model/OpcuaNodeIdServicesVariableWell.go | 2 +- .../model/OpcuaNodeIdServicesVariableWith.go | 2 +- .../model/OpcuaNodeIdServicesVariableWrite.go | 2 +- .../OpcuaNodeIdServicesVariableWriter.go | 2 +- .../model/OpcuaNodeIdServicesVariableX.go | 2 +- .../model/OpcuaNodeIdServicesVariableY.go | 2 +- .../opcua/readwrite/model/OpcuaOpenRequest.go | 8 +- .../readwrite/model/OpcuaOpenResponse.go | 8 +- .../opcua/readwrite/model/OpcuaStatusCode.go | 2 +- .../opcua/readwrite/model/OpenFileMode.go | 2 +- .../model/OpenSecureChannelRequest.go | 4 +- .../model/OpenSecureChannelResponse.go | 2 +- .../readwrite/model/OverrideValueHandling.go | 2 +- .../opcua/readwrite/model/ParsingResult.go | 4 +- .../opcua/readwrite/model/PascalByteString.go | 2 +- .../opcua/readwrite/model/PascalString.go | 2 +- .../readwrite/model/PasswordOptionsMask.go | 2 +- .../readwrite/model/PerformUpdateType.go | 2 +- .../opcua/readwrite/model/PermissionType.go | 2 +- .../model/PriorityMappingEntryType.go | 4 +- .../model/ProgramDiagnostic2DataType.go | 14 +- .../model/ProgramDiagnosticDataType.go | 10 +- .../model/PubSubConfigurationDataType.go | 6 +- .../model/PubSubConfigurationRefDataType.go | 6 +- .../model/PubSubConfigurationRefMask.go | 2 +- .../model/PubSubConnectionDataType.go | 8 +- .../PubSubDiagnosticsCounterClassification.go | 2 +- .../readwrite/model/PubSubGroupDataType.go | 8 +- .../model/PubSubKeyPushTargetDataType.go | 8 +- .../opcua/readwrite/model/PubSubState.go | 2 +- .../opcua/readwrite/model/PublishRequest.go | 2 +- .../opcua/readwrite/model/PublishResponse.go | 12 +- .../model/PublishedVariableDataType.go | 6 +- .../opcua/readwrite/model/QualifiedName.go | 2 +- .../readwrite/model/QueryDataDescription.go | 2 +- .../opcua/readwrite/model/QueryDataSet.go | 2 +- .../readwrite/model/QueryFirstRequest.go | 6 +- .../readwrite/model/QueryFirstResponse.go | 6 +- .../opcua/readwrite/model/QueryNextRequest.go | 2 +- .../readwrite/model/QueryNextResponse.go | 2 +- .../opcua/readwrite/model/RationalNumber.go | 4 +- .../opcua/readwrite/model/ReadRequest.go | 2 +- .../opcua/readwrite/model/ReadResponse.go | 4 +- .../opcua/readwrite/model/ReadValueId.go | 2 +- .../readwrite/model/RedundancySupport.go | 2 +- .../model/RedundantServerDataType.go | 2 +- .../readwrite/model/ReferenceDescription.go | 2 +- .../model/ReferenceDescriptionDataType.go | 2 +- .../model/ReferenceListEntryDataType.go | 2 +- .../readwrite/model/RegisterNodesRequest.go | 2 +- .../readwrite/model/RegisterNodesResponse.go | 2 +- .../readwrite/model/RegisterServer2Request.go | 2 +- .../model/RegisterServer2Response.go | 4 +- .../opcua/readwrite/model/RegisteredServer.go | 6 +- .../opcua/readwrite/model/RelativePath.go | 2 +- .../readwrite/model/RelativePathElement.go | 2 +- .../opcua/readwrite/model/RepublishRequest.go | 4 +- .../opcua/readwrite/model/RequestHeader.go | 8 +- .../opcua/readwrite/model/ResponseHeader.go | 6 +- .../SamplingIntervalDiagnosticsDataType.go | 6 +- .../readwrite/model/SecurityGroupDataType.go | 10 +- .../model/SecurityTokenRequestType.go | 2 +- .../model/ServerDiagnosticsSummaryDataType.go | 24 +- .../opcua/readwrite/model/ServerOnNetwork.go | 4 +- .../opcua/readwrite/model/ServerState.go | 2 +- .../readwrite/model/ServerStatusDataType.go | 6 +- .../readwrite/model/ServiceCounterDataType.go | 4 +- .../model/SessionDiagnosticsDataType.go | 16 +- .../SessionSecurityDiagnosticsDataType.go | 2 +- .../model/SessionlessInvokeRequestType.go | 10 +- .../model/SessionlessInvokeResponseType.go | 6 +- .../model/SetMonitoringModeRequest.go | 6 +- .../model/SetMonitoringModeResponse.go | 4 +- .../model/SetPublishingModeRequest.go | 6 +- .../model/SetPublishingModeResponse.go | 4 +- .../readwrite/model/SetTriggeringRequest.go | 12 +- .../readwrite/model/SetTriggeringResponse.go | 8 +- .../model/StatusChangeNotification.go | 2 +- .../opcua/readwrite/model/StatusCode.go | 2 +- .../opcua/readwrite/model/StringNodeId.go | 2 +- .../opcua/readwrite/model/StructureField.go | 10 +- .../opcua/readwrite/model/StructureType.go | 2 +- .../model/SubscriptionAcknowledgement.go | 4 +- .../model/SubscriptionDiagnosticsDataType.go | 58 +- .../opcua/readwrite/model/TimeZoneDataType.go | 4 +- .../readwrite/model/TimestampsToReturn.go | 2 +- .../opcua/readwrite/model/TransferResult.go | 4 +- .../model/TransferSubscriptionsRequest.go | 6 +- .../model/TransferSubscriptionsResponse.go | 4 +- .../TranslateBrowsePathsToNodeIdsRequest.go | 2 +- .../TranslateBrowsePathsToNodeIdsResponse.go | 4 +- .../readwrite/model/TrustListDataType.go | 10 +- .../opcua/readwrite/model/TrustListMasks.go | 2 +- .../model/TrustListValidationOptions.go | 2 +- .../opcua/readwrite/model/TsnFailureCode.go | 2 +- .../readwrite/model/TsnListenerStatus.go | 2 +- .../opcua/readwrite/model/TsnStreamState.go | 2 +- .../opcua/readwrite/model/TsnTalkerStatus.go | 2 +- .../opcua/readwrite/model/TwoByteNodeId.go | 2 +- .../model/UadpDataSetMessageContentMask.go | 2 +- .../model/UadpNetworkMessageContentMask.go | 2 +- .../readwrite/model/UnregisterNodesRequest.go | 2 +- .../readwrite/model/UnsignedRationalNumber.go | 4 +- .../readwrite/model/UserConfigurationMask.go | 2 +- .../readwrite/model/UserIdentityToken.go | 2 +- .../opcua/readwrite/model/UserTokenType.go | 2 +- .../opcua/readwrite/model/Variant.go | 4 +- .../opcua/readwrite/model/VariantBoolean.go | 2 +- .../opcua/readwrite/model/VariantByte.go | 4 +- .../readwrite/model/VariantByteString.go | 2 +- .../opcua/readwrite/model/VariantDataValue.go | 2 +- .../opcua/readwrite/model/VariantDateTime.go | 4 +- .../readwrite/model/VariantDiagnosticInfo.go | 2 +- .../opcua/readwrite/model/VariantDouble.go | 2 +- .../readwrite/model/VariantExpandedNodeId.go | 2 +- .../readwrite/model/VariantExtensionObject.go | 2 +- .../opcua/readwrite/model/VariantFloat.go | 2 +- .../opcua/readwrite/model/VariantGuid.go | 2 +- .../opcua/readwrite/model/VariantInt16.go | 4 +- .../opcua/readwrite/model/VariantInt32.go | 4 +- .../opcua/readwrite/model/VariantInt64.go | 4 +- .../readwrite/model/VariantLocalizedText.go | 2 +- .../opcua/readwrite/model/VariantNodeId.go | 2 +- .../readwrite/model/VariantQualifiedName.go | 2 +- .../opcua/readwrite/model/VariantSByte.go | 2 +- .../readwrite/model/VariantStatusCode.go | 2 +- .../opcua/readwrite/model/VariantString.go | 2 +- .../opcua/readwrite/model/VariantUInt16.go | 4 +- .../opcua/readwrite/model/VariantUInt32.go | 4 +- .../opcua/readwrite/model/VariantUInt64.go | 4 +- .../opcua/readwrite/model/VariantVariant.go | 2 +- .../readwrite/model/VariantXmlElement.go | 2 +- .../opcua/readwrite/model/ViewDescription.go | 4 +- .../opcua/readwrite/model/WriteRequest.go | 2 +- .../opcua/readwrite/model/WriteResponse.go | 4 +- .../opcua/readwrite/model/WriteValue.go | 2 +- .../opcua/readwrite/model/XmlElement.go | 2 +- .../readwrite/model/Alarm8MessageQueryType.go | 6 +- .../model/AlarmMessageAckObjectPushType.go | 8 +- .../model/AlarmMessageAckPushType.go | 4 +- .../model/AlarmMessageAckResponseType.go | 6 +- .../s7/readwrite/model/AlarmMessageAckType.go | 4 +- .../model/AlarmMessageObjectAckType.go | 8 +- .../model/AlarmMessageObjectPushType.go | 8 +- .../model/AlarmMessageObjectQueryType.go | 6 +- .../readwrite/model/AlarmMessagePushType.go | 4 +- .../readwrite/model/AlarmMessageQueryType.go | 6 +- .../s7/readwrite/model/AlarmStateType.go | 2 +- .../protocols/s7/readwrite/model/AlarmType.go | 2 +- .../model/AssociatedQueryValueType.go | 4 +- .../s7/readwrite/model/AssociatedValueType.go | 2 +- .../s7/readwrite/model/COTPPacket.go | 4 +- .../model/COTPPacketConnectionRequest.go | 4 +- .../model/COTPPacketConnectionResponse.go | 4 +- .../s7/readwrite/model/COTPPacketData.go | 2 +- .../model/COTPPacketDisconnectRequest.go | 4 +- .../model/COTPPacketDisconnectResponse.go | 4 +- .../s7/readwrite/model/COTPPacketTpduError.go | 4 +- .../s7/readwrite/model/COTPParameter.go | 4 +- .../model/COTPParameterCalledTsap.go | 2 +- .../model/COTPParameterCallingTsap.go | 2 +- .../readwrite/model/COTPParameterChecksum.go | 2 +- .../s7/readwrite/model/COTPProtocolClass.go | 2 +- .../s7/readwrite/model/COTPTpduSize.go | 2 +- .../s7/readwrite/model/CpuSubscribeEvents.go | 2 +- .../readwrite/model/CycServiceItemAnyType.go | 8 +- .../model/CycServiceItemDbReadType.go | 2 +- .../s7/readwrite/model/CycServiceItemType.go | 6 +- .../protocols/s7/readwrite/model/DataItem.go | 56 +- .../readwrite/model/DataTransportErrorCode.go | 2 +- .../s7/readwrite/model/DataTransportSize.go | 2 +- .../s7/readwrite/model/DateAndTime.go | 2 +- .../s7/readwrite/model/DeviceGroup.go | 2 +- .../protocols/s7/readwrite/model/EventType.go | 2 +- .../s7/readwrite/model/MemoryArea.go | 2 +- .../s7/readwrite/model/ModeTransitionType.go | 2 +- .../protocols/s7/readwrite/model/QueryType.go | 2 +- .../protocols/s7/readwrite/model/S7Address.go | 2 +- .../s7/readwrite/model/S7AddressAny.go | 12 +- .../s7/readwrite/model/S7DataAlarmMessage.go | 4 +- .../protocols/s7/readwrite/model/S7Message.go | 12 +- .../readwrite/model/S7MessageObjectRequest.go | 8 +- .../model/S7MessageObjectResponse.go | 2 +- .../s7/readwrite/model/S7MessageResponse.go | 4 +- .../readwrite/model/S7MessageResponseData.go | 4 +- .../s7/readwrite/model/S7Parameter.go | 2 +- .../model/S7ParameterModeTransition.go | 14 +- .../model/S7ParameterReadVarRequest.go | 2 +- .../model/S7ParameterReadVarResponse.go | 2 +- .../model/S7ParameterSetupCommunication.go | 8 +- .../s7/readwrite/model/S7ParameterUserData.go | 2 +- .../model/S7ParameterUserDataItem.go | 2 +- .../S7ParameterUserDataItemCPUFunctions.go | 18 +- .../model/S7ParameterWriteVarRequest.go | 2 +- .../model/S7ParameterWriteVarResponse.go | 2 +- .../model/S7PayloadDiagnosticMessage.go | 12 +- .../readwrite/model/S7PayloadUserDataItem.go | 2 +- .../S7PayloadUserDataItemClkFResponse.go | 4 +- .../model/S7PayloadUserDataItemClkResponse.go | 4 +- .../S7PayloadUserDataItemClkSetRequest.go | 4 +- ...dUserDataItemCpuFunctionAlarmAckRequest.go | 4 +- ...UserDataItemCpuFunctionAlarmAckResponse.go | 6 +- ...serDataItemCpuFunctionAlarmQueryRequest.go | 12 +- ...CpuFunctionMsgSubscriptionAlarmResponse.go | 8 +- ...taItemCpuFunctionMsgSubscriptionRequest.go | 6 +- ...emCpuFunctionMsgSubscriptionSysResponse.go | 4 +- ...adUserDataItemCpuFunctionReadSzlRequest.go | 2 +- ...rDataItemCyclicServicesChangeDrivenPush.go | 2 +- ...icServicesChangeDrivenSubscribeResponse.go | 2 +- ...S7PayloadUserDataItemCyclicServicesPush.go | 2 +- ...rDataItemCyclicServicesSubscribeRequest.go | 4 +- ...DataItemCyclicServicesSubscribeResponse.go | 2 +- ...ataItemCyclicServicesUnsubscribeRequest.go | 4 +- .../readwrite/model/S7VarPayloadDataItem.go | 4 +- .../model/S7VarRequestParameterItem.go | 2 +- .../model/S7VarRequestParameterItemAddress.go | 2 +- .../protocols/s7/readwrite/model/SubItem.go | 6 +- .../s7/readwrite/model/SyntaxIdType.go | 2 +- .../s7/readwrite/model/SzlDataTreeItem.go | 8 +- plc4go/protocols/s7/readwrite/model/SzlId.go | 2 +- .../s7/readwrite/model/SzlModuleTypeClass.go | 2 +- .../s7/readwrite/model/SzlSublist.go | 2 +- .../s7/readwrite/model/TPKTPacket.go | 6 +- .../protocols/s7/readwrite/model/TimeBase.go | 2 +- .../s7/readwrite/model/TransportSize.go | 2 +- .../simulated/readwrite/model/DataItem.go | 48 +- .../simulated/readwrite/model/Dummy.go | 2 +- .../readwrite/model/SimulatedDataTypeSizes.go | 2 +- plc4go/spi/values/PlcTIME.go | 6 +- .../bacnetip/readwrite/BACnetVendorId.java | 3 + .../plc4x/java/s7/readwrite/DataItem.java | 8 +- .../readwrite/model/KnxManufacturer.cs | 33 +- .../protocols/bacnetip/bacnet-vendorids.mspec | 3 + 1090 files changed, 2823 insertions(+), 2750 deletions(-) diff --git a/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java b/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java index 07bb3687d86..acdde73f3e4 100644 --- a/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java +++ b/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java @@ -445,31 +445,31 @@ public String getWriteBufferWriteMethodCall(String logicalName, SimpleTypeRefere case UINT: IntegerTypeReference unsignedIntegerTypeReference = (IntegerTypeReference) simpleTypeReference; if (unsignedIntegerTypeReference.getSizeInBits() <= 8) { - return "writeBuffer.WriteUint8(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteUint8(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", uint8(" + fieldName + ")" + writerArgsString + ")"; } if (unsignedIntegerTypeReference.getSizeInBits() <= 16) { - return "writeBuffer.WriteUint16(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteUint16(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", uint16(" + fieldName + ")" + writerArgsString + ")"; } if (unsignedIntegerTypeReference.getSizeInBits() <= 32) { - return "writeBuffer.WriteUint32(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteUint32(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", uint32(" + fieldName + ")" + writerArgsString + ")"; } if (unsignedIntegerTypeReference.getSizeInBits() <= 64) { - return "writeBuffer.WriteUint64(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteUint64(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", uint64(" + fieldName + ")" + writerArgsString + ")"; } return "writeBuffer.WriteBigInt(\"" + logicalName + "\", " + unsignedIntegerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; case INT: IntegerTypeReference integerTypeReference = (IntegerTypeReference) simpleTypeReference; if (integerTypeReference.getSizeInBits() <= 8) { - return "writeBuffer.WriteInt8(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteInt8(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", int8(" + fieldName + ")" + writerArgsString + ")"; } if (integerTypeReference.getSizeInBits() <= 16) { - return "writeBuffer.WriteInt16(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteInt16(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", int16(" + fieldName + ")" + writerArgsString + ")"; } if (integerTypeReference.getSizeInBits() <= 32) { - return "writeBuffer.WriteInt32(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteInt32(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", int32(" + fieldName + ")" + writerArgsString + ")"; } if (integerTypeReference.getSizeInBits() <= 64) { - return "writeBuffer.WriteInt64(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; + return "writeBuffer.WriteInt64(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", int64(" + fieldName + ")" + writerArgsString + ")"; } return "writeBuffer.WriteBigInt(\"" + logicalName + "\", " + integerTypeReference.getSizeInBits() + ", " + fieldName + writerArgsString + ")"; case FLOAT: diff --git a/code-generation/language-go/src/main/resources/templates/go/data-io-template.go.ftlh b/code-generation/language-go/src/main/resources/templates/go/data-io-template.go.ftlh index e5f8e90d901..560c004b1e6 100644 --- a/code-generation/language-go/src/main/resources/templates/go/data-io-template.go.ftlh +++ b/code-generation/language-go/src/main/resources/templates/go/data-io-template.go.ftlh @@ -171,7 +171,7 @@ func ${type.name}ParseWithBuffer(ctx context.Context, readBuffer utils.ReadBuffe <#case "TIME"> readBuffer.CloseContext("${type.name}") <#if helper.hasFieldsWithNames(case.fields, "milliseconds")> - return values.NewPlcTIMEFromMilliseconds(milliseconds), nil + return values.NewPlcTIMEFromMilliseconds(int64(milliseconds)), nil <#break> <#case "LTIME"> diff --git a/plc4c/generated-sources/s7/src/data_item.c b/plc4c/generated-sources/s7/src/data_item.c index b02d7f210c7..15906468242 100644 --- a/plc4c/generated-sources/s7/src/data_item.c +++ b/plc4c/generated-sources/s7/src/data_item.c @@ -252,8 +252,8 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4x_spi_context ctx, plc } else if(strcmp(dataProtocolId, "IEC61131_TIME") == 0) { /* TIME */ // Simple Field (milliseconds) - uint32_t milliseconds = 0; - _res = plc4c_spi_read_unsigned_int(readBuffer, 32, (uint32_t*) &milliseconds); + int32_t milliseconds = 0; + _res = plc4c_spi_read_signed_int(readBuffer, 32, (int32_t*) &milliseconds); if(_res != OK) { return _res; } @@ -522,7 +522,7 @@ plc4c_return_code plc4c_s7_read_write_data_item_serialize(plc4x_spi_context ctx, } else if(strcmp(dataProtocolId, "IEC61131_TIME") == 0) { /* TIME */ // Simple field (milliseconds) - _res = plc4c_spi_write_unsigned_int(writeBuffer, 32, (*data_item)->data.time_value); + _res = plc4c_spi_write_signed_int(writeBuffer, 32, (*data_item)->data.time_value); if(_res != OK) { return _res; } diff --git a/plc4go/protocols/abeth/readwrite/model/CIPEncapsulationPacket.go b/plc4go/protocols/abeth/readwrite/model/CIPEncapsulationPacket.go index 0063bd7f475..383434a6b65 100644 --- a/plc4go/protocols/abeth/readwrite/model/CIPEncapsulationPacket.go +++ b/plc4go/protocols/abeth/readwrite/model/CIPEncapsulationPacket.go @@ -306,7 +306,7 @@ func (pm *_CIPEncapsulationPacket) SerializeParent(ctx context.Context, writeBuf // Discriminator Field (commandType) (Used as input to a switch field) commandType := uint16(child.GetCommandType()) - _commandTypeErr := writeBuffer.WriteUint16("commandType", 16, (commandType)) + _commandTypeErr := writeBuffer.WriteUint16("commandType", 16, uint16((commandType))) if _commandTypeErr != nil { return errors.Wrap(_commandTypeErr, "Error serializing 'commandType' field") @@ -314,21 +314,21 @@ func (pm *_CIPEncapsulationPacket) SerializeParent(ctx context.Context, writeBuf // Implicit Field (packetLen) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) packetLen := uint16(uint16(uint16(m.GetLengthInBytes(ctx))) - uint16(uint16(28))) - _packetLenErr := writeBuffer.WriteUint16("packetLen", 16, (packetLen)) + _packetLenErr := writeBuffer.WriteUint16("packetLen", 16, uint16((packetLen))) if _packetLenErr != nil { return errors.Wrap(_packetLenErr, "Error serializing 'packetLen' field") } // Simple Field (sessionHandle) sessionHandle := uint32(m.GetSessionHandle()) - _sessionHandleErr := writeBuffer.WriteUint32("sessionHandle", 32, (sessionHandle)) + _sessionHandleErr := writeBuffer.WriteUint32("sessionHandle", 32, uint32((sessionHandle))) if _sessionHandleErr != nil { return errors.Wrap(_sessionHandleErr, "Error serializing 'sessionHandle' field") } // Simple Field (status) status := uint32(m.GetStatus()) - _statusErr := writeBuffer.WriteUint32("status", 32, (status)) + _statusErr := writeBuffer.WriteUint32("status", 32, uint32((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } @@ -339,7 +339,7 @@ func (pm *_CIPEncapsulationPacket) SerializeParent(ctx context.Context, writeBuf } for _curItem, _element := range m.GetSenderContext() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'senderContext' field") } @@ -350,7 +350,7 @@ func (pm *_CIPEncapsulationPacket) SerializeParent(ctx context.Context, writeBuf // Simple Field (options) options := uint32(m.GetOptions()) - _optionsErr := writeBuffer.WriteUint32("options", 32, (options)) + _optionsErr := writeBuffer.WriteUint32("options", 32, uint32((options))) if _optionsErr != nil { return errors.Wrap(_optionsErr, "Error serializing 'options' field") } @@ -365,7 +365,7 @@ func (pm *_CIPEncapsulationPacket) SerializeParent(ctx context.Context, writeBuf }).Msg("Overriding reserved field with unexpected value.") reserved = *pm.reservedField0 } - _err := writeBuffer.WriteUint32("reserved", 32, reserved) + _err := writeBuffer.WriteUint32("reserved", 32, uint32(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/abeth/readwrite/model/DF1CommandResponseMessageProtectedTypedLogicalRead.go b/plc4go/protocols/abeth/readwrite/model/DF1CommandResponseMessageProtectedTypedLogicalRead.go index 2f558843743..e123c9b824d 100644 --- a/plc4go/protocols/abeth/readwrite/model/DF1CommandResponseMessageProtectedTypedLogicalRead.go +++ b/plc4go/protocols/abeth/readwrite/model/DF1CommandResponseMessageProtectedTypedLogicalRead.go @@ -206,7 +206,7 @@ func (m *_DF1CommandResponseMessageProtectedTypedLogicalRead) SerializeWithWrite } for _curItem, _element := range m.GetData() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/abeth/readwrite/model/DF1RequestCommand.go b/plc4go/protocols/abeth/readwrite/model/DF1RequestCommand.go index 67346100833..06b2e6360c0 100644 --- a/plc4go/protocols/abeth/readwrite/model/DF1RequestCommand.go +++ b/plc4go/protocols/abeth/readwrite/model/DF1RequestCommand.go @@ -166,7 +166,7 @@ func (pm *_DF1RequestCommand) SerializeParent(ctx context.Context, writeBuffer u // Discriminator Field (functionCode) (Used as input to a switch field) functionCode := uint8(child.GetFunctionCode()) - _functionCodeErr := writeBuffer.WriteUint8("functionCode", 8, (functionCode)) + _functionCodeErr := writeBuffer.WriteUint8("functionCode", 8, uint8((functionCode))) if _functionCodeErr != nil { return errors.Wrap(_functionCodeErr, "Error serializing 'functionCode' field") diff --git a/plc4go/protocols/abeth/readwrite/model/DF1RequestMessage.go b/plc4go/protocols/abeth/readwrite/model/DF1RequestMessage.go index 2cfa8738281..eb0fb8f0662 100644 --- a/plc4go/protocols/abeth/readwrite/model/DF1RequestMessage.go +++ b/plc4go/protocols/abeth/readwrite/model/DF1RequestMessage.go @@ -267,14 +267,14 @@ func (pm *_DF1RequestMessage) SerializeParent(ctx context.Context, writeBuffer u // Simple Field (destinationAddress) destinationAddress := uint8(m.GetDestinationAddress()) - _destinationAddressErr := writeBuffer.WriteUint8("destinationAddress", 8, (destinationAddress)) + _destinationAddressErr := writeBuffer.WriteUint8("destinationAddress", 8, uint8((destinationAddress))) if _destinationAddressErr != nil { return errors.Wrap(_destinationAddressErr, "Error serializing 'destinationAddress' field") } // Simple Field (sourceAddress) sourceAddress := uint8(m.GetSourceAddress()) - _sourceAddressErr := writeBuffer.WriteUint8("sourceAddress", 8, (sourceAddress)) + _sourceAddressErr := writeBuffer.WriteUint8("sourceAddress", 8, uint8((sourceAddress))) if _sourceAddressErr != nil { return errors.Wrap(_sourceAddressErr, "Error serializing 'sourceAddress' field") } @@ -289,7 +289,7 @@ func (pm *_DF1RequestMessage) SerializeParent(ctx context.Context, writeBuffer u }).Msg("Overriding reserved field with unexpected value.") reserved = *pm.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -297,7 +297,7 @@ func (pm *_DF1RequestMessage) SerializeParent(ctx context.Context, writeBuffer u // Discriminator Field (commandCode) (Used as input to a switch field) commandCode := uint8(child.GetCommandCode()) - _commandCodeErr := writeBuffer.WriteUint8("commandCode", 8, (commandCode)) + _commandCodeErr := writeBuffer.WriteUint8("commandCode", 8, uint8((commandCode))) if _commandCodeErr != nil { return errors.Wrap(_commandCodeErr, "Error serializing 'commandCode' field") @@ -305,14 +305,14 @@ func (pm *_DF1RequestMessage) SerializeParent(ctx context.Context, writeBuffer u // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (transactionCounter) transactionCounter := uint16(m.GetTransactionCounter()) - _transactionCounterErr := writeBuffer.WriteUint16("transactionCounter", 16, (transactionCounter)) + _transactionCounterErr := writeBuffer.WriteUint16("transactionCounter", 16, uint16((transactionCounter))) if _transactionCounterErr != nil { return errors.Wrap(_transactionCounterErr, "Error serializing 'transactionCounter' field") } diff --git a/plc4go/protocols/abeth/readwrite/model/DF1RequestProtectedTypedLogicalRead.go b/plc4go/protocols/abeth/readwrite/model/DF1RequestProtectedTypedLogicalRead.go index 06f807a4b61..6b67af801e1 100644 --- a/plc4go/protocols/abeth/readwrite/model/DF1RequestProtectedTypedLogicalRead.go +++ b/plc4go/protocols/abeth/readwrite/model/DF1RequestProtectedTypedLogicalRead.go @@ -255,35 +255,35 @@ func (m *_DF1RequestProtectedTypedLogicalRead) SerializeWithWriteBuffer(ctx cont // Simple Field (byteSize) byteSize := uint8(m.GetByteSize()) - _byteSizeErr := writeBuffer.WriteUint8("byteSize", 8, (byteSize)) + _byteSizeErr := writeBuffer.WriteUint8("byteSize", 8, uint8((byteSize))) if _byteSizeErr != nil { return errors.Wrap(_byteSizeErr, "Error serializing 'byteSize' field") } // Simple Field (fileNumber) fileNumber := uint8(m.GetFileNumber()) - _fileNumberErr := writeBuffer.WriteUint8("fileNumber", 8, (fileNumber)) + _fileNumberErr := writeBuffer.WriteUint8("fileNumber", 8, uint8((fileNumber))) if _fileNumberErr != nil { return errors.Wrap(_fileNumberErr, "Error serializing 'fileNumber' field") } // Simple Field (fileType) fileType := uint8(m.GetFileType()) - _fileTypeErr := writeBuffer.WriteUint8("fileType", 8, (fileType)) + _fileTypeErr := writeBuffer.WriteUint8("fileType", 8, uint8((fileType))) if _fileTypeErr != nil { return errors.Wrap(_fileTypeErr, "Error serializing 'fileType' field") } // Simple Field (elementNumber) elementNumber := uint8(m.GetElementNumber()) - _elementNumberErr := writeBuffer.WriteUint8("elementNumber", 8, (elementNumber)) + _elementNumberErr := writeBuffer.WriteUint8("elementNumber", 8, uint8((elementNumber))) if _elementNumberErr != nil { return errors.Wrap(_elementNumberErr, "Error serializing 'elementNumber' field") } // Simple Field (subElementNumber) subElementNumber := uint8(m.GetSubElementNumber()) - _subElementNumberErr := writeBuffer.WriteUint8("subElementNumber", 8, (subElementNumber)) + _subElementNumberErr := writeBuffer.WriteUint8("subElementNumber", 8, uint8((subElementNumber))) if _subElementNumberErr != nil { return errors.Wrap(_subElementNumberErr, "Error serializing 'subElementNumber' field") } diff --git a/plc4go/protocols/abeth/readwrite/model/DF1ResponseMessage.go b/plc4go/protocols/abeth/readwrite/model/DF1ResponseMessage.go index e7602ed6d95..20127e2a71e 100644 --- a/plc4go/protocols/abeth/readwrite/model/DF1ResponseMessage.go +++ b/plc4go/protocols/abeth/readwrite/model/DF1ResponseMessage.go @@ -300,7 +300,7 @@ func (pm *_DF1ResponseMessage) SerializeParent(ctx context.Context, writeBuffer }).Msg("Overriding reserved field with unexpected value.") reserved = *pm.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -308,14 +308,14 @@ func (pm *_DF1ResponseMessage) SerializeParent(ctx context.Context, writeBuffer // Simple Field (destinationAddress) destinationAddress := uint8(m.GetDestinationAddress()) - _destinationAddressErr := writeBuffer.WriteUint8("destinationAddress", 8, (destinationAddress)) + _destinationAddressErr := writeBuffer.WriteUint8("destinationAddress", 8, uint8((destinationAddress))) if _destinationAddressErr != nil { return errors.Wrap(_destinationAddressErr, "Error serializing 'destinationAddress' field") } // Simple Field (sourceAddress) sourceAddress := uint8(m.GetSourceAddress()) - _sourceAddressErr := writeBuffer.WriteUint8("sourceAddress", 8, (sourceAddress)) + _sourceAddressErr := writeBuffer.WriteUint8("sourceAddress", 8, uint8((sourceAddress))) if _sourceAddressErr != nil { return errors.Wrap(_sourceAddressErr, "Error serializing 'sourceAddress' field") } @@ -330,7 +330,7 @@ func (pm *_DF1ResponseMessage) SerializeParent(ctx context.Context, writeBuffer }).Msg("Overriding reserved field with unexpected value.") reserved = *pm.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -338,7 +338,7 @@ func (pm *_DF1ResponseMessage) SerializeParent(ctx context.Context, writeBuffer // Discriminator Field (commandCode) (Used as input to a switch field) commandCode := uint8(child.GetCommandCode()) - _commandCodeErr := writeBuffer.WriteUint8("commandCode", 8, (commandCode)) + _commandCodeErr := writeBuffer.WriteUint8("commandCode", 8, uint8((commandCode))) if _commandCodeErr != nil { return errors.Wrap(_commandCodeErr, "Error serializing 'commandCode' field") @@ -346,14 +346,14 @@ func (pm *_DF1ResponseMessage) SerializeParent(ctx context.Context, writeBuffer // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (transactionCounter) transactionCounter := uint16(m.GetTransactionCounter()) - _transactionCounterErr := writeBuffer.WriteUint16("transactionCounter", 16, (transactionCounter)) + _transactionCounterErr := writeBuffer.WriteUint16("transactionCounter", 16, uint16((transactionCounter))) if _transactionCounterErr != nil { return errors.Wrap(_transactionCounterErr, "Error serializing 'transactionCounter' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscovery.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscovery.go index fa97fc34153..5f7e2f041b2 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscovery.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscovery.go @@ -303,14 +303,14 @@ func (m *_AdsDiscovery) SerializeWithWriteBuffer(ctx context.Context, writeBuffe } // Const Field (header) - _headerErr := writeBuffer.WriteUint32("header", 32, 0x71146603) + _headerErr := writeBuffer.WriteUint32("header", 32, uint32(0x71146603)) if _headerErr != nil { return errors.Wrap(_headerErr, "Error serializing 'header' field") } // Simple Field (requestId) requestId := uint32(m.GetRequestId()) - _requestIdErr := writeBuffer.WriteUint32("requestId", 32, (requestId)) + _requestIdErr := writeBuffer.WriteUint32("requestId", 32, uint32((requestId))) if _requestIdErr != nil { return errors.Wrap(_requestIdErr, "Error serializing 'requestId' field") } @@ -353,7 +353,7 @@ func (m *_AdsDiscovery) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Implicit Field (numBlocks) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numBlocks := uint32(uint32(len(m.GetBlocks()))) - _numBlocksErr := writeBuffer.WriteUint32("numBlocks", 32, (numBlocks)) + _numBlocksErr := writeBuffer.WriteUint32("numBlocks", 32, uint32((numBlocks))) if _numBlocksErr != nil { return errors.Wrap(_numBlocksErr, "Error serializing 'numBlocks' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockAmsNetId.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockAmsNetId.go index 1649bdb8f14..5016782b4d5 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockAmsNetId.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockAmsNetId.go @@ -212,7 +212,7 @@ func (m *_AdsDiscoveryBlockAmsNetId) SerializeWithWriteBuffer(ctx context.Contex } // Const Field (amsNetIdLength) - _amsNetIdLengthErr := writeBuffer.WriteUint16("amsNetIdLength", 16, 0x0006) + _amsNetIdLengthErr := writeBuffer.WriteUint16("amsNetIdLength", 16, uint16(0x0006)) if _amsNetIdLengthErr != nil { return errors.Wrap(_amsNetIdLengthErr, "Error serializing 'amsNetIdLength' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockFingerprint.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockFingerprint.go index b9d87461d2e..124a5481ad8 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockFingerprint.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockFingerprint.go @@ -190,7 +190,7 @@ func (m *_AdsDiscoveryBlockFingerprint) SerializeWithWriteBuffer(ctx context.Con // Implicit Field (dataLen) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) dataLen := uint16(uint16(len(m.GetData()))) - _dataLenErr := writeBuffer.WriteUint16("dataLen", 16, (dataLen)) + _dataLenErr := writeBuffer.WriteUint16("dataLen", 16, uint16((dataLen))) if _dataLenErr != nil { return errors.Wrap(_dataLenErr, "Error serializing 'dataLen' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockOsData.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockOsData.go index ccdba720217..5b6ee6c82b9 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockOsData.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockOsData.go @@ -190,7 +190,7 @@ func (m *_AdsDiscoveryBlockOsData) SerializeWithWriteBuffer(ctx context.Context, // Implicit Field (osDataLen) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) osDataLen := uint16(uint16(len(m.GetOsData()))) - _osDataLenErr := writeBuffer.WriteUint16("osDataLen", 16, (osDataLen)) + _osDataLenErr := writeBuffer.WriteUint16("osDataLen", 16, uint16((osDataLen))) if _osDataLenErr != nil { return errors.Wrap(_osDataLenErr, "Error serializing 'osDataLen' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockStatus.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockStatus.go index acc5b7e8f8c..15be7aff846 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockStatus.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockStatus.go @@ -212,7 +212,7 @@ func (m *_AdsDiscoveryBlockStatus) SerializeWithWriteBuffer(ctx context.Context, } // Const Field (statusLength) - _statusLengthErr := writeBuffer.WriteUint16("statusLength", 16, 0x0004) + _statusLengthErr := writeBuffer.WriteUint16("statusLength", 16, uint16(0x0004)) if _statusLengthErr != nil { return errors.Wrap(_statusLengthErr, "Error serializing 'statusLength' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockType.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockType.go index 34fd48567a5..1bda98ef75a 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockType.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockType.go @@ -174,7 +174,7 @@ func (e AdsDiscoveryBlockType) Serialize() ([]byte, error) { func (e AdsDiscoveryBlockType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("AdsDiscoveryBlockType", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("AdsDiscoveryBlockType", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockVersion.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockVersion.go index 5ab7b6e4427..67f656303eb 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockVersion.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryBlockVersion.go @@ -190,7 +190,7 @@ func (m *_AdsDiscoveryBlockVersion) SerializeWithWriteBuffer(ctx context.Context // Implicit Field (versionDataLen) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) versionDataLen := uint16(uint16(len(m.GetVersionData()))) - _versionDataLenErr := writeBuffer.WriteUint16("versionDataLen", 16, (versionDataLen)) + _versionDataLenErr := writeBuffer.WriteUint16("versionDataLen", 16, uint16((versionDataLen))) if _versionDataLenErr != nil { return errors.Wrap(_versionDataLenErr, "Error serializing 'versionDataLen' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryConstants.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryConstants.go index 62e97fd4aab..79a1dd15633 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryConstants.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsDiscoveryConstants.go @@ -147,7 +147,7 @@ func (m *_AdsDiscoveryConstants) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (adsDiscoveryUdpDefaultPort) - _adsDiscoveryUdpDefaultPortErr := writeBuffer.WriteUint16("adsDiscoveryUdpDefaultPort", 16, 48899) + _adsDiscoveryUdpDefaultPortErr := writeBuffer.WriteUint16("adsDiscoveryUdpDefaultPort", 16, uint16(48899)) if _adsDiscoveryUdpDefaultPortErr != nil { return errors.Wrap(_adsDiscoveryUdpDefaultPortErr, "Error serializing 'adsDiscoveryUdpDefaultPort' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AdsPortNumbers.go b/plc4go/protocols/ads/discovery/readwrite/model/AdsPortNumbers.go index f3da1fbe9f5..5e8ba62e947 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AdsPortNumbers.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AdsPortNumbers.go @@ -198,7 +198,7 @@ func (e AdsPortNumbers) Serialize() ([]byte, error) { func (e AdsPortNumbers) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("AdsPortNumbers", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("AdsPortNumbers", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AmsNetId.go b/plc4go/protocols/ads/discovery/readwrite/model/AmsNetId.go index 55ae018f942..0d62c0ce28a 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AmsNetId.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AmsNetId.go @@ -238,42 +238,42 @@ func (m *_AmsNetId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Simple Field (octet1) octet1 := uint8(m.GetOctet1()) - _octet1Err := writeBuffer.WriteUint8("octet1", 8, (octet1)) + _octet1Err := writeBuffer.WriteUint8("octet1", 8, uint8((octet1))) if _octet1Err != nil { return errors.Wrap(_octet1Err, "Error serializing 'octet1' field") } // Simple Field (octet2) octet2 := uint8(m.GetOctet2()) - _octet2Err := writeBuffer.WriteUint8("octet2", 8, (octet2)) + _octet2Err := writeBuffer.WriteUint8("octet2", 8, uint8((octet2))) if _octet2Err != nil { return errors.Wrap(_octet2Err, "Error serializing 'octet2' field") } // Simple Field (octet3) octet3 := uint8(m.GetOctet3()) - _octet3Err := writeBuffer.WriteUint8("octet3", 8, (octet3)) + _octet3Err := writeBuffer.WriteUint8("octet3", 8, uint8((octet3))) if _octet3Err != nil { return errors.Wrap(_octet3Err, "Error serializing 'octet3' field") } // Simple Field (octet4) octet4 := uint8(m.GetOctet4()) - _octet4Err := writeBuffer.WriteUint8("octet4", 8, (octet4)) + _octet4Err := writeBuffer.WriteUint8("octet4", 8, uint8((octet4))) if _octet4Err != nil { return errors.Wrap(_octet4Err, "Error serializing 'octet4' field") } // Simple Field (octet5) octet5 := uint8(m.GetOctet5()) - _octet5Err := writeBuffer.WriteUint8("octet5", 8, (octet5)) + _octet5Err := writeBuffer.WriteUint8("octet5", 8, uint8((octet5))) if _octet5Err != nil { return errors.Wrap(_octet5Err, "Error serializing 'octet5' field") } // Simple Field (octet6) octet6 := uint8(m.GetOctet6()) - _octet6Err := writeBuffer.WriteUint8("octet6", 8, (octet6)) + _octet6Err := writeBuffer.WriteUint8("octet6", 8, uint8((octet6))) if _octet6Err != nil { return errors.Wrap(_octet6Err, "Error serializing 'octet6' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/AmsString.go b/plc4go/protocols/ads/discovery/readwrite/model/AmsString.go index 18b4ca43779..bb29c7874d8 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/AmsString.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/AmsString.go @@ -181,7 +181,7 @@ func (m *_AmsString) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u // Implicit Field (strLen) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) strLen := uint16(uint16(uint16(len(m.GetText()))) + uint16(uint16(1))) - _strLenErr := writeBuffer.WriteUint16("strLen", 16, (strLen)) + _strLenErr := writeBuffer.WriteUint16("strLen", 16, uint16((strLen))) if _strLenErr != nil { return errors.Wrap(_strLenErr, "Error serializing 'strLen' field") } @@ -203,7 +203,7 @@ func (m *_AmsString) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/ads/discovery/readwrite/model/Operation.go b/plc4go/protocols/ads/discovery/readwrite/model/Operation.go index 4aeff3b94e7..49a75eb612a 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/Operation.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/Operation.go @@ -168,7 +168,7 @@ func (e Operation) Serialize() ([]byte, error) { func (e Operation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("Operation", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("Operation", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/discovery/readwrite/model/Status.go b/plc4go/protocols/ads/discovery/readwrite/model/Status.go index 2ea877692d3..9fb57a6e470 100644 --- a/plc4go/protocols/ads/discovery/readwrite/model/Status.go +++ b/plc4go/protocols/ads/discovery/readwrite/model/Status.go @@ -138,7 +138,7 @@ func (e Status) Serialize() ([]byte, error) { func (e Status) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("Status", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("Status", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go index c66ddb9da32..42931981a0a 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go +++ b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationRequest.go @@ -336,21 +336,21 @@ func (m *_AdsAddDeviceNotificationRequest) SerializeWithWriteBuffer(ctx context. // Simple Field (indexGroup) indexGroup := uint32(m.GetIndexGroup()) - _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, (indexGroup)) + _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, uint32((indexGroup))) if _indexGroupErr != nil { return errors.Wrap(_indexGroupErr, "Error serializing 'indexGroup' field") } // Simple Field (indexOffset) indexOffset := uint32(m.GetIndexOffset()) - _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, (indexOffset)) + _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, uint32((indexOffset))) if _indexOffsetErr != nil { return errors.Wrap(_indexOffsetErr, "Error serializing 'indexOffset' field") } // Simple Field (length) length := uint32(m.GetLength()) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } @@ -369,14 +369,14 @@ func (m *_AdsAddDeviceNotificationRequest) SerializeWithWriteBuffer(ctx context. // Simple Field (maxDelayInMs) maxDelayInMs := uint32(m.GetMaxDelayInMs()) - _maxDelayInMsErr := writeBuffer.WriteUint32("maxDelayInMs", 32, (maxDelayInMs)) + _maxDelayInMsErr := writeBuffer.WriteUint32("maxDelayInMs", 32, uint32((maxDelayInMs))) if _maxDelayInMsErr != nil { return errors.Wrap(_maxDelayInMsErr, "Error serializing 'maxDelayInMs' field") } // Simple Field (cycleTimeInMs) cycleTimeInMs := uint32(m.GetCycleTimeInMs()) - _cycleTimeInMsErr := writeBuffer.WriteUint32("cycleTimeInMs", 32, (cycleTimeInMs)) + _cycleTimeInMsErr := writeBuffer.WriteUint32("cycleTimeInMs", 32, uint32((cycleTimeInMs))) if _cycleTimeInMsErr != nil { return errors.Wrap(_cycleTimeInMsErr, "Error serializing 'cycleTimeInMs' field") } @@ -391,7 +391,7 @@ func (m *_AdsAddDeviceNotificationRequest) SerializeWithWriteBuffer(ctx context. }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint64("reserved", 64, reserved) + _err := writeBuffer.WriteUint64("reserved", 64, uint64(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -407,7 +407,7 @@ func (m *_AdsAddDeviceNotificationRequest) SerializeWithWriteBuffer(ctx context. }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint64("reserved", 64, reserved) + _err := writeBuffer.WriteUint64("reserved", 64, uint64(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go index 0bc2d6c7bd0..71f68c57355 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go +++ b/plc4go/protocols/ads/readwrite/model/AdsAddDeviceNotificationResponse.go @@ -227,7 +227,7 @@ func (m *_AdsAddDeviceNotificationResponse) SerializeWithWriteBuffer(ctx context // Simple Field (notificationHandle) notificationHandle := uint32(m.GetNotificationHandle()) - _notificationHandleErr := writeBuffer.WriteUint32("notificationHandle", 32, (notificationHandle)) + _notificationHandleErr := writeBuffer.WriteUint32("notificationHandle", 32, uint32((notificationHandle))) if _notificationHandleErr != nil { return errors.Wrap(_notificationHandleErr, "Error serializing 'notificationHandle' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsConstants.go b/plc4go/protocols/ads/readwrite/model/AdsConstants.go index 87097b95d96..96c8113d870 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsConstants.go +++ b/plc4go/protocols/ads/readwrite/model/AdsConstants.go @@ -147,7 +147,7 @@ func (m *_AdsConstants) SerializeWithWriteBuffer(ctx context.Context, writeBuffe } // Const Field (adsTcpDefaultPort) - _adsTcpDefaultPortErr := writeBuffer.WriteUint16("adsTcpDefaultPort", 16, 48898) + _adsTcpDefaultPortErr := writeBuffer.WriteUint16("adsTcpDefaultPort", 16, uint16(48898)) if _adsTcpDefaultPortErr != nil { return errors.Wrap(_adsTcpDefaultPortErr, "Error serializing 'adsTcpDefaultPort' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataType.go b/plc4go/protocols/ads/readwrite/model/AdsDataType.go index aa9207e155f..c68f85d346c 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsDataType.go +++ b/plc4go/protocols/ads/readwrite/model/AdsDataType.go @@ -717,7 +717,7 @@ func (e AdsDataType) Serialize() ([]byte, error) { func (e AdsDataType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt8("AdsDataType", 8, int8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt8("AdsDataType", 8, int8(int8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go index 5d452e6452b..5a4d9137001 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go +++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeArrayInfo.go @@ -191,14 +191,14 @@ func (m *_AdsDataTypeArrayInfo) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (lowerBound) lowerBound := uint32(m.GetLowerBound()) - _lowerBoundErr := writeBuffer.WriteUint32("lowerBound", 32, (lowerBound)) + _lowerBoundErr := writeBuffer.WriteUint32("lowerBound", 32, uint32((lowerBound))) if _lowerBoundErr != nil { return errors.Wrap(_lowerBoundErr, "Error serializing 'lowerBound' field") } // Simple Field (numElements) numElements := uint32(m.GetNumElements()) - _numElementsErr := writeBuffer.WriteUint32("numElements", 32, (numElements)) + _numElementsErr := writeBuffer.WriteUint32("numElements", 32, uint32((numElements))) if _numElementsErr != nil { return errors.Wrap(_numElementsErr, "Error serializing 'numElements' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go index 52347df328d..4646c4a3e4c 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go +++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go @@ -568,91 +568,91 @@ func (m *_AdsDataTypeTableChildEntry) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (entryLength) entryLength := uint32(m.GetEntryLength()) - _entryLengthErr := writeBuffer.WriteUint32("entryLength", 32, (entryLength)) + _entryLengthErr := writeBuffer.WriteUint32("entryLength", 32, uint32((entryLength))) if _entryLengthErr != nil { return errors.Wrap(_entryLengthErr, "Error serializing 'entryLength' field") } // Simple Field (version) version := uint32(m.GetVersion()) - _versionErr := writeBuffer.WriteUint32("version", 32, (version)) + _versionErr := writeBuffer.WriteUint32("version", 32, uint32((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } // Simple Field (hashValue) hashValue := uint32(m.GetHashValue()) - _hashValueErr := writeBuffer.WriteUint32("hashValue", 32, (hashValue)) + _hashValueErr := writeBuffer.WriteUint32("hashValue", 32, uint32((hashValue))) if _hashValueErr != nil { return errors.Wrap(_hashValueErr, "Error serializing 'hashValue' field") } // Simple Field (typeHashValue) typeHashValue := uint32(m.GetTypeHashValue()) - _typeHashValueErr := writeBuffer.WriteUint32("typeHashValue", 32, (typeHashValue)) + _typeHashValueErr := writeBuffer.WriteUint32("typeHashValue", 32, uint32((typeHashValue))) if _typeHashValueErr != nil { return errors.Wrap(_typeHashValueErr, "Error serializing 'typeHashValue' field") } // Simple Field (size) size := uint32(m.GetSize()) - _sizeErr := writeBuffer.WriteUint32("size", 32, (size)) + _sizeErr := writeBuffer.WriteUint32("size", 32, uint32((size))) if _sizeErr != nil { return errors.Wrap(_sizeErr, "Error serializing 'size' field") } // Simple Field (offset) offset := uint32(m.GetOffset()) - _offsetErr := writeBuffer.WriteUint32("offset", 32, (offset)) + _offsetErr := writeBuffer.WriteUint32("offset", 32, uint32((offset))) if _offsetErr != nil { return errors.Wrap(_offsetErr, "Error serializing 'offset' field") } // Simple Field (dataType) dataType := uint32(m.GetDataType()) - _dataTypeErr := writeBuffer.WriteUint32("dataType", 32, (dataType)) + _dataTypeErr := writeBuffer.WriteUint32("dataType", 32, uint32((dataType))) if _dataTypeErr != nil { return errors.Wrap(_dataTypeErr, "Error serializing 'dataType' field") } // Simple Field (flags) flags := uint32(m.GetFlags()) - _flagsErr := writeBuffer.WriteUint32("flags", 32, (flags)) + _flagsErr := writeBuffer.WriteUint32("flags", 32, uint32((flags))) if _flagsErr != nil { return errors.Wrap(_flagsErr, "Error serializing 'flags' field") } // Implicit Field (propertyNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) propertyNameLength := uint16(uint16(len(m.GetPropertyName()))) - _propertyNameLengthErr := writeBuffer.WriteUint16("propertyNameLength", 16, (propertyNameLength)) + _propertyNameLengthErr := writeBuffer.WriteUint16("propertyNameLength", 16, uint16((propertyNameLength))) if _propertyNameLengthErr != nil { return errors.Wrap(_propertyNameLengthErr, "Error serializing 'propertyNameLength' field") } // Implicit Field (dataTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) dataTypeNameLength := uint16(uint16(len(m.GetDataTypeName()))) - _dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, (dataTypeNameLength)) + _dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, uint16((dataTypeNameLength))) if _dataTypeNameLengthErr != nil { return errors.Wrap(_dataTypeNameLengthErr, "Error serializing 'dataTypeNameLength' field") } // Implicit Field (commentLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) commentLength := uint16(uint16(len(m.GetComment()))) - _commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, (commentLength)) + _commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, uint16((commentLength))) if _commentLengthErr != nil { return errors.Wrap(_commentLengthErr, "Error serializing 'commentLength' field") } // Simple Field (arrayDimensions) arrayDimensions := uint16(m.GetArrayDimensions()) - _arrayDimensionsErr := writeBuffer.WriteUint16("arrayDimensions", 16, (arrayDimensions)) + _arrayDimensionsErr := writeBuffer.WriteUint16("arrayDimensions", 16, uint16((arrayDimensions))) if _arrayDimensionsErr != nil { return errors.Wrap(_arrayDimensionsErr, "Error serializing 'arrayDimensions' field") } // Simple Field (numChildren) numChildren := uint16(m.GetNumChildren()) - _numChildrenErr := writeBuffer.WriteUint16("numChildren", 16, (numChildren)) + _numChildrenErr := writeBuffer.WriteUint16("numChildren", 16, uint16((numChildren))) if _numChildrenErr != nil { return errors.Wrap(_numChildrenErr, "Error serializing 'numChildren' field") } @@ -665,7 +665,7 @@ func (m *_AdsDataTypeTableChildEntry) SerializeWithWriteBuffer(ctx context.Conte } // Const Field (propertyNameTerminator) - _propertyNameTerminatorErr := writeBuffer.WriteUint8("propertyNameTerminator", 8, 0x00) + _propertyNameTerminatorErr := writeBuffer.WriteUint8("propertyNameTerminator", 8, uint8(0x00)) if _propertyNameTerminatorErr != nil { return errors.Wrap(_propertyNameTerminatorErr, "Error serializing 'propertyNameTerminator' field") } @@ -678,7 +678,7 @@ func (m *_AdsDataTypeTableChildEntry) SerializeWithWriteBuffer(ctx context.Conte } // Const Field (dataTypeNameTerminator) - _dataTypeNameTerminatorErr := writeBuffer.WriteUint8("dataTypeNameTerminator", 8, 0x00) + _dataTypeNameTerminatorErr := writeBuffer.WriteUint8("dataTypeNameTerminator", 8, uint8(0x00)) if _dataTypeNameTerminatorErr != nil { return errors.Wrap(_dataTypeNameTerminatorErr, "Error serializing 'dataTypeNameTerminator' field") } @@ -691,7 +691,7 @@ func (m *_AdsDataTypeTableChildEntry) SerializeWithWriteBuffer(ctx context.Conte } // Const Field (commentTerminator) - _commentTerminatorErr := writeBuffer.WriteUint8("commentTerminator", 8, 0x00) + _commentTerminatorErr := writeBuffer.WriteUint8("commentTerminator", 8, uint8(0x00)) if _commentTerminatorErr != nil { return errors.Wrap(_commentTerminatorErr, "Error serializing 'commentTerminator' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go index 08795a4c35c..236af317992 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go +++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go @@ -568,91 +568,91 @@ func (m *_AdsDataTypeTableEntry) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (entryLength) entryLength := uint32(m.GetEntryLength()) - _entryLengthErr := writeBuffer.WriteUint32("entryLength", 32, (entryLength)) + _entryLengthErr := writeBuffer.WriteUint32("entryLength", 32, uint32((entryLength))) if _entryLengthErr != nil { return errors.Wrap(_entryLengthErr, "Error serializing 'entryLength' field") } // Simple Field (version) version := uint32(m.GetVersion()) - _versionErr := writeBuffer.WriteUint32("version", 32, (version)) + _versionErr := writeBuffer.WriteUint32("version", 32, uint32((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } // Simple Field (hashValue) hashValue := uint32(m.GetHashValue()) - _hashValueErr := writeBuffer.WriteUint32("hashValue", 32, (hashValue)) + _hashValueErr := writeBuffer.WriteUint32("hashValue", 32, uint32((hashValue))) if _hashValueErr != nil { return errors.Wrap(_hashValueErr, "Error serializing 'hashValue' field") } // Simple Field (typeHashValue) typeHashValue := uint32(m.GetTypeHashValue()) - _typeHashValueErr := writeBuffer.WriteUint32("typeHashValue", 32, (typeHashValue)) + _typeHashValueErr := writeBuffer.WriteUint32("typeHashValue", 32, uint32((typeHashValue))) if _typeHashValueErr != nil { return errors.Wrap(_typeHashValueErr, "Error serializing 'typeHashValue' field") } // Simple Field (size) size := uint32(m.GetSize()) - _sizeErr := writeBuffer.WriteUint32("size", 32, (size)) + _sizeErr := writeBuffer.WriteUint32("size", 32, uint32((size))) if _sizeErr != nil { return errors.Wrap(_sizeErr, "Error serializing 'size' field") } // Simple Field (offset) offset := uint32(m.GetOffset()) - _offsetErr := writeBuffer.WriteUint32("offset", 32, (offset)) + _offsetErr := writeBuffer.WriteUint32("offset", 32, uint32((offset))) if _offsetErr != nil { return errors.Wrap(_offsetErr, "Error serializing 'offset' field") } // Simple Field (dataType) dataType := uint32(m.GetDataType()) - _dataTypeErr := writeBuffer.WriteUint32("dataType", 32, (dataType)) + _dataTypeErr := writeBuffer.WriteUint32("dataType", 32, uint32((dataType))) if _dataTypeErr != nil { return errors.Wrap(_dataTypeErr, "Error serializing 'dataType' field") } // Simple Field (flags) flags := uint32(m.GetFlags()) - _flagsErr := writeBuffer.WriteUint32("flags", 32, (flags)) + _flagsErr := writeBuffer.WriteUint32("flags", 32, uint32((flags))) if _flagsErr != nil { return errors.Wrap(_flagsErr, "Error serializing 'flags' field") } // Implicit Field (dataTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) dataTypeNameLength := uint16(uint16(len(m.GetDataTypeName()))) - _dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, (dataTypeNameLength)) + _dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, uint16((dataTypeNameLength))) if _dataTypeNameLengthErr != nil { return errors.Wrap(_dataTypeNameLengthErr, "Error serializing 'dataTypeNameLength' field") } // Implicit Field (simpleTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) simpleTypeNameLength := uint16(uint16(len(m.GetSimpleTypeName()))) - _simpleTypeNameLengthErr := writeBuffer.WriteUint16("simpleTypeNameLength", 16, (simpleTypeNameLength)) + _simpleTypeNameLengthErr := writeBuffer.WriteUint16("simpleTypeNameLength", 16, uint16((simpleTypeNameLength))) if _simpleTypeNameLengthErr != nil { return errors.Wrap(_simpleTypeNameLengthErr, "Error serializing 'simpleTypeNameLength' field") } // Implicit Field (commentLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) commentLength := uint16(uint16(len(m.GetComment()))) - _commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, (commentLength)) + _commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, uint16((commentLength))) if _commentLengthErr != nil { return errors.Wrap(_commentLengthErr, "Error serializing 'commentLength' field") } // Simple Field (arrayDimensions) arrayDimensions := uint16(m.GetArrayDimensions()) - _arrayDimensionsErr := writeBuffer.WriteUint16("arrayDimensions", 16, (arrayDimensions)) + _arrayDimensionsErr := writeBuffer.WriteUint16("arrayDimensions", 16, uint16((arrayDimensions))) if _arrayDimensionsErr != nil { return errors.Wrap(_arrayDimensionsErr, "Error serializing 'arrayDimensions' field") } // Simple Field (numChildren) numChildren := uint16(m.GetNumChildren()) - _numChildrenErr := writeBuffer.WriteUint16("numChildren", 16, (numChildren)) + _numChildrenErr := writeBuffer.WriteUint16("numChildren", 16, uint16((numChildren))) if _numChildrenErr != nil { return errors.Wrap(_numChildrenErr, "Error serializing 'numChildren' field") } @@ -665,7 +665,7 @@ func (m *_AdsDataTypeTableEntry) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (dataTypeNameTerminator) - _dataTypeNameTerminatorErr := writeBuffer.WriteUint8("dataTypeNameTerminator", 8, 0x00) + _dataTypeNameTerminatorErr := writeBuffer.WriteUint8("dataTypeNameTerminator", 8, uint8(0x00)) if _dataTypeNameTerminatorErr != nil { return errors.Wrap(_dataTypeNameTerminatorErr, "Error serializing 'dataTypeNameTerminator' field") } @@ -678,7 +678,7 @@ func (m *_AdsDataTypeTableEntry) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (simpleTypeNameTerminator) - _simpleTypeNameTerminatorErr := writeBuffer.WriteUint8("simpleTypeNameTerminator", 8, 0x00) + _simpleTypeNameTerminatorErr := writeBuffer.WriteUint8("simpleTypeNameTerminator", 8, uint8(0x00)) if _simpleTypeNameTerminatorErr != nil { return errors.Wrap(_simpleTypeNameTerminatorErr, "Error serializing 'simpleTypeNameTerminator' field") } @@ -691,7 +691,7 @@ func (m *_AdsDataTypeTableEntry) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (commentTerminator) - _commentTerminatorErr := writeBuffer.WriteUint8("commentTerminator", 8, 0x00) + _commentTerminatorErr := writeBuffer.WriteUint8("commentTerminator", 8, uint8(0x00)) if _commentTerminatorErr != nil { return errors.Wrap(_commentTerminatorErr, "Error serializing 'commentTerminator' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go b/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go index bcbc3e2cb4a..e032b1d6ad6 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go +++ b/plc4go/protocols/ads/readwrite/model/AdsDeleteDeviceNotificationRequest.go @@ -190,7 +190,7 @@ func (m *_AdsDeleteDeviceNotificationRequest) SerializeWithWriteBuffer(ctx conte // Simple Field (notificationHandle) notificationHandle := uint32(m.GetNotificationHandle()) - _notificationHandleErr := writeBuffer.WriteUint32("notificationHandle", 32, (notificationHandle)) + _notificationHandleErr := writeBuffer.WriteUint32("notificationHandle", 32, uint32((notificationHandle))) if _notificationHandleErr != nil { return errors.Wrap(_notificationHandleErr, "Error serializing 'notificationHandle' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go b/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go index 0612228fe57..be8e0befb2c 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go +++ b/plc4go/protocols/ads/readwrite/model/AdsDeviceNotificationRequest.go @@ -255,14 +255,14 @@ func (m *_AdsDeviceNotificationRequest) SerializeWithWriteBuffer(ctx context.Con // Simple Field (length) length := uint32(m.GetLength()) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } // Simple Field (stamps) stamps := uint32(m.GetStamps()) - _stampsErr := writeBuffer.WriteUint32("stamps", 32, (stamps)) + _stampsErr := writeBuffer.WriteUint32("stamps", 32, uint32((stamps))) if _stampsErr != nil { return errors.Wrap(_stampsErr, "Error serializing 'stamps' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemRead.go b/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemRead.go index c337b54d3a0..ba5df16e446 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemRead.go +++ b/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemRead.go @@ -217,21 +217,21 @@ func (m *_AdsMultiRequestItemRead) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (itemIndexGroup) itemIndexGroup := uint32(m.GetItemIndexGroup()) - _itemIndexGroupErr := writeBuffer.WriteUint32("itemIndexGroup", 32, (itemIndexGroup)) + _itemIndexGroupErr := writeBuffer.WriteUint32("itemIndexGroup", 32, uint32((itemIndexGroup))) if _itemIndexGroupErr != nil { return errors.Wrap(_itemIndexGroupErr, "Error serializing 'itemIndexGroup' field") } // Simple Field (itemIndexOffset) itemIndexOffset := uint32(m.GetItemIndexOffset()) - _itemIndexOffsetErr := writeBuffer.WriteUint32("itemIndexOffset", 32, (itemIndexOffset)) + _itemIndexOffsetErr := writeBuffer.WriteUint32("itemIndexOffset", 32, uint32((itemIndexOffset))) if _itemIndexOffsetErr != nil { return errors.Wrap(_itemIndexOffsetErr, "Error serializing 'itemIndexOffset' field") } // Simple Field (itemReadLength) itemReadLength := uint32(m.GetItemReadLength()) - _itemReadLengthErr := writeBuffer.WriteUint32("itemReadLength", 32, (itemReadLength)) + _itemReadLengthErr := writeBuffer.WriteUint32("itemReadLength", 32, uint32((itemReadLength))) if _itemReadLengthErr != nil { return errors.Wrap(_itemReadLengthErr, "Error serializing 'itemReadLength' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemReadWrite.go b/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemReadWrite.go index ab51977e018..db3bda909eb 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemReadWrite.go +++ b/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemReadWrite.go @@ -236,28 +236,28 @@ func (m *_AdsMultiRequestItemReadWrite) SerializeWithWriteBuffer(ctx context.Con // Simple Field (itemIndexGroup) itemIndexGroup := uint32(m.GetItemIndexGroup()) - _itemIndexGroupErr := writeBuffer.WriteUint32("itemIndexGroup", 32, (itemIndexGroup)) + _itemIndexGroupErr := writeBuffer.WriteUint32("itemIndexGroup", 32, uint32((itemIndexGroup))) if _itemIndexGroupErr != nil { return errors.Wrap(_itemIndexGroupErr, "Error serializing 'itemIndexGroup' field") } // Simple Field (itemIndexOffset) itemIndexOffset := uint32(m.GetItemIndexOffset()) - _itemIndexOffsetErr := writeBuffer.WriteUint32("itemIndexOffset", 32, (itemIndexOffset)) + _itemIndexOffsetErr := writeBuffer.WriteUint32("itemIndexOffset", 32, uint32((itemIndexOffset))) if _itemIndexOffsetErr != nil { return errors.Wrap(_itemIndexOffsetErr, "Error serializing 'itemIndexOffset' field") } // Simple Field (itemReadLength) itemReadLength := uint32(m.GetItemReadLength()) - _itemReadLengthErr := writeBuffer.WriteUint32("itemReadLength", 32, (itemReadLength)) + _itemReadLengthErr := writeBuffer.WriteUint32("itemReadLength", 32, uint32((itemReadLength))) if _itemReadLengthErr != nil { return errors.Wrap(_itemReadLengthErr, "Error serializing 'itemReadLength' field") } // Simple Field (itemWriteLength) itemWriteLength := uint32(m.GetItemWriteLength()) - _itemWriteLengthErr := writeBuffer.WriteUint32("itemWriteLength", 32, (itemWriteLength)) + _itemWriteLengthErr := writeBuffer.WriteUint32("itemWriteLength", 32, uint32((itemWriteLength))) if _itemWriteLengthErr != nil { return errors.Wrap(_itemWriteLengthErr, "Error serializing 'itemWriteLength' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemWrite.go b/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemWrite.go index 6135e1e64d5..8b5faad101e 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemWrite.go +++ b/plc4go/protocols/ads/readwrite/model/AdsMultiRequestItemWrite.go @@ -217,21 +217,21 @@ func (m *_AdsMultiRequestItemWrite) SerializeWithWriteBuffer(ctx context.Context // Simple Field (itemIndexGroup) itemIndexGroup := uint32(m.GetItemIndexGroup()) - _itemIndexGroupErr := writeBuffer.WriteUint32("itemIndexGroup", 32, (itemIndexGroup)) + _itemIndexGroupErr := writeBuffer.WriteUint32("itemIndexGroup", 32, uint32((itemIndexGroup))) if _itemIndexGroupErr != nil { return errors.Wrap(_itemIndexGroupErr, "Error serializing 'itemIndexGroup' field") } // Simple Field (itemIndexOffset) itemIndexOffset := uint32(m.GetItemIndexOffset()) - _itemIndexOffsetErr := writeBuffer.WriteUint32("itemIndexOffset", 32, (itemIndexOffset)) + _itemIndexOffsetErr := writeBuffer.WriteUint32("itemIndexOffset", 32, uint32((itemIndexOffset))) if _itemIndexOffsetErr != nil { return errors.Wrap(_itemIndexOffsetErr, "Error serializing 'itemIndexOffset' field") } // Simple Field (itemWriteLength) itemWriteLength := uint32(m.GetItemWriteLength()) - _itemWriteLengthErr := writeBuffer.WriteUint32("itemWriteLength", 32, (itemWriteLength)) + _itemWriteLengthErr := writeBuffer.WriteUint32("itemWriteLength", 32, uint32((itemWriteLength))) if _itemWriteLengthErr != nil { return errors.Wrap(_itemWriteLengthErr, "Error serializing 'itemWriteLength' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsNotificationSample.go b/plc4go/protocols/ads/readwrite/model/AdsNotificationSample.go index 677754fa5a3..cf8c766893d 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsNotificationSample.go +++ b/plc4go/protocols/ads/readwrite/model/AdsNotificationSample.go @@ -185,14 +185,14 @@ func (m *_AdsNotificationSample) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (notificationHandle) notificationHandle := uint32(m.GetNotificationHandle()) - _notificationHandleErr := writeBuffer.WriteUint32("notificationHandle", 32, (notificationHandle)) + _notificationHandleErr := writeBuffer.WriteUint32("notificationHandle", 32, uint32((notificationHandle))) if _notificationHandleErr != nil { return errors.Wrap(_notificationHandleErr, "Error serializing 'notificationHandle' field") } // Simple Field (sampleSize) sampleSize := uint32(m.GetSampleSize()) - _sampleSizeErr := writeBuffer.WriteUint32("sampleSize", 32, (sampleSize)) + _sampleSizeErr := writeBuffer.WriteUint32("sampleSize", 32, uint32((sampleSize))) if _sampleSizeErr != nil { return errors.Wrap(_sampleSizeErr, "Error serializing 'sampleSize' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go index b6d495e3241..743db37c795 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go +++ b/plc4go/protocols/ads/readwrite/model/AdsReadDeviceInfoResponse.go @@ -285,21 +285,21 @@ func (m *_AdsReadDeviceInfoResponse) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (majorVersion) majorVersion := uint8(m.GetMajorVersion()) - _majorVersionErr := writeBuffer.WriteUint8("majorVersion", 8, (majorVersion)) + _majorVersionErr := writeBuffer.WriteUint8("majorVersion", 8, uint8((majorVersion))) if _majorVersionErr != nil { return errors.Wrap(_majorVersionErr, "Error serializing 'majorVersion' field") } // Simple Field (minorVersion) minorVersion := uint8(m.GetMinorVersion()) - _minorVersionErr := writeBuffer.WriteUint8("minorVersion", 8, (minorVersion)) + _minorVersionErr := writeBuffer.WriteUint8("minorVersion", 8, uint8((minorVersion))) if _minorVersionErr != nil { return errors.Wrap(_minorVersionErr, "Error serializing 'minorVersion' field") } // Simple Field (version) version := uint16(m.GetVersion()) - _versionErr := writeBuffer.WriteUint16("version", 16, (version)) + _versionErr := writeBuffer.WriteUint16("version", 16, uint16((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go b/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go index f83e42e8cec..4dec626ab30 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go +++ b/plc4go/protocols/ads/readwrite/model/AdsReadRequest.go @@ -228,21 +228,21 @@ func (m *_AdsReadRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (indexGroup) indexGroup := uint32(m.GetIndexGroup()) - _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, (indexGroup)) + _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, uint32((indexGroup))) if _indexGroupErr != nil { return errors.Wrap(_indexGroupErr, "Error serializing 'indexGroup' field") } // Simple Field (indexOffset) indexOffset := uint32(m.GetIndexOffset()) - _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, (indexOffset)) + _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, uint32((indexOffset))) if _indexOffsetErr != nil { return errors.Wrap(_indexOffsetErr, "Error serializing 'indexOffset' field") } // Simple Field (length) length := uint32(m.GetLength()) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go index c97dcc084b5..ccc9552f1cc 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go +++ b/plc4go/protocols/ads/readwrite/model/AdsReadResponse.go @@ -238,7 +238,7 @@ func (m *_AdsReadResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu // Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) length := uint32(uint32(len(m.GetData()))) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go index a9b1fd6f757..493d9b03af7 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go +++ b/plc4go/protocols/ads/readwrite/model/AdsReadStateResponse.go @@ -246,14 +246,14 @@ func (m *_AdsReadStateResponse) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (adsState) adsState := uint16(m.GetAdsState()) - _adsStateErr := writeBuffer.WriteUint16("adsState", 16, (adsState)) + _adsStateErr := writeBuffer.WriteUint16("adsState", 16, uint16((adsState))) if _adsStateErr != nil { return errors.Wrap(_adsStateErr, "Error serializing 'adsState' field") } // Simple Field (deviceState) deviceState := uint16(m.GetDeviceState()) - _deviceStateErr := writeBuffer.WriteUint16("deviceState", 16, (deviceState)) + _deviceStateErr := writeBuffer.WriteUint16("deviceState", 16, uint16((deviceState))) if _deviceStateErr != nil { return errors.Wrap(_deviceStateErr, "Error serializing 'deviceState' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go b/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go index 807daa857ab..a7426cba6a3 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go +++ b/plc4go/protocols/ads/readwrite/model/AdsReadWriteRequest.go @@ -304,28 +304,28 @@ func (m *_AdsReadWriteRequest) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (indexGroup) indexGroup := uint32(m.GetIndexGroup()) - _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, (indexGroup)) + _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, uint32((indexGroup))) if _indexGroupErr != nil { return errors.Wrap(_indexGroupErr, "Error serializing 'indexGroup' field") } // Simple Field (indexOffset) indexOffset := uint32(m.GetIndexOffset()) - _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, (indexOffset)) + _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, uint32((indexOffset))) if _indexOffsetErr != nil { return errors.Wrap(_indexOffsetErr, "Error serializing 'indexOffset' field") } // Simple Field (readLength) readLength := uint32(m.GetReadLength()) - _readLengthErr := writeBuffer.WriteUint32("readLength", 32, (readLength)) + _readLengthErr := writeBuffer.WriteUint32("readLength", 32, uint32((readLength))) if _readLengthErr != nil { return errors.Wrap(_readLengthErr, "Error serializing 'readLength' field") } // Implicit Field (writeLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) writeLength := uint32(uint32((uint32(uint32(len(m.GetItems()))) * uint32((utils.InlineIf((bool((m.GetIndexGroup()) == (61570))), func() any { return uint32(uint32(16)) }, func() any { return uint32(uint32(12)) }).(uint32))))) + uint32(uint32(len(m.GetData())))) - _writeLengthErr := writeBuffer.WriteUint32("writeLength", 32, (writeLength)) + _writeLengthErr := writeBuffer.WriteUint32("writeLength", 32, uint32((writeLength))) if _writeLengthErr != nil { return errors.Wrap(_writeLengthErr, "Error serializing 'writeLength' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go b/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go index 1ea60a9af26..1ebc1762b52 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go +++ b/plc4go/protocols/ads/readwrite/model/AdsReadWriteResponse.go @@ -238,7 +238,7 @@ func (m *_AdsReadWriteResponse) SerializeWithWriteBuffer(ctx context.Context, wr // Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) length := uint32(uint32(len(m.GetData()))) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsStampHeader.go b/plc4go/protocols/ads/readwrite/model/AdsStampHeader.go index e5e0ae8781f..f2713aa0fba 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsStampHeader.go +++ b/plc4go/protocols/ads/readwrite/model/AdsStampHeader.go @@ -211,14 +211,14 @@ func (m *_AdsStampHeader) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (timestamp) timestamp := uint64(m.GetTimestamp()) - _timestampErr := writeBuffer.WriteUint64("timestamp", 64, (timestamp)) + _timestampErr := writeBuffer.WriteUint64("timestamp", 64, uint64((timestamp))) if _timestampErr != nil { return errors.Wrap(_timestampErr, "Error serializing 'timestamp' field") } // Simple Field (samples) samples := uint32(m.GetSamples()) - _samplesErr := writeBuffer.WriteUint32("samples", 32, (samples)) + _samplesErr := writeBuffer.WriteUint32("samples", 32, uint32((samples))) if _samplesErr != nil { return errors.Wrap(_samplesErr, "Error serializing 'samples' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go b/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go index 9b992822ad9..1c8c53ef915 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go +++ b/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go @@ -667,35 +667,35 @@ func (m *_AdsSymbolTableEntry) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (entryLength) entryLength := uint32(m.GetEntryLength()) - _entryLengthErr := writeBuffer.WriteUint32("entryLength", 32, (entryLength)) + _entryLengthErr := writeBuffer.WriteUint32("entryLength", 32, uint32((entryLength))) if _entryLengthErr != nil { return errors.Wrap(_entryLengthErr, "Error serializing 'entryLength' field") } // Simple Field (group) group := uint32(m.GetGroup()) - _groupErr := writeBuffer.WriteUint32("group", 32, (group)) + _groupErr := writeBuffer.WriteUint32("group", 32, uint32((group))) if _groupErr != nil { return errors.Wrap(_groupErr, "Error serializing 'group' field") } // Simple Field (offset) offset := uint32(m.GetOffset()) - _offsetErr := writeBuffer.WriteUint32("offset", 32, (offset)) + _offsetErr := writeBuffer.WriteUint32("offset", 32, uint32((offset))) if _offsetErr != nil { return errors.Wrap(_offsetErr, "Error serializing 'offset' field") } // Simple Field (size) size := uint32(m.GetSize()) - _sizeErr := writeBuffer.WriteUint32("size", 32, (size)) + _sizeErr := writeBuffer.WriteUint32("size", 32, uint32((size))) if _sizeErr != nil { return errors.Wrap(_sizeErr, "Error serializing 'size' field") } // Simple Field (dataType) dataType := uint32(m.GetDataType()) - _dataTypeErr := writeBuffer.WriteUint32("dataType", 32, (dataType)) + _dataTypeErr := writeBuffer.WriteUint32("dataType", 32, uint32((dataType))) if _dataTypeErr != nil { return errors.Wrap(_dataTypeErr, "Error serializing 'dataType' field") } @@ -766,7 +766,7 @@ func (m *_AdsSymbolTableEntry) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 3, reserved) + _err := writeBuffer.WriteUint8("reserved", 3, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -817,7 +817,7 @@ func (m *_AdsSymbolTableEntry) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -825,21 +825,21 @@ func (m *_AdsSymbolTableEntry) SerializeWithWriteBuffer(ctx context.Context, wri // Implicit Field (nameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) nameLength := uint16(uint16(len(m.GetName()))) - _nameLengthErr := writeBuffer.WriteUint16("nameLength", 16, (nameLength)) + _nameLengthErr := writeBuffer.WriteUint16("nameLength", 16, uint16((nameLength))) if _nameLengthErr != nil { return errors.Wrap(_nameLengthErr, "Error serializing 'nameLength' field") } // Implicit Field (dataTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) dataTypeNameLength := uint16(uint16(len(m.GetDataTypeName()))) - _dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, (dataTypeNameLength)) + _dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, uint16((dataTypeNameLength))) if _dataTypeNameLengthErr != nil { return errors.Wrap(_dataTypeNameLengthErr, "Error serializing 'dataTypeNameLength' field") } // Implicit Field (commentLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) commentLength := uint16(uint16(len(m.GetComment()))) - _commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, (commentLength)) + _commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, uint16((commentLength))) if _commentLengthErr != nil { return errors.Wrap(_commentLengthErr, "Error serializing 'commentLength' field") } @@ -852,7 +852,7 @@ func (m *_AdsSymbolTableEntry) SerializeWithWriteBuffer(ctx context.Context, wri } // Const Field (nameTerminator) - _nameTerminatorErr := writeBuffer.WriteUint8("nameTerminator", 8, 0x00) + _nameTerminatorErr := writeBuffer.WriteUint8("nameTerminator", 8, uint8(0x00)) if _nameTerminatorErr != nil { return errors.Wrap(_nameTerminatorErr, "Error serializing 'nameTerminator' field") } @@ -865,7 +865,7 @@ func (m *_AdsSymbolTableEntry) SerializeWithWriteBuffer(ctx context.Context, wri } // Const Field (dataTypeNameTerminator) - _dataTypeNameTerminatorErr := writeBuffer.WriteUint8("dataTypeNameTerminator", 8, 0x00) + _dataTypeNameTerminatorErr := writeBuffer.WriteUint8("dataTypeNameTerminator", 8, uint8(0x00)) if _dataTypeNameTerminatorErr != nil { return errors.Wrap(_dataTypeNameTerminatorErr, "Error serializing 'dataTypeNameTerminator' field") } @@ -878,7 +878,7 @@ func (m *_AdsSymbolTableEntry) SerializeWithWriteBuffer(ctx context.Context, wri } // Const Field (commentTerminator) - _commentTerminatorErr := writeBuffer.WriteUint8("commentTerminator", 8, 0x00) + _commentTerminatorErr := writeBuffer.WriteUint8("commentTerminator", 8, uint8(0x00)) if _commentTerminatorErr != nil { return errors.Wrap(_commentTerminatorErr, "Error serializing 'commentTerminator' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go b/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go index 8ab5c68e081..3f799ac689e 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go +++ b/plc4go/protocols/ads/readwrite/model/AdsTableSizes.go @@ -239,42 +239,42 @@ func (m *_AdsTableSizes) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (symbolCount) symbolCount := uint32(m.GetSymbolCount()) - _symbolCountErr := writeBuffer.WriteUint32("symbolCount", 32, (symbolCount)) + _symbolCountErr := writeBuffer.WriteUint32("symbolCount", 32, uint32((symbolCount))) if _symbolCountErr != nil { return errors.Wrap(_symbolCountErr, "Error serializing 'symbolCount' field") } // Simple Field (symbolLength) symbolLength := uint32(m.GetSymbolLength()) - _symbolLengthErr := writeBuffer.WriteUint32("symbolLength", 32, (symbolLength)) + _symbolLengthErr := writeBuffer.WriteUint32("symbolLength", 32, uint32((symbolLength))) if _symbolLengthErr != nil { return errors.Wrap(_symbolLengthErr, "Error serializing 'symbolLength' field") } // Simple Field (dataTypeCount) dataTypeCount := uint32(m.GetDataTypeCount()) - _dataTypeCountErr := writeBuffer.WriteUint32("dataTypeCount", 32, (dataTypeCount)) + _dataTypeCountErr := writeBuffer.WriteUint32("dataTypeCount", 32, uint32((dataTypeCount))) if _dataTypeCountErr != nil { return errors.Wrap(_dataTypeCountErr, "Error serializing 'dataTypeCount' field") } // Simple Field (dataTypeLength) dataTypeLength := uint32(m.GetDataTypeLength()) - _dataTypeLengthErr := writeBuffer.WriteUint32("dataTypeLength", 32, (dataTypeLength)) + _dataTypeLengthErr := writeBuffer.WriteUint32("dataTypeLength", 32, uint32((dataTypeLength))) if _dataTypeLengthErr != nil { return errors.Wrap(_dataTypeLengthErr, "Error serializing 'dataTypeLength' field") } // Simple Field (extraCount) extraCount := uint32(m.GetExtraCount()) - _extraCountErr := writeBuffer.WriteUint32("extraCount", 32, (extraCount)) + _extraCountErr := writeBuffer.WriteUint32("extraCount", 32, uint32((extraCount))) if _extraCountErr != nil { return errors.Wrap(_extraCountErr, "Error serializing 'extraCount' field") } // Simple Field (extraLength) extraLength := uint32(m.GetExtraLength()) - _extraLengthErr := writeBuffer.WriteUint32("extraLength", 32, (extraLength)) + _extraLengthErr := writeBuffer.WriteUint32("extraLength", 32, uint32((extraLength))) if _extraLengthErr != nil { return errors.Wrap(_extraLengthErr, "Error serializing 'extraLength' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsTransMode.go b/plc4go/protocols/ads/readwrite/model/AdsTransMode.go index f4e32bbd2cf..f88dd534b90 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsTransMode.go +++ b/plc4go/protocols/ads/readwrite/model/AdsTransMode.go @@ -162,7 +162,7 @@ func (e AdsTransMode) Serialize() ([]byte, error) { func (e AdsTransMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("AdsTransMode", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("AdsTransMode", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go b/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go index 47eec46dcf6..0f9acf28b07 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go +++ b/plc4go/protocols/ads/readwrite/model/AdsWriteControlRequest.go @@ -239,21 +239,21 @@ func (m *_AdsWriteControlRequest) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (adsState) adsState := uint16(m.GetAdsState()) - _adsStateErr := writeBuffer.WriteUint16("adsState", 16, (adsState)) + _adsStateErr := writeBuffer.WriteUint16("adsState", 16, uint16((adsState))) if _adsStateErr != nil { return errors.Wrap(_adsStateErr, "Error serializing 'adsState' field") } // Simple Field (deviceState) deviceState := uint16(m.GetDeviceState()) - _deviceStateErr := writeBuffer.WriteUint16("deviceState", 16, (deviceState)) + _deviceStateErr := writeBuffer.WriteUint16("deviceState", 16, uint16((deviceState))) if _deviceStateErr != nil { return errors.Wrap(_deviceStateErr, "Error serializing 'deviceState' field") } // Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) length := uint32(uint32(len(m.GetData()))) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go b/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go index a4ea79d0a71..2041a22c2dd 100644 --- a/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go +++ b/plc4go/protocols/ads/readwrite/model/AdsWriteRequest.go @@ -239,21 +239,21 @@ func (m *_AdsWriteRequest) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (indexGroup) indexGroup := uint32(m.GetIndexGroup()) - _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, (indexGroup)) + _indexGroupErr := writeBuffer.WriteUint32("indexGroup", 32, uint32((indexGroup))) if _indexGroupErr != nil { return errors.Wrap(_indexGroupErr, "Error serializing 'indexGroup' field") } // Simple Field (indexOffset) indexOffset := uint32(m.GetIndexOffset()) - _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, (indexOffset)) + _indexOffsetErr := writeBuffer.WriteUint32("indexOffset", 32, uint32((indexOffset))) if _indexOffsetErr != nil { return errors.Wrap(_indexOffsetErr, "Error serializing 'indexOffset' field") } // Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) length := uint32(uint32(len(m.GetData()))) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AmsNetId.go b/plc4go/protocols/ads/readwrite/model/AmsNetId.go index 55ae018f942..0d62c0ce28a 100644 --- a/plc4go/protocols/ads/readwrite/model/AmsNetId.go +++ b/plc4go/protocols/ads/readwrite/model/AmsNetId.go @@ -238,42 +238,42 @@ func (m *_AmsNetId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Simple Field (octet1) octet1 := uint8(m.GetOctet1()) - _octet1Err := writeBuffer.WriteUint8("octet1", 8, (octet1)) + _octet1Err := writeBuffer.WriteUint8("octet1", 8, uint8((octet1))) if _octet1Err != nil { return errors.Wrap(_octet1Err, "Error serializing 'octet1' field") } // Simple Field (octet2) octet2 := uint8(m.GetOctet2()) - _octet2Err := writeBuffer.WriteUint8("octet2", 8, (octet2)) + _octet2Err := writeBuffer.WriteUint8("octet2", 8, uint8((octet2))) if _octet2Err != nil { return errors.Wrap(_octet2Err, "Error serializing 'octet2' field") } // Simple Field (octet3) octet3 := uint8(m.GetOctet3()) - _octet3Err := writeBuffer.WriteUint8("octet3", 8, (octet3)) + _octet3Err := writeBuffer.WriteUint8("octet3", 8, uint8((octet3))) if _octet3Err != nil { return errors.Wrap(_octet3Err, "Error serializing 'octet3' field") } // Simple Field (octet4) octet4 := uint8(m.GetOctet4()) - _octet4Err := writeBuffer.WriteUint8("octet4", 8, (octet4)) + _octet4Err := writeBuffer.WriteUint8("octet4", 8, uint8((octet4))) if _octet4Err != nil { return errors.Wrap(_octet4Err, "Error serializing 'octet4' field") } // Simple Field (octet5) octet5 := uint8(m.GetOctet5()) - _octet5Err := writeBuffer.WriteUint8("octet5", 8, (octet5)) + _octet5Err := writeBuffer.WriteUint8("octet5", 8, uint8((octet5))) if _octet5Err != nil { return errors.Wrap(_octet5Err, "Error serializing 'octet5' field") } // Simple Field (octet6) octet6 := uint8(m.GetOctet6()) - _octet6Err := writeBuffer.WriteUint8("octet6", 8, (octet6)) + _octet6Err := writeBuffer.WriteUint8("octet6", 8, uint8((octet6))) if _octet6Err != nil { return errors.Wrap(_octet6Err, "Error serializing 'octet6' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AmsPacket.go b/plc4go/protocols/ads/readwrite/model/AmsPacket.go index 1f295a4983d..7209458bf43 100644 --- a/plc4go/protocols/ads/readwrite/model/AmsPacket.go +++ b/plc4go/protocols/ads/readwrite/model/AmsPacket.go @@ -541,7 +541,7 @@ func (pm *_AmsPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Simple Field (targetAmsPort) targetAmsPort := uint16(m.GetTargetAmsPort()) - _targetAmsPortErr := writeBuffer.WriteUint16("targetAmsPort", 16, (targetAmsPort)) + _targetAmsPortErr := writeBuffer.WriteUint16("targetAmsPort", 16, uint16((targetAmsPort))) if _targetAmsPortErr != nil { return errors.Wrap(_targetAmsPortErr, "Error serializing 'targetAmsPort' field") } @@ -560,7 +560,7 @@ func (pm *_AmsPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Simple Field (sourceAmsPort) sourceAmsPort := uint16(m.GetSourceAmsPort()) - _sourceAmsPortErr := writeBuffer.WriteUint16("sourceAmsPort", 16, (sourceAmsPort)) + _sourceAmsPortErr := writeBuffer.WriteUint16("sourceAmsPort", 16, uint16((sourceAmsPort))) if _sourceAmsPortErr != nil { return errors.Wrap(_sourceAmsPortErr, "Error serializing 'sourceAmsPort' field") } @@ -645,7 +645,7 @@ func (pm *_AmsPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wri }).Msg("Overriding reserved field with unexpected value.") reserved = *pm.reservedField0 } - _err := writeBuffer.WriteInt8("reserved", 7, reserved) + _err := writeBuffer.WriteInt8("reserved", 7, int8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -653,21 +653,21 @@ func (pm *_AmsPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) length := uint32(uint32(uint32(m.GetLengthInBytes(ctx))) - uint32(uint32(32))) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } // Simple Field (errorCode) errorCode := uint32(m.GetErrorCode()) - _errorCodeErr := writeBuffer.WriteUint32("errorCode", 32, (errorCode)) + _errorCodeErr := writeBuffer.WriteUint32("errorCode", 32, uint32((errorCode))) if _errorCodeErr != nil { return errors.Wrap(_errorCodeErr, "Error serializing 'errorCode' field") } // Simple Field (invokeId) invokeId := uint32(m.GetInvokeId()) - _invokeIdErr := writeBuffer.WriteUint32("invokeId", 32, (invokeId)) + _invokeIdErr := writeBuffer.WriteUint32("invokeId", 32, uint32((invokeId))) if _invokeIdErr != nil { return errors.Wrap(_invokeIdErr, "Error serializing 'invokeId' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AmsSerialAcknowledgeFrame.go b/plc4go/protocols/ads/readwrite/model/AmsSerialAcknowledgeFrame.go index ce0c1e0b5cb..5e15fc415b7 100644 --- a/plc4go/protocols/ads/readwrite/model/AmsSerialAcknowledgeFrame.go +++ b/plc4go/protocols/ads/readwrite/model/AmsSerialAcknowledgeFrame.go @@ -238,42 +238,42 @@ func (m *_AmsSerialAcknowledgeFrame) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (magicCookie) magicCookie := uint16(m.GetMagicCookie()) - _magicCookieErr := writeBuffer.WriteUint16("magicCookie", 16, (magicCookie)) + _magicCookieErr := writeBuffer.WriteUint16("magicCookie", 16, uint16((magicCookie))) if _magicCookieErr != nil { return errors.Wrap(_magicCookieErr, "Error serializing 'magicCookie' field") } // Simple Field (transmitterAddress) transmitterAddress := int8(m.GetTransmitterAddress()) - _transmitterAddressErr := writeBuffer.WriteInt8("transmitterAddress", 8, (transmitterAddress)) + _transmitterAddressErr := writeBuffer.WriteInt8("transmitterAddress", 8, int8((transmitterAddress))) if _transmitterAddressErr != nil { return errors.Wrap(_transmitterAddressErr, "Error serializing 'transmitterAddress' field") } // Simple Field (receiverAddress) receiverAddress := int8(m.GetReceiverAddress()) - _receiverAddressErr := writeBuffer.WriteInt8("receiverAddress", 8, (receiverAddress)) + _receiverAddressErr := writeBuffer.WriteInt8("receiverAddress", 8, int8((receiverAddress))) if _receiverAddressErr != nil { return errors.Wrap(_receiverAddressErr, "Error serializing 'receiverAddress' field") } // Simple Field (fragmentNumber) fragmentNumber := int8(m.GetFragmentNumber()) - _fragmentNumberErr := writeBuffer.WriteInt8("fragmentNumber", 8, (fragmentNumber)) + _fragmentNumberErr := writeBuffer.WriteInt8("fragmentNumber", 8, int8((fragmentNumber))) if _fragmentNumberErr != nil { return errors.Wrap(_fragmentNumberErr, "Error serializing 'fragmentNumber' field") } // Simple Field (length) length := int8(m.GetLength()) - _lengthErr := writeBuffer.WriteInt8("length", 8, (length)) + _lengthErr := writeBuffer.WriteInt8("length", 8, int8((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } // Simple Field (crc) crc := uint16(m.GetCrc()) - _crcErr := writeBuffer.WriteUint16("crc", 16, (crc)) + _crcErr := writeBuffer.WriteUint16("crc", 16, uint16((crc))) if _crcErr != nil { return errors.Wrap(_crcErr, "Error serializing 'crc' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AmsSerialFrame.go b/plc4go/protocols/ads/readwrite/model/AmsSerialFrame.go index 5804b24104a..c939f78e6a6 100644 --- a/plc4go/protocols/ads/readwrite/model/AmsSerialFrame.go +++ b/plc4go/protocols/ads/readwrite/model/AmsSerialFrame.go @@ -262,35 +262,35 @@ func (m *_AmsSerialFrame) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (magicCookie) magicCookie := uint16(m.GetMagicCookie()) - _magicCookieErr := writeBuffer.WriteUint16("magicCookie", 16, (magicCookie)) + _magicCookieErr := writeBuffer.WriteUint16("magicCookie", 16, uint16((magicCookie))) if _magicCookieErr != nil { return errors.Wrap(_magicCookieErr, "Error serializing 'magicCookie' field") } // Simple Field (transmitterAddress) transmitterAddress := int8(m.GetTransmitterAddress()) - _transmitterAddressErr := writeBuffer.WriteInt8("transmitterAddress", 8, (transmitterAddress)) + _transmitterAddressErr := writeBuffer.WriteInt8("transmitterAddress", 8, int8((transmitterAddress))) if _transmitterAddressErr != nil { return errors.Wrap(_transmitterAddressErr, "Error serializing 'transmitterAddress' field") } // Simple Field (receiverAddress) receiverAddress := int8(m.GetReceiverAddress()) - _receiverAddressErr := writeBuffer.WriteInt8("receiverAddress", 8, (receiverAddress)) + _receiverAddressErr := writeBuffer.WriteInt8("receiverAddress", 8, int8((receiverAddress))) if _receiverAddressErr != nil { return errors.Wrap(_receiverAddressErr, "Error serializing 'receiverAddress' field") } // Simple Field (fragmentNumber) fragmentNumber := int8(m.GetFragmentNumber()) - _fragmentNumberErr := writeBuffer.WriteInt8("fragmentNumber", 8, (fragmentNumber)) + _fragmentNumberErr := writeBuffer.WriteInt8("fragmentNumber", 8, int8((fragmentNumber))) if _fragmentNumberErr != nil { return errors.Wrap(_fragmentNumberErr, "Error serializing 'fragmentNumber' field") } // Simple Field (length) length := int8(m.GetLength()) - _lengthErr := writeBuffer.WriteInt8("length", 8, (length)) + _lengthErr := writeBuffer.WriteInt8("length", 8, int8((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } @@ -309,7 +309,7 @@ func (m *_AmsSerialFrame) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (crc) crc := uint16(m.GetCrc()) - _crcErr := writeBuffer.WriteUint16("crc", 16, (crc)) + _crcErr := writeBuffer.WriteUint16("crc", 16, uint16((crc))) if _crcErr != nil { return errors.Wrap(_crcErr, "Error serializing 'crc' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AmsSerialResetFrame.go b/plc4go/protocols/ads/readwrite/model/AmsSerialResetFrame.go index 988e1aee956..36491c2e5c6 100644 --- a/plc4go/protocols/ads/readwrite/model/AmsSerialResetFrame.go +++ b/plc4go/protocols/ads/readwrite/model/AmsSerialResetFrame.go @@ -238,42 +238,42 @@ func (m *_AmsSerialResetFrame) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (magicCookie) magicCookie := uint16(m.GetMagicCookie()) - _magicCookieErr := writeBuffer.WriteUint16("magicCookie", 16, (magicCookie)) + _magicCookieErr := writeBuffer.WriteUint16("magicCookie", 16, uint16((magicCookie))) if _magicCookieErr != nil { return errors.Wrap(_magicCookieErr, "Error serializing 'magicCookie' field") } // Simple Field (transmitterAddress) transmitterAddress := int8(m.GetTransmitterAddress()) - _transmitterAddressErr := writeBuffer.WriteInt8("transmitterAddress", 8, (transmitterAddress)) + _transmitterAddressErr := writeBuffer.WriteInt8("transmitterAddress", 8, int8((transmitterAddress))) if _transmitterAddressErr != nil { return errors.Wrap(_transmitterAddressErr, "Error serializing 'transmitterAddress' field") } // Simple Field (receiverAddress) receiverAddress := int8(m.GetReceiverAddress()) - _receiverAddressErr := writeBuffer.WriteInt8("receiverAddress", 8, (receiverAddress)) + _receiverAddressErr := writeBuffer.WriteInt8("receiverAddress", 8, int8((receiverAddress))) if _receiverAddressErr != nil { return errors.Wrap(_receiverAddressErr, "Error serializing 'receiverAddress' field") } // Simple Field (fragmentNumber) fragmentNumber := int8(m.GetFragmentNumber()) - _fragmentNumberErr := writeBuffer.WriteInt8("fragmentNumber", 8, (fragmentNumber)) + _fragmentNumberErr := writeBuffer.WriteInt8("fragmentNumber", 8, int8((fragmentNumber))) if _fragmentNumberErr != nil { return errors.Wrap(_fragmentNumberErr, "Error serializing 'fragmentNumber' field") } // Simple Field (length) length := int8(m.GetLength()) - _lengthErr := writeBuffer.WriteInt8("length", 8, (length)) + _lengthErr := writeBuffer.WriteInt8("length", 8, int8((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } // Simple Field (crc) crc := uint16(m.GetCrc()) - _crcErr := writeBuffer.WriteUint16("crc", 16, (crc)) + _crcErr := writeBuffer.WriteUint16("crc", 16, uint16((crc))) if _crcErr != nil { return errors.Wrap(_crcErr, "Error serializing 'crc' field") } diff --git a/plc4go/protocols/ads/readwrite/model/AmsTCPPacket.go b/plc4go/protocols/ads/readwrite/model/AmsTCPPacket.go index f8e1a342dc8..a807f3351db 100644 --- a/plc4go/protocols/ads/readwrite/model/AmsTCPPacket.go +++ b/plc4go/protocols/ads/readwrite/model/AmsTCPPacket.go @@ -196,7 +196,7 @@ func (m *_AmsTCPPacket) SerializeWithWriteBuffer(ctx context.Context, writeBuffe }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -204,7 +204,7 @@ func (m *_AmsTCPPacket) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) length := uint32(m.GetUserdata().GetLengthInBytes(ctx)) - _lengthErr := writeBuffer.WriteUint32("length", 32, (length)) + _lengthErr := writeBuffer.WriteUint32("length", 32, uint32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } diff --git a/plc4go/protocols/ads/readwrite/model/CommandId.go b/plc4go/protocols/ads/readwrite/model/CommandId.go index 852fbc90748..07a648fffcb 100644 --- a/plc4go/protocols/ads/readwrite/model/CommandId.go +++ b/plc4go/protocols/ads/readwrite/model/CommandId.go @@ -180,7 +180,7 @@ func (e CommandId) Serialize() ([]byte, error) { func (e CommandId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("CommandId", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("CommandId", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/readwrite/model/DataItem.go b/plc4go/protocols/ads/readwrite/model/DataItem.go index 135895e46cb..0ba201d4ff1 100644 --- a/plc4go/protocols/ads/readwrite/model/DataItem.go +++ b/plc4go/protocols/ads/readwrite/model/DataItem.go @@ -213,7 +213,7 @@ func DataItemParseWithBuffer(ctx context.Context, readBuffer utils.ReadBuffer, p return nil, errors.Wrap(_millisecondsErr, "Error parsing 'milliseconds' field") } readBuffer.CloseContext("DataItem") - return values.NewPlcTIMEFromMilliseconds(milliseconds), nil + return values.NewPlcTIMEFromMilliseconds(int64(milliseconds)), nil case plcValueType == PlcValueType_LTIME: // LTIME // Simple Field (nanoseconds) nanoseconds, _nanosecondsErr := readBuffer.ReadUint64("nanoseconds", 64) @@ -298,7 +298,7 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri switch { case plcValueType == PlcValueType_BOOL: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -308,62 +308,62 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } case plcValueType == PlcValueType_BYTE: // BYTE // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_WORD: // WORD // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_DWORD: // DWORD // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_LWORD: // LWORD // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_SINT: // SINT // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_USINT: // USINT // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_INT: // INT // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_UINT: // UINT // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_DINT: // DINT // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_UDINT: // UDINT // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_LINT: // LINT // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_ULINT: // ULINT // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case plcValueType == PlcValueType_REAL: // REAL @@ -393,7 +393,7 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } case plcValueType == PlcValueType_WSTRING: // WSTRING @@ -403,47 +403,47 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint16("reserved", 16, uint16(0x0000)); _err != nil { + if _err := writeBuffer.WriteUint16("reserved", 16, uint16(uint16(0x0000))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } case plcValueType == PlcValueType_TIME: // TIME // Simple Field (milliseconds) - if _err := writeBuffer.WriteUint32("milliseconds", 32, value.(values.PlcTIME).GetMilliseconds()); _err != nil { + if _err := writeBuffer.WriteUint32("milliseconds", 32, uint32(value.(values.PlcTIME).GetMilliseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'milliseconds' field") } case plcValueType == PlcValueType_LTIME: // LTIME // Simple Field (nanoseconds) - if _err := writeBuffer.WriteUint64("nanoseconds", 64, value.(values.PlcLTIME).GetNanoseconds()); _err != nil { + if _err := writeBuffer.WriteUint64("nanoseconds", 64, uint64(value.(values.PlcLTIME).GetNanoseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanoseconds' field") } case plcValueType == PlcValueType_DATE: // DATE // Simple Field (secondsSinceEpoch) - if _err := writeBuffer.WriteUint32("secondsSinceEpoch", 32, value.(values.PlcDATE).GetSecondsSinceEpoch()); _err != nil { + if _err := writeBuffer.WriteUint32("secondsSinceEpoch", 32, uint32(value.(values.PlcDATE).GetSecondsSinceEpoch())); _err != nil { return errors.Wrap(_err, "Error serializing 'secondsSinceEpoch' field") } case plcValueType == PlcValueType_LDATE: // LDATE // Simple Field (nanosecondsSinceEpoch) - if _err := writeBuffer.WriteUint64("nanosecondsSinceEpoch", 64, value.(values.PlcLDATE).GetNanosecondsSinceEpoch()); _err != nil { + if _err := writeBuffer.WriteUint64("nanosecondsSinceEpoch", 64, uint64(value.(values.PlcLDATE).GetNanosecondsSinceEpoch())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanosecondsSinceEpoch' field") } case plcValueType == PlcValueType_TIME_OF_DAY: // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) - if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight()); _err != nil { + if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, uint32(value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight())); _err != nil { return errors.Wrap(_err, "Error serializing 'millisecondsSinceMidnight' field") } case plcValueType == PlcValueType_LTIME_OF_DAY: // LTIME_OF_DAY // Simple Field (nanosecondsSinceMidnight) - if _err := writeBuffer.WriteUint64("nanosecondsSinceMidnight", 64, value.(values.PlcLTIME_OF_DAY).GetNanosecondsSinceMidnight()); _err != nil { + if _err := writeBuffer.WriteUint64("nanosecondsSinceMidnight", 64, uint64(value.(values.PlcLTIME_OF_DAY).GetNanosecondsSinceMidnight())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanosecondsSinceMidnight' field") } case plcValueType == PlcValueType_DATE_AND_TIME: // DATE_AND_TIME // Simple Field (secondsSinceEpoch) - if _err := writeBuffer.WriteUint32("secondsSinceEpoch", 32, value.(values.PlcDATE_AND_TIME).GetSecondsSinceEpoch()); _err != nil { + if _err := writeBuffer.WriteUint32("secondsSinceEpoch", 32, uint32(value.(values.PlcDATE_AND_TIME).GetSecondsSinceEpoch())); _err != nil { return errors.Wrap(_err, "Error serializing 'secondsSinceEpoch' field") } case plcValueType == PlcValueType_LDATE_AND_TIME: // LDATE_AND_TIME // Simple Field (nanosecondsSinceEpoch) - if _err := writeBuffer.WriteUint64("nanosecondsSinceEpoch", 64, value.(values.PlcLDATE_AND_TIME).GetNanosecondsSinceEpoch()); _err != nil { + if _err := writeBuffer.WriteUint64("nanosecondsSinceEpoch", 64, uint64(value.(values.PlcLDATE_AND_TIME).GetNanosecondsSinceEpoch())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanosecondsSinceEpoch' field") } default: diff --git a/plc4go/protocols/ads/readwrite/model/DefaultAmsPorts.go b/plc4go/protocols/ads/readwrite/model/DefaultAmsPorts.go index 0e352ea59cb..b892bdfd340 100644 --- a/plc4go/protocols/ads/readwrite/model/DefaultAmsPorts.go +++ b/plc4go/protocols/ads/readwrite/model/DefaultAmsPorts.go @@ -450,7 +450,7 @@ func (e DefaultAmsPorts) Serialize() ([]byte, error) { func (e DefaultAmsPorts) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("DefaultAmsPorts", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("DefaultAmsPorts", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/readwrite/model/PlcValueType.go b/plc4go/protocols/ads/readwrite/model/PlcValueType.go index 20e11f19368..12ccf7b6fd5 100644 --- a/plc4go/protocols/ads/readwrite/model/PlcValueType.go +++ b/plc4go/protocols/ads/readwrite/model/PlcValueType.go @@ -306,7 +306,7 @@ func (e PlcValueType) Serialize() ([]byte, error) { func (e PlcValueType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("PlcValueType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("PlcValueType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/readwrite/model/ReservedIndexGroups.go b/plc4go/protocols/ads/readwrite/model/ReservedIndexGroups.go index 4fc8fb18b36..f9a7f7714b6 100644 --- a/plc4go/protocols/ads/readwrite/model/ReservedIndexGroups.go +++ b/plc4go/protocols/ads/readwrite/model/ReservedIndexGroups.go @@ -342,7 +342,7 @@ func (e ReservedIndexGroups) Serialize() ([]byte, error) { func (e ReservedIndexGroups) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("ReservedIndexGroups", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("ReservedIndexGroups", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/ads/readwrite/model/ReturnCode.go b/plc4go/protocols/ads/readwrite/model/ReturnCode.go index 79e1628f814..5a17737c96c 100644 --- a/plc4go/protocols/ads/readwrite/model/ReturnCode.go +++ b/plc4go/protocols/ads/readwrite/model/ReturnCode.go @@ -852,7 +852,7 @@ func (e ReturnCode) Serialize() ([]byte, error) { func (e ReturnCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("ReturnCode", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("ReturnCode", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUAbort.go b/plc4go/protocols/bacnetip/readwrite/model/APDUAbort.go index de6a895c86b..9363cc07c91 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUAbort.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUAbort.go @@ -256,7 +256,7 @@ func (m *_APDUAbort) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 3, reserved) + _err := writeBuffer.WriteUint8("reserved", 3, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -271,7 +271,7 @@ func (m *_APDUAbort) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u // Simple Field (originalInvokeId) originalInvokeId := uint8(m.GetOriginalInvokeId()) - _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, (originalInvokeId)) + _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, uint8((originalInvokeId))) if _originalInvokeIdErr != nil { return errors.Wrap(_originalInvokeIdErr, "Error serializing 'originalInvokeId' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUComplexAck.go b/plc4go/protocols/bacnetip/readwrite/model/APDUComplexAck.go index 5e11095bd3b..ced69a6a5a3 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUComplexAck.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUComplexAck.go @@ -461,7 +461,7 @@ func (m *_APDUComplexAck) SerializeWithWriteBuffer(ctx context.Context, writeBuf }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 2, reserved) + _err := writeBuffer.WriteUint8("reserved", 2, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -469,7 +469,7 @@ func (m *_APDUComplexAck) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (originalInvokeId) originalInvokeId := uint8(m.GetOriginalInvokeId()) - _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, (originalInvokeId)) + _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, uint8((originalInvokeId))) if _originalInvokeIdErr != nil { return errors.Wrap(_originalInvokeIdErr, "Error serializing 'originalInvokeId' field") } @@ -478,7 +478,7 @@ func (m *_APDUComplexAck) SerializeWithWriteBuffer(ctx context.Context, writeBuf var sequenceNumber *uint8 = nil if m.GetSequenceNumber() != nil { sequenceNumber = m.GetSequenceNumber() - _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, *(sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, uint8(*(sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } @@ -488,7 +488,7 @@ func (m *_APDUComplexAck) SerializeWithWriteBuffer(ctx context.Context, writeBuf var proposedWindowSize *uint8 = nil if m.GetProposedWindowSize() != nil { proposedWindowSize = m.GetProposedWindowSize() - _proposedWindowSizeErr := writeBuffer.WriteUint8("proposedWindowSize", 8, *(proposedWindowSize)) + _proposedWindowSizeErr := writeBuffer.WriteUint8("proposedWindowSize", 8, uint8(*(proposedWindowSize))) if _proposedWindowSizeErr != nil { return errors.Wrap(_proposedWindowSizeErr, "Error serializing 'proposedWindowSize' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUConfirmedRequest.go b/plc4go/protocols/bacnetip/readwrite/model/APDUConfirmedRequest.go index 38ced76d369..f9024b332f5 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUConfirmedRequest.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUConfirmedRequest.go @@ -537,7 +537,7 @@ func (m *_APDUConfirmedRequest) SerializeWithWriteBuffer(ctx context.Context, wr }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 2, reserved) + _err := writeBuffer.WriteUint8("reserved", 2, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -569,7 +569,7 @@ func (m *_APDUConfirmedRequest) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (invokeId) invokeId := uint8(m.GetInvokeId()) - _invokeIdErr := writeBuffer.WriteUint8("invokeId", 8, (invokeId)) + _invokeIdErr := writeBuffer.WriteUint8("invokeId", 8, uint8((invokeId))) if _invokeIdErr != nil { return errors.Wrap(_invokeIdErr, "Error serializing 'invokeId' field") } @@ -578,7 +578,7 @@ func (m *_APDUConfirmedRequest) SerializeWithWriteBuffer(ctx context.Context, wr var sequenceNumber *uint8 = nil if m.GetSequenceNumber() != nil { sequenceNumber = m.GetSequenceNumber() - _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, *(sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, uint8(*(sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } @@ -588,7 +588,7 @@ func (m *_APDUConfirmedRequest) SerializeWithWriteBuffer(ctx context.Context, wr var proposedWindowSize *uint8 = nil if m.GetProposedWindowSize() != nil { proposedWindowSize = m.GetProposedWindowSize() - _proposedWindowSizeErr := writeBuffer.WriteUint8("proposedWindowSize", 8, *(proposedWindowSize)) + _proposedWindowSizeErr := writeBuffer.WriteUint8("proposedWindowSize", 8, uint8(*(proposedWindowSize))) if _proposedWindowSizeErr != nil { return errors.Wrap(_proposedWindowSizeErr, "Error serializing 'proposedWindowSize' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUError.go b/plc4go/protocols/bacnetip/readwrite/model/APDUError.go index 1ae544a31b4..cddddbbb087 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUError.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUError.go @@ -262,7 +262,7 @@ func (m *_APDUError) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 4, reserved) + _err := writeBuffer.WriteUint8("reserved", 4, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -270,7 +270,7 @@ func (m *_APDUError) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u // Simple Field (originalInvokeId) originalInvokeId := uint8(m.GetOriginalInvokeId()) - _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, (originalInvokeId)) + _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, uint8((originalInvokeId))) if _originalInvokeIdErr != nil { return errors.Wrap(_originalInvokeIdErr, "Error serializing 'originalInvokeId' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUReject.go b/plc4go/protocols/bacnetip/readwrite/model/APDUReject.go index ed9d3d9c057..22c3663a51a 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUReject.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUReject.go @@ -237,7 +237,7 @@ func (m *_APDUReject) SerializeWithWriteBuffer(ctx context.Context, writeBuffer }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 4, reserved) + _err := writeBuffer.WriteUint8("reserved", 4, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -245,7 +245,7 @@ func (m *_APDUReject) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (originalInvokeId) originalInvokeId := uint8(m.GetOriginalInvokeId()) - _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, (originalInvokeId)) + _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, uint8((originalInvokeId))) if _originalInvokeIdErr != nil { return errors.Wrap(_originalInvokeIdErr, "Error serializing 'originalInvokeId' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUSegmentAck.go b/plc4go/protocols/bacnetip/readwrite/model/APDUSegmentAck.go index 24a30911c5c..ac2679c3684 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUSegmentAck.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUSegmentAck.go @@ -288,7 +288,7 @@ func (m *_APDUSegmentAck) SerializeWithWriteBuffer(ctx context.Context, writeBuf }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 2, reserved) + _err := writeBuffer.WriteUint8("reserved", 2, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -310,21 +310,21 @@ func (m *_APDUSegmentAck) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (originalInvokeId) originalInvokeId := uint8(m.GetOriginalInvokeId()) - _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, (originalInvokeId)) + _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, uint8((originalInvokeId))) if _originalInvokeIdErr != nil { return errors.Wrap(_originalInvokeIdErr, "Error serializing 'originalInvokeId' field") } // Simple Field (sequenceNumber) sequenceNumber := uint8(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, uint8((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } // Simple Field (actualWindowSize) actualWindowSize := uint8(m.GetActualWindowSize()) - _actualWindowSizeErr := writeBuffer.WriteUint8("actualWindowSize", 8, (actualWindowSize)) + _actualWindowSizeErr := writeBuffer.WriteUint8("actualWindowSize", 8, uint8((actualWindowSize))) if _actualWindowSizeErr != nil { return errors.Wrap(_actualWindowSizeErr, "Error serializing 'actualWindowSize' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUSimpleAck.go b/plc4go/protocols/bacnetip/readwrite/model/APDUSimpleAck.go index 67b9d93ebf1..25187f51047 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUSimpleAck.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUSimpleAck.go @@ -237,7 +237,7 @@ func (m *_APDUSimpleAck) SerializeWithWriteBuffer(ctx context.Context, writeBuff }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 4, reserved) + _err := writeBuffer.WriteUint8("reserved", 4, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -245,7 +245,7 @@ func (m *_APDUSimpleAck) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (originalInvokeId) originalInvokeId := uint8(m.GetOriginalInvokeId()) - _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, (originalInvokeId)) + _originalInvokeIdErr := writeBuffer.WriteUint8("originalInvokeId", 8, uint8((originalInvokeId))) if _originalInvokeIdErr != nil { return errors.Wrap(_originalInvokeIdErr, "Error serializing 'originalInvokeId' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUUnconfirmedRequest.go b/plc4go/protocols/bacnetip/readwrite/model/APDUUnconfirmedRequest.go index 96b06b02a3f..d51fa2c9733 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUUnconfirmedRequest.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUUnconfirmedRequest.go @@ -218,7 +218,7 @@ func (m *_APDUUnconfirmedRequest) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 4, reserved) + _err := writeBuffer.WriteUint8("reserved", 4, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/APDUUnknown.go b/plc4go/protocols/bacnetip/readwrite/model/APDUUnknown.go index c376a53a8e7..ce2d5a7b22f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/APDUUnknown.go +++ b/plc4go/protocols/bacnetip/readwrite/model/APDUUnknown.go @@ -201,7 +201,7 @@ func (m *_APDUUnknown) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (unknownTypeRest) unknownTypeRest := uint8(m.GetUnknownTypeRest()) - _unknownTypeRestErr := writeBuffer.WriteUint8("unknownTypeRest", 4, (unknownTypeRest)) + _unknownTypeRestErr := writeBuffer.WriteUint8("unknownTypeRest", 4, uint8((unknownTypeRest))) if _unknownTypeRestErr != nil { return errors.Wrap(_unknownTypeRestErr, "Error serializing 'unknownTypeRest' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/ApduType.go b/plc4go/protocols/bacnetip/readwrite/model/ApduType.go index dc71c52b7b1..69f85351097 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/ApduType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/ApduType.go @@ -216,7 +216,7 @@ func (e ApduType) Serialize() ([]byte, error) { func (e ApduType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ApduType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ApduType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAbortReason.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAbortReason.go index 168f66259b2..fed6159cfb0 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAbortReason.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAbortReason.go @@ -198,7 +198,7 @@ func (e BACnetAbortReason) Serialize() ([]byte, error) { func (e BACnetAbortReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAbortReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAbortReason", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessAuthenticationFactorDisable.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessAuthenticationFactorDisable.go index 7a80ba42ab8..95416c15b48 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessAuthenticationFactorDisable.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessAuthenticationFactorDisable.go @@ -162,7 +162,7 @@ func (e BACnetAccessAuthenticationFactorDisable) Serialize() ([]byte, error) { func (e BACnetAccessAuthenticationFactorDisable) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetAccessAuthenticationFactorDisable", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetAccessAuthenticationFactorDisable", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisable.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisable.go index f370c779182..2ab2eea3755 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisable.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisable.go @@ -150,7 +150,7 @@ func (e BACnetAccessCredentialDisable) Serialize() ([]byte, error) { func (e BACnetAccessCredentialDisable) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetAccessCredentialDisable", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetAccessCredentialDisable", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisableReason.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisableReason.go index 676831b839b..4c9a5c2dda6 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisableReason.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessCredentialDisableReason.go @@ -186,7 +186,7 @@ func (e BACnetAccessCredentialDisableReason) Serialize() ([]byte, error) { func (e BACnetAccessCredentialDisableReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetAccessCredentialDisableReason", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetAccessCredentialDisableReason", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessEvent.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessEvent.go index ba0a0bae505..7ebc5945a96 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessEvent.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessEvent.go @@ -450,7 +450,7 @@ func (e BACnetAccessEvent) Serialize() ([]byte, error) { func (e BACnetAccessEvent) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetAccessEvent", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetAccessEvent", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessPassbackMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessPassbackMode.go index b80251dd3e8..cabaa6837f6 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessPassbackMode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessPassbackMode.go @@ -138,7 +138,7 @@ func (e BACnetAccessPassbackMode) Serialize() ([]byte, error) { func (e BACnetAccessPassbackMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAccessPassbackMode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAccessPassbackMode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleLocationSpecifier.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleLocationSpecifier.go index 1a360974a80..47dabd4361d 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleLocationSpecifier.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleLocationSpecifier.go @@ -132,7 +132,7 @@ func (e BACnetAccessRuleLocationSpecifier) Serialize() ([]byte, error) { func (e BACnetAccessRuleLocationSpecifier) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAccessRuleLocationSpecifier", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAccessRuleLocationSpecifier", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleTimeRangeSpecifier.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleTimeRangeSpecifier.go index 587b14a52d9..c1a0c5b00b2 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleTimeRangeSpecifier.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessRuleTimeRangeSpecifier.go @@ -132,7 +132,7 @@ func (e BACnetAccessRuleTimeRangeSpecifier) Serialize() ([]byte, error) { func (e BACnetAccessRuleTimeRangeSpecifier) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAccessRuleTimeRangeSpecifier", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAccessRuleTimeRangeSpecifier", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessUserType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessUserType.go index 3a93981549e..31f2f2a0818 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessUserType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessUserType.go @@ -144,7 +144,7 @@ func (e BACnetAccessUserType) Serialize() ([]byte, error) { func (e BACnetAccessUserType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetAccessUserType", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetAccessUserType", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessZoneOccupancyState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessZoneOccupancyState.go index 48765eeab17..5f8ff946ed1 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessZoneOccupancyState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccessZoneOccupancyState.go @@ -168,7 +168,7 @@ func (e BACnetAccessZoneOccupancyState) Serialize() ([]byte, error) { func (e BACnetAccessZoneOccupancyState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetAccessZoneOccupancyState", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetAccessZoneOccupancyState", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccumulatorRecordAccumulatorStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccumulatorRecordAccumulatorStatus.go index e4243687524..f2db2d54476 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAccumulatorRecordAccumulatorStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAccumulatorRecordAccumulatorStatus.go @@ -150,7 +150,7 @@ func (e BACnetAccumulatorRecordAccumulatorStatus) Serialize() ([]byte, error) { func (e BACnetAccumulatorRecordAccumulatorStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAccumulatorRecordAccumulatorStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAccumulatorRecordAccumulatorStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAction.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAction.go index 4c5423a9ca3..55fa472bdb3 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAction.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAction.go @@ -132,7 +132,7 @@ func (e BACnetAction) Serialize() ([]byte, error) { func (e BACnetAction) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAction", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAction", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationFactorType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationFactorType.go index baabed14d51..8d50fff2ab2 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationFactorType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationFactorType.go @@ -270,7 +270,7 @@ func (e BACnetAuthenticationFactorType) Serialize() ([]byte, error) { func (e BACnetAuthenticationFactorType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAuthenticationFactorType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAuthenticationFactorType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationStatus.go index 63948babd06..4b4e1a880f5 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthenticationStatus.go @@ -162,7 +162,7 @@ func (e BACnetAuthenticationStatus) Serialize() ([]byte, error) { func (e BACnetAuthenticationStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAuthenticationStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAuthenticationStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationExemption.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationExemption.go index 11387dbd612..b4791b8ffe9 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationExemption.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationExemption.go @@ -168,7 +168,7 @@ func (e BACnetAuthorizationExemption) Serialize() ([]byte, error) { func (e BACnetAuthorizationExemption) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetAuthorizationExemption", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetAuthorizationExemption", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationMode.go index b2625fc2a51..9fcbb7d2230 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationMode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetAuthorizationMode.go @@ -162,7 +162,7 @@ func (e BACnetAuthorizationMode) Serialize() ([]byte, error) { func (e BACnetAuthorizationMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetAuthorizationMode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetAuthorizationMode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetBackupState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetBackupState.go index e07b3e7eddc..5737cd05b1d 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetBackupState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetBackupState.go @@ -162,7 +162,7 @@ func (e BACnetBackupState) Serialize() ([]byte, error) { func (e BACnetBackupState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetBackupState", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetBackupState", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryLightingPV.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryLightingPV.go index 304d109309c..d8bf9465be6 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryLightingPV.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryLightingPV.go @@ -162,7 +162,7 @@ func (e BACnetBinaryLightingPV) Serialize() ([]byte, error) { func (e BACnetBinaryLightingPV) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetBinaryLightingPV", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetBinaryLightingPV", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryPV.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryPV.go index 3642eaf254e..0aabcbe6da8 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryPV.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetBinaryPV.go @@ -132,7 +132,7 @@ func (e BACnetBinaryPV) Serialize() ([]byte, error) { func (e BACnetBinaryPV) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetBinaryPV", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetBinaryPV", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceChoice.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceChoice.go index 175f187c6fa..31311290e6e 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceChoice.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceChoice.go @@ -312,7 +312,7 @@ func (e BACnetConfirmedServiceChoice) Serialize() ([]byte, error) { func (e BACnetConfirmedServiceChoice) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetConfirmedServiceChoice", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetConfirmedServiceChoice", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority.go index 418acc29f35..2f1f160b1a9 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority.go @@ -132,7 +132,7 @@ func (e BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority) Serial func (e BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestConfirmedTextMessageMessagePriority", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable.go index a1e30ceb014..17bc848e47c 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable.go @@ -138,7 +138,7 @@ func (e BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable) Se func (e BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestDeviceCommunicationControlEnableDisable", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter.go index e53ea765aa2..82c79f2b56d 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter.go @@ -138,7 +138,7 @@ func (e BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter) func (e BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestGetEnrollmentSummaryAcknowledgementFilter", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter.go index 90797264186..2d0b14fec55 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter.go @@ -150,7 +150,7 @@ func (e BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter) Seria func (e BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestGetEnrollmentSummaryEventStateFilter", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevice.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevice.go index a06e8873166..9331550a11d 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevice.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevice.go @@ -174,7 +174,7 @@ func (e BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevic func (e BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevice) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevice", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetConfirmedServiceRequestReinitializeDeviceReinitializedStateOfDevice", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetContextTagBoolean.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetContextTagBoolean.go index 4580ccad3eb..4d693ef2373 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetContextTagBoolean.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetContextTagBoolean.go @@ -237,7 +237,7 @@ func (m *_BACnetContextTagBoolean) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (value) value := uint8(m.GetValue()) - _valueErr := writeBuffer.WriteUint8("value", 8, (value)) + _valueErr := writeBuffer.WriteUint8("value", 8, uint8((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetDataType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetDataType.go index f199525af7e..28bd6c66135 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetDataType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetDataType.go @@ -204,7 +204,7 @@ func (e BACnetDataType) Serialize() ([]byte, error) { func (e BACnetDataType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetDataType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetDataType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetDaysOfWeek.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetDaysOfWeek.go index db7110606f5..8bb0eca896c 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetDaysOfWeek.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetDaysOfWeek.go @@ -162,7 +162,7 @@ func (e BACnetDaysOfWeek) Serialize() ([]byte, error) { func (e BACnetDaysOfWeek) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetDaysOfWeek", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetDaysOfWeek", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetDeviceStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetDeviceStatus.go index d447f62666d..1b98e9ff717 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetDeviceStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetDeviceStatus.go @@ -162,7 +162,7 @@ func (e BACnetDeviceStatus) Serialize() ([]byte, error) { func (e BACnetDeviceStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetDeviceStatus", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetDeviceStatus", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorAlarmState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorAlarmState.go index 479d0ef2e4d..82c9eed85cd 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorAlarmState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorAlarmState.go @@ -180,7 +180,7 @@ func (e BACnetDoorAlarmState) Serialize() ([]byte, error) { func (e BACnetDoorAlarmState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetDoorAlarmState", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetDoorAlarmState", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorSecuredStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorSecuredStatus.go index edc39976503..66c178855ba 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorSecuredStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorSecuredStatus.go @@ -138,7 +138,7 @@ func (e BACnetDoorSecuredStatus) Serialize() ([]byte, error) { func (e BACnetDoorSecuredStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetDoorSecuredStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetDoorSecuredStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorStatus.go index 457a64475de..0fbcd30d0d7 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorStatus.go @@ -186,7 +186,7 @@ func (e BACnetDoorStatus) Serialize() ([]byte, error) { func (e BACnetDoorStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetDoorStatus", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetDoorStatus", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorValue.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorValue.go index 9bb500319ce..d59d03f5593 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorValue.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetDoorValue.go @@ -144,7 +144,7 @@ func (e BACnetDoorValue) Serialize() ([]byte, error) { func (e BACnetDoorValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetDoorValue", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetDoorValue", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetEngineeringUnits.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetEngineeringUnits.go index 51991d7bb1a..ea6e9acc8e1 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetEngineeringUnits.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetEngineeringUnits.go @@ -1632,7 +1632,7 @@ func (e BACnetEngineeringUnits) Serialize() ([]byte, error) { func (e BACnetEngineeringUnits) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("BACnetEngineeringUnits", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("BACnetEngineeringUnits", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorFault.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorFault.go index f7eca16f411..d4f047749ef 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorFault.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorFault.go @@ -180,7 +180,7 @@ func (e BACnetEscalatorFault) Serialize() ([]byte, error) { func (e BACnetEscalatorFault) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetEscalatorFault", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetEscalatorFault", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorMode.go index bfb168d33bc..ee7ace0e65c 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorMode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorMode.go @@ -162,7 +162,7 @@ func (e BACnetEscalatorMode) Serialize() ([]byte, error) { func (e BACnetEscalatorMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetEscalatorMode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetEscalatorMode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorOperationDirection.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorOperationDirection.go index 02cf8f55e07..694d10a1b86 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorOperationDirection.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetEscalatorOperationDirection.go @@ -162,7 +162,7 @@ func (e BACnetEscalatorOperationDirection) Serialize() ([]byte, error) { func (e BACnetEscalatorOperationDirection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetEscalatorOperationDirection", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetEscalatorOperationDirection", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetEventState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetEventState.go index ffbf8c831e1..f7fc65fc7cd 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetEventState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetEventState.go @@ -162,7 +162,7 @@ func (e BACnetEventState) Serialize() ([]byte, error) { func (e BACnetEventState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetEventState", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetEventState", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetEventTransitionBits.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetEventTransitionBits.go index ec7850c24e8..ce828411dc1 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetEventTransitionBits.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetEventTransitionBits.go @@ -138,7 +138,7 @@ func (e BACnetEventTransitionBits) Serialize() ([]byte, error) { func (e BACnetEventTransitionBits) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetEventTransitionBits", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetEventTransitionBits", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetEventType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetEventType.go index 05d91c630bc..147b40346fc 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetEventType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetEventType.go @@ -246,7 +246,7 @@ func (e BACnetEventType) Serialize() ([]byte, error) { func (e BACnetEventType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetEventType", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetEventType", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetFaultType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetFaultType.go index 81ee41fb342..5248bad7d92 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetFaultType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetFaultType.go @@ -168,7 +168,7 @@ func (e BACnetFaultType) Serialize() ([]byte, error) { func (e BACnetFaultType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetFaultType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetFaultType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetFileAccessMethod.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetFileAccessMethod.go index 427f5652dea..8bbc16cc49e 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetFileAccessMethod.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetFileAccessMethod.go @@ -132,7 +132,7 @@ func (e BACnetFileAccessMethod) Serialize() ([]byte, error) { func (e BACnetFileAccessMethod) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetFileAccessMethod", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetFileAccessMethod", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetIPMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetIPMode.go index 7138bc2d90f..aa4d99264f1 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetIPMode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetIPMode.go @@ -138,7 +138,7 @@ func (e BACnetIPMode) Serialize() ([]byte, error) { func (e BACnetIPMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetIPMode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetIPMode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyMode.go index 80272f0dccc..1ff7685e649 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyMode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyMode.go @@ -216,7 +216,7 @@ func (e BACnetLifeSafetyMode) Serialize() ([]byte, error) { func (e BACnetLifeSafetyMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLifeSafetyMode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLifeSafetyMode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyOperation.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyOperation.go index c5be9ede23d..3fd62cd3510 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyOperation.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyOperation.go @@ -186,7 +186,7 @@ func (e BACnetLifeSafetyOperation) Serialize() ([]byte, error) { func (e BACnetLifeSafetyOperation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLifeSafetyOperation", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLifeSafetyOperation", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyState.go index a52f66d6b3e..d03253f52c8 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLifeSafetyState.go @@ -270,7 +270,7 @@ func (e BACnetLifeSafetyState) Serialize() ([]byte, error) { func (e BACnetLifeSafetyState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLifeSafetyState", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLifeSafetyState", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDirection.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDirection.go index a2f6271d7d2..f54867cbbfc 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDirection.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDirection.go @@ -162,7 +162,7 @@ func (e BACnetLiftCarDirection) Serialize() ([]byte, error) { func (e BACnetLiftCarDirection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLiftCarDirection", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLiftCarDirection", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDoorCommand.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDoorCommand.go index 3016e54c044..c58c9779dc7 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDoorCommand.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDoorCommand.go @@ -138,7 +138,7 @@ func (e BACnetLiftCarDoorCommand) Serialize() ([]byte, error) { func (e BACnetLiftCarDoorCommand) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLiftCarDoorCommand", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLiftCarDoorCommand", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDriveStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDriveStatus.go index 1afc21f8031..4226c798c73 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDriveStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarDriveStatus.go @@ -186,7 +186,7 @@ func (e BACnetLiftCarDriveStatus) Serialize() ([]byte, error) { func (e BACnetLiftCarDriveStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLiftCarDriveStatus", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLiftCarDriveStatus", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarMode.go index b1733293288..f91692f8112 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarMode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftCarMode.go @@ -210,7 +210,7 @@ func (e BACnetLiftCarMode) Serialize() ([]byte, error) { func (e BACnetLiftCarMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLiftCarMode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLiftCarMode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftFault.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftFault.go index c33cbc3a97a..df69fb07201 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftFault.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftFault.go @@ -228,7 +228,7 @@ func (e BACnetLiftFault) Serialize() ([]byte, error) { func (e BACnetLiftFault) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLiftFault", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLiftFault", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftGroupMode.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftGroupMode.go index 5aa7e3f8db1..61dde406f9e 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftGroupMode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLiftGroupMode.go @@ -162,7 +162,7 @@ func (e BACnetLiftGroupMode) Serialize() ([]byte, error) { func (e BACnetLiftGroupMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLiftGroupMode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLiftGroupMode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingInProgress.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingInProgress.go index a1f2047fc48..81ae04c4412 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingInProgress.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingInProgress.go @@ -150,7 +150,7 @@ func (e BACnetLightingInProgress) Serialize() ([]byte, error) { func (e BACnetLightingInProgress) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLightingInProgress", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLightingInProgress", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingOperation.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingOperation.go index 15e00708e0f..aac3043d576 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingOperation.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingOperation.go @@ -192,7 +192,7 @@ func (e BACnetLightingOperation) Serialize() ([]byte, error) { func (e BACnetLightingOperation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetLightingOperation", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetLightingOperation", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingTransition.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingTransition.go index 6bf102e94c6..2198cf6fdce 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingTransition.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLightingTransition.go @@ -144,7 +144,7 @@ func (e BACnetLightingTransition) Serialize() ([]byte, error) { func (e BACnetLightingTransition) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLightingTransition", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLightingTransition", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLimitEnable.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLimitEnable.go index 109b866c15d..d9436b2a51b 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLimitEnable.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLimitEnable.go @@ -132,7 +132,7 @@ func (e BACnetLimitEnable) Serialize() ([]byte, error) { func (e BACnetLimitEnable) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLimitEnable", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLimitEnable", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLockStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLockStatus.go index e1398bfd2bd..03b5fb7af80 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLockStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLockStatus.go @@ -150,7 +150,7 @@ func (e BACnetLockStatus) Serialize() ([]byte, error) { func (e BACnetLockStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLockStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLockStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLogStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLogStatus.go index a7fb3a0edb1..c2b78ed0477 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLogStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLogStatus.go @@ -138,7 +138,7 @@ func (e BACnetLogStatus) Serialize() ([]byte, error) { func (e BACnetLogStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLogStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLogStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetLoggingType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetLoggingType.go index 64d2b637347..fd083eb0e4c 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetLoggingType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetLoggingType.go @@ -144,7 +144,7 @@ func (e BACnetLoggingType) Serialize() ([]byte, error) { func (e BACnetLoggingType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetLoggingType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetLoggingType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetMaintenance.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetMaintenance.go index 6637d0385d9..a3c2381d250 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetMaintenance.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetMaintenance.go @@ -150,7 +150,7 @@ func (e BACnetMaintenance) Serialize() ([]byte, error) { func (e BACnetMaintenance) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetMaintenance", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetMaintenance", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkNumberQuality.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkNumberQuality.go index da315e04b7c..ff5345ce8d8 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkNumberQuality.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkNumberQuality.go @@ -144,7 +144,7 @@ func (e BACnetNetworkNumberQuality) Serialize() ([]byte, error) { func (e BACnetNetworkNumberQuality) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetNetworkNumberQuality", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetNetworkNumberQuality", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkPortCommand.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkPortCommand.go index 7b50788de45..3d81533d0b9 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkPortCommand.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkPortCommand.go @@ -174,7 +174,7 @@ func (e BACnetNetworkPortCommand) Serialize() ([]byte, error) { func (e BACnetNetworkPortCommand) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetNetworkPortCommand", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetNetworkPortCommand", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkType.go index 58193344add..bc92adc7276 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetNetworkType.go @@ -192,7 +192,7 @@ func (e BACnetNetworkType) Serialize() ([]byte, error) { func (e BACnetNetworkType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetNetworkType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetNetworkType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetNodeType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetNodeType.go index edca9bdbaa4..e0d44d48d0b 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetNodeType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetNodeType.go @@ -252,7 +252,7 @@ func (e BACnetNodeType) Serialize() ([]byte, error) { func (e BACnetNodeType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetNodeType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetNodeType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetNotifyType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetNotifyType.go index c5b8cd6fd3f..b67f59991ac 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetNotifyType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetNotifyType.go @@ -138,7 +138,7 @@ func (e BACnetNotifyType) Serialize() ([]byte, error) { func (e BACnetNotifyType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetNotifyType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetNotifyType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectType.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectType.go index 9bca3c3f516..b7ba1674548 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectType.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectType.go @@ -486,7 +486,7 @@ func (e BACnetObjectType) Serialize() ([]byte, error) { func (e BACnetObjectType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetObjectType", 10, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetObjectType", 10, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectTypesSupported.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectTypesSupported.go index 854f39889ca..e54c8063e69 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectTypesSupported.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetObjectTypesSupported.go @@ -480,7 +480,7 @@ func (e BACnetObjectTypesSupported) Serialize() ([]byte, error) { func (e BACnetObjectTypesSupported) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetObjectTypesSupported", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetObjectTypesSupported", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetPolarity.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetPolarity.go index 6ebff0128f4..ac3111a9233 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetPolarity.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetPolarity.go @@ -132,7 +132,7 @@ func (e BACnetPolarity) Serialize() ([]byte, error) { func (e BACnetPolarity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetPolarity", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetPolarity", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramError.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramError.go index effbb3afe4e..1810157c258 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramError.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramError.go @@ -156,7 +156,7 @@ func (e BACnetProgramError) Serialize() ([]byte, error) { func (e BACnetProgramError) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetProgramError", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetProgramError", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramRequest.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramRequest.go index 8524a621134..6c67c74f062 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramRequest.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramRequest.go @@ -156,7 +156,7 @@ func (e BACnetProgramRequest) Serialize() ([]byte, error) { func (e BACnetProgramRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetProgramRequest", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetProgramRequest", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramState.go index fc879ae18ba..81f335c3f71 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetProgramState.go @@ -156,7 +156,7 @@ func (e BACnetProgramState) Serialize() ([]byte, error) { func (e BACnetProgramState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetProgramState", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetProgramState", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetPropertyIdentifier.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetPropertyIdentifier.go index a0076f006d6..dca8bb35931 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetPropertyIdentifier.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetPropertyIdentifier.go @@ -2868,7 +2868,7 @@ func (e BACnetPropertyIdentifier) Serialize() ([]byte, error) { func (e BACnetPropertyIdentifier) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("BACnetPropertyIdentifier", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("BACnetPropertyIdentifier", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetProtocolLevel.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetProtocolLevel.go index b4451505480..6e72be6ed50 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetProtocolLevel.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetProtocolLevel.go @@ -144,7 +144,7 @@ func (e BACnetProtocolLevel) Serialize() ([]byte, error) { func (e BACnetProtocolLevel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetProtocolLevel", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetProtocolLevel", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetRejectReason.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetRejectReason.go index 1a3908d3670..39528bf57ad 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetRejectReason.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetRejectReason.go @@ -186,7 +186,7 @@ func (e BACnetRejectReason) Serialize() ([]byte, error) { func (e BACnetRejectReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetRejectReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetRejectReason", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetRelationship.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetRelationship.go index 0a0c9210629..f7f0b9c3a3f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetRelationship.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetRelationship.go @@ -306,7 +306,7 @@ func (e BACnetRelationship) Serialize() ([]byte, error) { func (e BACnetRelationship) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetRelationship", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetRelationship", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetReliability.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetReliability.go index 14143d84cef..d5de34e5463 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetReliability.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetReliability.go @@ -270,7 +270,7 @@ func (e BACnetReliability) Serialize() ([]byte, error) { func (e BACnetReliability) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetReliability", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetReliability", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetRestartReason.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetRestartReason.go index 93b08f65e8a..a3086aec7dd 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetRestartReason.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetRestartReason.go @@ -180,7 +180,7 @@ func (e BACnetRestartReason) Serialize() ([]byte, error) { func (e BACnetRestartReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetRestartReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetRestartReason", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetResultFlags.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetResultFlags.go index 33e9506a271..2dac926e9fc 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetResultFlags.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetResultFlags.go @@ -138,7 +138,7 @@ func (e BACnetResultFlags) Serialize() ([]byte, error) { func (e BACnetResultFlags) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetResultFlags", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetResultFlags", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetRouterEntryStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetRouterEntryStatus.go index 33eeddd3dfb..cb725b3c962 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetRouterEntryStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetRouterEntryStatus.go @@ -138,7 +138,7 @@ func (e BACnetRouterEntryStatus) Serialize() ([]byte, error) { func (e BACnetRouterEntryStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetRouterEntryStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetRouterEntryStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityLevel.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityLevel.go index b1775dee428..d4cd18fc34d 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityLevel.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityLevel.go @@ -156,7 +156,7 @@ func (e BACnetSecurityLevel) Serialize() ([]byte, error) { func (e BACnetSecurityLevel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetSecurityLevel", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetSecurityLevel", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityPolicy.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityPolicy.go index 363bff7f14d..1a9becdd51e 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityPolicy.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetSecurityPolicy.go @@ -144,7 +144,7 @@ func (e BACnetSecurityPolicy) Serialize() ([]byte, error) { func (e BACnetSecurityPolicy) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetSecurityPolicy", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetSecurityPolicy", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetSegmentation.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetSegmentation.go index 04624e2d42b..f555d978fef 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetSegmentation.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetSegmentation.go @@ -144,7 +144,7 @@ func (e BACnetSegmentation) Serialize() ([]byte, error) { func (e BACnetSegmentation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetSegmentation", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetSegmentation", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetServicesSupported.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetServicesSupported.go index ac6f7d312f3..7cc13b888d6 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetServicesSupported.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetServicesSupported.go @@ -366,7 +366,7 @@ func (e BACnetServicesSupported) Serialize() ([]byte, error) { func (e BACnetServicesSupported) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetServicesSupported", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetServicesSupported", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetShedState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetShedState.go index c89e5e9804f..e3c86d39231 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetShedState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetShedState.go @@ -144,7 +144,7 @@ func (e BACnetShedState) Serialize() ([]byte, error) { func (e BACnetShedState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetShedState", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetShedState", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetSilencedState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetSilencedState.go index 6e01652dd28..d9de2d42041 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetSilencedState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetSilencedState.go @@ -150,7 +150,7 @@ func (e BACnetSilencedState) Serialize() ([]byte, error) { func (e BACnetSilencedState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetSilencedState", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetSilencedState", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetStatusFlags.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetStatusFlags.go index 3b97cfe4c5b..bc56bffe8eb 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetStatusFlags.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetStatusFlags.go @@ -144,7 +144,7 @@ func (e BACnetStatusFlags) Serialize() ([]byte, error) { func (e BACnetStatusFlags) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetStatusFlags", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetStatusFlags", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagHeader.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagHeader.go index 1c9e93202cc..eac9a202787 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagHeader.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagHeader.go @@ -414,7 +414,7 @@ func (m *_BACnetTagHeader) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (tagNumber) tagNumber := uint8(m.GetTagNumber()) - _tagNumberErr := writeBuffer.WriteUint8("tagNumber", 4, (tagNumber)) + _tagNumberErr := writeBuffer.WriteUint8("tagNumber", 4, uint8((tagNumber))) if _tagNumberErr != nil { return errors.Wrap(_tagNumberErr, "Error serializing 'tagNumber' field") } @@ -433,7 +433,7 @@ func (m *_BACnetTagHeader) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (lengthValueType) lengthValueType := uint8(m.GetLengthValueType()) - _lengthValueTypeErr := writeBuffer.WriteUint8("lengthValueType", 3, (lengthValueType)) + _lengthValueTypeErr := writeBuffer.WriteUint8("lengthValueType", 3, uint8((lengthValueType))) if _lengthValueTypeErr != nil { return errors.Wrap(_lengthValueTypeErr, "Error serializing 'lengthValueType' field") } @@ -442,7 +442,7 @@ func (m *_BACnetTagHeader) SerializeWithWriteBuffer(ctx context.Context, writeBu var extTagNumber *uint8 = nil if m.GetExtTagNumber() != nil { extTagNumber = m.GetExtTagNumber() - _extTagNumberErr := writeBuffer.WriteUint8("extTagNumber", 8, *(extTagNumber)) + _extTagNumberErr := writeBuffer.WriteUint8("extTagNumber", 8, uint8(*(extTagNumber))) if _extTagNumberErr != nil { return errors.Wrap(_extTagNumberErr, "Error serializing 'extTagNumber' field") } @@ -476,7 +476,7 @@ func (m *_BACnetTagHeader) SerializeWithWriteBuffer(ctx context.Context, writeBu var extLength *uint8 = nil if m.GetExtLength() != nil { extLength = m.GetExtLength() - _extLengthErr := writeBuffer.WriteUint8("extLength", 8, *(extLength)) + _extLengthErr := writeBuffer.WriteUint8("extLength", 8, uint8(*(extLength))) if _extLengthErr != nil { return errors.Wrap(_extLengthErr, "Error serializing 'extLength' field") } @@ -486,7 +486,7 @@ func (m *_BACnetTagHeader) SerializeWithWriteBuffer(ctx context.Context, writeBu var extExtLength *uint16 = nil if m.GetExtExtLength() != nil { extExtLength = m.GetExtExtLength() - _extExtLengthErr := writeBuffer.WriteUint16("extExtLength", 16, *(extExtLength)) + _extExtLengthErr := writeBuffer.WriteUint16("extExtLength", 16, uint16(*(extExtLength))) if _extExtLengthErr != nil { return errors.Wrap(_extExtLengthErr, "Error serializing 'extExtLength' field") } @@ -496,7 +496,7 @@ func (m *_BACnetTagHeader) SerializeWithWriteBuffer(ctx context.Context, writeBu var extExtExtLength *uint32 = nil if m.GetExtExtExtLength() != nil { extExtExtLength = m.GetExtExtExtLength() - _extExtExtLengthErr := writeBuffer.WriteUint32("extExtExtLength", 32, *(extExtExtLength)) + _extExtExtLengthErr := writeBuffer.WriteUint32("extExtExtLength", 32, uint32(*(extExtExtLength))) if _extExtExtLengthErr != nil { return errors.Wrap(_extExtExtLengthErr, "Error serializing 'extExtExtLength' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadBitString.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadBitString.go index 5ea4b0616dd..58eb66a892b 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadBitString.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadBitString.go @@ -232,7 +232,7 @@ func (m *_BACnetTagPayloadBitString) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (unusedBits) unusedBits := uint8(m.GetUnusedBits()) - _unusedBitsErr := writeBuffer.WriteUint8("unusedBits", 8, (unusedBits)) + _unusedBitsErr := writeBuffer.WriteUint8("unusedBits", 8, uint8((unusedBits))) if _unusedBitsErr != nil { return errors.Wrap(_unusedBitsErr, "Error serializing 'unusedBits' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadDate.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadDate.go index 4163be66c0d..c75043ff01f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadDate.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadDate.go @@ -382,7 +382,7 @@ func (m *_BACnetTagPayloadDate) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (yearMinus1900) yearMinus1900 := uint8(m.GetYearMinus1900()) - _yearMinus1900Err := writeBuffer.WriteUint8("yearMinus1900", 8, (yearMinus1900)) + _yearMinus1900Err := writeBuffer.WriteUint8("yearMinus1900", 8, uint8((yearMinus1900))) if _yearMinus1900Err != nil { return errors.Wrap(_yearMinus1900Err, "Error serializing 'yearMinus1900' field") } @@ -401,7 +401,7 @@ func (m *_BACnetTagPayloadDate) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (month) month := uint8(m.GetMonth()) - _monthErr := writeBuffer.WriteUint8("month", 8, (month)) + _monthErr := writeBuffer.WriteUint8("month", 8, uint8((month))) if _monthErr != nil { return errors.Wrap(_monthErr, "Error serializing 'month' field") } @@ -426,7 +426,7 @@ func (m *_BACnetTagPayloadDate) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (dayOfMonth) dayOfMonth := uint8(m.GetDayOfMonth()) - _dayOfMonthErr := writeBuffer.WriteUint8("dayOfMonth", 8, (dayOfMonth)) + _dayOfMonthErr := writeBuffer.WriteUint8("dayOfMonth", 8, uint8((dayOfMonth))) if _dayOfMonthErr != nil { return errors.Wrap(_dayOfMonthErr, "Error serializing 'dayOfMonth' field") } @@ -457,7 +457,7 @@ func (m *_BACnetTagPayloadDate) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (dayOfWeek) dayOfWeek := uint8(m.GetDayOfWeek()) - _dayOfWeekErr := writeBuffer.WriteUint8("dayOfWeek", 8, (dayOfWeek)) + _dayOfWeekErr := writeBuffer.WriteUint8("dayOfWeek", 8, uint8((dayOfWeek))) if _dayOfWeekErr != nil { return errors.Wrap(_dayOfWeekErr, "Error serializing 'dayOfWeek' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadObjectIdentifier.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadObjectIdentifier.go index 9a7da05528e..df32bf4f813 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadObjectIdentifier.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadObjectIdentifier.go @@ -232,7 +232,7 @@ func (m *_BACnetTagPayloadObjectIdentifier) SerializeWithWriteBuffer(ctx context // Simple Field (instanceNumber) instanceNumber := uint32(m.GetInstanceNumber()) - _instanceNumberErr := writeBuffer.WriteUint32("instanceNumber", 22, (instanceNumber)) + _instanceNumberErr := writeBuffer.WriteUint32("instanceNumber", 22, uint32((instanceNumber))) if _instanceNumberErr != nil { return errors.Wrap(_instanceNumberErr, "Error serializing 'instanceNumber' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadSignedInteger.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadSignedInteger.go index b28342aadf1..c2a3617937f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadSignedInteger.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadSignedInteger.go @@ -643,7 +643,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt8 *int8 = nil if m.GetValueInt8() != nil { valueInt8 = m.GetValueInt8() - _valueInt8Err := writeBuffer.WriteInt8("valueInt8", 8, *(valueInt8)) + _valueInt8Err := writeBuffer.WriteInt8("valueInt8", 8, int8(*(valueInt8))) if _valueInt8Err != nil { return errors.Wrap(_valueInt8Err, "Error serializing 'valueInt8' field") } @@ -659,7 +659,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt16 *int16 = nil if m.GetValueInt16() != nil { valueInt16 = m.GetValueInt16() - _valueInt16Err := writeBuffer.WriteInt16("valueInt16", 16, *(valueInt16)) + _valueInt16Err := writeBuffer.WriteInt16("valueInt16", 16, int16(*(valueInt16))) if _valueInt16Err != nil { return errors.Wrap(_valueInt16Err, "Error serializing 'valueInt16' field") } @@ -675,7 +675,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt24 *int32 = nil if m.GetValueInt24() != nil { valueInt24 = m.GetValueInt24() - _valueInt24Err := writeBuffer.WriteInt32("valueInt24", 24, *(valueInt24)) + _valueInt24Err := writeBuffer.WriteInt32("valueInt24", 24, int32(*(valueInt24))) if _valueInt24Err != nil { return errors.Wrap(_valueInt24Err, "Error serializing 'valueInt24' field") } @@ -691,7 +691,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt32 *int32 = nil if m.GetValueInt32() != nil { valueInt32 = m.GetValueInt32() - _valueInt32Err := writeBuffer.WriteInt32("valueInt32", 32, *(valueInt32)) + _valueInt32Err := writeBuffer.WriteInt32("valueInt32", 32, int32(*(valueInt32))) if _valueInt32Err != nil { return errors.Wrap(_valueInt32Err, "Error serializing 'valueInt32' field") } @@ -707,7 +707,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt40 *int64 = nil if m.GetValueInt40() != nil { valueInt40 = m.GetValueInt40() - _valueInt40Err := writeBuffer.WriteInt64("valueInt40", 40, *(valueInt40)) + _valueInt40Err := writeBuffer.WriteInt64("valueInt40", 40, int64(*(valueInt40))) if _valueInt40Err != nil { return errors.Wrap(_valueInt40Err, "Error serializing 'valueInt40' field") } @@ -723,7 +723,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt48 *int64 = nil if m.GetValueInt48() != nil { valueInt48 = m.GetValueInt48() - _valueInt48Err := writeBuffer.WriteInt64("valueInt48", 48, *(valueInt48)) + _valueInt48Err := writeBuffer.WriteInt64("valueInt48", 48, int64(*(valueInt48))) if _valueInt48Err != nil { return errors.Wrap(_valueInt48Err, "Error serializing 'valueInt48' field") } @@ -739,7 +739,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt56 *int64 = nil if m.GetValueInt56() != nil { valueInt56 = m.GetValueInt56() - _valueInt56Err := writeBuffer.WriteInt64("valueInt56", 56, *(valueInt56)) + _valueInt56Err := writeBuffer.WriteInt64("valueInt56", 56, int64(*(valueInt56))) if _valueInt56Err != nil { return errors.Wrap(_valueInt56Err, "Error serializing 'valueInt56' field") } @@ -755,7 +755,7 @@ func (m *_BACnetTagPayloadSignedInteger) SerializeWithWriteBuffer(ctx context.Co var valueInt64 *int64 = nil if m.GetValueInt64() != nil { valueInt64 = m.GetValueInt64() - _valueInt64Err := writeBuffer.WriteInt64("valueInt64", 64, *(valueInt64)) + _valueInt64Err := writeBuffer.WriteInt64("valueInt64", 64, int64(*(valueInt64))) if _valueInt64Err != nil { return errors.Wrap(_valueInt64Err, "Error serializing 'valueInt64' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadTime.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadTime.go index dcd7a2d0aed..ab1bce2779f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadTime.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadTime.go @@ -292,7 +292,7 @@ func (m *_BACnetTagPayloadTime) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (hour) hour := uint8(m.GetHour()) - _hourErr := writeBuffer.WriteUint8("hour", 8, (hour)) + _hourErr := writeBuffer.WriteUint8("hour", 8, uint8((hour))) if _hourErr != nil { return errors.Wrap(_hourErr, "Error serializing 'hour' field") } @@ -305,7 +305,7 @@ func (m *_BACnetTagPayloadTime) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (minute) minute := uint8(m.GetMinute()) - _minuteErr := writeBuffer.WriteUint8("minute", 8, (minute)) + _minuteErr := writeBuffer.WriteUint8("minute", 8, uint8((minute))) if _minuteErr != nil { return errors.Wrap(_minuteErr, "Error serializing 'minute' field") } @@ -318,7 +318,7 @@ func (m *_BACnetTagPayloadTime) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (second) second := uint8(m.GetSecond()) - _secondErr := writeBuffer.WriteUint8("second", 8, (second)) + _secondErr := writeBuffer.WriteUint8("second", 8, uint8((second))) if _secondErr != nil { return errors.Wrap(_secondErr, "Error serializing 'second' field") } @@ -331,7 +331,7 @@ func (m *_BACnetTagPayloadTime) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (fractional) fractional := uint8(m.GetFractional()) - _fractionalErr := writeBuffer.WriteUint8("fractional", 8, (fractional)) + _fractionalErr := writeBuffer.WriteUint8("fractional", 8, uint8((fractional))) if _fractionalErr != nil { return errors.Wrap(_fractionalErr, "Error serializing 'fractional' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadUnsignedInteger.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadUnsignedInteger.go index 4c54960c113..186da93c8db 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadUnsignedInteger.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTagPayloadUnsignedInteger.go @@ -643,7 +643,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint8 *uint8 = nil if m.GetValueUint8() != nil { valueUint8 = m.GetValueUint8() - _valueUint8Err := writeBuffer.WriteUint8("valueUint8", 8, *(valueUint8)) + _valueUint8Err := writeBuffer.WriteUint8("valueUint8", 8, uint8(*(valueUint8))) if _valueUint8Err != nil { return errors.Wrap(_valueUint8Err, "Error serializing 'valueUint8' field") } @@ -659,7 +659,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint16 *uint16 = nil if m.GetValueUint16() != nil { valueUint16 = m.GetValueUint16() - _valueUint16Err := writeBuffer.WriteUint16("valueUint16", 16, *(valueUint16)) + _valueUint16Err := writeBuffer.WriteUint16("valueUint16", 16, uint16(*(valueUint16))) if _valueUint16Err != nil { return errors.Wrap(_valueUint16Err, "Error serializing 'valueUint16' field") } @@ -675,7 +675,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint24 *uint32 = nil if m.GetValueUint24() != nil { valueUint24 = m.GetValueUint24() - _valueUint24Err := writeBuffer.WriteUint32("valueUint24", 24, *(valueUint24)) + _valueUint24Err := writeBuffer.WriteUint32("valueUint24", 24, uint32(*(valueUint24))) if _valueUint24Err != nil { return errors.Wrap(_valueUint24Err, "Error serializing 'valueUint24' field") } @@ -691,7 +691,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint32 *uint32 = nil if m.GetValueUint32() != nil { valueUint32 = m.GetValueUint32() - _valueUint32Err := writeBuffer.WriteUint32("valueUint32", 32, *(valueUint32)) + _valueUint32Err := writeBuffer.WriteUint32("valueUint32", 32, uint32(*(valueUint32))) if _valueUint32Err != nil { return errors.Wrap(_valueUint32Err, "Error serializing 'valueUint32' field") } @@ -707,7 +707,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint40 *uint64 = nil if m.GetValueUint40() != nil { valueUint40 = m.GetValueUint40() - _valueUint40Err := writeBuffer.WriteUint64("valueUint40", 40, *(valueUint40)) + _valueUint40Err := writeBuffer.WriteUint64("valueUint40", 40, uint64(*(valueUint40))) if _valueUint40Err != nil { return errors.Wrap(_valueUint40Err, "Error serializing 'valueUint40' field") } @@ -723,7 +723,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint48 *uint64 = nil if m.GetValueUint48() != nil { valueUint48 = m.GetValueUint48() - _valueUint48Err := writeBuffer.WriteUint64("valueUint48", 48, *(valueUint48)) + _valueUint48Err := writeBuffer.WriteUint64("valueUint48", 48, uint64(*(valueUint48))) if _valueUint48Err != nil { return errors.Wrap(_valueUint48Err, "Error serializing 'valueUint48' field") } @@ -739,7 +739,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint56 *uint64 = nil if m.GetValueUint56() != nil { valueUint56 = m.GetValueUint56() - _valueUint56Err := writeBuffer.WriteUint64("valueUint56", 56, *(valueUint56)) + _valueUint56Err := writeBuffer.WriteUint64("valueUint56", 56, uint64(*(valueUint56))) if _valueUint56Err != nil { return errors.Wrap(_valueUint56Err, "Error serializing 'valueUint56' field") } @@ -755,7 +755,7 @@ func (m *_BACnetTagPayloadUnsignedInteger) SerializeWithWriteBuffer(ctx context. var valueUint64 *uint64 = nil if m.GetValueUint64() != nil { valueUint64 = m.GetValueUint64() - _valueUint64Err := writeBuffer.WriteUint64("valueUint64", 64, *(valueUint64)) + _valueUint64Err := writeBuffer.WriteUint64("valueUint64", 64, uint64(*(valueUint64))) if _valueUint64Err != nil { return errors.Wrap(_valueUint64Err, "Error serializing 'valueUint64' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerState.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerState.go index 64f17374ea1..1ec2942ed4e 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerState.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerState.go @@ -138,7 +138,7 @@ func (e BACnetTimerState) Serialize() ([]byte, error) { func (e BACnetTimerState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetTimerState", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetTimerState", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerTransition.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerTransition.go index 4b1aa6f8756..fdcf3058140 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerTransition.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetTimerTransition.go @@ -168,7 +168,7 @@ func (e BACnetTimerTransition) Serialize() ([]byte, error) { func (e BACnetTimerTransition) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetTimerTransition", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetTimerTransition", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetUnconfirmedServiceChoice.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetUnconfirmedServiceChoice.go index b19780ee4c1..3acbb59e7ba 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetUnconfirmedServiceChoice.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetUnconfirmedServiceChoice.go @@ -192,7 +192,7 @@ func (e BACnetUnconfirmedServiceChoice) Serialize() ([]byte, error) { func (e BACnetUnconfirmedServiceChoice) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetUnconfirmedServiceChoice", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetUnconfirmedServiceChoice", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetVTClass.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetVTClass.go index adbda3d6c33..c156abfa70e 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetVTClass.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetVTClass.go @@ -168,7 +168,7 @@ func (e BACnetVTClass) Serialize() ([]byte, error) { func (e BACnetVTClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetVTClass", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetVTClass", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go index 41a9938da1d..fd8fa44de77 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go @@ -1488,6 +1488,9 @@ const ( BACnetVendorId_RYOBI_LIMITED BACnetVendorId = 1451 BACnetVendorId_EKKO_SENSE_LTD BACnetVendorId = 1452 BACnetVendorId_CLIMA_COOL BACnetVendorId = 1453 + BACnetVendorId_GRID_CONNECT_INC BACnetVendorId = 1454 + BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD BACnetVendorId = 1455 + BACnetVendorId_CONTROL_TECLLC BACnetVendorId = 1456 BACnetVendorId_UNKNOWN_VENDOR BACnetVendorId = 0xFFFF ) @@ -2941,6 +2944,9 @@ func init() { BACnetVendorId_RYOBI_LIMITED, BACnetVendorId_EKKO_SENSE_LTD, BACnetVendorId_CLIMA_COOL, + BACnetVendorId_GRID_CONNECT_INC, + BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD, + BACnetVendorId_CONTROL_TECLLC, BACnetVendorId_UNKNOWN_VENDOR, } } @@ -4967,6 +4973,18 @@ func (e BACnetVendorId) VendorId() uint16 { { /* '1453' */ return 1453 } + case 1454: + { /* '1454' */ + return 1454 + } + case 1455: + { /* '1455' */ + return 1455 + } + case 1456: + { /* '1456' */ + return 1456 + } case 146: { /* '146' */ return 146 @@ -10769,6 +10787,18 @@ func (e BACnetVendorId) VendorName() string { { /* '1453' */ return "ClimaCool" } + case 1454: + { /* '1454' */ + return "Grid Connect Inc." + } + case 1455: + { /* '1455' */ + return "Ziegler Instrumentation UK Ltd" + } + case 1456: + { /* '1456' */ + return "ControlTec, LLC" + } case 146: { /* '146' */ return "Sanyo Electric Co., Ltd." @@ -15560,6 +15590,12 @@ func BACnetVendorIdByValue(value uint16) (enum BACnetVendorId, ok bool) { return BACnetVendorId_EKKO_SENSE_LTD, true case 1453: return BACnetVendorId_CLIMA_COOL, true + case 1454: + return BACnetVendorId_GRID_CONNECT_INC, true + case 1455: + return BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD, true + case 1456: + return BACnetVendorId_CONTROL_TECLLC, true case 146: return BACnetVendorId_SANYO_ELECTRIC_CO_LTD, true case 147: @@ -18458,6 +18494,12 @@ func BACnetVendorIdByName(value string) (enum BACnetVendorId, ok bool) { return BACnetVendorId_EKKO_SENSE_LTD, true case "CLIMA_COOL": return BACnetVendorId_CLIMA_COOL, true + case "GRID_CONNECT_INC": + return BACnetVendorId_GRID_CONNECT_INC, true + case "ZIEGLER_INSTRUMENTATIONUK_LTD": + return BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD, true + case "CONTROL_TECLLC": + return BACnetVendorId_CONTROL_TECLLC, true case "SANYO_ELECTRIC_CO_LTD": return BACnetVendorId_SANYO_ELECTRIC_CO_LTD, true case "INTEGRATED_INFORMATION_SYSTEMS_INC": @@ -20401,7 +20443,7 @@ func (e BACnetVendorId) Serialize() ([]byte, error) { func (e BACnetVendorId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BACnetVendorId", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BACnetVendorId", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum @@ -21417,6 +21459,12 @@ func (e BACnetVendorId) PLC4XEnumName() string { return "EKKO_SENSE_LTD" case BACnetVendorId_CLIMA_COOL: return "CLIMA_COOL" + case BACnetVendorId_GRID_CONNECT_INC: + return "GRID_CONNECT_INC" + case BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD: + return "ZIEGLER_INSTRUMENTATIONUK_LTD" + case BACnetVendorId_CONTROL_TECLLC: + return "CONTROL_TECLLC" case BACnetVendorId_SANYO_ELECTRIC_CO_LTD: return "SANYO_ELECTRIC_CO_LTD" case BACnetVendorId_INTEGRATED_INFORMATION_SYSTEMS_INC: diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetWeekNDayTagged.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetWeekNDayTagged.go index 746394f71a8..26cf26f188b 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetWeekNDayTagged.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetWeekNDayTagged.go @@ -460,7 +460,7 @@ func (m *_BACnetWeekNDayTagged) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (month) month := uint8(m.GetMonth()) - _monthErr := writeBuffer.WriteUint8("month", 8, (month)) + _monthErr := writeBuffer.WriteUint8("month", 8, uint8((month))) if _monthErr != nil { return errors.Wrap(_monthErr, "Error serializing 'month' field") } @@ -485,7 +485,7 @@ func (m *_BACnetWeekNDayTagged) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (weekOfMonth) weekOfMonth := uint8(m.GetWeekOfMonth()) - _weekOfMonthErr := writeBuffer.WriteUint8("weekOfMonth", 8, (weekOfMonth)) + _weekOfMonthErr := writeBuffer.WriteUint8("weekOfMonth", 8, uint8((weekOfMonth))) if _weekOfMonthErr != nil { return errors.Wrap(_weekOfMonthErr, "Error serializing 'weekOfMonth' field") } @@ -552,7 +552,7 @@ func (m *_BACnetWeekNDayTagged) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (dayOfWeek) dayOfWeek := uint8(m.GetDayOfWeek()) - _dayOfWeekErr := writeBuffer.WriteUint8("dayOfWeek", 8, (dayOfWeek)) + _dayOfWeekErr := writeBuffer.WriteUint8("dayOfWeek", 8, uint8((dayOfWeek))) if _dayOfWeekErr != nil { return errors.Wrap(_dayOfWeekErr, "Error serializing 'dayOfWeek' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetWriteStatus.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetWriteStatus.go index 820059f2c36..9f7619c689d 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetWriteStatus.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetWriteStatus.go @@ -144,7 +144,7 @@ func (e BACnetWriteStatus) Serialize() ([]byte, error) { func (e BACnetWriteStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BACnetWriteStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BACnetWriteStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BVLC.go b/plc4go/protocols/bacnetip/readwrite/model/BVLC.go index 1bf1e9080be..28cb47aeef8 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BVLC.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BVLC.go @@ -253,14 +253,14 @@ func (pm *_BVLC) SerializeParent(ctx context.Context, writeBuffer utils.WriteBuf } // Const Field (bacnetType) - _bacnetTypeErr := writeBuffer.WriteUint8("bacnetType", 8, 0x81) + _bacnetTypeErr := writeBuffer.WriteUint8("bacnetType", 8, uint8(0x81)) if _bacnetTypeErr != nil { return errors.Wrap(_bacnetTypeErr, "Error serializing 'bacnetType' field") } // Discriminator Field (bvlcFunction) (Used as input to a switch field) bvlcFunction := uint8(child.GetBvlcFunction()) - _bvlcFunctionErr := writeBuffer.WriteUint8("bvlcFunction", 8, (bvlcFunction)) + _bvlcFunctionErr := writeBuffer.WriteUint8("bvlcFunction", 8, uint8((bvlcFunction))) if _bvlcFunctionErr != nil { return errors.Wrap(_bvlcFunctionErr, "Error serializing 'bvlcFunction' field") @@ -268,7 +268,7 @@ func (pm *_BVLC) SerializeParent(ctx context.Context, writeBuffer utils.WriteBuf // Implicit Field (bvlcLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) bvlcLength := uint16(uint16(m.GetLengthInBytes(ctx))) - _bvlcLengthErr := writeBuffer.WriteUint16("bvlcLength", 16, (bvlcLength)) + _bvlcLengthErr := writeBuffer.WriteUint16("bvlcLength", 16, uint16((bvlcLength))) if _bvlcLengthErr != nil { return errors.Wrap(_bvlcLengthErr, "Error serializing 'bvlcLength' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BVLCBroadcastDistributionTableEntry.go b/plc4go/protocols/bacnetip/readwrite/model/BVLCBroadcastDistributionTableEntry.go index 699be43e3bd..bf884b31696 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BVLCBroadcastDistributionTableEntry.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BVLCBroadcastDistributionTableEntry.go @@ -232,7 +232,7 @@ func (m *_BVLCBroadcastDistributionTableEntry) SerializeWithWriteBuffer(ctx cont } for _curItem, _element := range m.GetIp() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'ip' field") } @@ -243,7 +243,7 @@ func (m *_BVLCBroadcastDistributionTableEntry) SerializeWithWriteBuffer(ctx cont // Simple Field (port) port := uint16(m.GetPort()) - _portErr := writeBuffer.WriteUint16("port", 16, (port)) + _portErr := writeBuffer.WriteUint16("port", 16, uint16((port))) if _portErr != nil { return errors.Wrap(_portErr, "Error serializing 'port' field") } @@ -254,7 +254,7 @@ func (m *_BVLCBroadcastDistributionTableEntry) SerializeWithWriteBuffer(ctx cont } for _curItem, _element := range m.GetBroadcastDistributionMap() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'broadcastDistributionMap' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go b/plc4go/protocols/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go index a21763939fd..4b57d675427 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BVLCDeleteForeignDeviceTableEntry.go @@ -225,7 +225,7 @@ func (m *_BVLCDeleteForeignDeviceTableEntry) SerializeWithWriteBuffer(ctx contex } for _curItem, _element := range m.GetIp() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'ip' field") } @@ -236,7 +236,7 @@ func (m *_BVLCDeleteForeignDeviceTableEntry) SerializeWithWriteBuffer(ctx contex // Simple Field (port) port := uint16(m.GetPort()) - _portErr := writeBuffer.WriteUint16("port", 16, (port)) + _portErr := writeBuffer.WriteUint16("port", 16, uint16((port))) if _portErr != nil { return errors.Wrap(_portErr, "Error serializing 'port' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BVLCForeignDeviceTableEntry.go b/plc4go/protocols/bacnetip/readwrite/model/BVLCForeignDeviceTableEntry.go index ef4889fb5d4..4628c8f27cb 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BVLCForeignDeviceTableEntry.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BVLCForeignDeviceTableEntry.go @@ -228,7 +228,7 @@ func (m *_BVLCForeignDeviceTableEntry) SerializeWithWriteBuffer(ctx context.Cont } for _curItem, _element := range m.GetIp() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'ip' field") } @@ -239,21 +239,21 @@ func (m *_BVLCForeignDeviceTableEntry) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (port) port := uint16(m.GetPort()) - _portErr := writeBuffer.WriteUint16("port", 16, (port)) + _portErr := writeBuffer.WriteUint16("port", 16, uint16((port))) if _portErr != nil { return errors.Wrap(_portErr, "Error serializing 'port' field") } // Simple Field (ttl) ttl := uint16(m.GetTtl()) - _ttlErr := writeBuffer.WriteUint16("ttl", 16, (ttl)) + _ttlErr := writeBuffer.WriteUint16("ttl", 16, uint16((ttl))) if _ttlErr != nil { return errors.Wrap(_ttlErr, "Error serializing 'ttl' field") } // Simple Field (secondRemainingBeforePurge) secondRemainingBeforePurge := uint16(m.GetSecondRemainingBeforePurge()) - _secondRemainingBeforePurgeErr := writeBuffer.WriteUint16("secondRemainingBeforePurge", 16, (secondRemainingBeforePurge)) + _secondRemainingBeforePurgeErr := writeBuffer.WriteUint16("secondRemainingBeforePurge", 16, uint16((secondRemainingBeforePurge))) if _secondRemainingBeforePurgeErr != nil { return errors.Wrap(_secondRemainingBeforePurgeErr, "Error serializing 'secondRemainingBeforePurge' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BVLCForwardedNPDU.go b/plc4go/protocols/bacnetip/readwrite/model/BVLCForwardedNPDU.go index f84ef804164..da5e7457d89 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BVLCForwardedNPDU.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BVLCForwardedNPDU.go @@ -253,7 +253,7 @@ func (m *_BVLCForwardedNPDU) SerializeWithWriteBuffer(ctx context.Context, write } for _curItem, _element := range m.GetIp() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'ip' field") } @@ -264,7 +264,7 @@ func (m *_BVLCForwardedNPDU) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (port) port := uint16(m.GetPort()) - _portErr := writeBuffer.WriteUint16("port", 16, (port)) + _portErr := writeBuffer.WriteUint16("port", 16, uint16((port))) if _portErr != nil { return errors.Wrap(_portErr, "Error serializing 'port' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go b/plc4go/protocols/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go index 1c9055ebd9f..0d5cf29f9e7 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BVLCRegisterForeignDevice.go @@ -180,7 +180,7 @@ func (m *_BVLCRegisterForeignDevice) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (ttl) ttl := uint16(m.GetTtl()) - _ttlErr := writeBuffer.WriteUint16("ttl", 16, (ttl)) + _ttlErr := writeBuffer.WriteUint16("ttl", 16, uint16((ttl))) if _ttlErr != nil { return errors.Wrap(_ttlErr, "Error serializing 'ttl' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/BVLCResultCode.go b/plc4go/protocols/bacnetip/readwrite/model/BVLCResultCode.go index 932c4dd91bb..371fb49763f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BVLCResultCode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BVLCResultCode.go @@ -162,7 +162,7 @@ func (e BVLCResultCode) Serialize() ([]byte, error) { func (e BVLCResultCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("BVLCResultCode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("BVLCResultCode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/BacnetConstants.go b/plc4go/protocols/bacnetip/readwrite/model/BacnetConstants.go index 7deb61a58fc..72c162f8fa7 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BacnetConstants.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BacnetConstants.go @@ -147,7 +147,7 @@ func (m *_BacnetConstants) SerializeWithWriteBuffer(ctx context.Context, writeBu } // Const Field (bacnetUdpDefaultPort) - _bacnetUdpDefaultPortErr := writeBuffer.WriteUint16("bacnetUdpDefaultPort", 16, 47808) + _bacnetUdpDefaultPortErr := writeBuffer.WriteUint16("bacnetUdpDefaultPort", 16, uint16(47808)) if _bacnetUdpDefaultPortErr != nil { return errors.Wrap(_bacnetUdpDefaultPortErr, "Error serializing 'bacnetUdpDefaultPort' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/ErrorClass.go b/plc4go/protocols/bacnetip/readwrite/model/ErrorClass.go index 4a11f83024b..2a83be76aaf 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/ErrorClass.go +++ b/plc4go/protocols/bacnetip/readwrite/model/ErrorClass.go @@ -174,7 +174,7 @@ func (e ErrorClass) Serialize() ([]byte, error) { func (e ErrorClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("ErrorClass", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("ErrorClass", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/ErrorCode.go b/plc4go/protocols/bacnetip/readwrite/model/ErrorCode.go index 046cec6dc29..a6be6e2603a 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/ErrorCode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/ErrorCode.go @@ -900,7 +900,7 @@ func (e ErrorCode) Serialize() ([]byte, error) { func (e ErrorCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("ErrorCode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("ErrorCode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/MaxApduLengthAccepted.go b/plc4go/protocols/bacnetip/readwrite/model/MaxApduLengthAccepted.go index 2c24a0b219a..88656db574c 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/MaxApduLengthAccepted.go +++ b/plc4go/protocols/bacnetip/readwrite/model/MaxApduLengthAccepted.go @@ -298,7 +298,7 @@ func (e MaxApduLengthAccepted) Serialize() ([]byte, error) { func (e MaxApduLengthAccepted) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MaxApduLengthAccepted", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MaxApduLengthAccepted", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/MaxSegmentsAccepted.go b/plc4go/protocols/bacnetip/readwrite/model/MaxSegmentsAccepted.go index 1a9278882d6..96e7ce8d6d6 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/MaxSegmentsAccepted.go +++ b/plc4go/protocols/bacnetip/readwrite/model/MaxSegmentsAccepted.go @@ -218,7 +218,7 @@ func (e MaxSegmentsAccepted) Serialize() ([]byte, error) { func (e MaxSegmentsAccepted) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MaxSegmentsAccepted", 3, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MaxSegmentsAccepted", 3, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLM.go b/plc4go/protocols/bacnetip/readwrite/model/NLM.go index 10d97aa0ef7..65866172787 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLM.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLM.go @@ -237,7 +237,7 @@ func (pm *_NLM) SerializeParent(ctx context.Context, writeBuffer utils.WriteBuff // Discriminator Field (messageType) (Used as input to a switch field) messageType := uint8(child.GetMessageType()) - _messageTypeErr := writeBuffer.WriteUint8("messageType", 8, (messageType)) + _messageTypeErr := writeBuffer.WriteUint8("messageType", 8, uint8((messageType))) if _messageTypeErr != nil { return errors.Wrap(_messageTypeErr, "Error serializing 'messageType' field") diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMChallengeRequest.go b/plc4go/protocols/bacnetip/readwrite/model/NLMChallengeRequest.go index cfdb6d8a5bb..f99d463055d 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMChallengeRequest.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMChallengeRequest.go @@ -226,14 +226,14 @@ func (m *_NLMChallengeRequest) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (originalMessageId) originalMessageId := uint32(m.GetOriginalMessageId()) - _originalMessageIdErr := writeBuffer.WriteUint32("originalMessageId", 32, (originalMessageId)) + _originalMessageIdErr := writeBuffer.WriteUint32("originalMessageId", 32, uint32((originalMessageId))) if _originalMessageIdErr != nil { return errors.Wrap(_originalMessageIdErr, "Error serializing 'originalMessageId' field") } // Simple Field (originalTimestamp) originalTimestamp := uint32(m.GetOriginalTimestamp()) - _originalTimestampErr := writeBuffer.WriteUint32("originalTimestamp", 32, (originalTimestamp)) + _originalTimestampErr := writeBuffer.WriteUint32("originalTimestamp", 32, uint32((originalTimestamp))) if _originalTimestampErr != nil { return errors.Wrap(_originalTimestampErr, "Error serializing 'originalTimestamp' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMDisconnectConnectionToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMDisconnectConnectionToNetwork.go index 8808f867ab8..6f5068caa30 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMDisconnectConnectionToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMDisconnectConnectionToNetwork.go @@ -181,7 +181,7 @@ func (m *_NLMDisconnectConnectionToNetwork) SerializeWithWriteBuffer(ctx context // Simple Field (destinationNetworkAddress) destinationNetworkAddress := uint16(m.GetDestinationNetworkAddress()) - _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, (destinationNetworkAddress)) + _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, uint16((destinationNetworkAddress))) if _destinationNetworkAddressErr != nil { return errors.Wrap(_destinationNetworkAddressErr, "Error serializing 'destinationNetworkAddress' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMEstablishConnectionToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMEstablishConnectionToNetwork.go index 05fdf7a8cab..fb145a283c3 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMEstablishConnectionToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMEstablishConnectionToNetwork.go @@ -200,14 +200,14 @@ func (m *_NLMEstablishConnectionToNetwork) SerializeWithWriteBuffer(ctx context. // Simple Field (destinationNetworkAddress) destinationNetworkAddress := uint16(m.GetDestinationNetworkAddress()) - _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, (destinationNetworkAddress)) + _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, uint16((destinationNetworkAddress))) if _destinationNetworkAddressErr != nil { return errors.Wrap(_destinationNetworkAddressErr, "Error serializing 'destinationNetworkAddress' field") } // Simple Field (terminationTime) terminationTime := uint8(m.GetTerminationTime()) - _terminationTimeErr := writeBuffer.WriteUint8("terminationTime", 8, (terminationTime)) + _terminationTimeErr := writeBuffer.WriteUint8("terminationTime", 8, uint8((terminationTime))) if _terminationTimeErr != nil { return errors.Wrap(_terminationTimeErr, "Error serializing 'terminationTime' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMIAmRouterToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMIAmRouterToNetwork.go index 0a91b036047..7856acbe93e 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMIAmRouterToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMIAmRouterToNetwork.go @@ -201,7 +201,7 @@ func (m *_NLMIAmRouterToNetwork) SerializeWithWriteBuffer(ctx context.Context, w } for _curItem, _element := range m.GetDestinationNetworkAddresses() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'destinationNetworkAddresses' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMICouldBeRouterToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMICouldBeRouterToNetwork.go index b3f74e40eb0..886340fef66 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMICouldBeRouterToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMICouldBeRouterToNetwork.go @@ -200,14 +200,14 @@ func (m *_NLMICouldBeRouterToNetwork) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (destinationNetworkAddress) destinationNetworkAddress := uint16(m.GetDestinationNetworkAddress()) - _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, (destinationNetworkAddress)) + _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, uint16((destinationNetworkAddress))) if _destinationNetworkAddressErr != nil { return errors.Wrap(_destinationNetworkAddressErr, "Error serializing 'destinationNetworkAddress' field") } // Simple Field (performanceIndex) performanceIndex := uint8(m.GetPerformanceIndex()) - _performanceIndexErr := writeBuffer.WriteUint8("performanceIndex", 8, (performanceIndex)) + _performanceIndexErr := writeBuffer.WriteUint8("performanceIndex", 8, uint8((performanceIndex))) if _performanceIndexErr != nil { return errors.Wrap(_performanceIndexErr, "Error serializing 'performanceIndex' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTable.go b/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTable.go index a8e8c21e4ca..27e1d04a6b7 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTable.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTable.go @@ -227,7 +227,7 @@ func (m *_NLMInitalizeRoutingTable) SerializeWithWriteBuffer(ctx context.Context // Simple Field (numberOfPorts) numberOfPorts := uint8(m.GetNumberOfPorts()) - _numberOfPortsErr := writeBuffer.WriteUint8("numberOfPorts", 8, (numberOfPorts)) + _numberOfPortsErr := writeBuffer.WriteUint8("numberOfPorts", 8, uint8((numberOfPorts))) if _numberOfPortsErr != nil { return errors.Wrap(_numberOfPortsErr, "Error serializing 'numberOfPorts' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTableAck.go b/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTableAck.go index 970ea2102bb..f2d007c52a9 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTableAck.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTableAck.go @@ -227,7 +227,7 @@ func (m *_NLMInitalizeRoutingTableAck) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (numberOfPorts) numberOfPorts := uint8(m.GetNumberOfPorts()) - _numberOfPortsErr := writeBuffer.WriteUint8("numberOfPorts", 8, (numberOfPorts)) + _numberOfPortsErr := writeBuffer.WriteUint8("numberOfPorts", 8, uint8((numberOfPorts))) if _numberOfPortsErr != nil { return errors.Wrap(_numberOfPortsErr, "Error serializing 'numberOfPorts' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTablePortMapping.go b/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTablePortMapping.go index a9ce1adfdec..7ecb6b15646 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTablePortMapping.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMInitalizeRoutingTablePortMapping.go @@ -203,21 +203,21 @@ func (m *_NLMInitalizeRoutingTablePortMapping) SerializeWithWriteBuffer(ctx cont // Simple Field (destinationNetworkAddress) destinationNetworkAddress := uint16(m.GetDestinationNetworkAddress()) - _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, (destinationNetworkAddress)) + _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, uint16((destinationNetworkAddress))) if _destinationNetworkAddressErr != nil { return errors.Wrap(_destinationNetworkAddressErr, "Error serializing 'destinationNetworkAddress' field") } // Simple Field (portId) portId := uint8(m.GetPortId()) - _portIdErr := writeBuffer.WriteUint8("portId", 8, (portId)) + _portIdErr := writeBuffer.WriteUint8("portId", 8, uint8((portId))) if _portIdErr != nil { return errors.Wrap(_portIdErr, "Error serializing 'portId' field") } // Simple Field (portInfoLength) portInfoLength := uint8(m.GetPortInfoLength()) - _portInfoLengthErr := writeBuffer.WriteUint8("portInfoLength", 8, (portInfoLength)) + _portInfoLengthErr := writeBuffer.WriteUint8("portInfoLength", 8, uint8((portInfoLength))) if _portInfoLengthErr != nil { return errors.Wrap(_portInfoLengthErr, "Error serializing 'portInfoLength' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMNetworkNumberIs.go b/plc4go/protocols/bacnetip/readwrite/model/NLMNetworkNumberIs.go index e9ee96af4ad..f1c7c41df2f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMNetworkNumberIs.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMNetworkNumberIs.go @@ -223,7 +223,7 @@ func (m *_NLMNetworkNumberIs) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (networkNumber) networkNumber := uint16(m.GetNetworkNumber()) - _networkNumberErr := writeBuffer.WriteUint16("networkNumber", 16, (networkNumber)) + _networkNumberErr := writeBuffer.WriteUint16("networkNumber", 16, uint16((networkNumber))) if _networkNumberErr != nil { return errors.Wrap(_networkNumberErr, "Error serializing 'networkNumber' field") } @@ -238,7 +238,7 @@ func (m *_NLMNetworkNumberIs) SerializeWithWriteBuffer(ctx context.Context, writ }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetwork.go index e33af1655c2..79c18192e25 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetwork.go @@ -218,7 +218,7 @@ func (m *_NLMRejectRouterToNetwork) SerializeWithWriteBuffer(ctx context.Context // Simple Field (destinationNetworkAddress) destinationNetworkAddress := uint16(m.GetDestinationNetworkAddress()) - _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, (destinationNetworkAddress)) + _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, uint16((destinationNetworkAddress))) if _destinationNetworkAddressErr != nil { return errors.Wrap(_destinationNetworkAddressErr, "Error serializing 'destinationNetworkAddress' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetworkRejectReason.go b/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetworkRejectReason.go index 46bba8c8fb8..11ae4ad63ee 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetworkRejectReason.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMRejectRouterToNetworkRejectReason.go @@ -162,7 +162,7 @@ func (e NLMRejectRouterToNetworkRejectReason) Serialize() ([]byte, error) { func (e NLMRejectRouterToNetworkRejectReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("NLMRejectRouterToNetworkRejectReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("NLMRejectRouterToNetworkRejectReason", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMRequestKeyUpdate.go b/plc4go/protocols/bacnetip/readwrite/model/NLMRequestKeyUpdate.go index e27253ccba3..ef95349d80b 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMRequestKeyUpdate.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMRequestKeyUpdate.go @@ -302,14 +302,14 @@ func (m *_NLMRequestKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (set1ActivationTime) set1ActivationTime := uint32(m.GetSet1ActivationTime()) - _set1ActivationTimeErr := writeBuffer.WriteUint32("set1ActivationTime", 32, (set1ActivationTime)) + _set1ActivationTimeErr := writeBuffer.WriteUint32("set1ActivationTime", 32, uint32((set1ActivationTime))) if _set1ActivationTimeErr != nil { return errors.Wrap(_set1ActivationTimeErr, "Error serializing 'set1ActivationTime' field") } // Simple Field (set1ExpirationTime) set1ExpirationTime := uint32(m.GetSet1ExpirationTime()) - _set1ExpirationTimeErr := writeBuffer.WriteUint32("set1ExpirationTime", 32, (set1ExpirationTime)) + _set1ExpirationTimeErr := writeBuffer.WriteUint32("set1ExpirationTime", 32, uint32((set1ExpirationTime))) if _set1ExpirationTimeErr != nil { return errors.Wrap(_set1ExpirationTimeErr, "Error serializing 'set1ExpirationTime' field") } @@ -323,14 +323,14 @@ func (m *_NLMRequestKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (set2ActivationTime) set2ActivationTime := uint32(m.GetSet2ActivationTime()) - _set2ActivationTimeErr := writeBuffer.WriteUint32("set2ActivationTime", 32, (set2ActivationTime)) + _set2ActivationTimeErr := writeBuffer.WriteUint32("set2ActivationTime", 32, uint32((set2ActivationTime))) if _set2ActivationTimeErr != nil { return errors.Wrap(_set2ActivationTimeErr, "Error serializing 'set2ActivationTime' field") } // Simple Field (set2ExpirationTime) set2ExpirationTime := uint32(m.GetSet2ExpirationTime()) - _set2ExpirationTimeErr := writeBuffer.WriteUint32("set2ExpirationTime", 32, (set2ExpirationTime)) + _set2ExpirationTimeErr := writeBuffer.WriteUint32("set2ExpirationTime", 32, uint32((set2ExpirationTime))) if _set2ExpirationTimeErr != nil { return errors.Wrap(_set2ExpirationTimeErr, "Error serializing 'set2ExpirationTime' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMRequestMasterKey.go b/plc4go/protocols/bacnetip/readwrite/model/NLMRequestMasterKey.go index 131f561c529..e9e74ff4657 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMRequestMasterKey.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMRequestMasterKey.go @@ -201,7 +201,7 @@ func (m *_NLMRequestMasterKey) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (numberOfSupportedKeyAlgorithms) numberOfSupportedKeyAlgorithms := uint8(m.GetNumberOfSupportedKeyAlgorithms()) - _numberOfSupportedKeyAlgorithmsErr := writeBuffer.WriteUint8("numberOfSupportedKeyAlgorithms", 8, (numberOfSupportedKeyAlgorithms)) + _numberOfSupportedKeyAlgorithmsErr := writeBuffer.WriteUint8("numberOfSupportedKeyAlgorithms", 8, uint8((numberOfSupportedKeyAlgorithms))) if _numberOfSupportedKeyAlgorithmsErr != nil { return errors.Wrap(_numberOfSupportedKeyAlgorithmsErr, "Error serializing 'numberOfSupportedKeyAlgorithms' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMRouterAvailableToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMRouterAvailableToNetwork.go index 2979b1c03f2..245e3030dc6 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMRouterAvailableToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMRouterAvailableToNetwork.go @@ -201,7 +201,7 @@ func (m *_NLMRouterAvailableToNetwork) SerializeWithWriteBuffer(ctx context.Cont } for _curItem, _element := range m.GetDestinationNetworkAddresses() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'destinationNetworkAddresses' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMRouterBusyToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMRouterBusyToNetwork.go index 0a7a87068e4..e6bbfeaa60f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMRouterBusyToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMRouterBusyToNetwork.go @@ -201,7 +201,7 @@ func (m *_NLMRouterBusyToNetwork) SerializeWithWriteBuffer(ctx context.Context, } for _curItem, _element := range m.GetDestinationNetworkAddresses() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'destinationNetworkAddresses' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityPayload.go b/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityPayload.go index d46e912fbed..d6010c56268 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityPayload.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityPayload.go @@ -201,7 +201,7 @@ func (m *_NLMSecurityPayload) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (payloadLength) payloadLength := uint16(m.GetPayloadLength()) - _payloadLengthErr := writeBuffer.WriteUint16("payloadLength", 16, (payloadLength)) + _payloadLengthErr := writeBuffer.WriteUint16("payloadLength", 16, uint16((payloadLength))) if _payloadLengthErr != nil { return errors.Wrap(_payloadLengthErr, "Error serializing 'payloadLength' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityResponse.go b/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityResponse.go index 4e6d76429da..005d1fd1203 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityResponse.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMSecurityResponse.go @@ -257,14 +257,14 @@ func (m *_NLMSecurityResponse) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (originalMessageId) originalMessageId := uint32(m.GetOriginalMessageId()) - _originalMessageIdErr := writeBuffer.WriteUint32("originalMessageId", 32, (originalMessageId)) + _originalMessageIdErr := writeBuffer.WriteUint32("originalMessageId", 32, uint32((originalMessageId))) if _originalMessageIdErr != nil { return errors.Wrap(_originalMessageIdErr, "Error serializing 'originalMessageId' field") } // Simple Field (originalTimestamp) originalTimestamp := uint32(m.GetOriginalTimestamp()) - _originalTimestampErr := writeBuffer.WriteUint32("originalTimestamp", 32, (originalTimestamp)) + _originalTimestampErr := writeBuffer.WriteUint32("originalTimestamp", 32, uint32((originalTimestamp))) if _originalTimestampErr != nil { return errors.Wrap(_originalTimestampErr, "Error serializing 'originalTimestamp' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdate.go b/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdate.go index 2cd8176ac0c..3e7c514f3e9 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdate.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdate.go @@ -495,7 +495,7 @@ func (m *_NLMUpdateKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, writ var set1ActivationTime *uint32 = nil if m.GetSet1ActivationTime() != nil { set1ActivationTime = m.GetSet1ActivationTime() - _set1ActivationTimeErr := writeBuffer.WriteUint32("set1ActivationTime", 32, *(set1ActivationTime)) + _set1ActivationTimeErr := writeBuffer.WriteUint32("set1ActivationTime", 32, uint32(*(set1ActivationTime))) if _set1ActivationTimeErr != nil { return errors.Wrap(_set1ActivationTimeErr, "Error serializing 'set1ActivationTime' field") } @@ -505,7 +505,7 @@ func (m *_NLMUpdateKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, writ var set1ExpirationTime *uint32 = nil if m.GetSet1ExpirationTime() != nil { set1ExpirationTime = m.GetSet1ExpirationTime() - _set1ExpirationTimeErr := writeBuffer.WriteUint32("set1ExpirationTime", 32, *(set1ExpirationTime)) + _set1ExpirationTimeErr := writeBuffer.WriteUint32("set1ExpirationTime", 32, uint32(*(set1ExpirationTime))) if _set1ExpirationTimeErr != nil { return errors.Wrap(_set1ExpirationTimeErr, "Error serializing 'set1ExpirationTime' field") } @@ -515,7 +515,7 @@ func (m *_NLMUpdateKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, writ var set1KeyCount *uint8 = nil if m.GetSet1KeyCount() != nil { set1KeyCount = m.GetSet1KeyCount() - _set1KeyCountErr := writeBuffer.WriteUint8("set1KeyCount", 8, *(set1KeyCount)) + _set1KeyCountErr := writeBuffer.WriteUint8("set1KeyCount", 8, uint8(*(set1KeyCount))) if _set1KeyCountErr != nil { return errors.Wrap(_set1KeyCountErr, "Error serializing 'set1KeyCount' field") } @@ -552,7 +552,7 @@ func (m *_NLMUpdateKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, writ var set2ActivationTime *uint32 = nil if m.GetSet2ActivationTime() != nil { set2ActivationTime = m.GetSet2ActivationTime() - _set2ActivationTimeErr := writeBuffer.WriteUint32("set2ActivationTime", 32, *(set2ActivationTime)) + _set2ActivationTimeErr := writeBuffer.WriteUint32("set2ActivationTime", 32, uint32(*(set2ActivationTime))) if _set2ActivationTimeErr != nil { return errors.Wrap(_set2ActivationTimeErr, "Error serializing 'set2ActivationTime' field") } @@ -562,7 +562,7 @@ func (m *_NLMUpdateKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, writ var set2ExpirationTime *uint32 = nil if m.GetSet2ExpirationTime() != nil { set2ExpirationTime = m.GetSet2ExpirationTime() - _set2ExpirationTimeErr := writeBuffer.WriteUint32("set2ExpirationTime", 32, *(set2ExpirationTime)) + _set2ExpirationTimeErr := writeBuffer.WriteUint32("set2ExpirationTime", 32, uint32(*(set2ExpirationTime))) if _set2ExpirationTimeErr != nil { return errors.Wrap(_set2ExpirationTimeErr, "Error serializing 'set2ExpirationTime' field") } @@ -572,7 +572,7 @@ func (m *_NLMUpdateKeyUpdate) SerializeWithWriteBuffer(ctx context.Context, writ var set2KeyCount *uint8 = nil if m.GetSet2KeyCount() != nil { set2KeyCount = m.GetSet2KeyCount() - _set2KeyCountErr := writeBuffer.WriteUint8("set2KeyCount", 8, *(set2KeyCount)) + _set2KeyCountErr := writeBuffer.WriteUint8("set2KeyCount", 8, uint8(*(set2KeyCount))) if _set2KeyCountErr != nil { return errors.Wrap(_set2KeyCountErr, "Error serializing 'set2KeyCount' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdateKeyEntry.go b/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdateKeyEntry.go index 1714f9bfe5f..a2bb039daea 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdateKeyEntry.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMUpdateKeyUpdateKeyEntry.go @@ -185,14 +185,14 @@ func (m *_NLMUpdateKeyUpdateKeyEntry) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (keyIdentifier) keyIdentifier := uint16(m.GetKeyIdentifier()) - _keyIdentifierErr := writeBuffer.WriteUint16("keyIdentifier", 16, (keyIdentifier)) + _keyIdentifierErr := writeBuffer.WriteUint16("keyIdentifier", 16, uint16((keyIdentifier))) if _keyIdentifierErr != nil { return errors.Wrap(_keyIdentifierErr, "Error serializing 'keyIdentifier' field") } // Simple Field (keySize) keySize := uint8(m.GetKeySize()) - _keySizeErr := writeBuffer.WriteUint8("keySize", 8, (keySize)) + _keySizeErr := writeBuffer.WriteUint8("keySize", 8, uint8((keySize))) if _keySizeErr != nil { return errors.Wrap(_keySizeErr, "Error serializing 'keySize' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NLMWhoIsRouterToNetwork.go b/plc4go/protocols/bacnetip/readwrite/model/NLMWhoIsRouterToNetwork.go index 52e29a1e5bd..9b51cbc8139 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NLMWhoIsRouterToNetwork.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NLMWhoIsRouterToNetwork.go @@ -188,7 +188,7 @@ func (m *_NLMWhoIsRouterToNetwork) SerializeWithWriteBuffer(ctx context.Context, var destinationNetworkAddress *uint16 = nil if m.GetDestinationNetworkAddress() != nil { destinationNetworkAddress = m.GetDestinationNetworkAddress() - _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, *(destinationNetworkAddress)) + _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, uint16(*(destinationNetworkAddress))) if _destinationNetworkAddressErr != nil { return errors.Wrap(_destinationNetworkAddressErr, "Error serializing 'destinationNetworkAddress' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NPDU.go b/plc4go/protocols/bacnetip/readwrite/model/NPDU.go index 8263166811a..792dc94abcf 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NPDU.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NPDU.go @@ -543,7 +543,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. // Simple Field (protocolVersionNumber) protocolVersionNumber := uint8(m.GetProtocolVersionNumber()) - _protocolVersionNumberErr := writeBuffer.WriteUint8("protocolVersionNumber", 8, (protocolVersionNumber)) + _protocolVersionNumberErr := writeBuffer.WriteUint8("protocolVersionNumber", 8, uint8((protocolVersionNumber))) if _protocolVersionNumberErr != nil { return errors.Wrap(_protocolVersionNumberErr, "Error serializing 'protocolVersionNumber' field") } @@ -564,7 +564,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. var destinationNetworkAddress *uint16 = nil if m.GetDestinationNetworkAddress() != nil { destinationNetworkAddress = m.GetDestinationNetworkAddress() - _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, *(destinationNetworkAddress)) + _destinationNetworkAddressErr := writeBuffer.WriteUint16("destinationNetworkAddress", 16, uint16(*(destinationNetworkAddress))) if _destinationNetworkAddressErr != nil { return errors.Wrap(_destinationNetworkAddressErr, "Error serializing 'destinationNetworkAddress' field") } @@ -574,7 +574,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. var destinationLength *uint8 = nil if m.GetDestinationLength() != nil { destinationLength = m.GetDestinationLength() - _destinationLengthErr := writeBuffer.WriteUint8("destinationLength", 8, *(destinationLength)) + _destinationLengthErr := writeBuffer.WriteUint8("destinationLength", 8, uint8(*(destinationLength))) if _destinationLengthErr != nil { return errors.Wrap(_destinationLengthErr, "Error serializing 'destinationLength' field") } @@ -586,7 +586,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } for _curItem, _element := range m.GetDestinationAddress() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'destinationAddress' field") } @@ -605,7 +605,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. var sourceNetworkAddress *uint16 = nil if m.GetSourceNetworkAddress() != nil { sourceNetworkAddress = m.GetSourceNetworkAddress() - _sourceNetworkAddressErr := writeBuffer.WriteUint16("sourceNetworkAddress", 16, *(sourceNetworkAddress)) + _sourceNetworkAddressErr := writeBuffer.WriteUint16("sourceNetworkAddress", 16, uint16(*(sourceNetworkAddress))) if _sourceNetworkAddressErr != nil { return errors.Wrap(_sourceNetworkAddressErr, "Error serializing 'sourceNetworkAddress' field") } @@ -615,7 +615,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. var sourceLength *uint8 = nil if m.GetSourceLength() != nil { sourceLength = m.GetSourceLength() - _sourceLengthErr := writeBuffer.WriteUint8("sourceLength", 8, *(sourceLength)) + _sourceLengthErr := writeBuffer.WriteUint8("sourceLength", 8, uint8(*(sourceLength))) if _sourceLengthErr != nil { return errors.Wrap(_sourceLengthErr, "Error serializing 'sourceLength' field") } @@ -627,7 +627,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } for _curItem, _element := range m.GetSourceAddress() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'sourceAddress' field") } @@ -646,7 +646,7 @@ func (m *_NPDU) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. var hopCount *uint8 = nil if m.GetHopCount() != nil { hopCount = m.GetHopCount() - _hopCountErr := writeBuffer.WriteUint8("hopCount", 8, *(hopCount)) + _hopCountErr := writeBuffer.WriteUint8("hopCount", 8, uint8(*(hopCount))) if _hopCountErr != nil { return errors.Wrap(_hopCountErr, "Error serializing 'hopCount' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NPDUControl.go b/plc4go/protocols/bacnetip/readwrite/model/NPDUControl.go index ededa752bc1..8a74005d0e6 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NPDUControl.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NPDUControl.go @@ -286,7 +286,7 @@ func (m *_NPDUControl) SerializeWithWriteBuffer(ctx context.Context, writeBuffer }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 1, reserved) + _err := writeBuffer.WriteUint8("reserved", 1, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -309,7 +309,7 @@ func (m *_NPDUControl) SerializeWithWriteBuffer(ctx context.Context, writeBuffer }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 1, reserved) + _err := writeBuffer.WriteUint8("reserved", 1, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/bacnetip/readwrite/model/NPDUNetworkPriority.go b/plc4go/protocols/bacnetip/readwrite/model/NPDUNetworkPriority.go index 0ff79e008cb..68fb9ddf3a1 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/NPDUNetworkPriority.go +++ b/plc4go/protocols/bacnetip/readwrite/model/NPDUNetworkPriority.go @@ -144,7 +144,7 @@ func (e NPDUNetworkPriority) Serialize() ([]byte, error) { func (e NPDUNetworkPriority) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("NPDUNetworkPriority", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("NPDUNetworkPriority", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/SecurityResponseCode.go b/plc4go/protocols/bacnetip/readwrite/model/SecurityResponseCode.go index 35e288fd356..931034b5e93 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/SecurityResponseCode.go +++ b/plc4go/protocols/bacnetip/readwrite/model/SecurityResponseCode.go @@ -276,7 +276,7 @@ func (e SecurityResponseCode) Serialize() ([]byte, error) { func (e SecurityResponseCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SecurityResponseCode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SecurityResponseCode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/bacnetip/readwrite/model/TagClass.go b/plc4go/protocols/bacnetip/readwrite/model/TagClass.go index d61a2d1a3eb..db0194a135f 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/TagClass.go +++ b/plc4go/protocols/bacnetip/readwrite/model/TagClass.go @@ -132,7 +132,7 @@ func (e TagClass) Serialize() ([]byte, error) { func (e TagClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TagClass", 1, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TagClass", 1, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/AccessControlCategory.go b/plc4go/protocols/cbus/readwrite/model/AccessControlCategory.go index 263abaffb3a..4283e2792e6 100644 --- a/plc4go/protocols/cbus/readwrite/model/AccessControlCategory.go +++ b/plc4go/protocols/cbus/readwrite/model/AccessControlCategory.go @@ -132,7 +132,7 @@ func (e AccessControlCategory) Serialize() ([]byte, error) { func (e AccessControlCategory) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AccessControlCategory", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AccessControlCategory", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/AccessControlCommandType.go b/plc4go/protocols/cbus/readwrite/model/AccessControlCommandType.go index 60b725e2e16..ccb649c50c6 100644 --- a/plc4go/protocols/cbus/readwrite/model/AccessControlCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/AccessControlCommandType.go @@ -218,7 +218,7 @@ func (e AccessControlCommandType) Serialize() ([]byte, error) { func (e AccessControlCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AccessControlCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AccessControlCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/AccessControlCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/AccessControlCommandTypeContainer.go index e9605fe08fd..e38128cf1db 100644 --- a/plc4go/protocols/cbus/readwrite/model/AccessControlCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/AccessControlCommandTypeContainer.go @@ -1436,7 +1436,7 @@ func (e AccessControlCommandTypeContainer) Serialize() ([]byte, error) { func (e AccessControlCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AccessControlCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AccessControlCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/AccessControlDirection.go b/plc4go/protocols/cbus/readwrite/model/AccessControlDirection.go index 3768c0cc6df..6607f969ca8 100644 --- a/plc4go/protocols/cbus/readwrite/model/AccessControlDirection.go +++ b/plc4go/protocols/cbus/readwrite/model/AccessControlDirection.go @@ -138,7 +138,7 @@ func (e AccessControlDirection) Serialize() ([]byte, error) { func (e AccessControlDirection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AccessControlDirection", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AccessControlDirection", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandType.go b/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandType.go index 818a8f6caf5..cb04485234a 100644 --- a/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandType.go @@ -328,7 +328,7 @@ func (e AirConditioningCommandType) Serialize() ([]byte, error) { func (e AirConditioningCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AirConditioningCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AirConditioningCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandTypeContainer.go index de6440315e2..d89d2e738e6 100644 --- a/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/AirConditioningCommandTypeContainer.go @@ -423,7 +423,7 @@ func (e AirConditioningCommandTypeContainer) Serialize() ([]byte, error) { func (e AirConditioningCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AirConditioningCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AirConditioningCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHumidityScheduleEntry.go b/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHumidityScheduleEntry.go index 0e396514b44..44cb6bde45d 100644 --- a/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHumidityScheduleEntry.go +++ b/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHumidityScheduleEntry.go @@ -382,7 +382,7 @@ func (m *_AirConditioningDataHumidityScheduleEntry) SerializeWithWriteBuffer(ctx // Simple Field (entry) entry := uint8(m.GetEntry()) - _entryErr := writeBuffer.WriteUint8("entry", 8, (entry)) + _entryErr := writeBuffer.WriteUint8("entry", 8, uint8((entry))) if _entryErr != nil { return errors.Wrap(_entryErr, "Error serializing 'entry' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHvacScheduleEntry.go b/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHvacScheduleEntry.go index 15d8c45bcdc..ad4e25c9c54 100644 --- a/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHvacScheduleEntry.go +++ b/plc4go/protocols/cbus/readwrite/model/AirConditioningDataHvacScheduleEntry.go @@ -382,7 +382,7 @@ func (m *_AirConditioningDataHvacScheduleEntry) SerializeWithWriteBuffer(ctx con // Simple Field (entry) entry := uint8(m.GetEntry()) - _entryErr := writeBuffer.WriteUint8("entry", 8, (entry)) + _entryErr := writeBuffer.WriteUint8("entry", 8, uint8((entry))) if _entryErr != nil { return errors.Wrap(_entryErr, "Error serializing 'entry' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/ApplicationId.go b/plc4go/protocols/cbus/readwrite/model/ApplicationId.go index 841b9bc4a27..1c6f04efdf2 100644 --- a/plc4go/protocols/cbus/readwrite/model/ApplicationId.go +++ b/plc4go/protocols/cbus/readwrite/model/ApplicationId.go @@ -270,7 +270,7 @@ func (e ApplicationId) Serialize() ([]byte, error) { func (e ApplicationId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ApplicationId", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ApplicationId", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ApplicationIdContainer.go b/plc4go/protocols/cbus/readwrite/model/ApplicationIdContainer.go index 69a23663567..5c23b86d357 100644 --- a/plc4go/protocols/cbus/readwrite/model/ApplicationIdContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/ApplicationIdContainer.go @@ -3741,7 +3741,7 @@ func (e ApplicationIdContainer) Serialize() ([]byte, error) { func (e ApplicationIdContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ApplicationIdContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ApplicationIdContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/Attribute.go b/plc4go/protocols/cbus/readwrite/model/Attribute.go index deee217c6c6..04cf05c43d0 100644 --- a/plc4go/protocols/cbus/readwrite/model/Attribute.go +++ b/plc4go/protocols/cbus/readwrite/model/Attribute.go @@ -318,7 +318,7 @@ func (e Attribute) Serialize() ([]byte, error) { func (e Attribute) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("Attribute", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("Attribute", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/BaudRateSelector.go b/plc4go/protocols/cbus/readwrite/model/BaudRateSelector.go index 55439951576..fb1af9be17d 100644 --- a/plc4go/protocols/cbus/readwrite/model/BaudRateSelector.go +++ b/plc4go/protocols/cbus/readwrite/model/BaudRateSelector.go @@ -156,7 +156,7 @@ func (e BaudRateSelector) Serialize() ([]byte, error) { func (e BaudRateSelector) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("BaudRateSelector", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("BaudRateSelector", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/CALCommandType.go b/plc4go/protocols/cbus/readwrite/model/CALCommandType.go index fba6158efce..54bfda076b1 100644 --- a/plc4go/protocols/cbus/readwrite/model/CALCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/CALCommandType.go @@ -174,7 +174,7 @@ func (e CALCommandType) Serialize() ([]byte, error) { func (e CALCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("CALCommandType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("CALCommandType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/CALCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/CALCommandTypeContainer.go index 4d8a626cae7..d13dfa99655 100644 --- a/plc4go/protocols/cbus/readwrite/model/CALCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/CALCommandTypeContainer.go @@ -1795,7 +1795,7 @@ func (e CALCommandTypeContainer) Serialize() ([]byte, error) { func (e CALCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("CALCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("CALCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/CALDataAcknowledge.go b/plc4go/protocols/cbus/readwrite/model/CALDataAcknowledge.go index de3e8cbf615..bbf73ad3dfd 100644 --- a/plc4go/protocols/cbus/readwrite/model/CALDataAcknowledge.go +++ b/plc4go/protocols/cbus/readwrite/model/CALDataAcknowledge.go @@ -217,7 +217,7 @@ func (m *_CALDataAcknowledge) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (code) code := uint8(m.GetCode()) - _codeErr := writeBuffer.WriteUint8("code", 8, (code)) + _codeErr := writeBuffer.WriteUint8("code", 8, uint8((code))) if _codeErr != nil { return errors.Wrap(_codeErr, "Error serializing 'code' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/CALDataGetStatus.go b/plc4go/protocols/cbus/readwrite/model/CALDataGetStatus.go index e19409ffa29..8eadb38377a 100644 --- a/plc4go/protocols/cbus/readwrite/model/CALDataGetStatus.go +++ b/plc4go/protocols/cbus/readwrite/model/CALDataGetStatus.go @@ -217,7 +217,7 @@ func (m *_CALDataGetStatus) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (count) count := uint8(m.GetCount()) - _countErr := writeBuffer.WriteUint8("count", 8, (count)) + _countErr := writeBuffer.WriteUint8("count", 8, uint8((count))) if _countErr != nil { return errors.Wrap(_countErr, "Error serializing 'count' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/CALDataRecall.go b/plc4go/protocols/cbus/readwrite/model/CALDataRecall.go index 3533e02148d..6563390641e 100644 --- a/plc4go/protocols/cbus/readwrite/model/CALDataRecall.go +++ b/plc4go/protocols/cbus/readwrite/model/CALDataRecall.go @@ -217,7 +217,7 @@ func (m *_CALDataRecall) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (count) count := uint8(m.GetCount()) - _countErr := writeBuffer.WriteUint8("count", 8, (count)) + _countErr := writeBuffer.WriteUint8("count", 8, uint8((count))) if _countErr != nil { return errors.Wrap(_countErr, "Error serializing 'count' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/CALDataStatus.go b/plc4go/protocols/cbus/readwrite/model/CALDataStatus.go index 545895c1ef6..eb66455897a 100644 --- a/plc4go/protocols/cbus/readwrite/model/CALDataStatus.go +++ b/plc4go/protocols/cbus/readwrite/model/CALDataStatus.go @@ -263,7 +263,7 @@ func (m *_CALDataStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (blockStart) blockStart := uint8(m.GetBlockStart()) - _blockStartErr := writeBuffer.WriteUint8("blockStart", 8, (blockStart)) + _blockStartErr := writeBuffer.WriteUint8("blockStart", 8, uint8((blockStart))) if _blockStartErr != nil { return errors.Wrap(_blockStartErr, "Error serializing 'blockStart' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/CALDataStatusExtended.go b/plc4go/protocols/cbus/readwrite/model/CALDataStatusExtended.go index 4a94462137d..a4480d77c17 100644 --- a/plc4go/protocols/cbus/readwrite/model/CALDataStatusExtended.go +++ b/plc4go/protocols/cbus/readwrite/model/CALDataStatusExtended.go @@ -389,7 +389,7 @@ func (m *_CALDataStatusExtended) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (blockStart) blockStart := uint8(m.GetBlockStart()) - _blockStartErr := writeBuffer.WriteUint8("blockStart", 8, (blockStart)) + _blockStartErr := writeBuffer.WriteUint8("blockStart", 8, uint8((blockStart))) if _blockStartErr != nil { return errors.Wrap(_blockStartErr, "Error serializing 'blockStart' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/CBusConstants.go b/plc4go/protocols/cbus/readwrite/model/CBusConstants.go index ddba22efb9f..9f4ca4e3183 100644 --- a/plc4go/protocols/cbus/readwrite/model/CBusConstants.go +++ b/plc4go/protocols/cbus/readwrite/model/CBusConstants.go @@ -147,7 +147,7 @@ func (m *_CBusConstants) SerializeWithWriteBuffer(ctx context.Context, writeBuff } // Const Field (cbusTcpDefaultPort) - _cbusTcpDefaultPortErr := writeBuffer.WriteUint16("cbusTcpDefaultPort", 16, 10001) + _cbusTcpDefaultPortErr := writeBuffer.WriteUint16("cbusTcpDefaultPort", 16, uint16(10001)) if _cbusTcpDefaultPortErr != nil { return errors.Wrap(_cbusTcpDefaultPortErr, "Error serializing 'cbusTcpDefaultPort' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/CBusHeader.go b/plc4go/protocols/cbus/readwrite/model/CBusHeader.go index 4a80754c278..a51eb481ba1 100644 --- a/plc4go/protocols/cbus/readwrite/model/CBusHeader.go +++ b/plc4go/protocols/cbus/readwrite/model/CBusHeader.go @@ -233,7 +233,7 @@ func (m *_CBusHeader) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (rc) rc := uint8(m.GetRc()) - _rcErr := writeBuffer.WriteUint8("rc", 2, (rc)) + _rcErr := writeBuffer.WriteUint8("rc", 2, uint8((rc))) if _rcErr != nil { return errors.Wrap(_rcErr, "Error serializing 'rc' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommandDirect.go b/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommandDirect.go index dafd2d32edd..7b3ef9ea5e4 100644 --- a/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommandDirect.go +++ b/plc4go/protocols/cbus/readwrite/model/CBusPointToPointCommandDirect.go @@ -229,7 +229,7 @@ func (m *_CBusPointToPointCommandDirect) SerializeWithWriteBuffer(ctx context.Co }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/ChannelStatus.go b/plc4go/protocols/cbus/readwrite/model/ChannelStatus.go index c4cf395d87c..ee0c272d3ef 100644 --- a/plc4go/protocols/cbus/readwrite/model/ChannelStatus.go +++ b/plc4go/protocols/cbus/readwrite/model/ChannelStatus.go @@ -138,7 +138,7 @@ func (e ChannelStatus) Serialize() ([]byte, error) { func (e ChannelStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ChannelStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ChannelStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandType.go b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandType.go index 4b7591ae05a..8fa74655e27 100644 --- a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandType.go @@ -158,7 +158,7 @@ func (e ClockAndTimekeepingCommandType) Serialize() ([]byte, error) { func (e ClockAndTimekeepingCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ClockAndTimekeepingCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ClockAndTimekeepingCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandTypeContainer.go index 7bcfe35f4fa..d55d7ed93d5 100644 --- a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingCommandTypeContainer.go @@ -283,7 +283,7 @@ func (e ClockAndTimekeepingCommandTypeContainer) Serialize() ([]byte, error) { func (e ClockAndTimekeepingCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ClockAndTimekeepingCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ClockAndTimekeepingCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateDate.go b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateDate.go index 58224042fb3..d49fafb5a9f 100644 --- a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateDate.go +++ b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateDate.go @@ -268,21 +268,21 @@ func (m *_ClockAndTimekeepingDataUpdateDate) SerializeWithWriteBuffer(ctx contex // Simple Field (month) month := uint8(m.GetMonth()) - _monthErr := writeBuffer.WriteUint8("month", 8, (month)) + _monthErr := writeBuffer.WriteUint8("month", 8, uint8((month))) if _monthErr != nil { return errors.Wrap(_monthErr, "Error serializing 'month' field") } // Simple Field (day) day := uint8(m.GetDay()) - _dayErr := writeBuffer.WriteUint8("day", 8, (day)) + _dayErr := writeBuffer.WriteUint8("day", 8, uint8((day))) if _dayErr != nil { return errors.Wrap(_dayErr, "Error serializing 'day' field") } // Simple Field (dayOfWeek) dayOfWeek := uint8(m.GetDayOfWeek()) - _dayOfWeekErr := writeBuffer.WriteUint8("dayOfWeek", 8, (dayOfWeek)) + _dayOfWeekErr := writeBuffer.WriteUint8("dayOfWeek", 8, uint8((dayOfWeek))) if _dayOfWeekErr != nil { return errors.Wrap(_dayOfWeekErr, "Error serializing 'dayOfWeek' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateTime.go b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateTime.go index 136ce776ac9..a49543ad817 100644 --- a/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateTime.go +++ b/plc4go/protocols/cbus/readwrite/model/ClockAndTimekeepingDataUpdateTime.go @@ -304,21 +304,21 @@ func (m *_ClockAndTimekeepingDataUpdateTime) SerializeWithWriteBuffer(ctx contex // Simple Field (hours) hours := uint8(m.GetHours()) - _hoursErr := writeBuffer.WriteUint8("hours", 8, (hours)) + _hoursErr := writeBuffer.WriteUint8("hours", 8, uint8((hours))) if _hoursErr != nil { return errors.Wrap(_hoursErr, "Error serializing 'hours' field") } // Simple Field (minute) minute := uint8(m.GetMinute()) - _minuteErr := writeBuffer.WriteUint8("minute", 8, (minute)) + _minuteErr := writeBuffer.WriteUint8("minute", 8, uint8((minute))) if _minuteErr != nil { return errors.Wrap(_minuteErr, "Error serializing 'minute' field") } // Simple Field (second) second := uint8(m.GetSecond()) - _secondErr := writeBuffer.WriteUint8("second", 8, (second)) + _secondErr := writeBuffer.WriteUint8("second", 8, uint8((second))) if _secondErr != nil { return errors.Wrap(_secondErr, "Error serializing 'second' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/DestinationAddressType.go b/plc4go/protocols/cbus/readwrite/model/DestinationAddressType.go index 2eceaacee39..af617e52cbb 100644 --- a/plc4go/protocols/cbus/readwrite/model/DestinationAddressType.go +++ b/plc4go/protocols/cbus/readwrite/model/DestinationAddressType.go @@ -138,7 +138,7 @@ func (e DestinationAddressType) Serialize() ([]byte, error) { func (e DestinationAddressType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("DestinationAddressType", 3, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("DestinationAddressType", 3, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/DialInFailureReason.go b/plc4go/protocols/cbus/readwrite/model/DialInFailureReason.go index 1834b2a4258..5463f698fac 100644 --- a/plc4go/protocols/cbus/readwrite/model/DialInFailureReason.go +++ b/plc4go/protocols/cbus/readwrite/model/DialInFailureReason.go @@ -126,7 +126,7 @@ func (e DialInFailureReason) Serialize() ([]byte, error) { func (e DialInFailureReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("DialInFailureReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("DialInFailureReason", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/DialOutFailureReason.go b/plc4go/protocols/cbus/readwrite/model/DialOutFailureReason.go index 5a7cf9c5736..e1f4e06928b 100644 --- a/plc4go/protocols/cbus/readwrite/model/DialOutFailureReason.go +++ b/plc4go/protocols/cbus/readwrite/model/DialOutFailureReason.go @@ -156,7 +156,7 @@ func (e DialOutFailureReason) Serialize() ([]byte, error) { func (e DialOutFailureReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("DialOutFailureReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("DialOutFailureReason", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/EnableControlCommandType.go b/plc4go/protocols/cbus/readwrite/model/EnableControlCommandType.go index e716dde5343..e2182110865 100644 --- a/plc4go/protocols/cbus/readwrite/model/EnableControlCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/EnableControlCommandType.go @@ -148,7 +148,7 @@ func (e EnableControlCommandType) Serialize() ([]byte, error) { func (e EnableControlCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("EnableControlCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("EnableControlCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/EnableControlCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/EnableControlCommandTypeContainer.go index e9ee8810ff8..96d676367f7 100644 --- a/plc4go/protocols/cbus/readwrite/model/EnableControlCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/EnableControlCommandTypeContainer.go @@ -381,7 +381,7 @@ func (e EnableControlCommandTypeContainer) Serialize() ([]byte, error) { func (e EnableControlCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("EnableControlCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("EnableControlCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandType.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandType.go index 62b480b7609..b5f5350ba1f 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandType.go @@ -178,7 +178,7 @@ func (e ErrorReportingCommandType) Serialize() ([]byte, error) { func (e ErrorReportingCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandTypeContainer.go index c55ee11c6e4..748354b9274 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingCommandTypeContainer.go @@ -213,7 +213,7 @@ func (e ErrorReportingCommandTypeContainer) Serialize() ([]byte, error) { func (e ErrorReportingCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingDataGeneric.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingDataGeneric.go index df20b16ff38..009d24b2759 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingDataGeneric.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingDataGeneric.go @@ -444,21 +444,21 @@ func (m *_ErrorReportingDataGeneric) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (deviceId) deviceId := uint8(m.GetDeviceId()) - _deviceIdErr := writeBuffer.WriteUint8("deviceId", 8, (deviceId)) + _deviceIdErr := writeBuffer.WriteUint8("deviceId", 8, uint8((deviceId))) if _deviceIdErr != nil { return errors.Wrap(_deviceIdErr, "Error serializing 'deviceId' field") } // Simple Field (errorData1) errorData1 := uint8(m.GetErrorData1()) - _errorData1Err := writeBuffer.WriteUint8("errorData1", 8, (errorData1)) + _errorData1Err := writeBuffer.WriteUint8("errorData1", 8, uint8((errorData1))) if _errorData1Err != nil { return errors.Wrap(_errorData1Err, "Error serializing 'errorData1' field") } // Simple Field (errorData2) errorData2 := uint8(m.GetErrorData2()) - _errorData2Err := writeBuffer.WriteUint8("errorData2", 8, (errorData2)) + _errorData2Err := writeBuffer.WriteUint8("errorData2", 8, uint8((errorData2))) if _errorData2Err != nil { return errors.Wrap(_errorData2Err, "Error serializing 'errorData2' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSeverity.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSeverity.go index bf1e55521d2..8fd6b30c09f 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSeverity.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSeverity.go @@ -168,7 +168,7 @@ func (e ErrorReportingSeverity) Serialize() ([]byte, error) { func (e ErrorReportingSeverity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSeverity", 3, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSeverity", 3, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryClass.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryClass.go index 70a1b7b34f8..3fa3e3c4c64 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryClass.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryClass.go @@ -216,7 +216,7 @@ func (e ErrorReportingSystemCategoryClass) Serialize() ([]byte, error) { func (e ErrorReportingSystemCategoryClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSystemCategoryClass", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSystemCategoryClass", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForBuildingManagementSystems.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForBuildingManagementSystems.go index 5f12b95613e..d690f0447d7 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForBuildingManagementSystems.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForBuildingManagementSystems.go @@ -216,7 +216,7 @@ func (e ErrorReportingSystemCategoryTypeForBuildingManagementSystems) Serialize( func (e ErrorReportingSystemCategoryTypeForBuildingManagementSystems) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForBuildingManagementSystems", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForBuildingManagementSystems", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForClimateControllers.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForClimateControllers.go index efa3fb660b2..b7c0aecfe08 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForClimateControllers.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForClimateControllers.go @@ -216,7 +216,7 @@ func (e ErrorReportingSystemCategoryTypeForClimateControllers) Serialize() ([]by func (e ErrorReportingSystemCategoryTypeForClimateControllers) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForClimateControllers", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForClimateControllers", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForInputUnits.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForInputUnits.go index 1a5b168ac3b..d457a0ec14a 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForInputUnits.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForInputUnits.go @@ -216,7 +216,7 @@ func (e ErrorReportingSystemCategoryTypeForInputUnits) Serialize() ([]byte, erro func (e ErrorReportingSystemCategoryTypeForInputUnits) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForInputUnits", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForInputUnits", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForOutputUnits.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForOutputUnits.go index 9c3f8d0a0ce..224a27466db 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForOutputUnits.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForOutputUnits.go @@ -216,7 +216,7 @@ func (e ErrorReportingSystemCategoryTypeForOutputUnits) Serialize() ([]byte, err func (e ErrorReportingSystemCategoryTypeForOutputUnits) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForOutputUnits", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForOutputUnits", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForSupportUnits.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForSupportUnits.go index 558c3326a91..22dcc42bd72 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForSupportUnits.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeForSupportUnits.go @@ -216,7 +216,7 @@ func (e ErrorReportingSystemCategoryTypeForSupportUnits) Serialize() ([]byte, er func (e ErrorReportingSystemCategoryTypeForSupportUnits) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForSupportUnits", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSystemCategoryTypeForSupportUnits", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeReserved.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeReserved.go index c1c46723ac3..3b6fc8c4bfa 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeReserved.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryTypeReserved.go @@ -180,7 +180,7 @@ func (m *_ErrorReportingSystemCategoryTypeReserved) SerializeWithWriteBuffer(ctx // Simple Field (reservedValue) reservedValue := uint8(m.GetReservedValue()) - _reservedValueErr := writeBuffer.WriteUint8("reservedValue", 4, (reservedValue)) + _reservedValueErr := writeBuffer.WriteUint8("reservedValue", 4, uint8((reservedValue))) if _reservedValueErr != nil { return errors.Wrap(_reservedValueErr, "Error serializing 'reservedValue' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryVariant.go b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryVariant.go index d5efb5e8a63..e1ef33899df 100644 --- a/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryVariant.go +++ b/plc4go/protocols/cbus/readwrite/model/ErrorReportingSystemCategoryVariant.go @@ -144,7 +144,7 @@ func (e ErrorReportingSystemCategoryVariant) Serialize() ([]byte, error) { func (e ErrorReportingSystemCategoryVariant) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ErrorReportingSystemCategoryVariant", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ErrorReportingSystemCategoryVariant", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/GAVState.go b/plc4go/protocols/cbus/readwrite/model/GAVState.go index 318ce8d6b1b..2203a56f80c 100644 --- a/plc4go/protocols/cbus/readwrite/model/GAVState.go +++ b/plc4go/protocols/cbus/readwrite/model/GAVState.go @@ -144,7 +144,7 @@ func (e GAVState) Serialize() ([]byte, error) { func (e GAVState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("GAVState", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("GAVState", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/HVACAuxiliaryLevel.go b/plc4go/protocols/cbus/readwrite/model/HVACAuxiliaryLevel.go index 6eb8ed0220b..060ba0166df 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACAuxiliaryLevel.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACAuxiliaryLevel.go @@ -293,7 +293,7 @@ func (m *_HVACAuxiliaryLevel) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (mode) mode := uint8(m.GetMode()) - _modeErr := writeBuffer.WriteUint8("mode", 6, (mode)) + _modeErr := writeBuffer.WriteUint8("mode", 6, uint8((mode))) if _modeErr != nil { return errors.Wrap(_modeErr, "Error serializing 'mode' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/HVACError.go b/plc4go/protocols/cbus/readwrite/model/HVACError.go index f54fe77530c..d525ea2cadc 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACError.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACError.go @@ -960,7 +960,7 @@ func (e HVACError) Serialize() ([]byte, error) { func (e HVACError) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HVACError", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HVACError", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/HVACHumidity.go b/plc4go/protocols/cbus/readwrite/model/HVACHumidity.go index 6c4a7692eee..d376fc230f4 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACHumidity.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACHumidity.go @@ -172,7 +172,7 @@ func (m *_HVACHumidity) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (humidityValue) humidityValue := uint16(m.GetHumidityValue()) - _humidityValueErr := writeBuffer.WriteUint16("humidityValue", 16, (humidityValue)) + _humidityValueErr := writeBuffer.WriteUint16("humidityValue", 16, uint16((humidityValue))) if _humidityValueErr != nil { return errors.Wrap(_humidityValueErr, "Error serializing 'humidityValue' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/HVACHumidityError.go b/plc4go/protocols/cbus/readwrite/model/HVACHumidityError.go index c84b39dc3ec..1ca82b5e4b2 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACHumidityError.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACHumidityError.go @@ -960,7 +960,7 @@ func (e HVACHumidityError) Serialize() ([]byte, error) { func (e HVACHumidityError) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HVACHumidityError", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HVACHumidityError", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/HVACHumidityModeAndFlagsMode.go b/plc4go/protocols/cbus/readwrite/model/HVACHumidityModeAndFlagsMode.go index cd2d7ebc8d7..84b52dc8b3c 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACHumidityModeAndFlagsMode.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACHumidityModeAndFlagsMode.go @@ -144,7 +144,7 @@ func (e HVACHumidityModeAndFlagsMode) Serialize() ([]byte, error) { func (e HVACHumidityModeAndFlagsMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HVACHumidityModeAndFlagsMode", 3, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HVACHumidityModeAndFlagsMode", 3, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/HVACHumidityType.go b/plc4go/protocols/cbus/readwrite/model/HVACHumidityType.go index af2ed6c68bf..ce9b330c102 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACHumidityType.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACHumidityType.go @@ -144,7 +144,7 @@ func (e HVACHumidityType) Serialize() ([]byte, error) { func (e HVACHumidityType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HVACHumidityType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HVACHumidityType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/HVACModeAndFlagsMode.go b/plc4go/protocols/cbus/readwrite/model/HVACModeAndFlagsMode.go index cc9a8df82e0..6c36b822d23 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACModeAndFlagsMode.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACModeAndFlagsMode.go @@ -150,7 +150,7 @@ func (e HVACModeAndFlagsMode) Serialize() ([]byte, error) { func (e HVACModeAndFlagsMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HVACModeAndFlagsMode", 3, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HVACModeAndFlagsMode", 3, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/HVACRawLevels.go b/plc4go/protocols/cbus/readwrite/model/HVACRawLevels.go index 12a8ef01a0d..ab4c568ec42 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACRawLevels.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACRawLevels.go @@ -172,7 +172,7 @@ func (m *_HVACRawLevels) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (rawValue) rawValue := int16(m.GetRawValue()) - _rawValueErr := writeBuffer.WriteInt16("rawValue", 16, (rawValue)) + _rawValueErr := writeBuffer.WriteInt16("rawValue", 16, int16((rawValue))) if _rawValueErr != nil { return errors.Wrap(_rawValueErr, "Error serializing 'rawValue' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/HVACSensorStatus.go b/plc4go/protocols/cbus/readwrite/model/HVACSensorStatus.go index 6da06c5c81b..bfa435f766a 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACSensorStatus.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACSensorStatus.go @@ -144,7 +144,7 @@ func (e HVACSensorStatus) Serialize() ([]byte, error) { func (e HVACSensorStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HVACSensorStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HVACSensorStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/HVACStartTime.go b/plc4go/protocols/cbus/readwrite/model/HVACStartTime.go index bf1cc0f5fa5..aa33bf5d2ee 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACStartTime.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACStartTime.go @@ -232,7 +232,7 @@ func (m *_HVACStartTime) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (minutesSinceSunday12AM) minutesSinceSunday12AM := uint16(m.GetMinutesSinceSunday12AM()) - _minutesSinceSunday12AMErr := writeBuffer.WriteUint16("minutesSinceSunday12AM", 16, (minutesSinceSunday12AM)) + _minutesSinceSunday12AMErr := writeBuffer.WriteUint16("minutesSinceSunday12AM", 16, uint16((minutesSinceSunday12AM))) if _minutesSinceSunday12AMErr != nil { return errors.Wrap(_minutesSinceSunday12AMErr, "Error serializing 'minutesSinceSunday12AM' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/HVACTemperature.go b/plc4go/protocols/cbus/readwrite/model/HVACTemperature.go index 87dadbcefc4..af3014e4971 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACTemperature.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACTemperature.go @@ -172,7 +172,7 @@ func (m *_HVACTemperature) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (temperatureValue) temperatureValue := int16(m.GetTemperatureValue()) - _temperatureValueErr := writeBuffer.WriteInt16("temperatureValue", 16, (temperatureValue)) + _temperatureValueErr := writeBuffer.WriteInt16("temperatureValue", 16, int16((temperatureValue))) if _temperatureValueErr != nil { return errors.Wrap(_temperatureValueErr, "Error serializing 'temperatureValue' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/HVACType.go b/plc4go/protocols/cbus/readwrite/model/HVACType.go index d8dd8598f3b..0e0b49fd67b 100644 --- a/plc4go/protocols/cbus/readwrite/model/HVACType.go +++ b/plc4go/protocols/cbus/readwrite/model/HVACType.go @@ -192,7 +192,7 @@ func (e HVACType) Serialize() ([]byte, error) { func (e HVACType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HVACType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HVACType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandExtendedDiagnosticSummary.go b/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandExtendedDiagnosticSummary.go index 72134a7d1c6..a4fc76924e3 100644 --- a/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandExtendedDiagnosticSummary.go +++ b/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandExtendedDiagnosticSummary.go @@ -658,14 +658,14 @@ func (m *_IdentifyReplyCommandExtendedDiagnosticSummary) SerializeWithWriteBuffe // Simple Field (crc) crc := uint16(m.GetCrc()) - _crcErr := writeBuffer.WriteUint16("crc", 16, (crc)) + _crcErr := writeBuffer.WriteUint16("crc", 16, uint16((crc))) if _crcErr != nil { return errors.Wrap(_crcErr, "Error serializing 'crc' field") } // Simple Field (serialNumber) serialNumber := uint32(m.GetSerialNumber()) - _serialNumberErr := writeBuffer.WriteUint32("serialNumber", 32, (serialNumber)) + _serialNumberErr := writeBuffer.WriteUint32("serialNumber", 32, uint32((serialNumber))) if _serialNumberErr != nil { return errors.Wrap(_serialNumberErr, "Error serializing 'serialNumber' field") } @@ -714,7 +714,7 @@ func (m *_IdentifyReplyCommandExtendedDiagnosticSummary) SerializeWithWriteBuffe }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 1, reserved) + _err := writeBuffer.WriteUint8("reserved", 1, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -730,7 +730,7 @@ func (m *_IdentifyReplyCommandExtendedDiagnosticSummary) SerializeWithWriteBuffe }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 1, reserved) + _err := writeBuffer.WriteUint8("reserved", 1, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -746,7 +746,7 @@ func (m *_IdentifyReplyCommandExtendedDiagnosticSummary) SerializeWithWriteBuffe }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField2 } - _err := writeBuffer.WriteUint8("reserved", 1, reserved) + _err := writeBuffer.WriteUint8("reserved", 1, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandOutputUnitSummary.go b/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandOutputUnitSummary.go index 481550a084f..d036e64156e 100644 --- a/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandOutputUnitSummary.go +++ b/plc4go/protocols/cbus/readwrite/model/IdentifyReplyCommandOutputUnitSummary.go @@ -286,7 +286,7 @@ func (m *_IdentifyReplyCommandOutputUnitSummary) SerializeWithWriteBuffer(ctx co // Simple Field (timeFromLastRecoverOfMainsInSeconds) timeFromLastRecoverOfMainsInSeconds := uint8(m.GetTimeFromLastRecoverOfMainsInSeconds()) - _timeFromLastRecoverOfMainsInSecondsErr := writeBuffer.WriteUint8("timeFromLastRecoverOfMainsInSeconds", 8, (timeFromLastRecoverOfMainsInSeconds)) + _timeFromLastRecoverOfMainsInSecondsErr := writeBuffer.WriteUint8("timeFromLastRecoverOfMainsInSeconds", 8, uint8((timeFromLastRecoverOfMainsInSeconds))) if _timeFromLastRecoverOfMainsInSecondsErr != nil { return errors.Wrap(_timeFromLastRecoverOfMainsInSecondsErr, "Error serializing 'timeFromLastRecoverOfMainsInSeconds' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/Language.go b/plc4go/protocols/cbus/readwrite/model/Language.go index 1ee69779bb3..79b57235a55 100644 --- a/plc4go/protocols/cbus/readwrite/model/Language.go +++ b/plc4go/protocols/cbus/readwrite/model/Language.go @@ -534,7 +534,7 @@ func (e Language) Serialize() ([]byte, error) { func (e Language) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("Language", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("Language", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/LevelInformationAbsent.go b/plc4go/protocols/cbus/readwrite/model/LevelInformationAbsent.go index aa0aa385bbc..a8fefa15391 100644 --- a/plc4go/protocols/cbus/readwrite/model/LevelInformationAbsent.go +++ b/plc4go/protocols/cbus/readwrite/model/LevelInformationAbsent.go @@ -179,7 +179,7 @@ func (m *_LevelInformationAbsent) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/LevelInformationCorrupted.go b/plc4go/protocols/cbus/readwrite/model/LevelInformationCorrupted.go index c62b6dffe55..582bd9dcaa8 100644 --- a/plc4go/protocols/cbus/readwrite/model/LevelInformationCorrupted.go +++ b/plc4go/protocols/cbus/readwrite/model/LevelInformationCorrupted.go @@ -234,28 +234,28 @@ func (m *_LevelInformationCorrupted) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (corruptedNibble1) corruptedNibble1 := uint8(m.GetCorruptedNibble1()) - _corruptedNibble1Err := writeBuffer.WriteUint8("corruptedNibble1", 4, (corruptedNibble1)) + _corruptedNibble1Err := writeBuffer.WriteUint8("corruptedNibble1", 4, uint8((corruptedNibble1))) if _corruptedNibble1Err != nil { return errors.Wrap(_corruptedNibble1Err, "Error serializing 'corruptedNibble1' field") } // Simple Field (corruptedNibble2) corruptedNibble2 := uint8(m.GetCorruptedNibble2()) - _corruptedNibble2Err := writeBuffer.WriteUint8("corruptedNibble2", 4, (corruptedNibble2)) + _corruptedNibble2Err := writeBuffer.WriteUint8("corruptedNibble2", 4, uint8((corruptedNibble2))) if _corruptedNibble2Err != nil { return errors.Wrap(_corruptedNibble2Err, "Error serializing 'corruptedNibble2' field") } // Simple Field (corruptedNibble3) corruptedNibble3 := uint8(m.GetCorruptedNibble3()) - _corruptedNibble3Err := writeBuffer.WriteUint8("corruptedNibble3", 4, (corruptedNibble3)) + _corruptedNibble3Err := writeBuffer.WriteUint8("corruptedNibble3", 4, uint8((corruptedNibble3))) if _corruptedNibble3Err != nil { return errors.Wrap(_corruptedNibble3Err, "Error serializing 'corruptedNibble3' field") } // Simple Field (corruptedNibble4) corruptedNibble4 := uint8(m.GetCorruptedNibble4()) - _corruptedNibble4Err := writeBuffer.WriteUint8("corruptedNibble4", 4, (corruptedNibble4)) + _corruptedNibble4Err := writeBuffer.WriteUint8("corruptedNibble4", 4, uint8((corruptedNibble4))) if _corruptedNibble4Err != nil { return errors.Wrap(_corruptedNibble4Err, "Error serializing 'corruptedNibble4' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/LevelInformationNibblePair.go b/plc4go/protocols/cbus/readwrite/model/LevelInformationNibblePair.go index 08e6bb06bda..7eda64499fe 100644 --- a/plc4go/protocols/cbus/readwrite/model/LevelInformationNibblePair.go +++ b/plc4go/protocols/cbus/readwrite/model/LevelInformationNibblePair.go @@ -298,7 +298,7 @@ func (e LevelInformationNibblePair) Serialize() ([]byte, error) { func (e LevelInformationNibblePair) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("LevelInformationNibblePair", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("LevelInformationNibblePair", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/LightingCommandType.go b/plc4go/protocols/cbus/readwrite/model/LightingCommandType.go index 54cdc7c1f06..3f9712d4ce9 100644 --- a/plc4go/protocols/cbus/readwrite/model/LightingCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/LightingCommandType.go @@ -188,7 +188,7 @@ func (e LightingCommandType) Serialize() ([]byte, error) { func (e LightingCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("LightingCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("LightingCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/LightingCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/LightingCommandTypeContainer.go index 7d5c4dd7c4e..940ba54f8e9 100644 --- a/plc4go/protocols/cbus/readwrite/model/LightingCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/LightingCommandTypeContainer.go @@ -871,7 +871,7 @@ func (e LightingCommandTypeContainer) Serialize() ([]byte, error) { func (e LightingCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("LightingCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("LightingCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/LightingCompatible.go b/plc4go/protocols/cbus/readwrite/model/LightingCompatible.go index 442c8af53cc..73e1659ec30 100644 --- a/plc4go/protocols/cbus/readwrite/model/LightingCompatible.go +++ b/plc4go/protocols/cbus/readwrite/model/LightingCompatible.go @@ -144,7 +144,7 @@ func (e LightingCompatible) Serialize() ([]byte, error) { func (e LightingCompatible) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("LightingCompatible", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("LightingCompatible", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/LightingLabelFlavour.go b/plc4go/protocols/cbus/readwrite/model/LightingLabelFlavour.go index 5c31230274a..0379c1e6bef 100644 --- a/plc4go/protocols/cbus/readwrite/model/LightingLabelFlavour.go +++ b/plc4go/protocols/cbus/readwrite/model/LightingLabelFlavour.go @@ -144,7 +144,7 @@ func (e LightingLabelFlavour) Serialize() ([]byte, error) { func (e LightingLabelFlavour) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("LightingLabelFlavour", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("LightingLabelFlavour", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/LightingLabelType.go b/plc4go/protocols/cbus/readwrite/model/LightingLabelType.go index 4f896b50c10..6129cf7091f 100644 --- a/plc4go/protocols/cbus/readwrite/model/LightingLabelType.go +++ b/plc4go/protocols/cbus/readwrite/model/LightingLabelType.go @@ -144,7 +144,7 @@ func (e LightingLabelType) Serialize() ([]byte, error) { func (e LightingLabelType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("LightingLabelType", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("LightingLabelType", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/LineOffHookReason.go b/plc4go/protocols/cbus/readwrite/model/LineOffHookReason.go index 687d7f420c1..28794454b9f 100644 --- a/plc4go/protocols/cbus/readwrite/model/LineOffHookReason.go +++ b/plc4go/protocols/cbus/readwrite/model/LineOffHookReason.go @@ -168,7 +168,7 @@ func (e LineOffHookReason) Serialize() ([]byte, error) { func (e LineOffHookReason) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("LineOffHookReason", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("LineOffHookReason", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MeasurementCommandType.go b/plc4go/protocols/cbus/readwrite/model/MeasurementCommandType.go index 51f57f315a7..892caad498e 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeasurementCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/MeasurementCommandType.go @@ -148,7 +148,7 @@ func (e MeasurementCommandType) Serialize() ([]byte, error) { func (e MeasurementCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MeasurementCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MeasurementCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MeasurementCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/MeasurementCommandTypeContainer.go index f33d8ceed41..c1941f7d212 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeasurementCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/MeasurementCommandTypeContainer.go @@ -171,7 +171,7 @@ func (e MeasurementCommandTypeContainer) Serialize() ([]byte, error) { func (e MeasurementCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MeasurementCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MeasurementCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MeasurementDataChannelMeasurementData.go b/plc4go/protocols/cbus/readwrite/model/MeasurementDataChannelMeasurementData.go index c011a5265f1..11ebf032051 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeasurementDataChannelMeasurementData.go +++ b/plc4go/protocols/cbus/readwrite/model/MeasurementDataChannelMeasurementData.go @@ -317,14 +317,14 @@ func (m *_MeasurementDataChannelMeasurementData) SerializeWithWriteBuffer(ctx co // Simple Field (deviceId) deviceId := uint8(m.GetDeviceId()) - _deviceIdErr := writeBuffer.WriteUint8("deviceId", 8, (deviceId)) + _deviceIdErr := writeBuffer.WriteUint8("deviceId", 8, uint8((deviceId))) if _deviceIdErr != nil { return errors.Wrap(_deviceIdErr, "Error serializing 'deviceId' field") } // Simple Field (channel) channel := uint8(m.GetChannel()) - _channelErr := writeBuffer.WriteUint8("channel", 8, (channel)) + _channelErr := writeBuffer.WriteUint8("channel", 8, uint8((channel))) if _channelErr != nil { return errors.Wrap(_channelErr, "Error serializing 'channel' field") } @@ -343,21 +343,21 @@ func (m *_MeasurementDataChannelMeasurementData) SerializeWithWriteBuffer(ctx co // Simple Field (multiplier) multiplier := int8(m.GetMultiplier()) - _multiplierErr := writeBuffer.WriteInt8("multiplier", 8, (multiplier)) + _multiplierErr := writeBuffer.WriteInt8("multiplier", 8, int8((multiplier))) if _multiplierErr != nil { return errors.Wrap(_multiplierErr, "Error serializing 'multiplier' field") } // Simple Field (msb) msb := uint8(m.GetMsb()) - _msbErr := writeBuffer.WriteUint8("msb", 8, (msb)) + _msbErr := writeBuffer.WriteUint8("msb", 8, uint8((msb))) if _msbErr != nil { return errors.Wrap(_msbErr, "Error serializing 'msb' field") } // Simple Field (lsb) lsb := uint8(m.GetLsb()) - _lsbErr := writeBuffer.WriteUint8("lsb", 8, (lsb)) + _lsbErr := writeBuffer.WriteUint8("lsb", 8, uint8((lsb))) if _lsbErr != nil { return errors.Wrap(_lsbErr, "Error serializing 'lsb' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MeasurementUnits.go b/plc4go/protocols/cbus/readwrite/model/MeasurementUnits.go index a1f9bc9784d..87cbbd2aeea 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeasurementUnits.go +++ b/plc4go/protocols/cbus/readwrite/model/MeasurementUnits.go @@ -372,7 +372,7 @@ func (e MeasurementUnits) Serialize() ([]byte, error) { func (e MeasurementUnits) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MeasurementUnits", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MeasurementUnits", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandType.go b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandType.go index ea3ce530d16..f766ac37e7e 100644 --- a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandType.go @@ -292,7 +292,7 @@ func (e MediaTransportControlCommandType) Serialize() ([]byte, error) { func (e MediaTransportControlCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MediaTransportControlCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MediaTransportControlCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandTypeContainer.go index 05e5b453381..37ab72cfa62 100644 --- a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlCommandTypeContainer.go @@ -1753,7 +1753,7 @@ func (e MediaTransportControlCommandTypeContainer) Serialize() ([]byte, error) { func (e MediaTransportControlCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MediaTransportControlCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MediaTransportControlCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerateCategoriesSelectionTracks.go b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerateCategoriesSelectionTracks.go index fafa186c4ba..1ad54544799 100644 --- a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerateCategoriesSelectionTracks.go +++ b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerateCategoriesSelectionTracks.go @@ -297,7 +297,7 @@ func (m *_MediaTransportControlDataEnumerateCategoriesSelectionTracks) Serialize // Simple Field (start) start := uint8(m.GetStart()) - _startErr := writeBuffer.WriteUint8("start", 8, (start)) + _startErr := writeBuffer.WriteUint8("start", 8, uint8((start))) if _startErr != nil { return errors.Wrap(_startErr, "Error serializing 'start' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerationsSize.go b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerationsSize.go index 41e2300ebbc..32e709c7867 100644 --- a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerationsSize.go +++ b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataEnumerationsSize.go @@ -316,14 +316,14 @@ func (m *_MediaTransportControlDataEnumerationsSize) SerializeWithWriteBuffer(ct // Simple Field (start) start := uint8(m.GetStart()) - _startErr := writeBuffer.WriteUint8("start", 8, (start)) + _startErr := writeBuffer.WriteUint8("start", 8, uint8((start))) if _startErr != nil { return errors.Wrap(_startErr, "Error serializing 'start' field") } // Simple Field (size) size := uint8(m.GetSize()) - _sizeErr := writeBuffer.WriteUint8("size", 8, (size)) + _sizeErr := writeBuffer.WriteUint8("size", 8, uint8((size))) if _sizeErr != nil { return errors.Wrap(_sizeErr, "Error serializing 'size' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataSetCategory.go b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataSetCategory.go index 88b6c115dcd..ed58d3ad5fa 100644 --- a/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataSetCategory.go +++ b/plc4go/protocols/cbus/readwrite/model/MediaTransportControlDataSetCategory.go @@ -178,7 +178,7 @@ func (m *_MediaTransportControlDataSetCategory) SerializeWithWriteBuffer(ctx con // Simple Field (categoryNumber) categoryNumber := uint8(m.GetCategoryNumber()) - _categoryNumberErr := writeBuffer.WriteUint8("categoryNumber", 8, (categoryNumber)) + _categoryNumberErr := writeBuffer.WriteUint8("categoryNumber", 8, uint8((categoryNumber))) if _categoryNumberErr != nil { return errors.Wrap(_categoryNumberErr, "Error serializing 'categoryNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MeteringCommandType.go b/plc4go/protocols/cbus/readwrite/model/MeteringCommandType.go index 9509c5ad517..094b9f8f959 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeteringCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/MeteringCommandType.go @@ -148,7 +148,7 @@ func (e MeteringCommandType) Serialize() ([]byte, error) { func (e MeteringCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MeteringCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MeteringCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MeteringCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/MeteringCommandTypeContainer.go index 095776f93a7..ae373c37e5a 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeteringCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/MeteringCommandTypeContainer.go @@ -269,7 +269,7 @@ func (e MeteringCommandTypeContainer) Serialize() ([]byte, error) { func (e MeteringCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MeteringCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MeteringCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/MeteringDataDrinkingWaterConsumption.go b/plc4go/protocols/cbus/readwrite/model/MeteringDataDrinkingWaterConsumption.go index 057d6dcdcf3..3bc71ec17d7 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeteringDataDrinkingWaterConsumption.go +++ b/plc4go/protocols/cbus/readwrite/model/MeteringDataDrinkingWaterConsumption.go @@ -178,7 +178,7 @@ func (m *_MeteringDataDrinkingWaterConsumption) SerializeWithWriteBuffer(ctx con // Simple Field (kL) kL := uint32(m.GetKL()) - _kLErr := writeBuffer.WriteUint32("kL", 32, (kL)) + _kLErr := writeBuffer.WriteUint32("kL", 32, uint32((kL))) if _kLErr != nil { return errors.Wrap(_kLErr, "Error serializing 'kL' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MeteringDataElectricityConsumption.go b/plc4go/protocols/cbus/readwrite/model/MeteringDataElectricityConsumption.go index f996225b2a0..67aabb2dded 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeteringDataElectricityConsumption.go +++ b/plc4go/protocols/cbus/readwrite/model/MeteringDataElectricityConsumption.go @@ -178,7 +178,7 @@ func (m *_MeteringDataElectricityConsumption) SerializeWithWriteBuffer(ctx conte // Simple Field (kWhr) kWhr := uint32(m.GetKWhr()) - _kWhrErr := writeBuffer.WriteUint32("kWhr", 32, (kWhr)) + _kWhrErr := writeBuffer.WriteUint32("kWhr", 32, uint32((kWhr))) if _kWhrErr != nil { return errors.Wrap(_kWhrErr, "Error serializing 'kWhr' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MeteringDataGasConsumption.go b/plc4go/protocols/cbus/readwrite/model/MeteringDataGasConsumption.go index b36510b4e27..9cef47414cf 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeteringDataGasConsumption.go +++ b/plc4go/protocols/cbus/readwrite/model/MeteringDataGasConsumption.go @@ -178,7 +178,7 @@ func (m *_MeteringDataGasConsumption) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (mJ) mJ := uint32(m.GetMJ()) - _mJErr := writeBuffer.WriteUint32("mJ", 32, (mJ)) + _mJErr := writeBuffer.WriteUint32("mJ", 32, uint32((mJ))) if _mJErr != nil { return errors.Wrap(_mJErr, "Error serializing 'mJ' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MeteringDataOilConsumption.go b/plc4go/protocols/cbus/readwrite/model/MeteringDataOilConsumption.go index caadc7274ef..bb1ffcd0f27 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeteringDataOilConsumption.go +++ b/plc4go/protocols/cbus/readwrite/model/MeteringDataOilConsumption.go @@ -178,7 +178,7 @@ func (m *_MeteringDataOilConsumption) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (L) L := uint32(m.GetL()) - _LErr := writeBuffer.WriteUint32("L", 32, (L)) + _LErr := writeBuffer.WriteUint32("L", 32, uint32((L))) if _LErr != nil { return errors.Wrap(_LErr, "Error serializing 'L' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MeteringDataOtherWaterConsumption.go b/plc4go/protocols/cbus/readwrite/model/MeteringDataOtherWaterConsumption.go index 5761e77add8..13522679479 100644 --- a/plc4go/protocols/cbus/readwrite/model/MeteringDataOtherWaterConsumption.go +++ b/plc4go/protocols/cbus/readwrite/model/MeteringDataOtherWaterConsumption.go @@ -178,7 +178,7 @@ func (m *_MeteringDataOtherWaterConsumption) SerializeWithWriteBuffer(ctx contex // Simple Field (kL) kL := uint32(m.GetKL()) - _kLErr := writeBuffer.WriteUint32("kL", 32, (kL)) + _kLErr := writeBuffer.WriteUint32("kL", 32, uint32((kL))) if _kLErr != nil { return errors.Wrap(_kLErr, "Error serializing 'kL' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/MonitoredSALShortFormBasicMode.go b/plc4go/protocols/cbus/readwrite/model/MonitoredSALShortFormBasicMode.go index e4228e10b15..624c7a94dc0 100644 --- a/plc4go/protocols/cbus/readwrite/model/MonitoredSALShortFormBasicMode.go +++ b/plc4go/protocols/cbus/readwrite/model/MonitoredSALShortFormBasicMode.go @@ -314,7 +314,7 @@ func (m *_MonitoredSALShortFormBasicMode) SerializeWithWriteBuffer(ctx context.C var bridgeCount *uint8 = nil if m.GetBridgeCount() != nil { bridgeCount = m.GetBridgeCount() - _bridgeCountErr := writeBuffer.WriteUint8("bridgeCount", 8, *(bridgeCount)) + _bridgeCountErr := writeBuffer.WriteUint8("bridgeCount", 8, uint8(*(bridgeCount))) if _bridgeCountErr != nil { return errors.Wrap(_bridgeCountErr, "Error serializing 'bridgeCount' field") } @@ -324,7 +324,7 @@ func (m *_MonitoredSALShortFormBasicMode) SerializeWithWriteBuffer(ctx context.C var networkNumber *uint8 = nil if m.GetNetworkNumber() != nil { networkNumber = m.GetNetworkNumber() - _networkNumberErr := writeBuffer.WriteUint8("networkNumber", 8, *(networkNumber)) + _networkNumberErr := writeBuffer.WriteUint8("networkNumber", 8, uint8(*(networkNumber))) if _networkNumberErr != nil { return errors.Wrap(_networkNumberErr, "Error serializing 'networkNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/NetworkProtocolControlInformation.go b/plc4go/protocols/cbus/readwrite/model/NetworkProtocolControlInformation.go index 6c59dc6ba63..f8c4f7d9b91 100644 --- a/plc4go/protocols/cbus/readwrite/model/NetworkProtocolControlInformation.go +++ b/plc4go/protocols/cbus/readwrite/model/NetworkProtocolControlInformation.go @@ -197,7 +197,7 @@ func (m *_NetworkProtocolControlInformation) SerializeWithWriteBuffer(ctx contex }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 2, reserved) + _err := writeBuffer.WriteUint8("reserved", 2, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -205,14 +205,14 @@ func (m *_NetworkProtocolControlInformation) SerializeWithWriteBuffer(ctx contex // Simple Field (stackCounter) stackCounter := uint8(m.GetStackCounter()) - _stackCounterErr := writeBuffer.WriteUint8("stackCounter", 3, (stackCounter)) + _stackCounterErr := writeBuffer.WriteUint8("stackCounter", 3, uint8((stackCounter))) if _stackCounterErr != nil { return errors.Wrap(_stackCounterErr, "Error serializing 'stackCounter' field") } // Simple Field (stackDepth) stackDepth := uint8(m.GetStackDepth()) - _stackDepthErr := writeBuffer.WriteUint8("stackDepth", 3, (stackDepth)) + _stackDepthErr := writeBuffer.WriteUint8("stackDepth", 3, uint8((stackDepth))) if _stackDepthErr != nil { return errors.Wrap(_stackDepthErr, "Error serializing 'stackDepth' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/PanicStatus.go b/plc4go/protocols/cbus/readwrite/model/PanicStatus.go index 23278bef758..7a77f1e7115 100644 --- a/plc4go/protocols/cbus/readwrite/model/PanicStatus.go +++ b/plc4go/protocols/cbus/readwrite/model/PanicStatus.go @@ -202,7 +202,7 @@ func (m *_PanicStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/Parameter.go b/plc4go/protocols/cbus/readwrite/model/Parameter.go index edf879f5c12..48f6a9c3009 100644 --- a/plc4go/protocols/cbus/readwrite/model/Parameter.go +++ b/plc4go/protocols/cbus/readwrite/model/Parameter.go @@ -7913,7 +7913,7 @@ func (e Parameter) Serialize() ([]byte, error) { func (e Parameter) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("Parameter", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("Parameter", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ParameterType.go b/plc4go/protocols/cbus/readwrite/model/ParameterType.go index 0b927504261..685b2fd1459 100644 --- a/plc4go/protocols/cbus/readwrite/model/ParameterType.go +++ b/plc4go/protocols/cbus/readwrite/model/ParameterType.go @@ -186,7 +186,7 @@ func (e ParameterType) Serialize() ([]byte, error) { func (e ParameterType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ParameterType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ParameterType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/PriorityClass.go b/plc4go/protocols/cbus/readwrite/model/PriorityClass.go index a0cdaa93f6a..93a9fbc0161 100644 --- a/plc4go/protocols/cbus/readwrite/model/PriorityClass.go +++ b/plc4go/protocols/cbus/readwrite/model/PriorityClass.go @@ -144,7 +144,7 @@ func (e PriorityClass) Serialize() ([]byte, error) { func (e PriorityClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("PriorityClass", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("PriorityClass", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ProtectionLevel.go b/plc4go/protocols/cbus/readwrite/model/ProtectionLevel.go index e56abd9dc2f..2ad22d6c61d 100644 --- a/plc4go/protocols/cbus/readwrite/model/ProtectionLevel.go +++ b/plc4go/protocols/cbus/readwrite/model/ProtectionLevel.go @@ -178,7 +178,7 @@ func (e ProtectionLevel) Serialize() ([]byte, error) { func (e ProtectionLevel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ProtectionLevel", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ProtectionLevel", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/RequestNull.go b/plc4go/protocols/cbus/readwrite/model/RequestNull.go index eaf5a3b4a4c..fcb0ae94ac4 100644 --- a/plc4go/protocols/cbus/readwrite/model/RequestNull.go +++ b/plc4go/protocols/cbus/readwrite/model/RequestNull.go @@ -182,7 +182,7 @@ func (m *_RequestNull) SerializeWithWriteBuffer(ctx context.Context, writeBuffer } // Const Field (nullIndicator) - _nullIndicatorErr := writeBuffer.WriteUint32("nullIndicator", 32, 0x6E756C6C) + _nullIndicatorErr := writeBuffer.WriteUint32("nullIndicator", 32, uint32(0x6E756C6C)) if _nullIndicatorErr != nil { return errors.Wrap(_nullIndicatorErr, "Error serializing 'nullIndicator' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/RequestType.go b/plc4go/protocols/cbus/readwrite/model/RequestType.go index 5b7d67c35a7..5f8d4a0a40a 100644 --- a/plc4go/protocols/cbus/readwrite/model/RequestType.go +++ b/plc4go/protocols/cbus/readwrite/model/RequestType.go @@ -208,7 +208,7 @@ func (e RequestType) Serialize() ([]byte, error) { func (e RequestType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("RequestType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("RequestType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityArmCode.go b/plc4go/protocols/cbus/readwrite/model/SecurityArmCode.go index c403f746086..b2d65f145f6 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityArmCode.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityArmCode.go @@ -232,7 +232,7 @@ func (m *_SecurityArmCode) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (code) code := uint8(m.GetCode()) - _codeErr := writeBuffer.WriteUint8("code", 8, (code)) + _codeErr := writeBuffer.WriteUint8("code", 8, uint8((code))) if _codeErr != nil { return errors.Wrap(_codeErr, "Error serializing 'code' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityCommandType.go b/plc4go/protocols/cbus/readwrite/model/SecurityCommandType.go index f26aef9a3c1..661b26f2d43 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityCommandType.go @@ -168,7 +168,7 @@ func (e SecurityCommandType) Serialize() ([]byte, error) { func (e SecurityCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SecurityCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SecurityCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/SecurityCommandTypeContainer.go index d5e4f8e5752..cfd9c262f07 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityCommandTypeContainer.go @@ -1837,7 +1837,7 @@ func (e SecurityCommandTypeContainer) Serialize() ([]byte, error) { func (e SecurityCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SecurityCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SecurityCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataArmReadyNotReady.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataArmReadyNotReady.go index 5fe74422386..855290887be 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataArmReadyNotReady.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataArmReadyNotReady.go @@ -178,7 +178,7 @@ func (m *_SecurityDataArmReadyNotReady) SerializeWithWriteBuffer(ctx context.Con // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataRequestZoneName.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataRequestZoneName.go index cc314026479..6edc18a67e0 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataRequestZoneName.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataRequestZoneName.go @@ -178,7 +178,7 @@ func (m *_SecurityDataRequestZoneName) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneIsolated.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneIsolated.go index e5bea63e246..befecefdd00 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneIsolated.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneIsolated.go @@ -178,7 +178,7 @@ func (m *_SecurityDataZoneIsolated) SerializeWithWriteBuffer(ctx context.Context // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneName.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneName.go index 6e5ca0af9ca..b51a4dc409c 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneName.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneName.go @@ -197,7 +197,7 @@ func (m *_SecurityDataZoneName) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneOpen.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneOpen.go index 4659bc3be9a..fd537e13275 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneOpen.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneOpen.go @@ -178,7 +178,7 @@ func (m *_SecurityDataZoneOpen) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneSealed.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneSealed.go index 7879fd975d8..31b1b43d2de 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneSealed.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneSealed.go @@ -178,7 +178,7 @@ func (m *_SecurityDataZoneSealed) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneShort.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneShort.go index e9d502a29b5..0f7c6dea186 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneShort.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneShort.go @@ -178,7 +178,7 @@ func (m *_SecurityDataZoneShort) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneUnsealed.go b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneUnsealed.go index a7001c49480..35be8e5ac95 100644 --- a/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneUnsealed.go +++ b/plc4go/protocols/cbus/readwrite/model/SecurityDataZoneUnsealed.go @@ -178,7 +178,7 @@ func (m *_SecurityDataZoneUnsealed) SerializeWithWriteBuffer(ctx context.Context // Simple Field (zoneNumber) zoneNumber := uint8(m.GetZoneNumber()) - _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, (zoneNumber)) + _zoneNumberErr := writeBuffer.WriteUint8("zoneNumber", 8, uint8((zoneNumber))) if _zoneNumberErr != nil { return errors.Wrap(_zoneNumberErr, "Error serializing 'zoneNumber' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/TamperStatus.go b/plc4go/protocols/cbus/readwrite/model/TamperStatus.go index ae28c334ff8..22079b80c1e 100644 --- a/plc4go/protocols/cbus/readwrite/model/TamperStatus.go +++ b/plc4go/protocols/cbus/readwrite/model/TamperStatus.go @@ -202,7 +202,7 @@ func (m *_TamperStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyCommandType.go b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandType.go index f530a0f80f0..40cef0fe9df 100644 --- a/plc4go/protocols/cbus/readwrite/model/TelephonyCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandType.go @@ -148,7 +148,7 @@ func (e TelephonyCommandType) Serialize() ([]byte, error) { func (e TelephonyCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TelephonyCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TelephonyCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/TelephonyCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandTypeContainer.go index 6e979f6c86b..8b12a304cd7 100644 --- a/plc4go/protocols/cbus/readwrite/model/TelephonyCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/TelephonyCommandTypeContainer.go @@ -619,7 +619,7 @@ func (e TelephonyCommandTypeContainer) Serialize() ([]byte, error) { func (e TelephonyCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TelephonyCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TelephonyCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandType.go b/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandType.go index f2601f2acb7..3360f822059 100644 --- a/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandType.go @@ -148,7 +148,7 @@ func (e TemperatureBroadcastCommandType) Serialize() ([]byte, error) { func (e TemperatureBroadcastCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TemperatureBroadcastCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TemperatureBroadcastCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandTypeContainer.go index a93e98079e0..81aed6e1da7 100644 --- a/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/TemperatureBroadcastCommandTypeContainer.go @@ -381,7 +381,7 @@ func (e TemperatureBroadcastCommandTypeContainer) Serialize() ([]byte, error) { func (e TemperatureBroadcastCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TemperatureBroadcastCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TemperatureBroadcastCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandType.go b/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandType.go index 2ffb2fdca83..a9b263dcf8c 100644 --- a/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandType.go +++ b/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandType.go @@ -188,7 +188,7 @@ func (e TriggerControlCommandType) Serialize() ([]byte, error) { func (e TriggerControlCommandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TriggerControlCommandType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TriggerControlCommandType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandTypeContainer.go b/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandTypeContainer.go index 4b8db6c9c7c..3a6a0a6bac2 100644 --- a/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandTypeContainer.go +++ b/plc4go/protocols/cbus/readwrite/model/TriggerControlCommandTypeContainer.go @@ -871,7 +871,7 @@ func (e TriggerControlCommandTypeContainer) Serialize() ([]byte, error) { func (e TriggerControlCommandTypeContainer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TriggerControlCommandTypeContainer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TriggerControlCommandTypeContainer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelFlavour.go b/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelFlavour.go index e62e9a89959..42a80b2b2ee 100644 --- a/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelFlavour.go +++ b/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelFlavour.go @@ -144,7 +144,7 @@ func (e TriggerControlLabelFlavour) Serialize() ([]byte, error) { func (e TriggerControlLabelFlavour) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TriggerControlLabelFlavour", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TriggerControlLabelFlavour", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelType.go b/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelType.go index d6e8eafe297..083ff64058b 100644 --- a/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelType.go +++ b/plc4go/protocols/cbus/readwrite/model/TriggerControlLabelType.go @@ -144,7 +144,7 @@ func (e TriggerControlLabelType) Serialize() ([]byte, error) { func (e TriggerControlLabelType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TriggerControlLabelType", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TriggerControlLabelType", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/UnitStatus.go b/plc4go/protocols/cbus/readwrite/model/UnitStatus.go index 9c7493f0833..b66ab76ae75 100644 --- a/plc4go/protocols/cbus/readwrite/model/UnitStatus.go +++ b/plc4go/protocols/cbus/readwrite/model/UnitStatus.go @@ -138,7 +138,7 @@ func (e UnitStatus) Serialize() ([]byte, error) { func (e UnitStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("UnitStatus", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("UnitStatus", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/cbus/readwrite/model/ZoneStatusTemp.go b/plc4go/protocols/cbus/readwrite/model/ZoneStatusTemp.go index 81906cccfa5..375754e0729 100644 --- a/plc4go/protocols/cbus/readwrite/model/ZoneStatusTemp.go +++ b/plc4go/protocols/cbus/readwrite/model/ZoneStatusTemp.go @@ -144,7 +144,7 @@ func (e ZoneStatusTemp) Serialize() ([]byte, error) { func (e ZoneStatusTemp) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ZoneStatusTemp", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ZoneStatusTemp", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/df1/readwrite/model/DF1Command.go b/plc4go/protocols/df1/readwrite/model/DF1Command.go index f52014e4543..4203a82037c 100644 --- a/plc4go/protocols/df1/readwrite/model/DF1Command.go +++ b/plc4go/protocols/df1/readwrite/model/DF1Command.go @@ -212,7 +212,7 @@ func (pm *_DF1Command) SerializeParent(ctx context.Context, writeBuffer utils.Wr // Discriminator Field (commandCode) (Used as input to a switch field) commandCode := uint8(child.GetCommandCode()) - _commandCodeErr := writeBuffer.WriteUint8("commandCode", 8, (commandCode)) + _commandCodeErr := writeBuffer.WriteUint8("commandCode", 8, uint8((commandCode))) if _commandCodeErr != nil { return errors.Wrap(_commandCodeErr, "Error serializing 'commandCode' field") @@ -220,14 +220,14 @@ func (pm *_DF1Command) SerializeParent(ctx context.Context, writeBuffer utils.Wr // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (transactionCounter) transactionCounter := uint16(m.GetTransactionCounter()) - _transactionCounterErr := writeBuffer.WriteUint16("transactionCounter", 16, (transactionCounter)) + _transactionCounterErr := writeBuffer.WriteUint16("transactionCounter", 16, uint16((transactionCounter))) if _transactionCounterErr != nil { return errors.Wrap(_transactionCounterErr, "Error serializing 'transactionCounter' field") } diff --git a/plc4go/protocols/df1/readwrite/model/DF1Symbol.go b/plc4go/protocols/df1/readwrite/model/DF1Symbol.go index 402009e70b7..a57fb84ce84 100644 --- a/plc4go/protocols/df1/readwrite/model/DF1Symbol.go +++ b/plc4go/protocols/df1/readwrite/model/DF1Symbol.go @@ -199,14 +199,14 @@ func (pm *_DF1Symbol) SerializeParent(ctx context.Context, writeBuffer utils.Wri } // Const Field (messageStart) - _messageStartErr := writeBuffer.WriteUint8("messageStart", 8, 0x10) + _messageStartErr := writeBuffer.WriteUint8("messageStart", 8, uint8(0x10)) if _messageStartErr != nil { return errors.Wrap(_messageStartErr, "Error serializing 'messageStart' field") } // Discriminator Field (symbolType) (Used as input to a switch field) symbolType := uint8(child.GetSymbolType()) - _symbolTypeErr := writeBuffer.WriteUint8("symbolType", 8, (symbolType)) + _symbolTypeErr := writeBuffer.WriteUint8("symbolType", 8, uint8((symbolType))) if _symbolTypeErr != nil { return errors.Wrap(_symbolTypeErr, "Error serializing 'symbolType' field") diff --git a/plc4go/protocols/df1/readwrite/model/DF1SymbolMessageFrame.go b/plc4go/protocols/df1/readwrite/model/DF1SymbolMessageFrame.go index 6dabc5b201e..f3810b5d9c0 100644 --- a/plc4go/protocols/df1/readwrite/model/DF1SymbolMessageFrame.go +++ b/plc4go/protocols/df1/readwrite/model/DF1SymbolMessageFrame.go @@ -287,14 +287,14 @@ func (m *_DF1SymbolMessageFrame) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (destinationAddress) destinationAddress := uint8(m.GetDestinationAddress()) - _destinationAddressErr := writeBuffer.WriteUint8("destinationAddress", 8, (destinationAddress)) + _destinationAddressErr := writeBuffer.WriteUint8("destinationAddress", 8, uint8((destinationAddress))) if _destinationAddressErr != nil { return errors.Wrap(_destinationAddressErr, "Error serializing 'destinationAddress' field") } // Simple Field (sourceAddress) sourceAddress := uint8(m.GetSourceAddress()) - _sourceAddressErr := writeBuffer.WriteUint8("sourceAddress", 8, (sourceAddress)) + _sourceAddressErr := writeBuffer.WriteUint8("sourceAddress", 8, uint8((sourceAddress))) if _sourceAddressErr != nil { return errors.Wrap(_sourceAddressErr, "Error serializing 'sourceAddress' field") } @@ -312,13 +312,13 @@ func (m *_DF1SymbolMessageFrame) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (messageEnd) - _messageEndErr := writeBuffer.WriteUint8("messageEnd", 8, 0x10) + _messageEndErr := writeBuffer.WriteUint8("messageEnd", 8, uint8(0x10)) if _messageEndErr != nil { return errors.Wrap(_messageEndErr, "Error serializing 'messageEnd' field") } // Const Field (endTransaction) - _endTransactionErr := writeBuffer.WriteUint8("endTransaction", 8, 0x03) + _endTransactionErr := writeBuffer.WriteUint8("endTransaction", 8, uint8(0x03)) if _endTransactionErr != nil { return errors.Wrap(_endTransactionErr, "Error serializing 'endTransaction' field") } @@ -329,7 +329,7 @@ func (m *_DF1SymbolMessageFrame) SerializeWithWriteBuffer(ctx context.Context, w if _checksumErr != nil { return errors.Wrap(_checksumErr, "Checksum calculation failed") } - _checksumWriteErr := writeBuffer.WriteUint16("checksum", 16, (_checksum)) + _checksumWriteErr := writeBuffer.WriteUint16("checksum", 16, uint16((_checksum))) if _checksumWriteErr != nil { return errors.Wrap(_checksumWriteErr, "Error serializing 'checksum' field") } diff --git a/plc4go/protocols/df1/readwrite/model/DF1UnprotectedReadRequest.go b/plc4go/protocols/df1/readwrite/model/DF1UnprotectedReadRequest.go index b05c250f618..2e6fa7c5c40 100644 --- a/plc4go/protocols/df1/readwrite/model/DF1UnprotectedReadRequest.go +++ b/plc4go/protocols/df1/readwrite/model/DF1UnprotectedReadRequest.go @@ -201,14 +201,14 @@ func (m *_DF1UnprotectedReadRequest) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (address) address := uint16(m.GetAddress()) - _addressErr := writeBuffer.WriteUint16("address", 16, (address)) + _addressErr := writeBuffer.WriteUint16("address", 16, uint16((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } // Simple Field (size) size := uint8(m.GetSize()) - _sizeErr := writeBuffer.WriteUint8("size", 8, (size)) + _sizeErr := writeBuffer.WriteUint8("size", 8, uint8((size))) if _sizeErr != nil { return errors.Wrap(_sizeErr, "Error serializing 'size' field") } diff --git a/plc4go/protocols/eip/readwrite/model/AnsiExtendedSymbolSegment.go b/plc4go/protocols/eip/readwrite/model/AnsiExtendedSymbolSegment.go index 1f665c1adb2..c32d4aca177 100644 --- a/plc4go/protocols/eip/readwrite/model/AnsiExtendedSymbolSegment.go +++ b/plc4go/protocols/eip/readwrite/model/AnsiExtendedSymbolSegment.go @@ -213,7 +213,7 @@ func (m *_AnsiExtendedSymbolSegment) SerializeWithWriteBuffer(ctx context.Contex // Implicit Field (dataSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) dataSize := uint8(uint8(len(m.GetSymbol()))) - _dataSizeErr := writeBuffer.WriteUint8("dataSize", 8, (dataSize)) + _dataSizeErr := writeBuffer.WriteUint8("dataSize", 8, uint8((dataSize))) if _dataSizeErr != nil { return errors.Wrap(_dataSizeErr, "Error serializing 'dataSize' field") } @@ -229,7 +229,7 @@ func (m *_AnsiExtendedSymbolSegment) SerializeWithWriteBuffer(ctx context.Contex var pad *uint8 = nil if m.GetPad() != nil { pad = m.GetPad() - _padErr := writeBuffer.WriteUint8("pad", 8, *(pad)) + _padErr := writeBuffer.WriteUint8("pad", 8, uint8(*(pad))) if _padErr != nil { return errors.Wrap(_padErr, "Error serializing 'pad' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CIPAttributes.go b/plc4go/protocols/eip/readwrite/model/CIPAttributes.go index 5b251f9cd91..046ed3d28d9 100644 --- a/plc4go/protocols/eip/readwrite/model/CIPAttributes.go +++ b/plc4go/protocols/eip/readwrite/model/CIPAttributes.go @@ -251,7 +251,7 @@ func (m *_CIPAttributes) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Implicit Field (numberOfClasses) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numberOfClasses := uint16(uint16(len(m.GetClassId()))) - _numberOfClassesErr := writeBuffer.WriteUint16("numberOfClasses", 16, (numberOfClasses)) + _numberOfClassesErr := writeBuffer.WriteUint16("numberOfClasses", 16, uint16((numberOfClasses))) if _numberOfClassesErr != nil { return errors.Wrap(_numberOfClassesErr, "Error serializing 'numberOfClasses' field") } @@ -262,7 +262,7 @@ func (m *_CIPAttributes) SerializeWithWriteBuffer(ctx context.Context, writeBuff } for _curItem, _element := range m.GetClassId() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'classId' field") } @@ -275,7 +275,7 @@ func (m *_CIPAttributes) SerializeWithWriteBuffer(ctx context.Context, writeBuff var numberAvailable *uint16 = nil if m.GetNumberAvailable() != nil { numberAvailable = m.GetNumberAvailable() - _numberAvailableErr := writeBuffer.WriteUint16("numberAvailable", 16, *(numberAvailable)) + _numberAvailableErr := writeBuffer.WriteUint16("numberAvailable", 16, uint16(*(numberAvailable))) if _numberAvailableErr != nil { return errors.Wrap(_numberAvailableErr, "Error serializing 'numberAvailable' field") } @@ -285,7 +285,7 @@ func (m *_CIPAttributes) SerializeWithWriteBuffer(ctx context.Context, writeBuff var numberActive *uint16 = nil if m.GetNumberActive() != nil { numberActive = m.GetNumberActive() - _numberActiveErr := writeBuffer.WriteUint16("numberActive", 16, *(numberActive)) + _numberActiveErr := writeBuffer.WriteUint16("numberActive", 16, uint16(*(numberActive))) if _numberActiveErr != nil { return errors.Wrap(_numberActiveErr, "Error serializing 'numberActive' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CIPClassID.go b/plc4go/protocols/eip/readwrite/model/CIPClassID.go index 591e9aeba7b..1a382aa7cb2 100644 --- a/plc4go/protocols/eip/readwrite/model/CIPClassID.go +++ b/plc4go/protocols/eip/readwrite/model/CIPClassID.go @@ -536,7 +536,7 @@ func (e CIPClassID) Serialize() ([]byte, error) { func (e CIPClassID) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("CIPClassID", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("CIPClassID", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/eip/readwrite/model/CIPDataConnected.go b/plc4go/protocols/eip/readwrite/model/CIPDataConnected.go index 1ad7900a452..7cb7b416fe1 100644 --- a/plc4go/protocols/eip/readwrite/model/CIPDataConnected.go +++ b/plc4go/protocols/eip/readwrite/model/CIPDataConnected.go @@ -166,14 +166,14 @@ func (m *_CIPDataConnected) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (value) value := uint32(m.GetValue()) - _valueErr := writeBuffer.WriteUint32("value", 32, (value)) + _valueErr := writeBuffer.WriteUint32("value", 32, uint32((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } // Simple Field (tagStatus) tagStatus := uint16(m.GetTagStatus()) - _tagStatusErr := writeBuffer.WriteUint16("tagStatus", 16, (tagStatus)) + _tagStatusErr := writeBuffer.WriteUint16("tagStatus", 16, uint16((tagStatus))) if _tagStatusErr != nil { return errors.Wrap(_tagStatusErr, "Error serializing 'tagStatus' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CIPDataTypeCode.go b/plc4go/protocols/eip/readwrite/model/CIPDataTypeCode.go index f057ff0018e..81cd5dd181a 100644 --- a/plc4go/protocols/eip/readwrite/model/CIPDataTypeCode.go +++ b/plc4go/protocols/eip/readwrite/model/CIPDataTypeCode.go @@ -432,7 +432,7 @@ func (e CIPDataTypeCode) Serialize() ([]byte, error) { func (e CIPDataTypeCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("CIPDataTypeCode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("CIPDataTypeCode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/eip/readwrite/model/CIPStatus.go b/plc4go/protocols/eip/readwrite/model/CIPStatus.go index 817307f924a..bd8f2fda24c 100644 --- a/plc4go/protocols/eip/readwrite/model/CIPStatus.go +++ b/plc4go/protocols/eip/readwrite/model/CIPStatus.go @@ -318,7 +318,7 @@ func (e CIPStatus) Serialize() ([]byte, error) { func (e CIPStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("CIPStatus", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("CIPStatus", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/eip/readwrite/model/CIPStructTypeCode.go b/plc4go/protocols/eip/readwrite/model/CIPStructTypeCode.go index 94ad2fa42a4..2ada846e843 100644 --- a/plc4go/protocols/eip/readwrite/model/CIPStructTypeCode.go +++ b/plc4go/protocols/eip/readwrite/model/CIPStructTypeCode.go @@ -126,7 +126,7 @@ func (e CIPStructTypeCode) Serialize() ([]byte, error) { func (e CIPStructTypeCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("CIPStructTypeCode", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("CIPStructTypeCode", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/eip/readwrite/model/CipConnectedRequest.go b/plc4go/protocols/eip/readwrite/model/CipConnectedRequest.go index 8d0abe7b239..c6e30766634 100644 --- a/plc4go/protocols/eip/readwrite/model/CipConnectedRequest.go +++ b/plc4go/protocols/eip/readwrite/model/CipConnectedRequest.go @@ -245,7 +245,7 @@ func (m *_CipConnectedRequest) SerializeWithWriteBuffer(ctx context.Context, wri // Implicit Field (requestPathSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) requestPathSize := uint8(uint8(uint8(len(m.GetPathSegments()))) / uint8(uint8(2))) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, (requestPathSize)) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8((requestPathSize))) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } @@ -266,7 +266,7 @@ func (m *_CipConnectedRequest) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -282,7 +282,7 @@ func (m *_CipConnectedRequest) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint32("reserved", 32, reserved) + _err := writeBuffer.WriteUint32("reserved", 32, uint32(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipConnectedResponse.go b/plc4go/protocols/eip/readwrite/model/CipConnectedResponse.go index dd50ec6d2b3..ab8014c4da0 100644 --- a/plc4go/protocols/eip/readwrite/model/CipConnectedResponse.go +++ b/plc4go/protocols/eip/readwrite/model/CipConnectedResponse.go @@ -276,7 +276,7 @@ func (m *_CipConnectedResponse) SerializeWithWriteBuffer(ctx context.Context, wr }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -284,14 +284,14 @@ func (m *_CipConnectedResponse) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (additionalStatusWords) additionalStatusWords := uint8(m.GetAdditionalStatusWords()) - _additionalStatusWordsErr := writeBuffer.WriteUint8("additionalStatusWords", 8, (additionalStatusWords)) + _additionalStatusWordsErr := writeBuffer.WriteUint8("additionalStatusWords", 8, uint8((additionalStatusWords))) if _additionalStatusWordsErr != nil { return errors.Wrap(_additionalStatusWordsErr, "Error serializing 'additionalStatusWords' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseRequest.go b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseRequest.go index 24c51ead2d6..4366c6387ce 100644 --- a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseRequest.go +++ b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseRequest.go @@ -430,7 +430,7 @@ func (m *_CipConnectionManagerCloseRequest) SerializeWithWriteBuffer(ctx context // Simple Field (requestPathSize) requestPathSize := uint8(m.GetRequestPathSize()) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, (requestPathSize)) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8((requestPathSize))) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } @@ -461,49 +461,49 @@ func (m *_CipConnectionManagerCloseRequest) SerializeWithWriteBuffer(ctx context // Simple Field (priority) priority := uint8(m.GetPriority()) - _priorityErr := writeBuffer.WriteUint8("priority", 4, (priority)) + _priorityErr := writeBuffer.WriteUint8("priority", 4, uint8((priority))) if _priorityErr != nil { return errors.Wrap(_priorityErr, "Error serializing 'priority' field") } // Simple Field (tickTime) tickTime := uint8(m.GetTickTime()) - _tickTimeErr := writeBuffer.WriteUint8("tickTime", 4, (tickTime)) + _tickTimeErr := writeBuffer.WriteUint8("tickTime", 4, uint8((tickTime))) if _tickTimeErr != nil { return errors.Wrap(_tickTimeErr, "Error serializing 'tickTime' field") } // Simple Field (timeoutTicks) timeoutTicks := uint8(m.GetTimeoutTicks()) - _timeoutTicksErr := writeBuffer.WriteUint8("timeoutTicks", 8, (timeoutTicks)) + _timeoutTicksErr := writeBuffer.WriteUint8("timeoutTicks", 8, uint8((timeoutTicks))) if _timeoutTicksErr != nil { return errors.Wrap(_timeoutTicksErr, "Error serializing 'timeoutTicks' field") } // Simple Field (connectionSerialNumber) connectionSerialNumber := uint16(m.GetConnectionSerialNumber()) - _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, (connectionSerialNumber)) + _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, uint16((connectionSerialNumber))) if _connectionSerialNumberErr != nil { return errors.Wrap(_connectionSerialNumberErr, "Error serializing 'connectionSerialNumber' field") } // Simple Field (originatorVendorId) originatorVendorId := uint16(m.GetOriginatorVendorId()) - _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, (originatorVendorId)) + _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, uint16((originatorVendorId))) if _originatorVendorIdErr != nil { return errors.Wrap(_originatorVendorIdErr, "Error serializing 'originatorVendorId' field") } // Simple Field (originatorSerialNumber) originatorSerialNumber := uint32(m.GetOriginatorSerialNumber()) - _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, (originatorSerialNumber)) + _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, uint32((originatorSerialNumber))) if _originatorSerialNumberErr != nil { return errors.Wrap(_originatorSerialNumberErr, "Error serializing 'originatorSerialNumber' field") } // Simple Field (connectionPathSize) connectionPathSize := uint8(m.GetConnectionPathSize()) - _connectionPathSizeErr := writeBuffer.WriteUint8("connectionPathSize", 8, (connectionPathSize)) + _connectionPathSizeErr := writeBuffer.WriteUint8("connectionPathSize", 8, uint8((connectionPathSize))) if _connectionPathSizeErr != nil { return errors.Wrap(_connectionPathSizeErr, "Error serializing 'connectionPathSize' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseResponse.go b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseResponse.go index d875a5b1777..30eaa034e74 100644 --- a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseResponse.go +++ b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerCloseResponse.go @@ -337,7 +337,7 @@ func (m *_CipConnectionManagerCloseResponse) SerializeWithWriteBuffer(ctx contex }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -345,42 +345,42 @@ func (m *_CipConnectionManagerCloseResponse) SerializeWithWriteBuffer(ctx contex // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (additionalStatusWords) additionalStatusWords := uint8(m.GetAdditionalStatusWords()) - _additionalStatusWordsErr := writeBuffer.WriteUint8("additionalStatusWords", 8, (additionalStatusWords)) + _additionalStatusWordsErr := writeBuffer.WriteUint8("additionalStatusWords", 8, uint8((additionalStatusWords))) if _additionalStatusWordsErr != nil { return errors.Wrap(_additionalStatusWordsErr, "Error serializing 'additionalStatusWords' field") } // Simple Field (connectionSerialNumber) connectionSerialNumber := uint16(m.GetConnectionSerialNumber()) - _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, (connectionSerialNumber)) + _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, uint16((connectionSerialNumber))) if _connectionSerialNumberErr != nil { return errors.Wrap(_connectionSerialNumberErr, "Error serializing 'connectionSerialNumber' field") } // Simple Field (originatorVendorId) originatorVendorId := uint16(m.GetOriginatorVendorId()) - _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, (originatorVendorId)) + _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, uint16((originatorVendorId))) if _originatorVendorIdErr != nil { return errors.Wrap(_originatorVendorIdErr, "Error serializing 'originatorVendorId' field") } // Simple Field (originatorSerialNumber) originatorSerialNumber := uint32(m.GetOriginatorSerialNumber()) - _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, (originatorSerialNumber)) + _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, uint32((originatorSerialNumber))) if _originatorSerialNumberErr != nil { return errors.Wrap(_originatorSerialNumberErr, "Error serializing 'originatorSerialNumber' field") } // Simple Field (applicationReplySize) applicationReplySize := uint8(m.GetApplicationReplySize()) - _applicationReplySizeErr := writeBuffer.WriteUint8("applicationReplySize", 8, (applicationReplySize)) + _applicationReplySizeErr := writeBuffer.WriteUint8("applicationReplySize", 8, uint8((applicationReplySize))) if _applicationReplySizeErr != nil { return errors.Wrap(_applicationReplySizeErr, "Error serializing 'applicationReplySize' field") } @@ -395,7 +395,7 @@ func (m *_CipConnectionManagerCloseResponse) SerializeWithWriteBuffer(ctx contex }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerRequest.go b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerRequest.go index d17a1934666..ba43a8d90dc 100644 --- a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerRequest.go +++ b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerRequest.go @@ -591,7 +591,7 @@ func (m *_CipConnectionManagerRequest) SerializeWithWriteBuffer(ctx context.Cont // Implicit Field (requestPathSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) requestPathSize := uint8(uint8((uint8(m.GetClassSegment().GetLengthInBytes(ctx)) + uint8(m.GetInstanceSegment().GetLengthInBytes(ctx)))) / uint8(uint8(2))) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, (requestPathSize)) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8((requestPathSize))) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } @@ -622,63 +622,63 @@ func (m *_CipConnectionManagerRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (priority) priority := uint8(m.GetPriority()) - _priorityErr := writeBuffer.WriteUint8("priority", 4, (priority)) + _priorityErr := writeBuffer.WriteUint8("priority", 4, uint8((priority))) if _priorityErr != nil { return errors.Wrap(_priorityErr, "Error serializing 'priority' field") } // Simple Field (tickTime) tickTime := uint8(m.GetTickTime()) - _tickTimeErr := writeBuffer.WriteUint8("tickTime", 4, (tickTime)) + _tickTimeErr := writeBuffer.WriteUint8("tickTime", 4, uint8((tickTime))) if _tickTimeErr != nil { return errors.Wrap(_tickTimeErr, "Error serializing 'tickTime' field") } // Simple Field (timeoutTicks) timeoutTicks := uint8(m.GetTimeoutTicks()) - _timeoutTicksErr := writeBuffer.WriteUint8("timeoutTicks", 8, (timeoutTicks)) + _timeoutTicksErr := writeBuffer.WriteUint8("timeoutTicks", 8, uint8((timeoutTicks))) if _timeoutTicksErr != nil { return errors.Wrap(_timeoutTicksErr, "Error serializing 'timeoutTicks' field") } // Simple Field (otConnectionId) otConnectionId := uint32(m.GetOtConnectionId()) - _otConnectionIdErr := writeBuffer.WriteUint32("otConnectionId", 32, (otConnectionId)) + _otConnectionIdErr := writeBuffer.WriteUint32("otConnectionId", 32, uint32((otConnectionId))) if _otConnectionIdErr != nil { return errors.Wrap(_otConnectionIdErr, "Error serializing 'otConnectionId' field") } // Simple Field (toConnectionId) toConnectionId := uint32(m.GetToConnectionId()) - _toConnectionIdErr := writeBuffer.WriteUint32("toConnectionId", 32, (toConnectionId)) + _toConnectionIdErr := writeBuffer.WriteUint32("toConnectionId", 32, uint32((toConnectionId))) if _toConnectionIdErr != nil { return errors.Wrap(_toConnectionIdErr, "Error serializing 'toConnectionId' field") } // Simple Field (connectionSerialNumber) connectionSerialNumber := uint16(m.GetConnectionSerialNumber()) - _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, (connectionSerialNumber)) + _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, uint16((connectionSerialNumber))) if _connectionSerialNumberErr != nil { return errors.Wrap(_connectionSerialNumberErr, "Error serializing 'connectionSerialNumber' field") } // Simple Field (originatorVendorId) originatorVendorId := uint16(m.GetOriginatorVendorId()) - _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, (originatorVendorId)) + _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, uint16((originatorVendorId))) if _originatorVendorIdErr != nil { return errors.Wrap(_originatorVendorIdErr, "Error serializing 'originatorVendorId' field") } // Simple Field (originatorSerialNumber) originatorSerialNumber := uint32(m.GetOriginatorSerialNumber()) - _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, (originatorSerialNumber)) + _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, uint32((originatorSerialNumber))) if _originatorSerialNumberErr != nil { return errors.Wrap(_originatorSerialNumberErr, "Error serializing 'originatorSerialNumber' field") } // Simple Field (timeoutMultiplier) timeoutMultiplier := uint8(m.GetTimeoutMultiplier()) - _timeoutMultiplierErr := writeBuffer.WriteUint8("timeoutMultiplier", 8, (timeoutMultiplier)) + _timeoutMultiplierErr := writeBuffer.WriteUint8("timeoutMultiplier", 8, uint8((timeoutMultiplier))) if _timeoutMultiplierErr != nil { return errors.Wrap(_timeoutMultiplierErr, "Error serializing 'timeoutMultiplier' field") } @@ -693,7 +693,7 @@ func (m *_CipConnectionManagerRequest) SerializeWithWriteBuffer(ctx context.Cont }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint32("reserved", 24, reserved) + _err := writeBuffer.WriteUint32("reserved", 24, uint32(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -701,7 +701,7 @@ func (m *_CipConnectionManagerRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (otRpi) otRpi := uint32(m.GetOtRpi()) - _otRpiErr := writeBuffer.WriteUint32("otRpi", 32, (otRpi)) + _otRpiErr := writeBuffer.WriteUint32("otRpi", 32, uint32((otRpi))) if _otRpiErr != nil { return errors.Wrap(_otRpiErr, "Error serializing 'otRpi' field") } @@ -720,7 +720,7 @@ func (m *_CipConnectionManagerRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (toRpi) toRpi := uint32(m.GetToRpi()) - _toRpiErr := writeBuffer.WriteUint32("toRpi", 32, (toRpi)) + _toRpiErr := writeBuffer.WriteUint32("toRpi", 32, uint32((toRpi))) if _toRpiErr != nil { return errors.Wrap(_toRpiErr, "Error serializing 'toRpi' field") } @@ -751,7 +751,7 @@ func (m *_CipConnectionManagerRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (connectionPathSize) connectionPathSize := uint8(m.GetConnectionPathSize()) - _connectionPathSizeErr := writeBuffer.WriteUint8("connectionPathSize", 8, (connectionPathSize)) + _connectionPathSizeErr := writeBuffer.WriteUint8("connectionPathSize", 8, uint8((connectionPathSize))) if _connectionPathSizeErr != nil { return errors.Wrap(_connectionPathSizeErr, "Error serializing 'connectionPathSize' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerResponse.go b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerResponse.go index a9376c9b856..771af9355e5 100644 --- a/plc4go/protocols/eip/readwrite/model/CipConnectionManagerResponse.go +++ b/plc4go/protocols/eip/readwrite/model/CipConnectionManagerResponse.go @@ -366,7 +366,7 @@ func (m *_CipConnectionManagerResponse) SerializeWithWriteBuffer(ctx context.Con }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint32("reserved", 24, reserved) + _err := writeBuffer.WriteUint32("reserved", 24, uint32(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -374,56 +374,56 @@ func (m *_CipConnectionManagerResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (otConnectionId) otConnectionId := uint32(m.GetOtConnectionId()) - _otConnectionIdErr := writeBuffer.WriteUint32("otConnectionId", 32, (otConnectionId)) + _otConnectionIdErr := writeBuffer.WriteUint32("otConnectionId", 32, uint32((otConnectionId))) if _otConnectionIdErr != nil { return errors.Wrap(_otConnectionIdErr, "Error serializing 'otConnectionId' field") } // Simple Field (toConnectionId) toConnectionId := uint32(m.GetToConnectionId()) - _toConnectionIdErr := writeBuffer.WriteUint32("toConnectionId", 32, (toConnectionId)) + _toConnectionIdErr := writeBuffer.WriteUint32("toConnectionId", 32, uint32((toConnectionId))) if _toConnectionIdErr != nil { return errors.Wrap(_toConnectionIdErr, "Error serializing 'toConnectionId' field") } // Simple Field (connectionSerialNumber) connectionSerialNumber := uint16(m.GetConnectionSerialNumber()) - _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, (connectionSerialNumber)) + _connectionSerialNumberErr := writeBuffer.WriteUint16("connectionSerialNumber", 16, uint16((connectionSerialNumber))) if _connectionSerialNumberErr != nil { return errors.Wrap(_connectionSerialNumberErr, "Error serializing 'connectionSerialNumber' field") } // Simple Field (originatorVendorId) originatorVendorId := uint16(m.GetOriginatorVendorId()) - _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, (originatorVendorId)) + _originatorVendorIdErr := writeBuffer.WriteUint16("originatorVendorId", 16, uint16((originatorVendorId))) if _originatorVendorIdErr != nil { return errors.Wrap(_originatorVendorIdErr, "Error serializing 'originatorVendorId' field") } // Simple Field (originatorSerialNumber) originatorSerialNumber := uint32(m.GetOriginatorSerialNumber()) - _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, (originatorSerialNumber)) + _originatorSerialNumberErr := writeBuffer.WriteUint32("originatorSerialNumber", 32, uint32((originatorSerialNumber))) if _originatorSerialNumberErr != nil { return errors.Wrap(_originatorSerialNumberErr, "Error serializing 'originatorSerialNumber' field") } // Simple Field (otApi) otApi := uint32(m.GetOtApi()) - _otApiErr := writeBuffer.WriteUint32("otApi", 32, (otApi)) + _otApiErr := writeBuffer.WriteUint32("otApi", 32, uint32((otApi))) if _otApiErr != nil { return errors.Wrap(_otApiErr, "Error serializing 'otApi' field") } // Simple Field (toApi) toApi := uint32(m.GetToApi()) - _toApiErr := writeBuffer.WriteUint32("toApi", 32, (toApi)) + _toApiErr := writeBuffer.WriteUint32("toApi", 32, uint32((toApi))) if _toApiErr != nil { return errors.Wrap(_toApiErr, "Error serializing 'toApi' field") } // Implicit Field (replySize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) replySize := uint8(uint8(uint8(m.GetLengthInBytes(ctx))) - uint8(uint8(30))) - _replySizeErr := writeBuffer.WriteUint8("replySize", 8, (replySize)) + _replySizeErr := writeBuffer.WriteUint8("replySize", 8, uint8((replySize))) if _replySizeErr != nil { return errors.Wrap(_replySizeErr, "Error serializing 'replySize' field") } @@ -438,7 +438,7 @@ func (m *_CipConnectionManagerResponse) SerializeWithWriteBuffer(ctx context.Con }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipIdentity.go b/plc4go/protocols/eip/readwrite/model/CipIdentity.go index 6201ec89dfd..848a50cebf1 100644 --- a/plc4go/protocols/eip/readwrite/model/CipIdentity.go +++ b/plc4go/protocols/eip/readwrite/model/CipIdentity.go @@ -494,28 +494,28 @@ func (m *_CipIdentity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Implicit Field (itemLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) itemLength := uint16(uint16(uint16(34)) + uint16(uint8(len(m.GetProductName())))) - _itemLengthErr := writeBuffer.WriteUint16("itemLength", 16, (itemLength)) + _itemLengthErr := writeBuffer.WriteUint16("itemLength", 16, uint16((itemLength))) if _itemLengthErr != nil { return errors.Wrap(_itemLengthErr, "Error serializing 'itemLength' field") } // Simple Field (encapsulationProtocolVersion) encapsulationProtocolVersion := uint16(m.GetEncapsulationProtocolVersion()) - _encapsulationProtocolVersionErr := writeBuffer.WriteUint16("encapsulationProtocolVersion", 16, (encapsulationProtocolVersion)) + _encapsulationProtocolVersionErr := writeBuffer.WriteUint16("encapsulationProtocolVersion", 16, uint16((encapsulationProtocolVersion))) if _encapsulationProtocolVersionErr != nil { return errors.Wrap(_encapsulationProtocolVersionErr, "Error serializing 'encapsulationProtocolVersion' field") } // Simple Field (socketAddressFamily) socketAddressFamily := uint16(m.GetSocketAddressFamily()) - _socketAddressFamilyErr := writeBuffer.WriteUint16("socketAddressFamily", 16, (socketAddressFamily)) + _socketAddressFamilyErr := writeBuffer.WriteUint16("socketAddressFamily", 16, uint16((socketAddressFamily))) if _socketAddressFamilyErr != nil { return errors.Wrap(_socketAddressFamilyErr, "Error serializing 'socketAddressFamily' field") } // Simple Field (socketAddressPort) socketAddressPort := uint16(m.GetSocketAddressPort()) - _socketAddressPortErr := writeBuffer.WriteUint16("socketAddressPort", 16, (socketAddressPort)) + _socketAddressPortErr := writeBuffer.WriteUint16("socketAddressPort", 16, uint16((socketAddressPort))) if _socketAddressPortErr != nil { return errors.Wrap(_socketAddressPortErr, "Error serializing 'socketAddressPort' field") } @@ -526,7 +526,7 @@ func (m *_CipIdentity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer } for _curItem, _element := range m.GetSocketAddressAddress() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'socketAddressAddress' field") } @@ -536,69 +536,69 @@ func (m *_CipIdentity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer } // Const Field (zeroes1) - _zeroes1Err := writeBuffer.WriteUint32("zeroes1", 32, 0x00000000) + _zeroes1Err := writeBuffer.WriteUint32("zeroes1", 32, uint32(0x00000000)) if _zeroes1Err != nil { return errors.Wrap(_zeroes1Err, "Error serializing 'zeroes1' field") } // Const Field (zeroes2) - _zeroes2Err := writeBuffer.WriteUint32("zeroes2", 32, 0x00000000) + _zeroes2Err := writeBuffer.WriteUint32("zeroes2", 32, uint32(0x00000000)) if _zeroes2Err != nil { return errors.Wrap(_zeroes2Err, "Error serializing 'zeroes2' field") } // Simple Field (vendorId) vendorId := uint16(m.GetVendorId()) - _vendorIdErr := writeBuffer.WriteUint16("vendorId", 16, (vendorId)) + _vendorIdErr := writeBuffer.WriteUint16("vendorId", 16, uint16((vendorId))) if _vendorIdErr != nil { return errors.Wrap(_vendorIdErr, "Error serializing 'vendorId' field") } // Simple Field (deviceType) deviceType := uint16(m.GetDeviceType()) - _deviceTypeErr := writeBuffer.WriteUint16("deviceType", 16, (deviceType)) + _deviceTypeErr := writeBuffer.WriteUint16("deviceType", 16, uint16((deviceType))) if _deviceTypeErr != nil { return errors.Wrap(_deviceTypeErr, "Error serializing 'deviceType' field") } // Simple Field (productCode) productCode := uint16(m.GetProductCode()) - _productCodeErr := writeBuffer.WriteUint16("productCode", 16, (productCode)) + _productCodeErr := writeBuffer.WriteUint16("productCode", 16, uint16((productCode))) if _productCodeErr != nil { return errors.Wrap(_productCodeErr, "Error serializing 'productCode' field") } // Simple Field (revisionMajor) revisionMajor := uint8(m.GetRevisionMajor()) - _revisionMajorErr := writeBuffer.WriteUint8("revisionMajor", 8, (revisionMajor)) + _revisionMajorErr := writeBuffer.WriteUint8("revisionMajor", 8, uint8((revisionMajor))) if _revisionMajorErr != nil { return errors.Wrap(_revisionMajorErr, "Error serializing 'revisionMajor' field") } // Simple Field (revisionMinor) revisionMinor := uint8(m.GetRevisionMinor()) - _revisionMinorErr := writeBuffer.WriteUint8("revisionMinor", 8, (revisionMinor)) + _revisionMinorErr := writeBuffer.WriteUint8("revisionMinor", 8, uint8((revisionMinor))) if _revisionMinorErr != nil { return errors.Wrap(_revisionMinorErr, "Error serializing 'revisionMinor' field") } // Simple Field (status) status := uint16(m.GetStatus()) - _statusErr := writeBuffer.WriteUint16("status", 16, (status)) + _statusErr := writeBuffer.WriteUint16("status", 16, uint16((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (serialNumber) serialNumber := uint32(m.GetSerialNumber()) - _serialNumberErr := writeBuffer.WriteUint32("serialNumber", 32, (serialNumber)) + _serialNumberErr := writeBuffer.WriteUint32("serialNumber", 32, uint32((serialNumber))) if _serialNumberErr != nil { return errors.Wrap(_serialNumberErr, "Error serializing 'serialNumber' field") } // Implicit Field (productNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) productNameLength := uint8(uint8(len(m.GetProductName()))) - _productNameLengthErr := writeBuffer.WriteUint8("productNameLength", 8, (productNameLength)) + _productNameLengthErr := writeBuffer.WriteUint8("productNameLength", 8, uint8((productNameLength))) if _productNameLengthErr != nil { return errors.Wrap(_productNameLengthErr, "Error serializing 'productNameLength' field") } @@ -612,7 +612,7 @@ func (m *_CipIdentity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (state) state := uint8(m.GetState()) - _stateErr := writeBuffer.WriteUint8("state", 8, (state)) + _stateErr := writeBuffer.WriteUint8("state", 8, uint8((state))) if _stateErr != nil { return errors.Wrap(_stateErr, "Error serializing 'state' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipRRData.go b/plc4go/protocols/eip/readwrite/model/CipRRData.go index 80f059c0464..9ad8dfe5f22 100644 --- a/plc4go/protocols/eip/readwrite/model/CipRRData.go +++ b/plc4go/protocols/eip/readwrite/model/CipRRData.go @@ -267,21 +267,21 @@ func (m *_CipRRData) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u // Simple Field (interfaceHandle) interfaceHandle := uint32(m.GetInterfaceHandle()) - _interfaceHandleErr := writeBuffer.WriteUint32("interfaceHandle", 32, (interfaceHandle)) + _interfaceHandleErr := writeBuffer.WriteUint32("interfaceHandle", 32, uint32((interfaceHandle))) if _interfaceHandleErr != nil { return errors.Wrap(_interfaceHandleErr, "Error serializing 'interfaceHandle' field") } // Simple Field (timeout) timeout := uint16(m.GetTimeout()) - _timeoutErr := writeBuffer.WriteUint16("timeout", 16, (timeout)) + _timeoutErr := writeBuffer.WriteUint16("timeout", 16, uint16((timeout))) if _timeoutErr != nil { return errors.Wrap(_timeoutErr, "Error serializing 'timeout' field") } // Implicit Field (typeIdCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) typeIdCount := uint16(uint16(len(m.GetTypeIds()))) - _typeIdCountErr := writeBuffer.WriteUint16("typeIdCount", 16, (typeIdCount)) + _typeIdCountErr := writeBuffer.WriteUint16("typeIdCount", 16, uint16((typeIdCount))) if _typeIdCountErr != nil { return errors.Wrap(_typeIdCountErr, "Error serializing 'typeIdCount' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipReadRequest.go b/plc4go/protocols/eip/readwrite/model/CipReadRequest.go index 94278ea7907..101a6741cd4 100644 --- a/plc4go/protocols/eip/readwrite/model/CipReadRequest.go +++ b/plc4go/protocols/eip/readwrite/model/CipReadRequest.go @@ -219,7 +219,7 @@ func (m *_CipReadRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Implicit Field (requestPathSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) requestPathSize := uint8(uint8(uint8(len(m.GetTag()))) / uint8(uint8(2))) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, (requestPathSize)) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8((requestPathSize))) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } @@ -232,7 +232,7 @@ func (m *_CipReadRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (elementNb) elementNb := uint16(m.GetElementNb()) - _elementNbErr := writeBuffer.WriteUint16("elementNb", 16, (elementNb)) + _elementNbErr := writeBuffer.WriteUint16("elementNb", 16, uint16((elementNb))) if _elementNbErr != nil { return errors.Wrap(_elementNbErr, "Error serializing 'elementNb' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipReadResponse.go b/plc4go/protocols/eip/readwrite/model/CipReadResponse.go index 8cb8ef5bdf3..cf6a67fe90f 100644 --- a/plc4go/protocols/eip/readwrite/model/CipReadResponse.go +++ b/plc4go/protocols/eip/readwrite/model/CipReadResponse.go @@ -276,7 +276,7 @@ func (m *_CipReadResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -284,14 +284,14 @@ func (m *_CipReadResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (extStatus) extStatus := uint8(m.GetExtStatus()) - _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, (extStatus)) + _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, uint8((extStatus))) if _extStatusErr != nil { return errors.Wrap(_extStatusErr, "Error serializing 'extStatus' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipSecurityInformation.go b/plc4go/protocols/eip/readwrite/model/CipSecurityInformation.go index c48b5a7adfe..ed6b4109a74 100644 --- a/plc4go/protocols/eip/readwrite/model/CipSecurityInformation.go +++ b/plc4go/protocols/eip/readwrite/model/CipSecurityInformation.go @@ -211,7 +211,7 @@ func (m *_CipSecurityInformation) SerializeWithWriteBuffer(ctx context.Context, // Implicit Field (itemLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) itemLength := uint16(uint16(len(m.GetTodoImplement()))) - _itemLengthErr := writeBuffer.WriteUint16("itemLength", 16, (itemLength)) + _itemLengthErr := writeBuffer.WriteUint16("itemLength", 16, uint16((itemLength))) if _itemLengthErr != nil { return errors.Wrap(_itemLengthErr, "Error serializing 'itemLength' field") } @@ -222,7 +222,7 @@ func (m *_CipSecurityInformation) SerializeWithWriteBuffer(ctx context.Context, } for _curItem, _element := range m.GetTodoImplement() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'todoImplement' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipService.go b/plc4go/protocols/eip/readwrite/model/CipService.go index ffec02cf6c8..6164ee472f1 100644 --- a/plc4go/protocols/eip/readwrite/model/CipService.go +++ b/plc4go/protocols/eip/readwrite/model/CipService.go @@ -239,7 +239,7 @@ func (pm *_CipService) SerializeParent(ctx context.Context, writeBuffer utils.Wr // Discriminator Field (service) (Used as input to a switch field) service := uint8(child.GetService()) - _serviceErr := writeBuffer.WriteUint8("service", 7, (service)) + _serviceErr := writeBuffer.WriteUint8("service", 7, uint8((service))) if _serviceErr != nil { return errors.Wrap(_serviceErr, "Error serializing 'service' field") diff --git a/plc4go/protocols/eip/readwrite/model/CipUnconnectedRequest.go b/plc4go/protocols/eip/readwrite/model/CipUnconnectedRequest.go index 7dda56379b6..fa297c8217e 100644 --- a/plc4go/protocols/eip/readwrite/model/CipUnconnectedRequest.go +++ b/plc4go/protocols/eip/readwrite/model/CipUnconnectedRequest.go @@ -354,7 +354,7 @@ func (m *_CipUnconnectedRequest) SerializeWithWriteBuffer(ctx context.Context, w // Implicit Field (requestPathSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) requestPathSize := uint8(uint8((uint8(m.GetClassSegment().GetLengthInBytes(ctx)) + uint8(m.GetInstanceSegment().GetLengthInBytes(ctx)))) / uint8(uint8(2))) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, (requestPathSize)) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8((requestPathSize))) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } @@ -393,7 +393,7 @@ func (m *_CipUnconnectedRequest) SerializeWithWriteBuffer(ctx context.Context, w }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -401,7 +401,7 @@ func (m *_CipUnconnectedRequest) SerializeWithWriteBuffer(ctx context.Context, w // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := uint16(uint16(uint16(uint16(m.GetLengthInBytes(ctx)))-uint16(uint16(10))) - uint16(uint16(4))) - _messageSizeErr := writeBuffer.WriteUint16("messageSize", 16, (messageSize)) + _messageSizeErr := writeBuffer.WriteUint16("messageSize", 16, uint16((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } @@ -419,21 +419,21 @@ func (m *_CipUnconnectedRequest) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (route) - _routeErr := writeBuffer.WriteUint16("route", 16, 0x0001) + _routeErr := writeBuffer.WriteUint16("route", 16, uint16(0x0001)) if _routeErr != nil { return errors.Wrap(_routeErr, "Error serializing 'route' field") } // Simple Field (backPlane) backPlane := int8(m.GetBackPlane()) - _backPlaneErr := writeBuffer.WriteInt8("backPlane", 8, (backPlane)) + _backPlaneErr := writeBuffer.WriteInt8("backPlane", 8, int8((backPlane))) if _backPlaneErr != nil { return errors.Wrap(_backPlaneErr, "Error serializing 'backPlane' field") } // Simple Field (slot) slot := int8(m.GetSlot()) - _slotErr := writeBuffer.WriteInt8("slot", 8, (slot)) + _slotErr := writeBuffer.WriteInt8("slot", 8, int8((slot))) if _slotErr != nil { return errors.Wrap(_slotErr, "Error serializing 'slot' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipWriteRequest.go b/plc4go/protocols/eip/readwrite/model/CipWriteRequest.go index 201362d2fd5..5cddb59a1d3 100644 --- a/plc4go/protocols/eip/readwrite/model/CipWriteRequest.go +++ b/plc4go/protocols/eip/readwrite/model/CipWriteRequest.go @@ -264,7 +264,7 @@ func (m *_CipWriteRequest) SerializeWithWriteBuffer(ctx context.Context, writeBu // Implicit Field (requestPathSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) requestPathSize := uint8(uint8(uint8(len(m.GetTag()))) / uint8(uint8(2))) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, (requestPathSize)) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8((requestPathSize))) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } @@ -289,7 +289,7 @@ func (m *_CipWriteRequest) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (elementNb) elementNb := uint16(m.GetElementNb()) - _elementNbErr := writeBuffer.WriteUint16("elementNb", 16, (elementNb)) + _elementNbErr := writeBuffer.WriteUint16("elementNb", 16, uint16((elementNb))) if _elementNbErr != nil { return errors.Wrap(_elementNbErr, "Error serializing 'elementNb' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CipWriteResponse.go b/plc4go/protocols/eip/readwrite/model/CipWriteResponse.go index 522b9036736..96314a01069 100644 --- a/plc4go/protocols/eip/readwrite/model/CipWriteResponse.go +++ b/plc4go/protocols/eip/readwrite/model/CipWriteResponse.go @@ -239,7 +239,7 @@ func (m *_CipWriteResponse) SerializeWithWriteBuffer(ctx context.Context, writeB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -247,14 +247,14 @@ func (m *_CipWriteResponse) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (extStatus) extStatus := uint8(m.GetExtStatus()) - _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, (extStatus)) + _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, uint8((extStatus))) if _extStatusErr != nil { return errors.Wrap(_extStatusErr, "Error serializing 'extStatus' field") } diff --git a/plc4go/protocols/eip/readwrite/model/ClassID.go b/plc4go/protocols/eip/readwrite/model/ClassID.go index 8358aeefcbc..8d23e894e9d 100644 --- a/plc4go/protocols/eip/readwrite/model/ClassID.go +++ b/plc4go/protocols/eip/readwrite/model/ClassID.go @@ -198,14 +198,14 @@ func (m *_ClassID) SerializeWithWriteBuffer(ctx context.Context, writeBuffer uti // Simple Field (format) format := uint8(m.GetFormat()) - _formatErr := writeBuffer.WriteUint8("format", 2, (format)) + _formatErr := writeBuffer.WriteUint8("format", 2, uint8((format))) if _formatErr != nil { return errors.Wrap(_formatErr, "Error serializing 'format' field") } // Simple Field (segmentClass) segmentClass := uint8(m.GetSegmentClass()) - _segmentClassErr := writeBuffer.WriteUint8("segmentClass", 8, (segmentClass)) + _segmentClassErr := writeBuffer.WriteUint8("segmentClass", 8, uint8((segmentClass))) if _segmentClassErr != nil { return errors.Wrap(_segmentClassErr, "Error serializing 'segmentClass' field") } diff --git a/plc4go/protocols/eip/readwrite/model/ClassSegment.go b/plc4go/protocols/eip/readwrite/model/ClassSegment.go index 78c51c61a58..e35aade40ac 100644 --- a/plc4go/protocols/eip/readwrite/model/ClassSegment.go +++ b/plc4go/protocols/eip/readwrite/model/ClassSegment.go @@ -202,28 +202,28 @@ func (m *_ClassSegment) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (pathSegmentType) pathSegmentType := uint8(m.GetPathSegmentType()) - _pathSegmentTypeErr := writeBuffer.WriteUint8("pathSegmentType", 3, (pathSegmentType)) + _pathSegmentTypeErr := writeBuffer.WriteUint8("pathSegmentType", 3, uint8((pathSegmentType))) if _pathSegmentTypeErr != nil { return errors.Wrap(_pathSegmentTypeErr, "Error serializing 'pathSegmentType' field") } // Simple Field (logicalSegmentType) logicalSegmentType := uint8(m.GetLogicalSegmentType()) - _logicalSegmentTypeErr := writeBuffer.WriteUint8("logicalSegmentType", 3, (logicalSegmentType)) + _logicalSegmentTypeErr := writeBuffer.WriteUint8("logicalSegmentType", 3, uint8((logicalSegmentType))) if _logicalSegmentTypeErr != nil { return errors.Wrap(_logicalSegmentTypeErr, "Error serializing 'logicalSegmentType' field") } // Simple Field (logicalSegmentFormat) logicalSegmentFormat := uint8(m.GetLogicalSegmentFormat()) - _logicalSegmentFormatErr := writeBuffer.WriteUint8("logicalSegmentFormat", 2, (logicalSegmentFormat)) + _logicalSegmentFormatErr := writeBuffer.WriteUint8("logicalSegmentFormat", 2, uint8((logicalSegmentFormat))) if _logicalSegmentFormatErr != nil { return errors.Wrap(_logicalSegmentFormatErr, "Error serializing 'logicalSegmentFormat' field") } // Simple Field (classSegment) classSegment := uint8(m.GetClassSegment()) - _classSegmentErr := writeBuffer.WriteUint8("classSegment", 8, (classSegment)) + _classSegmentErr := writeBuffer.WriteUint8("classSegment", 8, uint8((classSegment))) if _classSegmentErr != nil { return errors.Wrap(_classSegmentErr, "Error serializing 'classSegment' field") } diff --git a/plc4go/protocols/eip/readwrite/model/CommandSpecificDataItem.go b/plc4go/protocols/eip/readwrite/model/CommandSpecificDataItem.go index 7cba1821ed0..6c3cbe8fb39 100644 --- a/plc4go/protocols/eip/readwrite/model/CommandSpecificDataItem.go +++ b/plc4go/protocols/eip/readwrite/model/CommandSpecificDataItem.go @@ -168,7 +168,7 @@ func (pm *_CommandSpecificDataItem) SerializeParent(ctx context.Context, writeBu // Discriminator Field (itemType) (Used as input to a switch field) itemType := uint16(child.GetItemType()) - _itemTypeErr := writeBuffer.WriteUint16("itemType", 16, (itemType)) + _itemTypeErr := writeBuffer.WriteUint16("itemType", 16, uint16((itemType))) if _itemTypeErr != nil { return errors.Wrap(_itemTypeErr, "Error serializing 'itemType' field") diff --git a/plc4go/protocols/eip/readwrite/model/ConnectedAddressItem.go b/plc4go/protocols/eip/readwrite/model/ConnectedAddressItem.go index 27520dd2ba4..2d2a5da18b4 100644 --- a/plc4go/protocols/eip/readwrite/model/ConnectedAddressItem.go +++ b/plc4go/protocols/eip/readwrite/model/ConnectedAddressItem.go @@ -210,7 +210,7 @@ func (m *_ConnectedAddressItem) SerializeWithWriteBuffer(ctx context.Context, wr }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -218,7 +218,7 @@ func (m *_ConnectedAddressItem) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (connectionId) connectionId := uint32(m.GetConnectionId()) - _connectionIdErr := writeBuffer.WriteUint32("connectionId", 32, (connectionId)) + _connectionIdErr := writeBuffer.WriteUint32("connectionId", 32, uint32((connectionId))) if _connectionIdErr != nil { return errors.Wrap(_connectionIdErr, "Error serializing 'connectionId' field") } diff --git a/plc4go/protocols/eip/readwrite/model/ConnectedDataItem.go b/plc4go/protocols/eip/readwrite/model/ConnectedDataItem.go index 1bd069c286b..b500f3f0c3c 100644 --- a/plc4go/protocols/eip/readwrite/model/ConnectedDataItem.go +++ b/plc4go/protocols/eip/readwrite/model/ConnectedDataItem.go @@ -214,14 +214,14 @@ func (m *_ConnectedDataItem) SerializeWithWriteBuffer(ctx context.Context, write // Implicit Field (packetSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) packetSize := uint16(uint16(m.GetService().GetLengthInBytes(ctx)) + uint16(uint16(2))) - _packetSizeErr := writeBuffer.WriteUint16("packetSize", 16, (packetSize)) + _packetSizeErr := writeBuffer.WriteUint16("packetSize", 16, uint16((packetSize))) if _packetSizeErr != nil { return errors.Wrap(_packetSizeErr, "Error serializing 'packetSize' field") } // Simple Field (sequenceCount) sequenceCount := uint16(m.GetSequenceCount()) - _sequenceCountErr := writeBuffer.WriteUint16("sequenceCount", 16, (sequenceCount)) + _sequenceCountErr := writeBuffer.WriteUint16("sequenceCount", 16, uint16((sequenceCount))) if _sequenceCountErr != nil { return errors.Wrap(_sequenceCountErr, "Error serializing 'sequenceCount' field") } diff --git a/plc4go/protocols/eip/readwrite/model/DataSegmentType.go b/plc4go/protocols/eip/readwrite/model/DataSegmentType.go index eccd160c322..5bdf66bd20d 100644 --- a/plc4go/protocols/eip/readwrite/model/DataSegmentType.go +++ b/plc4go/protocols/eip/readwrite/model/DataSegmentType.go @@ -166,7 +166,7 @@ func (pm *_DataSegmentType) SerializeParent(ctx context.Context, writeBuffer uti // Discriminator Field (dataSegmentType) (Used as input to a switch field) dataSegmentType := uint8(child.GetDataSegmentType()) - _dataSegmentTypeErr := writeBuffer.WriteUint8("dataSegmentType", 5, (dataSegmentType)) + _dataSegmentTypeErr := writeBuffer.WriteUint8("dataSegmentType", 5, uint8((dataSegmentType))) if _dataSegmentTypeErr != nil { return errors.Wrap(_dataSegmentTypeErr, "Error serializing 'dataSegmentType' field") diff --git a/plc4go/protocols/eip/readwrite/model/EiPCommand.go b/plc4go/protocols/eip/readwrite/model/EiPCommand.go index 10f0dce75ab..51a3d512006 100644 --- a/plc4go/protocols/eip/readwrite/model/EiPCommand.go +++ b/plc4go/protocols/eip/readwrite/model/EiPCommand.go @@ -138,7 +138,7 @@ func (e EiPCommand) Serialize() ([]byte, error) { func (e EiPCommand) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("EiPCommand", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("EiPCommand", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/eip/readwrite/model/EipConnectionRequest.go b/plc4go/protocols/eip/readwrite/model/EipConnectionRequest.go index 4dd2c0dc799..fc577cbe647 100644 --- a/plc4go/protocols/eip/readwrite/model/EipConnectionRequest.go +++ b/plc4go/protocols/eip/readwrite/model/EipConnectionRequest.go @@ -208,13 +208,13 @@ func (m *_EipConnectionRequest) SerializeWithWriteBuffer(ctx context.Context, wr } // Const Field (protocolVersion) - _protocolVersionErr := writeBuffer.WriteUint16("protocolVersion", 16, 0x01) + _protocolVersionErr := writeBuffer.WriteUint16("protocolVersion", 16, uint16(0x01)) if _protocolVersionErr != nil { return errors.Wrap(_protocolVersionErr, "Error serializing 'protocolVersion' field") } // Const Field (flags) - _flagsErr := writeBuffer.WriteUint16("flags", 16, 0x00) + _flagsErr := writeBuffer.WriteUint16("flags", 16, uint16(0x00)) if _flagsErr != nil { return errors.Wrap(_flagsErr, "Error serializing 'flags' field") } diff --git a/plc4go/protocols/eip/readwrite/model/EipConnectionResponse.go b/plc4go/protocols/eip/readwrite/model/EipConnectionResponse.go index 6f53d923dc9..3085bc98f91 100644 --- a/plc4go/protocols/eip/readwrite/model/EipConnectionResponse.go +++ b/plc4go/protocols/eip/readwrite/model/EipConnectionResponse.go @@ -208,13 +208,13 @@ func (m *_EipConnectionResponse) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (protocolVersion) - _protocolVersionErr := writeBuffer.WriteUint16("protocolVersion", 16, 0x01) + _protocolVersionErr := writeBuffer.WriteUint16("protocolVersion", 16, uint16(0x01)) if _protocolVersionErr != nil { return errors.Wrap(_protocolVersionErr, "Error serializing 'protocolVersion' field") } // Const Field (flags) - _flagsErr := writeBuffer.WriteUint16("flags", 16, 0x00) + _flagsErr := writeBuffer.WriteUint16("flags", 16, uint16(0x00)) if _flagsErr != nil { return errors.Wrap(_flagsErr, "Error serializing 'flags' field") } diff --git a/plc4go/protocols/eip/readwrite/model/EipConstants.go b/plc4go/protocols/eip/readwrite/model/EipConstants.go index 979033a82b1..658beb5b3bf 100644 --- a/plc4go/protocols/eip/readwrite/model/EipConstants.go +++ b/plc4go/protocols/eip/readwrite/model/EipConstants.go @@ -164,13 +164,13 @@ func (m *_EipConstants) SerializeWithWriteBuffer(ctx context.Context, writeBuffe } // Const Field (eipUdpDiscoveryDefaultPort) - _eipUdpDiscoveryDefaultPortErr := writeBuffer.WriteUint16("eipUdpDiscoveryDefaultPort", 16, 44818) + _eipUdpDiscoveryDefaultPortErr := writeBuffer.WriteUint16("eipUdpDiscoveryDefaultPort", 16, uint16(44818)) if _eipUdpDiscoveryDefaultPortErr != nil { return errors.Wrap(_eipUdpDiscoveryDefaultPortErr, "Error serializing 'eipUdpDiscoveryDefaultPort' field") } // Const Field (eipTcpDefaultPort) - _eipTcpDefaultPortErr := writeBuffer.WriteUint16("eipTcpDefaultPort", 16, 44818) + _eipTcpDefaultPortErr := writeBuffer.WriteUint16("eipTcpDefaultPort", 16, uint16(44818)) if _eipTcpDefaultPortErr != nil { return errors.Wrap(_eipTcpDefaultPortErr, "Error serializing 'eipTcpDefaultPort' field") } diff --git a/plc4go/protocols/eip/readwrite/model/EipListIdentityResponse.go b/plc4go/protocols/eip/readwrite/model/EipListIdentityResponse.go index 7622174fbb9..cf3b967b493 100644 --- a/plc4go/protocols/eip/readwrite/model/EipListIdentityResponse.go +++ b/plc4go/protocols/eip/readwrite/model/EipListIdentityResponse.go @@ -229,7 +229,7 @@ func (m *_EipListIdentityResponse) SerializeWithWriteBuffer(ctx context.Context, // Implicit Field (itemCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) itemCount := uint16(uint16(len(m.GetItems()))) - _itemCountErr := writeBuffer.WriteUint16("itemCount", 16, (itemCount)) + _itemCountErr := writeBuffer.WriteUint16("itemCount", 16, uint16((itemCount))) if _itemCountErr != nil { return errors.Wrap(_itemCountErr, "Error serializing 'itemCount' field") } diff --git a/plc4go/protocols/eip/readwrite/model/EipPacket.go b/plc4go/protocols/eip/readwrite/model/EipPacket.go index 61e34789a70..04ddd470543 100644 --- a/plc4go/protocols/eip/readwrite/model/EipPacket.go +++ b/plc4go/protocols/eip/readwrite/model/EipPacket.go @@ -285,7 +285,7 @@ func (pm *_EipPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Discriminator Field (command) (Used as input to a switch field) command := uint16(child.GetCommand()) - _commandErr := writeBuffer.WriteUint16("command", 16, (command)) + _commandErr := writeBuffer.WriteUint16("command", 16, uint16((command))) if _commandErr != nil { return errors.Wrap(_commandErr, "Error serializing 'command' field") @@ -293,21 +293,21 @@ func (pm *_EipPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Implicit Field (packetLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) packetLength := uint16(uint16(uint16(m.GetLengthInBytes(ctx))) - uint16(uint16(24))) - _packetLengthErr := writeBuffer.WriteUint16("packetLength", 16, (packetLength)) + _packetLengthErr := writeBuffer.WriteUint16("packetLength", 16, uint16((packetLength))) if _packetLengthErr != nil { return errors.Wrap(_packetLengthErr, "Error serializing 'packetLength' field") } // Simple Field (sessionHandle) sessionHandle := uint32(m.GetSessionHandle()) - _sessionHandleErr := writeBuffer.WriteUint32("sessionHandle", 32, (sessionHandle)) + _sessionHandleErr := writeBuffer.WriteUint32("sessionHandle", 32, uint32((sessionHandle))) if _sessionHandleErr != nil { return errors.Wrap(_sessionHandleErr, "Error serializing 'sessionHandle' field") } // Simple Field (status) status := uint32(m.GetStatus()) - _statusErr := writeBuffer.WriteUint32("status", 32, (status)) + _statusErr := writeBuffer.WriteUint32("status", 32, uint32((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } @@ -320,7 +320,7 @@ func (pm *_EipPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Simple Field (options) options := uint32(m.GetOptions()) - _optionsErr := writeBuffer.WriteUint32("options", 32, (options)) + _optionsErr := writeBuffer.WriteUint32("options", 32, uint32((options))) if _optionsErr != nil { return errors.Wrap(_optionsErr, "Error serializing 'options' field") } diff --git a/plc4go/protocols/eip/readwrite/model/GetAttributeAllRequest.go b/plc4go/protocols/eip/readwrite/model/GetAttributeAllRequest.go index 7c55184b324..24b961e7305 100644 --- a/plc4go/protocols/eip/readwrite/model/GetAttributeAllRequest.go +++ b/plc4go/protocols/eip/readwrite/model/GetAttributeAllRequest.go @@ -230,7 +230,7 @@ func (m *_GetAttributeAllRequest) SerializeWithWriteBuffer(ctx context.Context, // Implicit Field (requestPathSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) requestPathSize := uint8(uint8((uint8(m.GetClassSegment().GetLengthInBytes(ctx)) + uint8(m.GetInstanceSegment().GetLengthInBytes(ctx)))) / uint8(uint8(2))) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, (requestPathSize)) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8((requestPathSize))) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } diff --git a/plc4go/protocols/eip/readwrite/model/GetAttributeAllResponse.go b/plc4go/protocols/eip/readwrite/model/GetAttributeAllResponse.go index cdbad689207..ea19a044ec9 100644 --- a/plc4go/protocols/eip/readwrite/model/GetAttributeAllResponse.go +++ b/plc4go/protocols/eip/readwrite/model/GetAttributeAllResponse.go @@ -276,7 +276,7 @@ func (m *_GetAttributeAllResponse) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -284,14 +284,14 @@ func (m *_GetAttributeAllResponse) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (extStatus) extStatus := uint8(m.GetExtStatus()) - _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, (extStatus)) + _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, uint8((extStatus))) if _extStatusErr != nil { return errors.Wrap(_extStatusErr, "Error serializing 'extStatus' field") } diff --git a/plc4go/protocols/eip/readwrite/model/InstanceID.go b/plc4go/protocols/eip/readwrite/model/InstanceID.go index 5b95559d342..3a5671a1fc5 100644 --- a/plc4go/protocols/eip/readwrite/model/InstanceID.go +++ b/plc4go/protocols/eip/readwrite/model/InstanceID.go @@ -198,14 +198,14 @@ func (m *_InstanceID) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (format) format := uint8(m.GetFormat()) - _formatErr := writeBuffer.WriteUint8("format", 2, (format)) + _formatErr := writeBuffer.WriteUint8("format", 2, uint8((format))) if _formatErr != nil { return errors.Wrap(_formatErr, "Error serializing 'format' field") } // Simple Field (instance) instance := uint8(m.GetInstance()) - _instanceErr := writeBuffer.WriteUint8("instance", 8, (instance)) + _instanceErr := writeBuffer.WriteUint8("instance", 8, uint8((instance))) if _instanceErr != nil { return errors.Wrap(_instanceErr, "Error serializing 'instance' field") } diff --git a/plc4go/protocols/eip/readwrite/model/InstanceSegment.go b/plc4go/protocols/eip/readwrite/model/InstanceSegment.go index 14d63f9037a..970f94b445b 100644 --- a/plc4go/protocols/eip/readwrite/model/InstanceSegment.go +++ b/plc4go/protocols/eip/readwrite/model/InstanceSegment.go @@ -202,28 +202,28 @@ func (m *_InstanceSegment) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (pathSegmentType) pathSegmentType := uint8(m.GetPathSegmentType()) - _pathSegmentTypeErr := writeBuffer.WriteUint8("pathSegmentType", 3, (pathSegmentType)) + _pathSegmentTypeErr := writeBuffer.WriteUint8("pathSegmentType", 3, uint8((pathSegmentType))) if _pathSegmentTypeErr != nil { return errors.Wrap(_pathSegmentTypeErr, "Error serializing 'pathSegmentType' field") } // Simple Field (logicalSegmentType) logicalSegmentType := uint8(m.GetLogicalSegmentType()) - _logicalSegmentTypeErr := writeBuffer.WriteUint8("logicalSegmentType", 3, (logicalSegmentType)) + _logicalSegmentTypeErr := writeBuffer.WriteUint8("logicalSegmentType", 3, uint8((logicalSegmentType))) if _logicalSegmentTypeErr != nil { return errors.Wrap(_logicalSegmentTypeErr, "Error serializing 'logicalSegmentType' field") } // Simple Field (logicalSegmentFormat) logicalSegmentFormat := uint8(m.GetLogicalSegmentFormat()) - _logicalSegmentFormatErr := writeBuffer.WriteUint8("logicalSegmentFormat", 2, (logicalSegmentFormat)) + _logicalSegmentFormatErr := writeBuffer.WriteUint8("logicalSegmentFormat", 2, uint8((logicalSegmentFormat))) if _logicalSegmentFormatErr != nil { return errors.Wrap(_logicalSegmentFormatErr, "Error serializing 'logicalSegmentFormat' field") } // Simple Field (instance) instance := uint8(m.GetInstance()) - _instanceErr := writeBuffer.WriteUint8("instance", 8, (instance)) + _instanceErr := writeBuffer.WriteUint8("instance", 8, uint8((instance))) if _instanceErr != nil { return errors.Wrap(_instanceErr, "Error serializing 'instance' field") } diff --git a/plc4go/protocols/eip/readwrite/model/ListServicesResponse.go b/plc4go/protocols/eip/readwrite/model/ListServicesResponse.go index adeef4cde58..5a58cb8eb91 100644 --- a/plc4go/protocols/eip/readwrite/model/ListServicesResponse.go +++ b/plc4go/protocols/eip/readwrite/model/ListServicesResponse.go @@ -229,7 +229,7 @@ func (m *_ListServicesResponse) SerializeWithWriteBuffer(ctx context.Context, wr // Implicit Field (typeIdCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) typeIdCount := uint16(uint16(len(m.GetTypeIds()))) - _typeIdCountErr := writeBuffer.WriteUint16("typeIdCount", 16, (typeIdCount)) + _typeIdCountErr := writeBuffer.WriteUint16("typeIdCount", 16, uint16((typeIdCount))) if _typeIdCountErr != nil { return errors.Wrap(_typeIdCountErr, "Error serializing 'typeIdCount' field") } diff --git a/plc4go/protocols/eip/readwrite/model/LogicalSegmentType.go b/plc4go/protocols/eip/readwrite/model/LogicalSegmentType.go index ed1e8334803..47811aaa257 100644 --- a/plc4go/protocols/eip/readwrite/model/LogicalSegmentType.go +++ b/plc4go/protocols/eip/readwrite/model/LogicalSegmentType.go @@ -170,7 +170,7 @@ func (pm *_LogicalSegmentType) SerializeParent(ctx context.Context, writeBuffer // Discriminator Field (logicalSegmentType) (Used as input to a switch field) logicalSegmentType := uint8(child.GetLogicalSegmentType()) - _logicalSegmentTypeErr := writeBuffer.WriteUint8("logicalSegmentType", 3, (logicalSegmentType)) + _logicalSegmentTypeErr := writeBuffer.WriteUint8("logicalSegmentType", 3, uint8((logicalSegmentType))) if _logicalSegmentTypeErr != nil { return errors.Wrap(_logicalSegmentTypeErr, "Error serializing 'logicalSegmentType' field") diff --git a/plc4go/protocols/eip/readwrite/model/MemberID.go b/plc4go/protocols/eip/readwrite/model/MemberID.go index 906ab5dda75..2d727dd660d 100644 --- a/plc4go/protocols/eip/readwrite/model/MemberID.go +++ b/plc4go/protocols/eip/readwrite/model/MemberID.go @@ -198,14 +198,14 @@ func (m *_MemberID) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Simple Field (format) format := uint8(m.GetFormat()) - _formatErr := writeBuffer.WriteUint8("format", 2, (format)) + _formatErr := writeBuffer.WriteUint8("format", 2, uint8((format))) if _formatErr != nil { return errors.Wrap(_formatErr, "Error serializing 'format' field") } // Simple Field (instance) instance := uint8(m.GetInstance()) - _instanceErr := writeBuffer.WriteUint8("instance", 8, (instance)) + _instanceErr := writeBuffer.WriteUint8("instance", 8, uint8((instance))) if _instanceErr != nil { return errors.Wrap(_instanceErr, "Error serializing 'instance' field") } diff --git a/plc4go/protocols/eip/readwrite/model/MultipleServiceRequest.go b/plc4go/protocols/eip/readwrite/model/MultipleServiceRequest.go index 8ca073078f8..e4e1b05fe3e 100644 --- a/plc4go/protocols/eip/readwrite/model/MultipleServiceRequest.go +++ b/plc4go/protocols/eip/readwrite/model/MultipleServiceRequest.go @@ -239,13 +239,13 @@ func (m *_MultipleServiceRequest) SerializeWithWriteBuffer(ctx context.Context, } // Const Field (requestPathSize) - _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, 0x02) + _requestPathSizeErr := writeBuffer.WriteUint8("requestPathSize", 8, uint8(0x02)) if _requestPathSizeErr != nil { return errors.Wrap(_requestPathSizeErr, "Error serializing 'requestPathSize' field") } // Const Field (requestPath) - _requestPathErr := writeBuffer.WriteUint32("requestPath", 32, 0x01240220) + _requestPathErr := writeBuffer.WriteUint32("requestPath", 32, uint32(0x01240220)) if _requestPathErr != nil { return errors.Wrap(_requestPathErr, "Error serializing 'requestPath' field") } diff --git a/plc4go/protocols/eip/readwrite/model/MultipleServiceResponse.go b/plc4go/protocols/eip/readwrite/model/MultipleServiceResponse.go index 6a8b1eb10d7..39c6a6f8651 100644 --- a/plc4go/protocols/eip/readwrite/model/MultipleServiceResponse.go +++ b/plc4go/protocols/eip/readwrite/model/MultipleServiceResponse.go @@ -319,7 +319,7 @@ func (m *_MultipleServiceResponse) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -327,21 +327,21 @@ func (m *_MultipleServiceResponse) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (status) status := uint8(m.GetStatus()) - _statusErr := writeBuffer.WriteUint8("status", 8, (status)) + _statusErr := writeBuffer.WriteUint8("status", 8, uint8((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (extStatus) extStatus := uint8(m.GetExtStatus()) - _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, (extStatus)) + _extStatusErr := writeBuffer.WriteUint8("extStatus", 8, uint8((extStatus))) if _extStatusErr != nil { return errors.Wrap(_extStatusErr, "Error serializing 'extStatus' field") } // Simple Field (serviceNb) serviceNb := uint16(m.GetServiceNb()) - _serviceNbErr := writeBuffer.WriteUint16("serviceNb", 16, (serviceNb)) + _serviceNbErr := writeBuffer.WriteUint16("serviceNb", 16, uint16((serviceNb))) if _serviceNbErr != nil { return errors.Wrap(_serviceNbErr, "Error serializing 'serviceNb' field") } @@ -352,7 +352,7 @@ func (m *_MultipleServiceResponse) SerializeWithWriteBuffer(ctx context.Context, } for _curItem, _element := range m.GetOffsets() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'offsets' field") } diff --git a/plc4go/protocols/eip/readwrite/model/NetworkConnectionParameters.go b/plc4go/protocols/eip/readwrite/model/NetworkConnectionParameters.go index 1fb7dcbbeac..bc777465fbf 100644 --- a/plc4go/protocols/eip/readwrite/model/NetworkConnectionParameters.go +++ b/plc4go/protocols/eip/readwrite/model/NetworkConnectionParameters.go @@ -287,7 +287,7 @@ func (m *_NetworkConnectionParameters) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (connectionSize) connectionSize := uint16(m.GetConnectionSize()) - _connectionSizeErr := writeBuffer.WriteUint16("connectionSize", 16, (connectionSize)) + _connectionSizeErr := writeBuffer.WriteUint16("connectionSize", 16, uint16((connectionSize))) if _connectionSizeErr != nil { return errors.Wrap(_connectionSizeErr, "Error serializing 'connectionSize' field") } @@ -302,7 +302,7 @@ func (m *_NetworkConnectionParameters) SerializeWithWriteBuffer(ctx context.Cont }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -317,7 +317,7 @@ func (m *_NetworkConnectionParameters) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (connectionType) connectionType := uint8(m.GetConnectionType()) - _connectionTypeErr := writeBuffer.WriteUint8("connectionType", 2, (connectionType)) + _connectionTypeErr := writeBuffer.WriteUint8("connectionType", 2, uint8((connectionType))) if _connectionTypeErr != nil { return errors.Wrap(_connectionTypeErr, "Error serializing 'connectionType' field") } @@ -340,7 +340,7 @@ func (m *_NetworkConnectionParameters) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (priority) priority := uint8(m.GetPriority()) - _priorityErr := writeBuffer.WriteUint8("priority", 2, (priority)) + _priorityErr := writeBuffer.WriteUint8("priority", 2, uint8((priority))) if _priorityErr != nil { return errors.Wrap(_priorityErr, "Error serializing 'priority' field") } diff --git a/plc4go/protocols/eip/readwrite/model/NullAddressItem.go b/plc4go/protocols/eip/readwrite/model/NullAddressItem.go index 0bac555fbae..509b691fe55 100644 --- a/plc4go/protocols/eip/readwrite/model/NullAddressItem.go +++ b/plc4go/protocols/eip/readwrite/model/NullAddressItem.go @@ -181,7 +181,7 @@ func (m *_NullAddressItem) SerializeWithWriteBuffer(ctx context.Context, writeBu }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/eip/readwrite/model/PathSegment.go b/plc4go/protocols/eip/readwrite/model/PathSegment.go index 3e8fe3d8e18..8b02e6d5dcb 100644 --- a/plc4go/protocols/eip/readwrite/model/PathSegment.go +++ b/plc4go/protocols/eip/readwrite/model/PathSegment.go @@ -170,7 +170,7 @@ func (pm *_PathSegment) SerializeParent(ctx context.Context, writeBuffer utils.W // Discriminator Field (pathSegment) (Used as input to a switch field) pathSegment := uint8(child.GetPathSegment()) - _pathSegmentErr := writeBuffer.WriteUint8("pathSegment", 3, (pathSegment)) + _pathSegmentErr := writeBuffer.WriteUint8("pathSegment", 3, uint8((pathSegment))) if _pathSegmentErr != nil { return errors.Wrap(_pathSegmentErr, "Error serializing 'pathSegment' field") diff --git a/plc4go/protocols/eip/readwrite/model/PortSegmentExtended.go b/plc4go/protocols/eip/readwrite/model/PortSegmentExtended.go index 854044fa586..5b173ec7334 100644 --- a/plc4go/protocols/eip/readwrite/model/PortSegmentExtended.go +++ b/plc4go/protocols/eip/readwrite/model/PortSegmentExtended.go @@ -241,14 +241,14 @@ func (m *_PortSegmentExtended) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (port) port := uint8(m.GetPort()) - _portErr := writeBuffer.WriteUint8("port", 4, (port)) + _portErr := writeBuffer.WriteUint8("port", 4, uint8((port))) if _portErr != nil { return errors.Wrap(_portErr, "Error serializing 'port' field") } // Simple Field (linkAddressSize) linkAddressSize := uint8(m.GetLinkAddressSize()) - _linkAddressSizeErr := writeBuffer.WriteUint8("linkAddressSize", 8, (linkAddressSize)) + _linkAddressSizeErr := writeBuffer.WriteUint8("linkAddressSize", 8, uint8((linkAddressSize))) if _linkAddressSizeErr != nil { return errors.Wrap(_linkAddressSizeErr, "Error serializing 'linkAddressSize' field") } diff --git a/plc4go/protocols/eip/readwrite/model/PortSegmentNormal.go b/plc4go/protocols/eip/readwrite/model/PortSegmentNormal.go index 2f02cf59afa..9ab40dc52ca 100644 --- a/plc4go/protocols/eip/readwrite/model/PortSegmentNormal.go +++ b/plc4go/protocols/eip/readwrite/model/PortSegmentNormal.go @@ -198,14 +198,14 @@ func (m *_PortSegmentNormal) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (port) port := uint8(m.GetPort()) - _portErr := writeBuffer.WriteUint8("port", 4, (port)) + _portErr := writeBuffer.WriteUint8("port", 4, uint8((port))) if _portErr != nil { return errors.Wrap(_portErr, "Error serializing 'port' field") } // Simple Field (linkAddress) linkAddress := uint8(m.GetLinkAddress()) - _linkAddressErr := writeBuffer.WriteUint8("linkAddress", 8, (linkAddress)) + _linkAddressErr := writeBuffer.WriteUint8("linkAddress", 8, uint8((linkAddress))) if _linkAddressErr != nil { return errors.Wrap(_linkAddressErr, "Error serializing 'linkAddress' field") } diff --git a/plc4go/protocols/eip/readwrite/model/SendUnitData.go b/plc4go/protocols/eip/readwrite/model/SendUnitData.go index d1624ab68b1..642eeb5d57a 100644 --- a/plc4go/protocols/eip/readwrite/model/SendUnitData.go +++ b/plc4go/protocols/eip/readwrite/model/SendUnitData.go @@ -275,21 +275,21 @@ func (m *_SendUnitData) SerializeWithWriteBuffer(ctx context.Context, writeBuffe } // Const Field (interfaceHandle) - _interfaceHandleErr := writeBuffer.WriteUint32("interfaceHandle", 32, 0x00000000) + _interfaceHandleErr := writeBuffer.WriteUint32("interfaceHandle", 32, uint32(0x00000000)) if _interfaceHandleErr != nil { return errors.Wrap(_interfaceHandleErr, "Error serializing 'interfaceHandle' field") } // Simple Field (timeout) timeout := uint16(m.GetTimeout()) - _timeoutErr := writeBuffer.WriteUint16("timeout", 16, (timeout)) + _timeoutErr := writeBuffer.WriteUint16("timeout", 16, uint16((timeout))) if _timeoutErr != nil { return errors.Wrap(_timeoutErr, "Error serializing 'timeout' field") } // Implicit Field (typeIdCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) typeIdCount := uint16(uint16(len(m.GetTypeIds()))) - _typeIdCountErr := writeBuffer.WriteUint16("typeIdCount", 16, (typeIdCount)) + _typeIdCountErr := writeBuffer.WriteUint16("typeIdCount", 16, uint16((typeIdCount))) if _typeIdCountErr != nil { return errors.Wrap(_typeIdCountErr, "Error serializing 'typeIdCount' field") } diff --git a/plc4go/protocols/eip/readwrite/model/Services.go b/plc4go/protocols/eip/readwrite/model/Services.go index 2644b5c7af7..0f034ce2da4 100644 --- a/plc4go/protocols/eip/readwrite/model/Services.go +++ b/plc4go/protocols/eip/readwrite/model/Services.go @@ -229,7 +229,7 @@ func (m *_Services) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Implicit Field (serviceNb) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) serviceNb := uint16(uint16(len(m.GetOffsets()))) - _serviceNbErr := writeBuffer.WriteUint16("serviceNb", 16, (serviceNb)) + _serviceNbErr := writeBuffer.WriteUint16("serviceNb", 16, uint16((serviceNb))) if _serviceNbErr != nil { return errors.Wrap(_serviceNbErr, "Error serializing 'serviceNb' field") } @@ -240,7 +240,7 @@ func (m *_Services) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut } for _curItem, _element := range m.GetOffsets() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'offsets' field") } diff --git a/plc4go/protocols/eip/readwrite/model/ServicesResponse.go b/plc4go/protocols/eip/readwrite/model/ServicesResponse.go index fd533494e6a..6aa0ecbb3b1 100644 --- a/plc4go/protocols/eip/readwrite/model/ServicesResponse.go +++ b/plc4go/protocols/eip/readwrite/model/ServicesResponse.go @@ -292,14 +292,14 @@ func (m *_ServicesResponse) SerializeWithWriteBuffer(ctx context.Context, writeB // Implicit Field (serviceLen) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) serviceLen := uint16(uint16(uint16(m.GetLengthInBytes(ctx))) - uint16(uint16(4))) - _serviceLenErr := writeBuffer.WriteUint16("serviceLen", 16, (serviceLen)) + _serviceLenErr := writeBuffer.WriteUint16("serviceLen", 16, uint16((serviceLen))) if _serviceLenErr != nil { return errors.Wrap(_serviceLenErr, "Error serializing 'serviceLen' field") } // Simple Field (encapsulationProtocol) encapsulationProtocol := uint16(m.GetEncapsulationProtocol()) - _encapsulationProtocolErr := writeBuffer.WriteUint16("encapsulationProtocol", 16, (encapsulationProtocol)) + _encapsulationProtocolErr := writeBuffer.WriteUint16("encapsulationProtocol", 16, uint16((encapsulationProtocol))) if _encapsulationProtocolErr != nil { return errors.Wrap(_encapsulationProtocolErr, "Error serializing 'encapsulationProtocol' field") } @@ -314,7 +314,7 @@ func (m *_ServicesResponse) SerializeWithWriteBuffer(ctx context.Context, writeB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 2, reserved) + _err := writeBuffer.WriteUint8("reserved", 2, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -337,7 +337,7 @@ func (m *_ServicesResponse) SerializeWithWriteBuffer(ctx context.Context, writeB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint16("reserved", 12, reserved) + _err := writeBuffer.WriteUint16("reserved", 12, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/eip/readwrite/model/TransportType.go b/plc4go/protocols/eip/readwrite/model/TransportType.go index 66f48362e51..a915fc131ed 100644 --- a/plc4go/protocols/eip/readwrite/model/TransportType.go +++ b/plc4go/protocols/eip/readwrite/model/TransportType.go @@ -191,14 +191,14 @@ func (m *_TransportType) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (trigger) trigger := uint8(m.GetTrigger()) - _triggerErr := writeBuffer.WriteUint8("trigger", 3, (trigger)) + _triggerErr := writeBuffer.WriteUint8("trigger", 3, uint8((trigger))) if _triggerErr != nil { return errors.Wrap(_triggerErr, "Error serializing 'trigger' field") } // Simple Field (classTransport) classTransport := uint8(m.GetClassTransport()) - _classTransportErr := writeBuffer.WriteUint8("classTransport", 4, (classTransport)) + _classTransportErr := writeBuffer.WriteUint8("classTransport", 4, uint8((classTransport))) if _classTransportErr != nil { return errors.Wrap(_classTransportErr, "Error serializing 'classTransport' field") } diff --git a/plc4go/protocols/eip/readwrite/model/TypeId.go b/plc4go/protocols/eip/readwrite/model/TypeId.go index fdb0a0291a7..6a12daeeed4 100644 --- a/plc4go/protocols/eip/readwrite/model/TypeId.go +++ b/plc4go/protocols/eip/readwrite/model/TypeId.go @@ -174,7 +174,7 @@ func (pm *_TypeId) SerializeParent(ctx context.Context, writeBuffer utils.WriteB // Discriminator Field (id) (Used as input to a switch field) id := uint16(child.GetId()) - _idErr := writeBuffer.WriteUint16("id", 16, (id)) + _idErr := writeBuffer.WriteUint16("id", 16, uint16((id))) if _idErr != nil { return errors.Wrap(_idErr, "Error serializing 'id' field") diff --git a/plc4go/protocols/eip/readwrite/model/UnConnectedDataItem.go b/plc4go/protocols/eip/readwrite/model/UnConnectedDataItem.go index 9ef76e4f54c..332d95c185d 100644 --- a/plc4go/protocols/eip/readwrite/model/UnConnectedDataItem.go +++ b/plc4go/protocols/eip/readwrite/model/UnConnectedDataItem.go @@ -195,7 +195,7 @@ func (m *_UnConnectedDataItem) SerializeWithWriteBuffer(ctx context.Context, wri // Implicit Field (packetSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) packetSize := uint16(m.GetService().GetLengthInBytes(ctx)) - _packetSizeErr := writeBuffer.WriteUint16("packetSize", 16, (packetSize)) + _packetSizeErr := writeBuffer.WriteUint16("packetSize", 16, uint16((packetSize))) if _packetSizeErr != nil { return errors.Wrap(_packetSizeErr, "Error serializing 'packetSize' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataCommand.go b/plc4go/protocols/firmata/readwrite/model/FirmataCommand.go index 8b9403a52c0..ad39f2a4113 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataCommand.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataCommand.go @@ -177,7 +177,7 @@ func (pm *_FirmataCommand) SerializeParent(ctx context.Context, writeBuffer util // Discriminator Field (commandCode) (Used as input to a switch field) commandCode := uint8(child.GetCommandCode()) - _commandCodeErr := writeBuffer.WriteUint8("commandCode", 4, (commandCode)) + _commandCodeErr := writeBuffer.WriteUint8("commandCode", 4, uint8((commandCode))) if _commandCodeErr != nil { return errors.Wrap(_commandCodeErr, "Error serializing 'commandCode' field") diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataCommandProtocolVersion.go b/plc4go/protocols/firmata/readwrite/model/FirmataCommandProtocolVersion.go index 1931eeb1425..4cd4fd8bfd9 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataCommandProtocolVersion.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataCommandProtocolVersion.go @@ -200,14 +200,14 @@ func (m *_FirmataCommandProtocolVersion) SerializeWithWriteBuffer(ctx context.Co // Simple Field (majorVersion) majorVersion := uint8(m.GetMajorVersion()) - _majorVersionErr := writeBuffer.WriteUint8("majorVersion", 8, (majorVersion)) + _majorVersionErr := writeBuffer.WriteUint8("majorVersion", 8, uint8((majorVersion))) if _majorVersionErr != nil { return errors.Wrap(_majorVersionErr, "Error serializing 'majorVersion' field") } // Simple Field (minorVersion) minorVersion := uint8(m.GetMinorVersion()) - _minorVersionErr := writeBuffer.WriteUint8("minorVersion", 8, (minorVersion)) + _minorVersionErr := writeBuffer.WriteUint8("minorVersion", 8, uint8((minorVersion))) if _minorVersionErr != nil { return errors.Wrap(_minorVersionErr, "Error serializing 'minorVersion' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetDigitalPinValue.go b/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetDigitalPinValue.go index 2a8285a6b32..b7cd3a7e9fd 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetDigitalPinValue.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetDigitalPinValue.go @@ -223,7 +223,7 @@ func (m *_FirmataCommandSetDigitalPinValue) SerializeWithWriteBuffer(ctx context // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 8, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 8, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } @@ -238,7 +238,7 @@ func (m *_FirmataCommandSetDigitalPinValue) SerializeWithWriteBuffer(ctx context }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetPinMode.go b/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetPinMode.go index 7db3f1dc7a1..9773c16b12e 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetPinMode.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataCommandSetPinMode.go @@ -206,7 +206,7 @@ func (m *_FirmataCommandSetPinMode) SerializeWithWriteBuffer(ctx context.Context // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 8, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 8, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataCommandSysex.go b/plc4go/protocols/firmata/readwrite/model/FirmataCommandSysex.go index 14584a6a51a..833f59ccdc2 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataCommandSysex.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataCommandSysex.go @@ -230,7 +230,7 @@ func (m *_FirmataCommandSysex) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataMessage.go b/plc4go/protocols/firmata/readwrite/model/FirmataMessage.go index c7c9c1e92c1..297f9ef8b70 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataMessage.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataMessage.go @@ -178,7 +178,7 @@ func (pm *_FirmataMessage) SerializeParent(ctx context.Context, writeBuffer util // Discriminator Field (messageType) (Used as input to a switch field) messageType := uint8(child.GetMessageType()) - _messageTypeErr := writeBuffer.WriteUint8("messageType", 4, (messageType)) + _messageTypeErr := writeBuffer.WriteUint8("messageType", 4, uint8((messageType))) if _messageTypeErr != nil { return errors.Wrap(_messageTypeErr, "Error serializing 'messageType' field") diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataMessageAnalogIO.go b/plc4go/protocols/firmata/readwrite/model/FirmataMessageAnalogIO.go index f158a34e31f..89531ede63e 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataMessageAnalogIO.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataMessageAnalogIO.go @@ -223,7 +223,7 @@ func (m *_FirmataMessageAnalogIO) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 4, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 4, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } @@ -234,7 +234,7 @@ func (m *_FirmataMessageAnalogIO) SerializeWithWriteBuffer(ctx context.Context, } for _curItem, _element := range m.GetData() { _ = _curItem - _elementErr := writeBuffer.WriteInt8("", 8, _element) + _elementErr := writeBuffer.WriteInt8("", 8, int8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataMessageDigitalIO.go b/plc4go/protocols/firmata/readwrite/model/FirmataMessageDigitalIO.go index 83f561dc2d7..e953daa34c0 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataMessageDigitalIO.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataMessageDigitalIO.go @@ -223,7 +223,7 @@ func (m *_FirmataMessageDigitalIO) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (pinBlock) pinBlock := uint8(m.GetPinBlock()) - _pinBlockErr := writeBuffer.WriteUint8("pinBlock", 4, (pinBlock)) + _pinBlockErr := writeBuffer.WriteUint8("pinBlock", 4, uint8((pinBlock))) if _pinBlockErr != nil { return errors.Wrap(_pinBlockErr, "Error serializing 'pinBlock' field") } @@ -234,7 +234,7 @@ func (m *_FirmataMessageDigitalIO) SerializeWithWriteBuffer(ctx context.Context, } for _curItem, _element := range m.GetData() { _ = _curItem - _elementErr := writeBuffer.WriteInt8("", 8, _element) + _elementErr := writeBuffer.WriteInt8("", 8, int8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeAnalogPinValue.go b/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeAnalogPinValue.go index b0cb2a9103e..c27a9cee401 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeAnalogPinValue.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeAnalogPinValue.go @@ -224,7 +224,7 @@ func (m *_FirmataMessageSubscribeAnalogPinValue) SerializeWithWriteBuffer(ctx co // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 4, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 4, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } @@ -239,7 +239,7 @@ func (m *_FirmataMessageSubscribeAnalogPinValue) SerializeWithWriteBuffer(ctx co }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeDigitalPinValue.go b/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeDigitalPinValue.go index 8f8bba12a11..0f87d3f4738 100644 --- a/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeDigitalPinValue.go +++ b/plc4go/protocols/firmata/readwrite/model/FirmataMessageSubscribeDigitalPinValue.go @@ -224,7 +224,7 @@ func (m *_FirmataMessageSubscribeDigitalPinValue) SerializeWithWriteBuffer(ctx c // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 4, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 4, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } @@ -239,7 +239,7 @@ func (m *_FirmataMessageSubscribeDigitalPinValue) SerializeWithWriteBuffer(ctx c }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/PinMode.go b/plc4go/protocols/firmata/readwrite/model/PinMode.go index 0f8c4f4bea3..17fe9fa0c76 100644 --- a/plc4go/protocols/firmata/readwrite/model/PinMode.go +++ b/plc4go/protocols/firmata/readwrite/model/PinMode.go @@ -192,7 +192,7 @@ func (e PinMode) Serialize() ([]byte, error) { func (e PinMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("PinMode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("PinMode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/firmata/readwrite/model/SysexCommand.go b/plc4go/protocols/firmata/readwrite/model/SysexCommand.go index 10dcaa9f31d..79b02cf4b42 100644 --- a/plc4go/protocols/firmata/readwrite/model/SysexCommand.go +++ b/plc4go/protocols/firmata/readwrite/model/SysexCommand.go @@ -197,7 +197,7 @@ func (pm *_SysexCommand) SerializeParent(ctx context.Context, writeBuffer utils. // Discriminator Field (commandType) (Used as input to a switch field) commandType := uint8(child.GetCommandType()) - _commandTypeErr := writeBuffer.WriteUint8("commandType", 8, (commandType)) + _commandTypeErr := writeBuffer.WriteUint8("commandType", 8, uint8((commandType))) if _commandTypeErr != nil { return errors.Wrap(_commandTypeErr, "Error serializing 'commandType' field") diff --git a/plc4go/protocols/firmata/readwrite/model/SysexCommandAnalogMappingQueryResponse.go b/plc4go/protocols/firmata/readwrite/model/SysexCommandAnalogMappingQueryResponse.go index 2f0fbc10b0e..121d376b24b 100644 --- a/plc4go/protocols/firmata/readwrite/model/SysexCommandAnalogMappingQueryResponse.go +++ b/plc4go/protocols/firmata/readwrite/model/SysexCommandAnalogMappingQueryResponse.go @@ -183,7 +183,7 @@ func (m *_SysexCommandAnalogMappingQueryResponse) SerializeWithWriteBuffer(ctx c // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 8, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 8, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/SysexCommandExtendedId.go b/plc4go/protocols/firmata/readwrite/model/SysexCommandExtendedId.go index 85866d84536..020486da4a0 100644 --- a/plc4go/protocols/firmata/readwrite/model/SysexCommandExtendedId.go +++ b/plc4go/protocols/firmata/readwrite/model/SysexCommandExtendedId.go @@ -209,7 +209,7 @@ func (m *_SysexCommandExtendedId) SerializeWithWriteBuffer(ctx context.Context, } for _curItem, _element := range m.GetId() { _ = _curItem - _elementErr := writeBuffer.WriteInt8("", 8, _element) + _elementErr := writeBuffer.WriteInt8("", 8, int8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'id' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateQuery.go b/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateQuery.go index bb0de6270b4..20aa0bd63a1 100644 --- a/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateQuery.go +++ b/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateQuery.go @@ -183,7 +183,7 @@ func (m *_SysexCommandPinStateQuery) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 8, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 8, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateResponse.go b/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateResponse.go index 9dd23023f3e..d1ce8afdce2 100644 --- a/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateResponse.go +++ b/plc4go/protocols/firmata/readwrite/model/SysexCommandPinStateResponse.go @@ -221,21 +221,21 @@ func (m *_SysexCommandPinStateResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (pin) pin := uint8(m.GetPin()) - _pinErr := writeBuffer.WriteUint8("pin", 8, (pin)) + _pinErr := writeBuffer.WriteUint8("pin", 8, uint8((pin))) if _pinErr != nil { return errors.Wrap(_pinErr, "Error serializing 'pin' field") } // Simple Field (pinMode) pinMode := uint8(m.GetPinMode()) - _pinModeErr := writeBuffer.WriteUint8("pinMode", 8, (pinMode)) + _pinModeErr := writeBuffer.WriteUint8("pinMode", 8, uint8((pinMode))) if _pinModeErr != nil { return errors.Wrap(_pinModeErr, "Error serializing 'pinMode' field") } // Simple Field (pinState) pinState := uint8(m.GetPinState()) - _pinStateErr := writeBuffer.WriteUint8("pinState", 8, (pinState)) + _pinStateErr := writeBuffer.WriteUint8("pinState", 8, uint8((pinState))) if _pinStateErr != nil { return errors.Wrap(_pinStateErr, "Error serializing 'pinState' field") } diff --git a/plc4go/protocols/firmata/readwrite/model/SysexCommandReportFirmwareResponse.go b/plc4go/protocols/firmata/readwrite/model/SysexCommandReportFirmwareResponse.go index 998604689ec..b614e28ed3b 100644 --- a/plc4go/protocols/firmata/readwrite/model/SysexCommandReportFirmwareResponse.go +++ b/plc4go/protocols/firmata/readwrite/model/SysexCommandReportFirmwareResponse.go @@ -232,14 +232,14 @@ func (m *_SysexCommandReportFirmwareResponse) SerializeWithWriteBuffer(ctx conte // Simple Field (majorVersion) majorVersion := uint8(m.GetMajorVersion()) - _majorVersionErr := writeBuffer.WriteUint8("majorVersion", 8, (majorVersion)) + _majorVersionErr := writeBuffer.WriteUint8("majorVersion", 8, uint8((majorVersion))) if _majorVersionErr != nil { return errors.Wrap(_majorVersionErr, "Error serializing 'majorVersion' field") } // Simple Field (minorVersion) minorVersion := uint8(m.GetMinorVersion()) - _minorVersionErr := writeBuffer.WriteUint8("minorVersion", 8, (minorVersion)) + _minorVersionErr := writeBuffer.WriteUint8("minorVersion", 8, uint8((minorVersion))) if _minorVersionErr != nil { return errors.Wrap(_minorVersionErr, "Error serializing 'minorVersion' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/AccessLevel.go b/plc4go/protocols/knxnetip/readwrite/model/AccessLevel.go index f8cb145251a..6f247bc29aa 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/AccessLevel.go +++ b/plc4go/protocols/knxnetip/readwrite/model/AccessLevel.go @@ -227,7 +227,7 @@ func (e AccessLevel) Serialize() ([]byte, error) { func (e AccessLevel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AccessLevel", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AccessLevel", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/Apdu.go b/plc4go/protocols/knxnetip/readwrite/model/Apdu.go index 56b947f029b..3dfe8fccbcf 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/Apdu.go +++ b/plc4go/protocols/knxnetip/readwrite/model/Apdu.go @@ -215,7 +215,7 @@ func (pm *_Apdu) SerializeParent(ctx context.Context, writeBuffer utils.WriteBuf // Discriminator Field (control) (Used as input to a switch field) control := uint8(child.GetControl()) - _controlErr := writeBuffer.WriteUint8("control", 1, (control)) + _controlErr := writeBuffer.WriteUint8("control", 1, uint8((control))) if _controlErr != nil { return errors.Wrap(_controlErr, "Error serializing 'control' field") @@ -230,7 +230,7 @@ func (pm *_Apdu) SerializeParent(ctx context.Context, writeBuffer utils.WriteBuf // Simple Field (counter) counter := uint8(m.GetCounter()) - _counterErr := writeBuffer.WriteUint8("counter", 4, (counter)) + _counterErr := writeBuffer.WriteUint8("counter", 4, uint8((counter))) if _counterErr != nil { return errors.Wrap(_counterErr, "Error serializing 'counter' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduControl.go b/plc4go/protocols/knxnetip/readwrite/model/ApduControl.go index f4f98f370b0..2a4262e797f 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduControl.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduControl.go @@ -172,7 +172,7 @@ func (pm *_ApduControl) SerializeParent(ctx context.Context, writeBuffer utils.W // Discriminator Field (controlType) (Used as input to a switch field) controlType := uint8(child.GetControlType()) - _controlTypeErr := writeBuffer.WriteUint8("controlType", 2, (controlType)) + _controlTypeErr := writeBuffer.WriteUint8("controlType", 2, uint8((controlType))) if _controlTypeErr != nil { return errors.Wrap(_controlTypeErr, "Error serializing 'controlType' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduData.go b/plc4go/protocols/knxnetip/readwrite/model/ApduData.go index 64d47957024..88c78b35873 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduData.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduData.go @@ -199,7 +199,7 @@ func (pm *_ApduData) SerializeParent(ctx context.Context, writeBuffer utils.Writ // Discriminator Field (apciType) (Used as input to a switch field) apciType := uint8(child.GetApciType()) - _apciTypeErr := writeBuffer.WriteUint8("apciType", 4, (apciType)) + _apciTypeErr := writeBuffer.WriteUint8("apciType", 4, uint8((apciType))) if _apciTypeErr != nil { return errors.Wrap(_apciTypeErr, "Error serializing 'apciType' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorRead.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorRead.go index 70442864513..381f7ed73ad 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorRead.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorRead.go @@ -181,7 +181,7 @@ func (m *_ApduDataDeviceDescriptorRead) SerializeWithWriteBuffer(ctx context.Con // Simple Field (descriptorType) descriptorType := uint8(m.GetDescriptorType()) - _descriptorTypeErr := writeBuffer.WriteUint8("descriptorType", 6, (descriptorType)) + _descriptorTypeErr := writeBuffer.WriteUint8("descriptorType", 6, uint8((descriptorType))) if _descriptorTypeErr != nil { return errors.Wrap(_descriptorTypeErr, "Error serializing 'descriptorType' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorResponse.go index 67538a7743c..8204ac9c25e 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataDeviceDescriptorResponse.go @@ -201,7 +201,7 @@ func (m *_ApduDataDeviceDescriptorResponse) SerializeWithWriteBuffer(ctx context // Simple Field (descriptorType) descriptorType := uint8(m.GetDescriptorType()) - _descriptorTypeErr := writeBuffer.WriteUint8("descriptorType", 6, (descriptorType)) + _descriptorTypeErr := writeBuffer.WriteUint8("descriptorType", 6, uint8((descriptorType))) if _descriptorTypeErr != nil { return errors.Wrap(_descriptorTypeErr, "Error serializing 'descriptorType' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExt.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExt.go index 5e549e98108..3245c2ddc2b 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExt.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExt.go @@ -249,7 +249,7 @@ func (pm *_ApduDataExt) SerializeParent(ctx context.Context, writeBuffer utils.W // Discriminator Field (extApciType) (Used as input to a switch field) extApciType := uint8(child.GetExtApciType()) - _extApciTypeErr := writeBuffer.WriteUint8("extApciType", 6, (extApciType)) + _extApciTypeErr := writeBuffer.WriteUint8("extApciType", 6, uint8((extApciType))) if _extApciTypeErr != nil { return errors.Wrap(_extApciTypeErr, "Error serializing 'extApciType' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeRequest.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeRequest.go index 9eee0a02da3..e73af49d535 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeRequest.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeRequest.go @@ -201,7 +201,7 @@ func (m *_ApduDataExtAuthorizeRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (level) level := uint8(m.GetLevel()) - _levelErr := writeBuffer.WriteUint8("level", 8, (level)) + _levelErr := writeBuffer.WriteUint8("level", 8, uint8((level))) if _levelErr != nil { return errors.Wrap(_levelErr, "Error serializing 'level' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeResponse.go index 79a9664867e..ff74fec0b80 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtAuthorizeResponse.go @@ -181,7 +181,7 @@ func (m *_ApduDataExtAuthorizeResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (level) level := uint8(m.GetLevel()) - _levelErr := writeBuffer.WriteUint8("level", 8, (level)) + _levelErr := writeBuffer.WriteUint8("level", 8, uint8((level))) if _levelErr != nil { return errors.Wrap(_levelErr, "Error serializing 'level' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionRead.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionRead.go index ab7c411c248..89367dd254e 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionRead.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionRead.go @@ -219,21 +219,21 @@ func (m *_ApduDataExtPropertyDescriptionRead) SerializeWithWriteBuffer(ctx conte // Simple Field (objectIndex) objectIndex := uint8(m.GetObjectIndex()) - _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, (objectIndex)) + _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, uint8((objectIndex))) if _objectIndexErr != nil { return errors.Wrap(_objectIndexErr, "Error serializing 'objectIndex' field") } // Simple Field (propertyId) propertyId := uint8(m.GetPropertyId()) - _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, (propertyId)) + _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, uint8((propertyId))) if _propertyIdErr != nil { return errors.Wrap(_propertyIdErr, "Error serializing 'propertyId' field") } // Simple Field (index) index := uint8(m.GetIndex()) - _indexErr := writeBuffer.WriteUint8("index", 8, (index)) + _indexErr := writeBuffer.WriteUint8("index", 8, uint8((index))) if _indexErr != nil { return errors.Wrap(_indexErr, "Error serializing 'index' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionResponse.go index 2f11d230f22..e3d1927d120 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyDescriptionResponse.go @@ -377,21 +377,21 @@ func (m *_ApduDataExtPropertyDescriptionResponse) SerializeWithWriteBuffer(ctx c // Simple Field (objectIndex) objectIndex := uint8(m.GetObjectIndex()) - _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, (objectIndex)) + _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, uint8((objectIndex))) if _objectIndexErr != nil { return errors.Wrap(_objectIndexErr, "Error serializing 'objectIndex' field") } // Simple Field (propertyId) propertyId := uint8(m.GetPropertyId()) - _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, (propertyId)) + _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, uint8((propertyId))) if _propertyIdErr != nil { return errors.Wrap(_propertyIdErr, "Error serializing 'propertyId' field") } // Simple Field (index) index := uint8(m.GetIndex()) - _indexErr := writeBuffer.WriteUint8("index", 8, (index)) + _indexErr := writeBuffer.WriteUint8("index", 8, uint8((index))) if _indexErr != nil { return errors.Wrap(_indexErr, "Error serializing 'index' field") } @@ -413,7 +413,7 @@ func (m *_ApduDataExtPropertyDescriptionResponse) SerializeWithWriteBuffer(ctx c }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 1, reserved) + _err := writeBuffer.WriteUint8("reserved", 1, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -441,7 +441,7 @@ func (m *_ApduDataExtPropertyDescriptionResponse) SerializeWithWriteBuffer(ctx c }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 4, reserved) + _err := writeBuffer.WriteUint8("reserved", 4, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -449,7 +449,7 @@ func (m *_ApduDataExtPropertyDescriptionResponse) SerializeWithWriteBuffer(ctx c // Simple Field (maxNrOfElements) maxNrOfElements := uint16(m.GetMaxNrOfElements()) - _maxNrOfElementsErr := writeBuffer.WriteUint16("maxNrOfElements", 12, (maxNrOfElements)) + _maxNrOfElementsErr := writeBuffer.WriteUint16("maxNrOfElements", 12, uint16((maxNrOfElements))) if _maxNrOfElementsErr != nil { return errors.Wrap(_maxNrOfElementsErr, "Error serializing 'maxNrOfElements' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueRead.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueRead.go index ee2e5cac94e..a681d3576d4 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueRead.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueRead.go @@ -238,28 +238,28 @@ func (m *_ApduDataExtPropertyValueRead) SerializeWithWriteBuffer(ctx context.Con // Simple Field (objectIndex) objectIndex := uint8(m.GetObjectIndex()) - _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, (objectIndex)) + _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, uint8((objectIndex))) if _objectIndexErr != nil { return errors.Wrap(_objectIndexErr, "Error serializing 'objectIndex' field") } // Simple Field (propertyId) propertyId := uint8(m.GetPropertyId()) - _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, (propertyId)) + _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, uint8((propertyId))) if _propertyIdErr != nil { return errors.Wrap(_propertyIdErr, "Error serializing 'propertyId' field") } // Simple Field (count) count := uint8(m.GetCount()) - _countErr := writeBuffer.WriteUint8("count", 4, (count)) + _countErr := writeBuffer.WriteUint8("count", 4, uint8((count))) if _countErr != nil { return errors.Wrap(_countErr, "Error serializing 'count' field") } // Simple Field (index) index := uint16(m.GetIndex()) - _indexErr := writeBuffer.WriteUint16("index", 12, (index)) + _indexErr := writeBuffer.WriteUint16("index", 12, uint16((index))) if _indexErr != nil { return errors.Wrap(_indexErr, "Error serializing 'index' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueResponse.go index bd8a19b6ee4..141396d6889 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueResponse.go @@ -258,28 +258,28 @@ func (m *_ApduDataExtPropertyValueResponse) SerializeWithWriteBuffer(ctx context // Simple Field (objectIndex) objectIndex := uint8(m.GetObjectIndex()) - _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, (objectIndex)) + _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, uint8((objectIndex))) if _objectIndexErr != nil { return errors.Wrap(_objectIndexErr, "Error serializing 'objectIndex' field") } // Simple Field (propertyId) propertyId := uint8(m.GetPropertyId()) - _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, (propertyId)) + _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, uint8((propertyId))) if _propertyIdErr != nil { return errors.Wrap(_propertyIdErr, "Error serializing 'propertyId' field") } // Simple Field (count) count := uint8(m.GetCount()) - _countErr := writeBuffer.WriteUint8("count", 4, (count)) + _countErr := writeBuffer.WriteUint8("count", 4, uint8((count))) if _countErr != nil { return errors.Wrap(_countErr, "Error serializing 'count' field") } // Simple Field (index) index := uint16(m.GetIndex()) - _indexErr := writeBuffer.WriteUint16("index", 12, (index)) + _indexErr := writeBuffer.WriteUint16("index", 12, uint16((index))) if _indexErr != nil { return errors.Wrap(_indexErr, "Error serializing 'index' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueWrite.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueWrite.go index 8fffcc2509f..b688a40fcd1 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueWrite.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataExtPropertyValueWrite.go @@ -258,28 +258,28 @@ func (m *_ApduDataExtPropertyValueWrite) SerializeWithWriteBuffer(ctx context.Co // Simple Field (objectIndex) objectIndex := uint8(m.GetObjectIndex()) - _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, (objectIndex)) + _objectIndexErr := writeBuffer.WriteUint8("objectIndex", 8, uint8((objectIndex))) if _objectIndexErr != nil { return errors.Wrap(_objectIndexErr, "Error serializing 'objectIndex' field") } // Simple Field (propertyId) propertyId := uint8(m.GetPropertyId()) - _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, (propertyId)) + _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, uint8((propertyId))) if _propertyIdErr != nil { return errors.Wrap(_propertyIdErr, "Error serializing 'propertyId' field") } // Simple Field (count) count := uint8(m.GetCount()) - _countErr := writeBuffer.WriteUint8("count", 4, (count)) + _countErr := writeBuffer.WriteUint8("count", 4, uint8((count))) if _countErr != nil { return errors.Wrap(_countErr, "Error serializing 'count' field") } // Simple Field (index) index := uint16(m.GetIndex()) - _indexErr := writeBuffer.WriteUint16("index", 12, (index)) + _indexErr := writeBuffer.WriteUint16("index", 12, uint16((index))) if _indexErr != nil { return errors.Wrap(_indexErr, "Error serializing 'index' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueRead.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueRead.go index f91b0d930b3..57df85426a5 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueRead.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueRead.go @@ -183,7 +183,7 @@ func (m *_ApduDataGroupValueRead) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 6, reserved) + _err := writeBuffer.WriteUint8("reserved", 6, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueResponse.go index 2c473d41e6f..03ce9bdced5 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueResponse.go @@ -201,7 +201,7 @@ func (m *_ApduDataGroupValueResponse) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (dataFirstByte) dataFirstByte := int8(m.GetDataFirstByte()) - _dataFirstByteErr := writeBuffer.WriteInt8("dataFirstByte", 6, (dataFirstByte)) + _dataFirstByteErr := writeBuffer.WriteInt8("dataFirstByte", 6, int8((dataFirstByte))) if _dataFirstByteErr != nil { return errors.Wrap(_dataFirstByteErr, "Error serializing 'dataFirstByte' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueWrite.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueWrite.go index 51330335686..ece84cab00d 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueWrite.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataGroupValueWrite.go @@ -201,7 +201,7 @@ func (m *_ApduDataGroupValueWrite) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (dataFirstByte) dataFirstByte := int8(m.GetDataFirstByte()) - _dataFirstByteErr := writeBuffer.WriteInt8("dataFirstByte", 6, (dataFirstByte)) + _dataFirstByteErr := writeBuffer.WriteInt8("dataFirstByte", 6, int8((dataFirstByte))) if _dataFirstByteErr != nil { return errors.Wrap(_dataFirstByteErr, "Error serializing 'dataFirstByte' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryRead.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryRead.go index 4297a99500f..b2a6a6b9d81 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryRead.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryRead.go @@ -200,14 +200,14 @@ func (m *_ApduDataMemoryRead) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (numBytes) numBytes := uint8(m.GetNumBytes()) - _numBytesErr := writeBuffer.WriteUint8("numBytes", 6, (numBytes)) + _numBytesErr := writeBuffer.WriteUint8("numBytes", 6, uint8((numBytes))) if _numBytesErr != nil { return errors.Wrap(_numBytesErr, "Error serializing 'numBytes' field") } // Simple Field (address) address := uint16(m.GetAddress()) - _addressErr := writeBuffer.WriteUint16("address", 16, (address)) + _addressErr := writeBuffer.WriteUint16("address", 16, uint16((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryResponse.go index cab634d5940..6346c314f4e 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ApduDataMemoryResponse.go @@ -211,14 +211,14 @@ func (m *_ApduDataMemoryResponse) SerializeWithWriteBuffer(ctx context.Context, // Implicit Field (numBytes) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numBytes := uint8(uint8(len(m.GetData()))) - _numBytesErr := writeBuffer.WriteUint8("numBytes", 6, (numBytes)) + _numBytesErr := writeBuffer.WriteUint8("numBytes", 6, uint8((numBytes))) if _numBytesErr != nil { return errors.Wrap(_numBytesErr, "Error serializing 'numBytes' field") } // Simple Field (address) address := uint16(m.GetAddress()) - _addressErr := writeBuffer.WriteUint16("address", 16, (address)) + _addressErr := writeBuffer.WriteUint16("address", 16, uint16((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/CEMI.go b/plc4go/protocols/knxnetip/readwrite/model/CEMI.go index 0a2dad88712..d998a11f5ce 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/CEMI.go +++ b/plc4go/protocols/knxnetip/readwrite/model/CEMI.go @@ -213,7 +213,7 @@ func (pm *_CEMI) SerializeParent(ctx context.Context, writeBuffer utils.WriteBuf // Discriminator Field (messageCode) (Used as input to a switch field) messageCode := uint8(child.GetMessageCode()) - _messageCodeErr := writeBuffer.WriteUint8("messageCode", 8, (messageCode)) + _messageCodeErr := writeBuffer.WriteUint8("messageCode", 8, uint8((messageCode))) if _messageCodeErr != nil { return errors.Wrap(_messageCodeErr, "Error serializing 'messageCode' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformation.go b/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformation.go index f17feb37281..3e3059a0566 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformation.go +++ b/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformation.go @@ -168,7 +168,7 @@ func (pm *_CEMIAdditionalInformation) SerializeParent(ctx context.Context, write // Discriminator Field (additionalInformationType) (Used as input to a switch field) additionalInformationType := uint8(child.GetAdditionalInformationType()) - _additionalInformationTypeErr := writeBuffer.WriteUint8("additionalInformationType", 8, (additionalInformationType)) + _additionalInformationTypeErr := writeBuffer.WriteUint8("additionalInformationType", 8, uint8((additionalInformationType))) if _additionalInformationTypeErr != nil { return errors.Wrap(_additionalInformationTypeErr, "Error serializing 'additionalInformationType' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationBusmonitorInfo.go b/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationBusmonitorInfo.go index 1a71eed9101..dc8b66933b2 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationBusmonitorInfo.go +++ b/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationBusmonitorInfo.go @@ -302,7 +302,7 @@ func (m *_CEMIAdditionalInformationBusmonitorInfo) SerializeWithWriteBuffer(ctx } // Const Field (len) - _lenErr := writeBuffer.WriteUint8("len", 8, 1) + _lenErr := writeBuffer.WriteUint8("len", 8, uint8(1)) if _lenErr != nil { return errors.Wrap(_lenErr, "Error serializing 'len' field") } @@ -344,7 +344,7 @@ func (m *_CEMIAdditionalInformationBusmonitorInfo) SerializeWithWriteBuffer(ctx // Simple Field (sequenceNumber) sequenceNumber := uint8(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 3, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 3, uint8((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationRelativeTimestamp.go b/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationRelativeTimestamp.go index a43c60d4755..366c839c9cc 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationRelativeTimestamp.go +++ b/plc4go/protocols/knxnetip/readwrite/model/CEMIAdditionalInformationRelativeTimestamp.go @@ -213,7 +213,7 @@ func (m *_CEMIAdditionalInformationRelativeTimestamp) SerializeWithWriteBuffer(c } // Const Field (len) - _lenErr := writeBuffer.WriteUint8("len", 8, 2) + _lenErr := writeBuffer.WriteUint8("len", 8, uint8(2)) if _lenErr != nil { return errors.Wrap(_lenErr, "Error serializing 'len' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/CEMIPriority.go b/plc4go/protocols/knxnetip/readwrite/model/CEMIPriority.go index 554c4d1b3f6..2772d0a1f63 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/CEMIPriority.go +++ b/plc4go/protocols/knxnetip/readwrite/model/CEMIPriority.go @@ -144,7 +144,7 @@ func (e CEMIPriority) Serialize() ([]byte, error) { func (e CEMIPriority) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("CEMIPriority", 2, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("CEMIPriority", 2, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/ChannelInformation.go b/plc4go/protocols/knxnetip/readwrite/model/ChannelInformation.go index b51be5d5ae0..3627c8b66d4 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ChannelInformation.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ChannelInformation.go @@ -166,14 +166,14 @@ func (m *_ChannelInformation) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (numChannels) numChannels := uint8(m.GetNumChannels()) - _numChannelsErr := writeBuffer.WriteUint8("numChannels", 3, (numChannels)) + _numChannelsErr := writeBuffer.WriteUint8("numChannels", 3, uint8((numChannels))) if _numChannelsErr != nil { return errors.Wrap(_numChannelsErr, "Error serializing 'numChannels' field") } // Simple Field (channelCode) channelCode := uint16(m.GetChannelCode()) - _channelCodeErr := writeBuffer.WriteUint16("channelCode", 13, (channelCode)) + _channelCodeErr := writeBuffer.WriteUint16("channelCode", 13, uint16((channelCode))) if _channelCodeErr != nil { return errors.Wrap(_channelCodeErr, "Error serializing 'channelCode' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableAddresses.go b/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableAddresses.go index bc99995f28e..422991e980c 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableAddresses.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableAddresses.go @@ -18898,7 +18898,7 @@ func (e ComObjectTableAddresses) Serialize() ([]byte, error) { func (e ComObjectTableAddresses) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("ComObjectTableAddresses", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("ComObjectTableAddresses", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType1.go b/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType1.go index b9222fd8c03..ed65f2f3226 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType1.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType1.go @@ -244,14 +244,14 @@ func (m *_ComObjectTableRealisationType1) SerializeWithWriteBuffer(ctx context.C // Simple Field (numEntries) numEntries := uint8(m.GetNumEntries()) - _numEntriesErr := writeBuffer.WriteUint8("numEntries", 8, (numEntries)) + _numEntriesErr := writeBuffer.WriteUint8("numEntries", 8, uint8((numEntries))) if _numEntriesErr != nil { return errors.Wrap(_numEntriesErr, "Error serializing 'numEntries' field") } // Simple Field (ramFlagsTablePointer) ramFlagsTablePointer := uint8(m.GetRamFlagsTablePointer()) - _ramFlagsTablePointerErr := writeBuffer.WriteUint8("ramFlagsTablePointer", 8, (ramFlagsTablePointer)) + _ramFlagsTablePointerErr := writeBuffer.WriteUint8("ramFlagsTablePointer", 8, uint8((ramFlagsTablePointer))) if _ramFlagsTablePointerErr != nil { return errors.Wrap(_ramFlagsTablePointerErr, "Error serializing 'ramFlagsTablePointer' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType2.go b/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType2.go index 753afc43759..83c310a8a45 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType2.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ComObjectTableRealisationType2.go @@ -244,14 +244,14 @@ func (m *_ComObjectTableRealisationType2) SerializeWithWriteBuffer(ctx context.C // Simple Field (numEntries) numEntries := uint8(m.GetNumEntries()) - _numEntriesErr := writeBuffer.WriteUint8("numEntries", 8, (numEntries)) + _numEntriesErr := writeBuffer.WriteUint8("numEntries", 8, uint8((numEntries))) if _numEntriesErr != nil { return errors.Wrap(_numEntriesErr, "Error serializing 'numEntries' field") } // Simple Field (ramFlagsTablePointer) ramFlagsTablePointer := uint8(m.GetRamFlagsTablePointer()) - _ramFlagsTablePointerErr := writeBuffer.WriteUint8("ramFlagsTablePointer", 8, (ramFlagsTablePointer)) + _ramFlagsTablePointerErr := writeBuffer.WriteUint8("ramFlagsTablePointer", 8, uint8((ramFlagsTablePointer))) if _ramFlagsTablePointerErr != nil { return errors.Wrap(_ramFlagsTablePointerErr, "Error serializing 'ramFlagsTablePointer' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ComObjectValueType.go b/plc4go/protocols/knxnetip/readwrite/model/ComObjectValueType.go index 9a61cabaf32..3197aa1790e 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ComObjectValueType.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ComObjectValueType.go @@ -288,7 +288,7 @@ func (e ComObjectValueType) Serialize() ([]byte, error) { func (e ComObjectValueType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ComObjectValueType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ComObjectValueType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformation.go b/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformation.go index d5dec593aad..27836127de9 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformation.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformation.go @@ -178,14 +178,14 @@ func (pm *_ConnectionRequestInformation) SerializeParent(ctx context.Context, wr // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Discriminator Field (connectionType) (Used as input to a switch field) connectionType := uint8(child.GetConnectionType()) - _connectionTypeErr := writeBuffer.WriteUint8("connectionType", 8, (connectionType)) + _connectionTypeErr := writeBuffer.WriteUint8("connectionType", 8, uint8((connectionType))) if _connectionTypeErr != nil { return errors.Wrap(_connectionTypeErr, "Error serializing 'connectionType' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformationTunnelConnection.go b/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformationTunnelConnection.go index 6095d7d9e0c..41aa7a4f696 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformationTunnelConnection.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ConnectionRequestInformationTunnelConnection.go @@ -229,7 +229,7 @@ func (m *_ConnectionRequestInformationTunnelConnection) SerializeWithWriteBuffer }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponse.go index 0338ee629df..6477e5e06e8 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponse.go @@ -278,7 +278,7 @@ func (m *_ConnectionResponse) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponseDataBlock.go b/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponseDataBlock.go index 2f36a34fa98..51ed635640a 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponseDataBlock.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ConnectionResponseDataBlock.go @@ -178,14 +178,14 @@ func (pm *_ConnectionResponseDataBlock) SerializeParent(ctx context.Context, wri // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Discriminator Field (connectionType) (Used as input to a switch field) connectionType := uint8(child.GetConnectionType()) - _connectionTypeErr := writeBuffer.WriteUint8("connectionType", 8, (connectionType)) + _connectionTypeErr := writeBuffer.WriteUint8("connectionType", 8, uint8((connectionType))) if _connectionTypeErr != nil { return errors.Wrap(_connectionTypeErr, "Error serializing 'connectionType' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateRequest.go b/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateRequest.go index b98d24d6971..9b9e3208fce 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateRequest.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateRequest.go @@ -228,7 +228,7 @@ func (m *_ConnectionStateRequest) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } @@ -243,7 +243,7 @@ func (m *_ConnectionStateRequest) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateResponse.go b/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateResponse.go index 1570a0f97c6..e8084a3fccb 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ConnectionStateResponse.go @@ -205,7 +205,7 @@ func (m *_ConnectionStateResponse) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DIBDeviceInfo.go b/plc4go/protocols/knxnetip/readwrite/model/DIBDeviceInfo.go index 00638576edb..ff2599b86d3 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DIBDeviceInfo.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DIBDeviceInfo.go @@ -340,14 +340,14 @@ func (m *_DIBDeviceInfo) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Simple Field (descriptionType) descriptionType := uint8(m.GetDescriptionType()) - _descriptionTypeErr := writeBuffer.WriteUint8("descriptionType", 8, (descriptionType)) + _descriptionTypeErr := writeBuffer.WriteUint8("descriptionType", 8, uint8((descriptionType))) if _descriptionTypeErr != nil { return errors.Wrap(_descriptionTypeErr, "Error serializing 'descriptionType' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DIBSuppSvcFamilies.go b/plc4go/protocols/knxnetip/readwrite/model/DIBSuppSvcFamilies.go index c02b5940ef6..750451988bb 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DIBSuppSvcFamilies.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DIBSuppSvcFamilies.go @@ -194,14 +194,14 @@ func (m *_DIBSuppSvcFamilies) SerializeWithWriteBuffer(ctx context.Context, writ // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Simple Field (descriptionType) descriptionType := uint8(m.GetDescriptionType()) - _descriptionTypeErr := writeBuffer.WriteUint8("descriptionType", 8, (descriptionType)) + _descriptionTypeErr := writeBuffer.WriteUint8("descriptionType", 8, uint8((descriptionType))) if _descriptionTypeErr != nil { return errors.Wrap(_descriptionTypeErr, "Error serializing 'descriptionType' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationAckDataBlock.go b/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationAckDataBlock.go index 415830eade4..e3dea13a0ac 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationAckDataBlock.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationAckDataBlock.go @@ -200,21 +200,21 @@ func (m *_DeviceConfigurationAckDataBlock) SerializeWithWriteBuffer(ctx context. // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } // Simple Field (sequenceCounter) sequenceCounter := uint8(m.GetSequenceCounter()) - _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, (sequenceCounter)) + _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, uint8((sequenceCounter))) if _sequenceCounterErr != nil { return errors.Wrap(_sequenceCounterErr, "Error serializing 'sequenceCounter' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationRequestDataBlock.go b/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationRequestDataBlock.go index a1a976b6b79..3848076293f 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationRequestDataBlock.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DeviceConfigurationRequestDataBlock.go @@ -199,21 +199,21 @@ func (m *_DeviceConfigurationRequestDataBlock) SerializeWithWriteBuffer(ctx cont // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } // Simple Field (sequenceCounter) sequenceCounter := uint8(m.GetSequenceCounter()) - _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, (sequenceCounter)) + _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, uint8((sequenceCounter))) if _sequenceCounterErr != nil { return errors.Wrap(_sequenceCounterErr, "Error serializing 'sequenceCounter' field") } @@ -228,7 +228,7 @@ func (m *_DeviceConfigurationRequestDataBlock) SerializeWithWriteBuffer(ctx cont }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptor.go b/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptor.go index 70416a09e3f..39fb13e2a19 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptor.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptor.go @@ -563,7 +563,7 @@ func (e DeviceDescriptor) Serialize() ([]byte, error) { func (e DeviceDescriptor) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("DeviceDescriptor", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("DeviceDescriptor", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorMediumType.go b/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorMediumType.go index 61b12b3d384..156ecf64ccb 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorMediumType.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorMediumType.go @@ -156,7 +156,7 @@ func (e DeviceDescriptorMediumType) Serialize() ([]byte, error) { func (e DeviceDescriptorMediumType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("DeviceDescriptorMediumType", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("DeviceDescriptorMediumType", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorType2.go b/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorType2.go index 053b09f0a75..3fcada6191f 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorType2.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DeviceDescriptorType2.go @@ -334,21 +334,21 @@ func (m *_DeviceDescriptorType2) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (manufacturerId) manufacturerId := uint16(m.GetManufacturerId()) - _manufacturerIdErr := writeBuffer.WriteUint16("manufacturerId", 16, (manufacturerId)) + _manufacturerIdErr := writeBuffer.WriteUint16("manufacturerId", 16, uint16((manufacturerId))) if _manufacturerIdErr != nil { return errors.Wrap(_manufacturerIdErr, "Error serializing 'manufacturerId' field") } // Simple Field (deviceType) deviceType := uint16(m.GetDeviceType()) - _deviceTypeErr := writeBuffer.WriteUint16("deviceType", 16, (deviceType)) + _deviceTypeErr := writeBuffer.WriteUint16("deviceType", 16, uint16((deviceType))) if _deviceTypeErr != nil { return errors.Wrap(_deviceTypeErr, "Error serializing 'deviceType' field") } // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } @@ -369,7 +369,7 @@ func (m *_DeviceDescriptorType2) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (logicalTagBase) logicalTagBase := uint8(m.GetLogicalTagBase()) - _logicalTagBaseErr := writeBuffer.WriteUint8("logicalTagBase", 6, (logicalTagBase)) + _logicalTagBaseErr := writeBuffer.WriteUint8("logicalTagBase", 6, uint8((logicalTagBase))) if _logicalTagBaseErr != nil { return errors.Wrap(_logicalTagBaseErr, "Error serializing 'logicalTagBase' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DeviceStatus.go b/plc4go/protocols/knxnetip/readwrite/model/DeviceStatus.go index 3dcf679410e..319393c06da 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DeviceStatus.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DeviceStatus.go @@ -179,7 +179,7 @@ func (m *_DeviceStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffe }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DisconnectRequest.go b/plc4go/protocols/knxnetip/readwrite/model/DisconnectRequest.go index 19da7f0bab0..d7405728064 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DisconnectRequest.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DisconnectRequest.go @@ -228,7 +228,7 @@ func (m *_DisconnectRequest) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } @@ -243,7 +243,7 @@ func (m *_DisconnectRequest) SerializeWithWriteBuffer(ctx context.Context, write }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/DisconnectResponse.go b/plc4go/protocols/knxnetip/readwrite/model/DisconnectResponse.go index 6ca8cf08895..bda7d9fcf81 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/DisconnectResponse.go +++ b/plc4go/protocols/knxnetip/readwrite/model/DisconnectResponse.go @@ -205,7 +205,7 @@ func (m *_DisconnectResponse) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/FirmwareType.go b/plc4go/protocols/knxnetip/readwrite/model/FirmwareType.go index 2088a4944f7..4c46fd57121 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/FirmwareType.go +++ b/plc4go/protocols/knxnetip/readwrite/model/FirmwareType.go @@ -216,7 +216,7 @@ func (e FirmwareType) Serialize() ([]byte, error) { func (e FirmwareType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("FirmwareType", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("FirmwareType", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType1.go b/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType1.go index a35a7407852..d9ae16a68f5 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType1.go +++ b/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType1.go @@ -309,7 +309,7 @@ func (m *_GroupObjectDescriptorRealisationType1) SerializeWithWriteBuffer(ctx co // Simple Field (dataPointer) dataPointer := uint8(m.GetDataPointer()) - _dataPointerErr := writeBuffer.WriteUint8("dataPointer", 8, (dataPointer)) + _dataPointerErr := writeBuffer.WriteUint8("dataPointer", 8, uint8((dataPointer))) if _dataPointerErr != nil { return errors.Wrap(_dataPointerErr, "Error serializing 'dataPointer' field") } @@ -324,7 +324,7 @@ func (m *_GroupObjectDescriptorRealisationType1) SerializeWithWriteBuffer(ctx co }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 1, reserved) + _err := writeBuffer.WriteUint8("reserved", 1, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType2.go b/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType2.go index 45d427e7c9d..544b55bcbfc 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType2.go +++ b/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType2.go @@ -304,7 +304,7 @@ func (m *_GroupObjectDescriptorRealisationType2) SerializeWithWriteBuffer(ctx co // Simple Field (dataPointer) dataPointer := uint8(m.GetDataPointer()) - _dataPointerErr := writeBuffer.WriteUint8("dataPointer", 8, (dataPointer)) + _dataPointerErr := writeBuffer.WriteUint8("dataPointer", 8, uint8((dataPointer))) if _dataPointerErr != nil { return errors.Wrap(_dataPointerErr, "Error serializing 'dataPointer' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType7.go b/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType7.go index 8120eeefb0f..4797c86cfe1 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType7.go +++ b/plc4go/protocols/knxnetip/readwrite/model/GroupObjectDescriptorRealisationType7.go @@ -304,7 +304,7 @@ func (m *_GroupObjectDescriptorRealisationType7) SerializeWithWriteBuffer(ctx co // Simple Field (dataAddress) dataAddress := uint16(m.GetDataAddress()) - _dataAddressErr := writeBuffer.WriteUint16("dataAddress", 16, (dataAddress)) + _dataAddressErr := writeBuffer.WriteUint16("dataAddress", 16, uint16((dataAddress))) if _dataAddressErr != nil { return errors.Wrap(_dataAddressErr, "Error serializing 'dataAddress' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/HPAIControlEndpoint.go b/plc4go/protocols/knxnetip/readwrite/model/HPAIControlEndpoint.go index 60025bbeeb2..4c09210c9fb 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/HPAIControlEndpoint.go +++ b/plc4go/protocols/knxnetip/readwrite/model/HPAIControlEndpoint.go @@ -206,7 +206,7 @@ func (m *_HPAIControlEndpoint) SerializeWithWriteBuffer(ctx context.Context, wri // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } @@ -237,7 +237,7 @@ func (m *_HPAIControlEndpoint) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (ipPort) ipPort := uint16(m.GetIpPort()) - _ipPortErr := writeBuffer.WriteUint16("ipPort", 16, (ipPort)) + _ipPortErr := writeBuffer.WriteUint16("ipPort", 16, uint16((ipPort))) if _ipPortErr != nil { return errors.Wrap(_ipPortErr, "Error serializing 'ipPort' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/HPAIDataEndpoint.go b/plc4go/protocols/knxnetip/readwrite/model/HPAIDataEndpoint.go index 200b6f7eb13..0456905e9a1 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/HPAIDataEndpoint.go +++ b/plc4go/protocols/knxnetip/readwrite/model/HPAIDataEndpoint.go @@ -206,7 +206,7 @@ func (m *_HPAIDataEndpoint) SerializeWithWriteBuffer(ctx context.Context, writeB // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } @@ -237,7 +237,7 @@ func (m *_HPAIDataEndpoint) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (ipPort) ipPort := uint16(m.GetIpPort()) - _ipPortErr := writeBuffer.WriteUint16("ipPort", 16, (ipPort)) + _ipPortErr := writeBuffer.WriteUint16("ipPort", 16, uint16((ipPort))) if _ipPortErr != nil { return errors.Wrap(_ipPortErr, "Error serializing 'ipPort' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/HPAIDiscoveryEndpoint.go b/plc4go/protocols/knxnetip/readwrite/model/HPAIDiscoveryEndpoint.go index abd6876bf40..667efc1c317 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/HPAIDiscoveryEndpoint.go +++ b/plc4go/protocols/knxnetip/readwrite/model/HPAIDiscoveryEndpoint.go @@ -206,7 +206,7 @@ func (m *_HPAIDiscoveryEndpoint) SerializeWithWriteBuffer(ctx context.Context, w // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } @@ -237,7 +237,7 @@ func (m *_HPAIDiscoveryEndpoint) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (ipPort) ipPort := uint16(m.GetIpPort()) - _ipPortErr := writeBuffer.WriteUint16("ipPort", 16, (ipPort)) + _ipPortErr := writeBuffer.WriteUint16("ipPort", 16, uint16((ipPort))) if _ipPortErr != nil { return errors.Wrap(_ipPortErr, "Error serializing 'ipPort' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/HostProtocolCode.go b/plc4go/protocols/knxnetip/readwrite/model/HostProtocolCode.go index cf608efd6d0..178958f69cc 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/HostProtocolCode.go +++ b/plc4go/protocols/knxnetip/readwrite/model/HostProtocolCode.go @@ -132,7 +132,7 @@ func (e HostProtocolCode) Serialize() ([]byte, error) { func (e HostProtocolCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("HostProtocolCode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("HostProtocolCode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxAddress.go b/plc4go/protocols/knxnetip/readwrite/model/KnxAddress.go index 5ced856d5af..7c4496bfad4 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxAddress.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxAddress.go @@ -184,21 +184,21 @@ func (m *_KnxAddress) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (mainGroup) mainGroup := uint8(m.GetMainGroup()) - _mainGroupErr := writeBuffer.WriteUint8("mainGroup", 4, (mainGroup)) + _mainGroupErr := writeBuffer.WriteUint8("mainGroup", 4, uint8((mainGroup))) if _mainGroupErr != nil { return errors.Wrap(_mainGroupErr, "Error serializing 'mainGroup' field") } // Simple Field (middleGroup) middleGroup := uint8(m.GetMiddleGroup()) - _middleGroupErr := writeBuffer.WriteUint8("middleGroup", 4, (middleGroup)) + _middleGroupErr := writeBuffer.WriteUint8("middleGroup", 4, uint8((middleGroup))) if _middleGroupErr != nil { return errors.Wrap(_middleGroupErr, "Error serializing 'middleGroup' field") } // Simple Field (subGroup) subGroup := uint8(m.GetSubGroup()) - _subGroupErr := writeBuffer.WriteUint8("subGroup", 8, (subGroup)) + _subGroupErr := writeBuffer.WriteUint8("subGroup", 8, uint8((subGroup))) if _subGroupErr != nil { return errors.Wrap(_subGroupErr, "Error serializing 'subGroup' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxDatapoint.go b/plc4go/protocols/knxnetip/readwrite/model/KnxDatapoint.go index 10cf3e4718c..2a691fa879d 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxDatapoint.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxDatapoint.go @@ -272,7 +272,7 @@ func KnxDatapointParseWithBuffer(ctx context.Context, readBuffer utils.ReadBuffe return nil, errors.Wrap(_millisecondsErr, "Error parsing 'milliseconds' field") } readBuffer.CloseContext("KnxDatapoint") - return values.NewPlcTIMEFromMilliseconds(milliseconds), nil + return values.NewPlcTIMEFromMilliseconds(int64(milliseconds)), nil case datapointType == KnxDatapointType_LTIME: // LTIME // Reserved Field (Just skip the bytes) if _, _err := readBuffer.ReadUint8("reserved", 8); _err != nil { @@ -7612,7 +7612,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils switch { case datapointType == KnxDatapointType_BOOL: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7622,127 +7622,127 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_BYTE: // BYTE // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_WORD: // WORD // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DWORD: // DWORD // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_LWORD: // LWORD // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_USINT: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_SINT: // SINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_UINT: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_INT: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_UDINT: // UDINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DINT: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_ULINT: // ULINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_LINT: // LINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_REAL: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7752,7 +7752,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_LREAL: // LREAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7762,7 +7762,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_CHAR: // CHAR // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7772,7 +7772,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_WCHAR: // WCHAR // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7782,147 +7782,147 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_TIME: // TIME // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (milliseconds) - if _err := writeBuffer.WriteUint32("milliseconds", 32, value.(values.PlcTIME).GetMilliseconds()); _err != nil { + if _err := writeBuffer.WriteUint32("milliseconds", 32, uint32(value.(values.PlcTIME).GetMilliseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'milliseconds' field") } case datapointType == KnxDatapointType_LTIME: // LTIME // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (nanoseconds) - if _err := writeBuffer.WriteUint64("nanoseconds", 64, value.(values.PlcLTIME).GetNanoseconds()); _err != nil { + if _err := writeBuffer.WriteUint64("nanoseconds", 64, uint64(value.(values.PlcLTIME).GetNanoseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanoseconds' field") } case datapointType == KnxDatapointType_DATE: // DATE // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (secondsSinceEpoch) - if _err := writeBuffer.WriteUint32("secondsSinceEpoch", 32, value.(values.PlcDATE).GetSecondsSinceEpoch()); _err != nil { + if _err := writeBuffer.WriteUint32("secondsSinceEpoch", 32, uint32(value.(values.PlcDATE).GetSecondsSinceEpoch())); _err != nil { return errors.Wrap(_err, "Error serializing 'secondsSinceEpoch' field") } case datapointType == KnxDatapointType_TIME_OF_DAY: // TIME_OF_DAY // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (millisecondsSinceMidnight) - if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight()); _err != nil { + if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, uint32(value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight())); _err != nil { return errors.Wrap(_err, "Error serializing 'millisecondsSinceMidnight' field") } case datapointType == KnxDatapointType_TOD: // TIME_OF_DAY // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (millisecondsSinceMidnight) - if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight()); _err != nil { + if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, uint32(value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight())); _err != nil { return errors.Wrap(_err, "Error serializing 'millisecondsSinceMidnight' field") } case datapointType == KnxDatapointType_DATE_AND_TIME: // DATE_AND_TIME // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (year) - if _err := writeBuffer.WriteUint16("year", 16, value.(values.PlcDATE_AND_TIME).GetYear()); _err != nil { + if _err := writeBuffer.WriteUint16("year", 16, uint16(value.(values.PlcDATE_AND_TIME).GetYear())); _err != nil { return errors.Wrap(_err, "Error serializing 'year' field") } // Simple Field (month) - if _err := writeBuffer.WriteUint8("month", 8, value.(values.PlcDATE_AND_TIME).GetMonth()); _err != nil { + if _err := writeBuffer.WriteUint8("month", 8, uint8(value.(values.PlcDATE_AND_TIME).GetMonth())); _err != nil { return errors.Wrap(_err, "Error serializing 'month' field") } // Simple Field (day) - if _err := writeBuffer.WriteUint8("day", 8, value.(values.PlcDATE_AND_TIME).GetDay()); _err != nil { + if _err := writeBuffer.WriteUint8("day", 8, uint8(value.(values.PlcDATE_AND_TIME).GetDay())); _err != nil { return errors.Wrap(_err, "Error serializing 'day' field") } // Simple Field (dayOfWeek) - if _err := writeBuffer.WriteUint8("dayOfWeek", 8, value.(values.PlcDATE_AND_TIME).GetDayOfWeek()); _err != nil { + if _err := writeBuffer.WriteUint8("dayOfWeek", 8, uint8(value.(values.PlcDATE_AND_TIME).GetDayOfWeek())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayOfWeek' field") } // Simple Field (hour) - if _err := writeBuffer.WriteUint8("hour", 8, value.(values.PlcDATE_AND_TIME).GetHour()); _err != nil { + if _err := writeBuffer.WriteUint8("hour", 8, uint8(value.(values.PlcDATE_AND_TIME).GetHour())); _err != nil { return errors.Wrap(_err, "Error serializing 'hour' field") } // Simple Field (minutes) - if _err := writeBuffer.WriteUint8("minutes", 8, value.(values.PlcDATE_AND_TIME).GetMinutes()); _err != nil { + if _err := writeBuffer.WriteUint8("minutes", 8, uint8(value.(values.PlcDATE_AND_TIME).GetMinutes())); _err != nil { return errors.Wrap(_err, "Error serializing 'minutes' field") } // Simple Field (seconds) - if _err := writeBuffer.WriteUint8("seconds", 8, value.(values.PlcDATE_AND_TIME).GetSeconds()); _err != nil { + if _err := writeBuffer.WriteUint8("seconds", 8, uint8(value.(values.PlcDATE_AND_TIME).GetSeconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'seconds' field") } // Simple Field (nanoseconds) - if _err := writeBuffer.WriteUint32("nanoseconds", 32, value.(values.PlcDATE_AND_TIME).GetNanoseconds()); _err != nil { + if _err := writeBuffer.WriteUint32("nanoseconds", 32, uint32(value.(values.PlcDATE_AND_TIME).GetNanoseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanoseconds' field") } case datapointType == KnxDatapointType_DT: // DATE_AND_TIME // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (year) - if _err := writeBuffer.WriteUint16("year", 16, value.(values.PlcDATE_AND_TIME).GetYear()); _err != nil { + if _err := writeBuffer.WriteUint16("year", 16, uint16(value.(values.PlcDATE_AND_TIME).GetYear())); _err != nil { return errors.Wrap(_err, "Error serializing 'year' field") } // Simple Field (month) - if _err := writeBuffer.WriteUint8("month", 8, value.(values.PlcDATE_AND_TIME).GetMonth()); _err != nil { + if _err := writeBuffer.WriteUint8("month", 8, uint8(value.(values.PlcDATE_AND_TIME).GetMonth())); _err != nil { return errors.Wrap(_err, "Error serializing 'month' field") } // Simple Field (day) - if _err := writeBuffer.WriteUint8("day", 8, value.(values.PlcDATE_AND_TIME).GetDay()); _err != nil { + if _err := writeBuffer.WriteUint8("day", 8, uint8(value.(values.PlcDATE_AND_TIME).GetDay())); _err != nil { return errors.Wrap(_err, "Error serializing 'day' field") } // Simple Field (dayOfWeek) - if _err := writeBuffer.WriteUint8("dayOfWeek", 8, value.(values.PlcDATE_AND_TIME).GetDayOfWeek()); _err != nil { + if _err := writeBuffer.WriteUint8("dayOfWeek", 8, uint8(value.(values.PlcDATE_AND_TIME).GetDayOfWeek())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayOfWeek' field") } // Simple Field (hour) - if _err := writeBuffer.WriteUint8("hour", 8, value.(values.PlcDATE_AND_TIME).GetHour()); _err != nil { + if _err := writeBuffer.WriteUint8("hour", 8, uint8(value.(values.PlcDATE_AND_TIME).GetHour())); _err != nil { return errors.Wrap(_err, "Error serializing 'hour' field") } // Simple Field (minutes) - if _err := writeBuffer.WriteUint8("minutes", 8, value.(values.PlcDATE_AND_TIME).GetMinutes()); _err != nil { + if _err := writeBuffer.WriteUint8("minutes", 8, uint8(value.(values.PlcDATE_AND_TIME).GetMinutes())); _err != nil { return errors.Wrap(_err, "Error serializing 'minutes' field") } // Simple Field (seconds) - if _err := writeBuffer.WriteUint8("seconds", 8, value.(values.PlcDATE_AND_TIME).GetSeconds()); _err != nil { + if _err := writeBuffer.WriteUint8("seconds", 8, uint8(value.(values.PlcDATE_AND_TIME).GetSeconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'seconds' field") } // Simple Field (nanoseconds) - if _err := writeBuffer.WriteUint32("nanoseconds", 32, value.(values.PlcDATE_AND_TIME).GetNanoseconds()); _err != nil { + if _err := writeBuffer.WriteUint32("nanoseconds", 32, uint32(value.(values.PlcDATE_AND_TIME).GetNanoseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanoseconds' field") } case datapointType == KnxDatapointType_DPT_Switch: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7932,7 +7932,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Bool: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7942,7 +7942,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Enable: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7952,7 +7952,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Ramp: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7962,7 +7962,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Alarm: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7972,7 +7972,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_BinaryValue: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7982,7 +7982,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Step: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -7992,7 +7992,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_UpDown: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8002,7 +8002,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_OpenClose: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8012,7 +8012,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Start: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8022,7 +8022,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_State: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8032,7 +8032,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Invert: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8042,7 +8042,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_DimSendStyle: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8052,7 +8052,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_InputSource: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8062,7 +8062,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Reset: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8072,7 +8072,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Ack: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8082,7 +8082,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Trigger: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8092,7 +8092,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Occupancy: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8102,7 +8102,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Window_Door: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8112,7 +8112,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_LogicalFunction: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8122,7 +8122,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Scene_AB: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8132,7 +8132,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_ShutterBlinds_Mode: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8142,7 +8142,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_DayNight: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8152,7 +8152,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Heat_Cool: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8162,7 +8162,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Switch_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8177,7 +8177,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Bool_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8192,7 +8192,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Enable_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8207,7 +8207,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Ramp_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8222,7 +8222,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Alarm_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8237,7 +8237,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_BinaryValue_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8252,7 +8252,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Step_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8267,7 +8267,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Direction1_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8282,7 +8282,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Direction2_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8297,7 +8297,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Start_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8312,7 +8312,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_State_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8327,7 +8327,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Invert_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8342,7 +8342,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Control_Dimming: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8352,12 +8352,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepcode) - if _err := writeBuffer.WriteUint8("stepcode", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepcode", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepcode' field") } case datapointType == KnxDatapointType_DPT_Control_Blinds: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8367,12 +8367,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepcode) - if _err := writeBuffer.WriteUint8("stepcode", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepcode", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepcode' field") } case datapointType == KnxDatapointType_DPT_Char_ASCII: // STRING // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8382,7 +8382,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Char_8859_1: // STRING // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8392,97 +8392,97 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Scaling: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Angle: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Percent_U8: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DecimalFactor: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Tariff: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Value_1_Ucount: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_FanStage: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Percent_V8: // SINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Value_1_Count: // SINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Status_Mode3: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8512,232 +8512,232 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (mode) - if _err := writeBuffer.WriteUint8("mode", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("mode", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'mode' field") } case datapointType == KnxDatapointType_DPT_Value_2_Ucount: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_TimePeriodMsec: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_TimePeriod10Msec: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_TimePeriod100Msec: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_TimePeriodSec: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_TimePeriodMin: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_TimePeriodHrs: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_PropDataType: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Length_mm: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_UElCurrentmA: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Brightness: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Absolute_Colour_Temperature: // UINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Value_2_Count: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaTimeMsec: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaTime10Msec: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaTime100Msec: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaTimeSec: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaTimeMin: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaTimeHrs: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Percent_V16: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Rotation_Angle: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Length_m: // INT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Value_Temp: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8747,7 +8747,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Tempd: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8757,7 +8757,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Tempa: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8767,7 +8767,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Lux: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8777,7 +8777,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Wsp: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8787,7 +8787,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Pres: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8797,7 +8797,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Humidity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8807,7 +8807,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_AirQuality: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8817,7 +8817,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_AirFlow: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8827,7 +8827,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Time1: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8837,7 +8837,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Time2: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8847,7 +8847,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Volt: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8857,7 +8857,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Curr: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8867,7 +8867,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_PowerDensity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8877,7 +8877,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_KelvinPerPercent: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8887,7 +8887,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Power: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8897,7 +8897,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Volume_Flow: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8907,7 +8907,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Rain_Amount: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8917,7 +8917,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Temp_F: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8927,7 +8927,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Wsp_kmh: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8937,7 +8937,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Absolute_Humidity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8947,7 +8947,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Concentration_ygm3: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8957,7 +8957,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Coefficient: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -8967,257 +8967,257 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_TimeOfDay: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (day) - if _err := writeBuffer.WriteUint8("day", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("day", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'day' field") } // Simple Field (hour) - if _err := writeBuffer.WriteUint8("hour", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("hour", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'hour' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (minutes) - if _err := writeBuffer.WriteUint8("minutes", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("minutes", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'minutes' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (seconds) - if _err := writeBuffer.WriteUint8("seconds", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("seconds", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'seconds' field") } case datapointType == KnxDatapointType_DPT_Date: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (dayOfMonth) - if _err := writeBuffer.WriteUint8("dayOfMonth", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("dayOfMonth", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayOfMonth' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (month) - if _err := writeBuffer.WriteUint8("month", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("month", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'month' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (year) - if _err := writeBuffer.WriteUint8("year", 7, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("year", 7, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'year' field") } case datapointType == KnxDatapointType_DPT_Value_4_Ucount: // UDINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LongTimePeriod_Sec: // UDINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LongTimePeriod_Min: // UDINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LongTimePeriod_Hrs: // UDINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_VolumeLiquid_Litre: // UDINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Volume_m_3: // UDINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Value_4_Count: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_FlowRate_m3h: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ActiveEnergy: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ApparantEnergy: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ReactiveEnergy: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ActiveEnergy_kWh: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ApparantEnergy_kVAh: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ReactiveEnergy_kVARh: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ActiveEnergy_MWh: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LongDeltaTimeSec: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaVolumeLiquid_Litre: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DeltaVolume_m_3: // DINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Value_Acceleration: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9227,7 +9227,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Acceleration_Angular: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9237,7 +9237,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Activation_Energy: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9247,7 +9247,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Activity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9257,7 +9257,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Mol: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9267,7 +9267,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Amplitude: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9277,7 +9277,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_AngleRad: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9287,7 +9287,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_AngleDeg: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9297,7 +9297,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Angular_Momentum: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9307,7 +9307,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Angular_Velocity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9317,7 +9317,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Area: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9327,7 +9327,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Capacitance: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9337,7 +9337,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Charge_DensitySurface: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9347,7 +9347,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Charge_DensityVolume: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9357,7 +9357,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Compressibility: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9367,7 +9367,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Conductance: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9377,7 +9377,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electrical_Conductivity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9387,7 +9387,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Density: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9397,7 +9397,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_Charge: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9407,7 +9407,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_Current: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9417,7 +9417,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_CurrentDensity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9427,7 +9427,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_DipoleMoment: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9437,7 +9437,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_Displacement: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9447,7 +9447,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_FieldStrength: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9457,7 +9457,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_Flux: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9467,7 +9467,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_FluxDensity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9477,7 +9477,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_Polarization: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9487,7 +9487,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_Potential: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9497,7 +9497,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electric_PotentialDifference: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9507,7 +9507,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_ElectromagneticMoment: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9517,7 +9517,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Electromotive_Force: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9527,7 +9527,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Energy: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9537,7 +9537,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Force: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9547,7 +9547,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Frequency: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9557,7 +9557,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Angular_Frequency: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9567,7 +9567,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Heat_Capacity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9577,7 +9577,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Heat_FlowRate: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9587,7 +9587,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Heat_Quantity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9597,7 +9597,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Impedance: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9607,7 +9607,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Length: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9617,7 +9617,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Light_Quantity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9627,7 +9627,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Luminance: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9637,7 +9637,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Luminous_Flux: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9647,7 +9647,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Luminous_Intensity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9657,7 +9657,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Magnetic_FieldStrength: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9667,7 +9667,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Magnetic_Flux: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9677,7 +9677,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Magnetic_FluxDensity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9687,7 +9687,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Magnetic_Moment: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9697,7 +9697,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Magnetic_Polarization: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9707,7 +9707,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Magnetization: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9717,7 +9717,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_MagnetomotiveForce: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9727,7 +9727,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Mass: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9737,7 +9737,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_MassFlux: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9747,7 +9747,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Momentum: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9757,7 +9757,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Phase_AngleRad: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9767,7 +9767,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Phase_AngleDeg: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9777,7 +9777,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Power: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9787,7 +9787,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Power_Factor: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9797,7 +9797,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Pressure: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9807,7 +9807,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Reactance: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9817,7 +9817,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Resistance: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9827,7 +9827,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Resistivity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9837,7 +9837,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_SelfInductance: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9847,7 +9847,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_SolidAngle: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9857,7 +9857,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Sound_Intensity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9867,7 +9867,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Speed: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9877,7 +9877,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Stress: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9887,7 +9887,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Surface_Tension: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9897,7 +9897,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Common_Temperature: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9907,7 +9907,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Absolute_Temperature: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9917,7 +9917,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_TemperatureDifference: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9927,7 +9927,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Thermal_Capacity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9937,7 +9937,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Thermal_Conductivity: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9947,7 +9947,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_ThermoelectricPower: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9957,7 +9957,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Time: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9967,7 +9967,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Torque: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9977,7 +9977,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Volume: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9987,7 +9987,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Volume_Flux: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -9997,7 +9997,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Weight: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10007,7 +10007,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_Work: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10017,7 +10017,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Value_ApparentPower: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10027,7 +10027,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Volume_Flux_Meter: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10037,7 +10037,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Volume_Flux_ls: // REAL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10047,37 +10047,37 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Access_Data: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (hurz) - if _err := writeBuffer.WriteUint8("hurz", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("hurz", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'hurz' field") } // Simple Field (value1) - if _err := writeBuffer.WriteUint8("value1", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value1", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value1' field") } // Simple Field (value2) - if _err := writeBuffer.WriteUint8("value2", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value2", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value2' field") } // Simple Field (value3) - if _err := writeBuffer.WriteUint8("value3", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value3", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value3' field") } // Simple Field (value4) - if _err := writeBuffer.WriteUint8("value4", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value4", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value4' field") } // Simple Field (value5) - if _err := writeBuffer.WriteUint8("value5", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value5", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value5' field") } @@ -10102,12 +10102,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (indexOfAccessIdentificationCode) - if _err := writeBuffer.WriteUint8("indexOfAccessIdentificationCode", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("indexOfAccessIdentificationCode", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'indexOfAccessIdentificationCode' field") } case datapointType == KnxDatapointType_DPT_String_ASCII: // STRING // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10117,7 +10117,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_String_8859_1: // STRING // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10127,17 +10127,17 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_SceneNumber: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_SceneControl: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10147,72 +10147,72 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (sceneNumber) - if _err := writeBuffer.WriteUint8("sceneNumber", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("sceneNumber", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'sceneNumber' field") } case datapointType == KnxDatapointType_DPT_DateTime: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (year) - if _err := writeBuffer.WriteUint8("year", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("year", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'year' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (month) - if _err := writeBuffer.WriteUint8("month", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("month", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'month' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (dayofmonth) - if _err := writeBuffer.WriteUint8("dayofmonth", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("dayofmonth", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayofmonth' field") } // Simple Field (dayofweek) - if _err := writeBuffer.WriteUint8("dayofweek", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("dayofweek", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayofweek' field") } // Simple Field (hourofday) - if _err := writeBuffer.WriteUint8("hourofday", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("hourofday", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'hourofday' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (minutes) - if _err := writeBuffer.WriteUint8("minutes", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("minutes", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'minutes' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (seconds) - if _err := writeBuffer.WriteUint8("seconds", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("seconds", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'seconds' field") } @@ -10262,577 +10262,577 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } case datapointType == KnxDatapointType_DPT_SCLOMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_BuildingMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_OccMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Priority: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LightApplicationMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ApplicationArea: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_AlarmClassType: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_PSUMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ErrorClass_System: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ErrorClass_HVAC: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Time_Delay: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Beaufort_Wind_Force_Scale: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_SensorSelect: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ActuatorConnectType: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Cloud_Cover: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_PowerReturnMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_FuelType: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_BurnerType: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_HVACMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DHWMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LoadPriority: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_HVACContrMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_HVACEmergMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ChangeoverMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ValveMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DamperMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_HeaterMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_FanMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_MasterSlaveMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_StatusRoomSetp: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Metering_DeviceType: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_HumDehumMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_EnableHCStage: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ADAType: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_BackupMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_StartSynchronization: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Behaviour_Lock_Unlock: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Behaviour_Bus_Power_Up_Down: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DALI_Fade_Time: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_BlinkingMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LightControlMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_SwitchPBModel: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_PBAction: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DimmPBModel: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_SwitchOnMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LoadTypeSet: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_LoadTypeDetected: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Converter_Test_Control: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_SABExcept_Behaviour: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_SABBehaviour_Lock_Unlock: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_SSSBMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_BlindsControlMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_CommMode: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_AddInfoTypes: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_RF_ModeSelect: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_RF_FilterSelect: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_StatusGen: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10862,12 +10862,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Device_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10887,7 +10887,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_ForceSign: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10932,7 +10932,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_ForceSignCool: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10942,7 +10942,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_StatusRHC: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -10987,12 +10987,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_StatusSDHWC: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11012,12 +11012,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_FuelTypeSet: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11037,7 +11037,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_StatusRCC: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11047,12 +11047,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_StatusAHU: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11077,12 +11077,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_CombinedStatus_RTSM: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11112,12 +11112,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_LightActuatorErrorInfo: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11157,12 +11157,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_RF_ModeInfo: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11182,12 +11182,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_RF_FilterInfo: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11207,7 +11207,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Channel_Activation_8: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11252,12 +11252,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_StatusDHWC: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11302,12 +11302,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_StatusRHCC: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11387,12 +11387,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_CombinedStatus_HVA: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11442,12 +11442,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_CombinedStatus_RTC: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11497,12 +11497,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Media: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint16("reserved", 10, uint16(0x00)); _err != nil { + if _err := writeBuffer.WriteUint16("reserved", 10, uint16(uint16(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11517,7 +11517,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11532,12 +11532,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } case datapointType == KnxDatapointType_DPT_Channel_Activation_16: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11622,67 +11622,67 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_OnOffAction: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Alarm_Reaction: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_UpDown_Action: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_HVAC_PB_Action: // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_DoubleNibble: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (busy) - if _err := writeBuffer.WriteUint8("busy", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("busy", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'busy' field") } // Simple Field (nak) - if _err := writeBuffer.WriteUint8("nak", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("nak", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'nak' field") } case datapointType == KnxDatapointType_DPT_SceneInfo: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11692,12 +11692,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (scenenumber) - if _err := writeBuffer.WriteUint8("scenenumber", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("scenenumber", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'scenenumber' field") } case datapointType == KnxDatapointType_DPT_CombinedInfoOnOff: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -11862,37 +11862,37 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_ActiveEnergy_V64: // LINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ApparantEnergy_V64: // LINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_ReactiveEnergy_V64: // LINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case datapointType == KnxDatapointType_DPT_Channel_Activation_24: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12017,67 +12017,67 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_HVACModeNext: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (delayTimeMin) - if _err := writeBuffer.WriteUint16("delayTimeMin", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("delayTimeMin", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'delayTimeMin' field") } // Simple Field (hvacMode) - if _err := writeBuffer.WriteUint8("hvacMode", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("hvacMode", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'hvacMode' field") } case datapointType == KnxDatapointType_DPT_DHWModeNext: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (delayTimeMin) - if _err := writeBuffer.WriteUint16("delayTimeMin", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("delayTimeMin", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'delayTimeMin' field") } // Simple Field (dhwMode) - if _err := writeBuffer.WriteUint8("dhwMode", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("dhwMode", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'dhwMode' field") } case datapointType == KnxDatapointType_DPT_OccModeNext: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (delayTimeMin) - if _err := writeBuffer.WriteUint16("delayTimeMin", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("delayTimeMin", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'delayTimeMin' field") } // Simple Field (occupancyMode) - if _err := writeBuffer.WriteUint8("occupancyMode", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("occupancyMode", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'occupancyMode' field") } case datapointType == KnxDatapointType_DPT_BuildingModeNext: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (delayTimeMin) - if _err := writeBuffer.WriteUint16("delayTimeMin", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("delayTimeMin", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'delayTimeMin' field") } // Simple Field (buildingMode) - if _err := writeBuffer.WriteUint8("buildingMode", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("buildingMode", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'buildingMode' field") } case datapointType == KnxDatapointType_DPT_StatusLightingActuator: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12122,57 +12122,57 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (actualvalue) - if _err := writeBuffer.WriteUint8("actualvalue", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("actualvalue", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'actualvalue' field") } case datapointType == KnxDatapointType_DPT_Version: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (magicNumber) - if _err := writeBuffer.WriteUint8("magicNumber", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("magicNumber", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'magicNumber' field") } // Simple Field (versionNumber) - if _err := writeBuffer.WriteUint8("versionNumber", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("versionNumber", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'versionNumber' field") } // Simple Field (revisionNumber) - if _err := writeBuffer.WriteUint8("revisionNumber", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("revisionNumber", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'revisionNumber' field") } case datapointType == KnxDatapointType_DPT_AlarmInfo: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (logNumber) - if _err := writeBuffer.WriteUint8("logNumber", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("logNumber", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'logNumber' field") } // Simple Field (alarmPriority) - if _err := writeBuffer.WriteUint8("alarmPriority", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("alarmPriority", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'alarmPriority' field") } // Simple Field (applicationArea) - if _err := writeBuffer.WriteUint8("applicationArea", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("applicationArea", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'applicationArea' field") } // Simple Field (errorClass) - if _err := writeBuffer.WriteUint8("errorClass", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("errorClass", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'errorClass' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12197,7 +12197,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12217,7 +12217,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_TempRoomSetpSetF16_3: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12237,7 +12237,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_TempRoomSetpSetShiftF16_3: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12257,52 +12257,52 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Scaling_Speed: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (timePeriod) - if _err := writeBuffer.WriteUint16("timePeriod", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("timePeriod", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'timePeriod' field") } // Simple Field (percent) - if _err := writeBuffer.WriteUint8("percent", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("percent", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'percent' field") } case datapointType == KnxDatapointType_DPT_Scaling_Step_Time: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (timePeriod) - if _err := writeBuffer.WriteUint16("timePeriod", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("timePeriod", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'timePeriod' field") } // Simple Field (percent) - if _err := writeBuffer.WriteUint8("percent", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("percent", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'percent' field") } case datapointType == KnxDatapointType_DPT_MeteringValue: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (countval) - if _err := writeBuffer.WriteInt32("countval", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("countval", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'countval' field") } // Simple Field (valinffield) - if _err := writeBuffer.WriteUint8("valinffield", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("valinffield", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'valinffield' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12332,52 +12332,52 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_MBus_Address: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (manufactid) - if _err := writeBuffer.WriteUint16("manufactid", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("manufactid", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'manufactid' field") } // Simple Field (identnumber) - if _err := writeBuffer.WriteUint32("identnumber", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("identnumber", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'identnumber' field") } // Simple Field (version) - if _err := writeBuffer.WriteUint8("version", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("version", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'version' field") } // Simple Field (medium) - if _err := writeBuffer.WriteUint8("medium", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("medium", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'medium' field") } case datapointType == KnxDatapointType_DPT_Colour_RGB: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (r) - if _err := writeBuffer.WriteUint8("r", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("r", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'r' field") } // Simple Field (g) - if _err := writeBuffer.WriteUint8("g", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("g", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'g' field") } // Simple Field (b) - if _err := writeBuffer.WriteUint8("b", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("b", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'b' field") } case datapointType == KnxDatapointType_DPT_LanguageCodeAlpha2_ASCII: // STRING // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12387,22 +12387,22 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Tariff_ActiveEnergy: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (activeelectricalenergy) - if _err := writeBuffer.WriteInt32("activeelectricalenergy", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("activeelectricalenergy", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'activeelectricalenergy' field") } // Simple Field (tariff) - if _err := writeBuffer.WriteUint8("tariff", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("tariff", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'tariff' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12417,7 +12417,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Prioritised_Mode_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12427,22 +12427,22 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (priorityLevel) - if _err := writeBuffer.WriteUint8("priorityLevel", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("priorityLevel", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'priorityLevel' field") } // Simple Field (modeLevel) - if _err := writeBuffer.WriteUint8("modeLevel", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("modeLevel", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'modeLevel' field") } case datapointType == KnxDatapointType_DPT_DALI_Control_Gear_Diagnostic: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12472,12 +12472,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (daliDeviceAddressOrDaliGroupAddress) - if _err := writeBuffer.WriteUint8("daliDeviceAddressOrDaliGroupAddress", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("daliDeviceAddressOrDaliGroupAddress", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'daliDeviceAddressOrDaliGroupAddress' field") } case datapointType == KnxDatapointType_DPT_DALI_Diagnostics: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12492,27 +12492,27 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (deviceAddress) - if _err := writeBuffer.WriteUint8("deviceAddress", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("deviceAddress", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'deviceAddress' field") } case datapointType == KnxDatapointType_DPT_CombinedPosition: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (heightPosition) - if _err := writeBuffer.WriteUint8("heightPosition", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("heightPosition", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'heightPosition' field") } // Simple Field (slatsPosition) - if _err := writeBuffer.WriteUint8("slatsPosition", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("slatsPosition", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'slatsPosition' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12527,17 +12527,17 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_StatusSAB: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (heightPosition) - if _err := writeBuffer.WriteUint8("heightPosition", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("heightPosition", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'heightPosition' field") } // Simple Field (slatsPosition) - if _err := writeBuffer.WriteUint8("slatsPosition", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("slatsPosition", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'slatsPosition' field") } @@ -12597,7 +12597,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12612,27 +12612,27 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Colour_xyY: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (xAxis) - if _err := writeBuffer.WriteUint16("xAxis", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("xAxis", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'xAxis' field") } // Simple Field (yAxis) - if _err := writeBuffer.WriteUint16("yAxis", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("yAxis", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'yAxis' field") } // Simple Field (brightness) - if _err := writeBuffer.WriteUint8("brightness", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("brightness", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'brightness' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12647,17 +12647,17 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Converter_Status: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (converterModeAccordingToTheDaliConverterStateMachine) - if _err := writeBuffer.WriteUint8("converterModeAccordingToTheDaliConverterStateMachine", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("converterModeAccordingToTheDaliConverterStateMachine", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'converterModeAccordingToTheDaliConverterStateMachine' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12672,87 +12672,87 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (functionTestPending) - if _err := writeBuffer.WriteUint8("functionTestPending", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("functionTestPending", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'functionTestPending' field") } // Simple Field (durationTestPending) - if _err := writeBuffer.WriteUint8("durationTestPending", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("durationTestPending", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'durationTestPending' field") } // Simple Field (partialDurationTestPending) - if _err := writeBuffer.WriteUint8("partialDurationTestPending", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("partialDurationTestPending", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'partialDurationTestPending' field") } // Simple Field (converterFailure) - if _err := writeBuffer.WriteUint8("converterFailure", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("converterFailure", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'converterFailure' field") } case datapointType == KnxDatapointType_DPT_Converter_Test_Result: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (ltrf) - if _err := writeBuffer.WriteUint8("ltrf", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("ltrf", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'ltrf' field") } // Simple Field (ltrd) - if _err := writeBuffer.WriteUint8("ltrd", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("ltrd", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'ltrd' field") } // Simple Field (ltrp) - if _err := writeBuffer.WriteUint8("ltrp", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("ltrp", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'ltrp' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (sf) - if _err := writeBuffer.WriteUint8("sf", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("sf", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'sf' field") } // Simple Field (sd) - if _err := writeBuffer.WriteUint8("sd", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("sd", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'sd' field") } // Simple Field (sp) - if _err := writeBuffer.WriteUint8("sp", 2, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("sp", 2, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'sp' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (ldtr) - if _err := writeBuffer.WriteUint16("ldtr", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("ldtr", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'ldtr' field") } // Simple Field (lpdtr) - if _err := writeBuffer.WriteUint8("lpdtr", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("lpdtr", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'lpdtr' field") } case datapointType == KnxDatapointType_DPT_Battery_Info: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12772,32 +12772,32 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (batteryChargeLevel) - if _err := writeBuffer.WriteUint8("batteryChargeLevel", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("batteryChargeLevel", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'batteryChargeLevel' field") } case datapointType == KnxDatapointType_DPT_Brightness_Colour_Temperature_Transition: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (ms) - if _err := writeBuffer.WriteUint16("ms", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("ms", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'ms' field") } // Simple Field (temperatureK) - if _err := writeBuffer.WriteUint16("temperatureK", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("temperatureK", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'temperatureK' field") } // Simple Field (percent) - if _err := writeBuffer.WriteUint8("percent", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("percent", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'percent' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12817,12 +12817,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Brightness_Colour_Temperature_Control: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12832,12 +12832,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourTemperature) - if _err := writeBuffer.WriteUint8("stepCodeColourTemperature", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourTemperature", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourTemperature' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12847,12 +12847,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeBrightness) - if _err := writeBuffer.WriteUint8("stepCodeBrightness", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeBrightness", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeBrightness' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 6, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 6, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12867,37 +12867,37 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Colour_RGBW: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (colourLevelRed) - if _err := writeBuffer.WriteUint8("colourLevelRed", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("colourLevelRed", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'colourLevelRed' field") } // Simple Field (colourLevelGreen) - if _err := writeBuffer.WriteUint8("colourLevelGreen", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("colourLevelGreen", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'colourLevelGreen' field") } // Simple Field (colourLevelBlue) - if _err := writeBuffer.WriteUint8("colourLevelBlue", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("colourLevelBlue", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'colourLevelBlue' field") } // Simple Field (colourLevelWhite) - if _err := writeBuffer.WriteUint8("colourLevelWhite", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("colourLevelWhite", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'colourLevelWhite' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12922,12 +12922,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_Relative_Control_RGBW: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12952,7 +12952,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12962,12 +12962,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourWhite) - if _err := writeBuffer.WriteUint8("stepCodeColourWhite", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourWhite", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourWhite' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12977,12 +12977,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourBlue) - if _err := writeBuffer.WriteUint8("stepCodeColourBlue", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourBlue", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourBlue' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -12992,12 +12992,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourGreen) - if _err := writeBuffer.WriteUint8("stepCodeColourGreen", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourGreen", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourGreen' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -13007,17 +13007,17 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourRed) - if _err := writeBuffer.WriteUint8("stepCodeColourRed", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourRed", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourRed' field") } case datapointType == KnxDatapointType_DPT_Relative_Control_RGB: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -13027,12 +13027,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourBlue) - if _err := writeBuffer.WriteUint8("stepCodeColourBlue", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourBlue", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourBlue' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -13042,12 +13042,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourGreen) - if _err := writeBuffer.WriteUint8("stepCodeColourGreen", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourGreen", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourGreen' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -13057,12 +13057,12 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } // Simple Field (stepCodeColourRed) - if _err := writeBuffer.WriteUint8("stepCodeColourRed", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("stepCodeColourRed", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'stepCodeColourRed' field") } case datapointType == KnxDatapointType_DPT_GeographicalLocation: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -13077,7 +13077,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_TempRoomSetpSetF16_4: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -13102,7 +13102,7 @@ func KnxDatapointSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils } case datapointType == KnxDatapointType_DPT_TempRoomSetpSetShiftF16_4: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointMainType.go b/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointMainType.go index 50a19491dfc..1e313ef4d8d 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointMainType.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointMainType.go @@ -1274,7 +1274,7 @@ func (e KnxDatapointMainType) Serialize() ([]byte, error) { func (e KnxDatapointMainType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("KnxDatapointMainType", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("KnxDatapointMainType", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointType.go b/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointType.go index 7028d635afd..246512cc994 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointType.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxDatapointType.go @@ -6494,7 +6494,7 @@ func (e KnxDatapointType) Serialize() ([]byte, error) { func (e KnxDatapointType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("KnxDatapointType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("KnxDatapointType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress2Level.go b/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress2Level.go index 0b72d575fe2..d7d3d31ae29 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress2Level.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress2Level.go @@ -198,14 +198,14 @@ func (m *_KnxGroupAddress2Level) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (mainGroup) mainGroup := uint8(m.GetMainGroup()) - _mainGroupErr := writeBuffer.WriteUint8("mainGroup", 5, (mainGroup)) + _mainGroupErr := writeBuffer.WriteUint8("mainGroup", 5, uint8((mainGroup))) if _mainGroupErr != nil { return errors.Wrap(_mainGroupErr, "Error serializing 'mainGroup' field") } // Simple Field (subGroup) subGroup := uint16(m.GetSubGroup()) - _subGroupErr := writeBuffer.WriteUint16("subGroup", 11, (subGroup)) + _subGroupErr := writeBuffer.WriteUint16("subGroup", 11, uint16((subGroup))) if _subGroupErr != nil { return errors.Wrap(_subGroupErr, "Error serializing 'subGroup' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress3Level.go b/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress3Level.go index 3b11e18297b..deece487724 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress3Level.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddress3Level.go @@ -217,21 +217,21 @@ func (m *_KnxGroupAddress3Level) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (mainGroup) mainGroup := uint8(m.GetMainGroup()) - _mainGroupErr := writeBuffer.WriteUint8("mainGroup", 5, (mainGroup)) + _mainGroupErr := writeBuffer.WriteUint8("mainGroup", 5, uint8((mainGroup))) if _mainGroupErr != nil { return errors.Wrap(_mainGroupErr, "Error serializing 'mainGroup' field") } // Simple Field (middleGroup) middleGroup := uint8(m.GetMiddleGroup()) - _middleGroupErr := writeBuffer.WriteUint8("middleGroup", 3, (middleGroup)) + _middleGroupErr := writeBuffer.WriteUint8("middleGroup", 3, uint8((middleGroup))) if _middleGroupErr != nil { return errors.Wrap(_middleGroupErr, "Error serializing 'middleGroup' field") } // Simple Field (subGroup) subGroup := uint8(m.GetSubGroup()) - _subGroupErr := writeBuffer.WriteUint8("subGroup", 8, (subGroup)) + _subGroupErr := writeBuffer.WriteUint8("subGroup", 8, uint8((subGroup))) if _subGroupErr != nil { return errors.Wrap(_subGroupErr, "Error serializing 'subGroup' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddressFreeLevel.go b/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddressFreeLevel.go index 3a4e04b77c5..1401613c0cb 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddressFreeLevel.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxGroupAddressFreeLevel.go @@ -179,7 +179,7 @@ func (m *_KnxGroupAddressFreeLevel) SerializeWithWriteBuffer(ctx context.Context // Simple Field (subGroup) subGroup := uint16(m.GetSubGroup()) - _subGroupErr := writeBuffer.WriteUint16("subGroup", 16, (subGroup)) + _subGroupErr := writeBuffer.WriteUint16("subGroup", 16, uint16((subGroup))) if _subGroupErr != nil { return errors.Wrap(_subGroupErr, "Error serializing 'subGroup' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectProperty.go b/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectProperty.go index 71265972caf..f17322bf84b 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectProperty.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectProperty.go @@ -4947,7 +4947,7 @@ func (e KnxInterfaceObjectProperty) Serialize() ([]byte, error) { func (e KnxInterfaceObjectProperty) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("KnxInterfaceObjectProperty", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("KnxInterfaceObjectProperty", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectType.go b/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectType.go index 5537dbd0222..4708ca4f5d8 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectType.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxInterfaceObjectType.go @@ -507,7 +507,7 @@ func (e KnxInterfaceObjectType) Serialize() ([]byte, error) { func (e KnxInterfaceObjectType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("KnxInterfaceObjectType", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("KnxInterfaceObjectType", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxLayer.go b/plc4go/protocols/knxnetip/readwrite/model/KnxLayer.go index a7dff230fde..83cb14683f7 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxLayer.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxLayer.go @@ -138,7 +138,7 @@ func (e KnxLayer) Serialize() ([]byte, error) { func (e KnxLayer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("KnxLayer", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("KnxLayer", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go b/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go index 2a7509e17f7..5825a6b3291 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go @@ -9341,7 +9341,7 @@ func (e KnxManufacturer) Serialize() ([]byte, error) { func (e KnxManufacturer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("KnxManufacturer", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("KnxManufacturer", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxMedium.go b/plc4go/protocols/knxnetip/readwrite/model/KnxMedium.go index 26d621ce607..73aaead33ca 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxMedium.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxMedium.go @@ -156,7 +156,7 @@ func (e KnxMedium) Serialize() ([]byte, error) { func (e KnxMedium) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("KnxMedium", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("KnxMedium", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpCore.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpCore.go index 2ec074926f3..6e5cc1d7c46 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpCore.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpCore.go @@ -179,7 +179,7 @@ func (m *_KnxNetIpCore) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpDeviceManagement.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpDeviceManagement.go index 7df51d992dc..564d04669a2 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpDeviceManagement.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpDeviceManagement.go @@ -179,7 +179,7 @@ func (m *_KnxNetIpDeviceManagement) SerializeWithWriteBuffer(ctx context.Context // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpMessage.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpMessage.go index 9ca9321d5ef..0026be225bb 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpMessage.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpMessage.go @@ -246,20 +246,20 @@ func (pm *_KnxNetIpMessage) SerializeParent(ctx context.Context, writeBuffer uti // Implicit Field (headerLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) headerLength := uint8(uint8(6)) - _headerLengthErr := writeBuffer.WriteUint8("headerLength", 8, (headerLength)) + _headerLengthErr := writeBuffer.WriteUint8("headerLength", 8, uint8((headerLength))) if _headerLengthErr != nil { return errors.Wrap(_headerLengthErr, "Error serializing 'headerLength' field") } // Const Field (protocolVersion) - _protocolVersionErr := writeBuffer.WriteUint8("protocolVersion", 8, 0x10) + _protocolVersionErr := writeBuffer.WriteUint8("protocolVersion", 8, uint8(0x10)) if _protocolVersionErr != nil { return errors.Wrap(_protocolVersionErr, "Error serializing 'protocolVersion' field") } // Discriminator Field (msgType) (Used as input to a switch field) msgType := uint16(child.GetMsgType()) - _msgTypeErr := writeBuffer.WriteUint16("msgType", 16, (msgType)) + _msgTypeErr := writeBuffer.WriteUint16("msgType", 16, uint16((msgType))) if _msgTypeErr != nil { return errors.Wrap(_msgTypeErr, "Error serializing 'msgType' field") @@ -267,7 +267,7 @@ func (pm *_KnxNetIpMessage) SerializeParent(ctx context.Context, writeBuffer uti // Implicit Field (totalLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) totalLength := uint16(uint16(m.GetLengthInBytes(ctx))) - _totalLengthErr := writeBuffer.WriteUint16("totalLength", 16, (totalLength)) + _totalLengthErr := writeBuffer.WriteUint16("totalLength", 16, uint16((totalLength))) if _totalLengthErr != nil { return errors.Wrap(_totalLengthErr, "Error serializing 'totalLength' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpRouting.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpRouting.go index d33fe88a93f..82f4d40c042 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpRouting.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpRouting.go @@ -179,7 +179,7 @@ func (m *_KnxNetIpRouting) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpTunneling.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpTunneling.go index 1f3bbea852a..e1de8fe9f31 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpTunneling.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetIpTunneling.go @@ -179,7 +179,7 @@ func (m *_KnxNetIpTunneling) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetObjectServer.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetObjectServer.go index c3879a458a3..505a5fde1fe 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetObjectServer.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetObjectServer.go @@ -179,7 +179,7 @@ func (m *_KnxNetObjectServer) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteConfigurationAndDiagnosis.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteConfigurationAndDiagnosis.go index 7bc9049acbe..e4f760c60d0 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteConfigurationAndDiagnosis.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteConfigurationAndDiagnosis.go @@ -179,7 +179,7 @@ func (m *_KnxNetRemoteConfigurationAndDiagnosis) SerializeWithWriteBuffer(ctx co // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteLogging.go b/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteLogging.go index 4d000cc1cbf..737c2fd911d 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteLogging.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxNetRemoteLogging.go @@ -179,7 +179,7 @@ func (m *_KnxNetRemoteLogging) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (version) version := uint8(m.GetVersion()) - _versionErr := writeBuffer.WriteUint8("version", 8, (version)) + _versionErr := writeBuffer.WriteUint8("version", 8, uint8((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxProperty.go b/plc4go/protocols/knxnetip/readwrite/model/KnxProperty.go index a1d951b4b03..b5b000c4078 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxProperty.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxProperty.go @@ -867,7 +867,7 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. switch { case propertyType == KnxPropertyDataType_PDT_CONTROL: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -877,27 +877,27 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } case propertyType == KnxPropertyDataType_PDT_CHAR: // SINT // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_UNSIGNED_CHAR: // USINT // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_INT: // INT // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_UNSIGNED_INT && dataLengthInBytes == uint8(4): // UDINT // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_UNSIGNED_INT: // UINT // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_KNX_FLOAT: // REAL @@ -907,72 +907,72 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } case propertyType == KnxPropertyDataType_PDT_DATE: // Struct // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (dayOfMonth) - if _err := writeBuffer.WriteUint8("dayOfMonth", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("dayOfMonth", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayOfMonth' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (month) - if _err := writeBuffer.WriteUint8("month", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("month", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'month' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 1, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 1, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (year) - if _err := writeBuffer.WriteUint8("year", 7, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("year", 7, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'year' field") } case propertyType == KnxPropertyDataType_PDT_TIME: // Struct // Simple Field (day) - if _err := writeBuffer.WriteUint8("day", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("day", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'day' field") } // Simple Field (hour) - if _err := writeBuffer.WriteUint8("hour", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("hour", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'hour' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (minutes) - if _err := writeBuffer.WriteUint8("minutes", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("minutes", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'minutes' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (seconds) - if _err := writeBuffer.WriteUint8("seconds", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("seconds", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'seconds' field") } case propertyType == KnxPropertyDataType_PDT_LONG: // DINT // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_UNSIGNED_LONG: // UDINT // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_FLOAT: // REAL @@ -1009,12 +1009,12 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x0)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x0))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (pollingSoftNr) - if _err := writeBuffer.WriteUint8("pollingSoftNr", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("pollingSoftNr", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'pollingSoftNr' field") } case propertyType == KnxPropertyDataType_PDT_SHORT_CHAR_BLOCK: // List @@ -1027,57 +1027,57 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } case propertyType == KnxPropertyDataType_PDT_DATE_TIME: // Struct // Simple Field (year) - if _err := writeBuffer.WriteUint8("year", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("year", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'year' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (month) - if _err := writeBuffer.WriteUint8("month", 4, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("month", 4, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'month' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 3, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 3, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (dayofmonth) - if _err := writeBuffer.WriteUint8("dayofmonth", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("dayofmonth", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayofmonth' field") } // Simple Field (dayofweek) - if _err := writeBuffer.WriteUint8("dayofweek", 3, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("dayofweek", 3, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayofweek' field") } // Simple Field (hourofday) - if _err := writeBuffer.WriteUint8("hourofday", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("hourofday", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'hourofday' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (minutes) - if _err := writeBuffer.WriteUint8("minutes", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("minutes", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'minutes' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 2, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 2, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (seconds) - if _err := writeBuffer.WriteUint8("seconds", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("seconds", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'seconds' field") } @@ -1127,7 +1127,7 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } case propertyType == KnxPropertyDataType_PDT_GENERIC_01: // List @@ -1292,42 +1292,42 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } case propertyType == KnxPropertyDataType_PDT_VERSION: // Struct // Simple Field (magicNumber) - if _err := writeBuffer.WriteUint8("magicNumber", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("magicNumber", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'magicNumber' field") } // Simple Field (versionNumber) - if _err := writeBuffer.WriteUint8("versionNumber", 5, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("versionNumber", 5, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'versionNumber' field") } // Simple Field (revisionNumber) - if _err := writeBuffer.WriteUint8("revisionNumber", 6, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("revisionNumber", 6, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'revisionNumber' field") } case propertyType == KnxPropertyDataType_PDT_ALARM_INFO: // Struct // Simple Field (logNumber) - if _err := writeBuffer.WriteUint8("logNumber", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("logNumber", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'logNumber' field") } // Simple Field (alarmPriority) - if _err := writeBuffer.WriteUint8("alarmPriority", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("alarmPriority", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'alarmPriority' field") } // Simple Field (applicationArea) - if _err := writeBuffer.WriteUint8("applicationArea", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("applicationArea", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'applicationArea' field") } // Simple Field (errorClass) - if _err := writeBuffer.WriteUint8("errorClass", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("errorClass", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'errorClass' field") } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 4, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 4, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -1352,7 +1352,7 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 5, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 5, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -1372,7 +1372,7 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } case propertyType == KnxPropertyDataType_PDT_BINARY_INFORMATION: // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -1398,12 +1398,12 @@ func KnxPropertySerializeWithWriteBuffer(ctx context.Context, writeBuffer utils. } case propertyType == KnxPropertyDataType_PDT_ENUM8: // USINT // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case propertyType == KnxPropertyDataType_PDT_SCALING: // USINT // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } default: // List diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxPropertyDataType.go b/plc4go/protocols/knxnetip/readwrite/model/KnxPropertyDataType.go index 17f392d94b2..38e62aec420 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxPropertyDataType.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxPropertyDataType.go @@ -1076,7 +1076,7 @@ func (e KnxPropertyDataType) Serialize() ([]byte, error) { func (e KnxPropertyDataType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("KnxPropertyDataType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("KnxPropertyDataType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/LBusmonInd.go b/plc4go/protocols/knxnetip/readwrite/model/LBusmonInd.go index ef8c6eaaa57..80b57aa0c17 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/LBusmonInd.go +++ b/plc4go/protocols/knxnetip/readwrite/model/LBusmonInd.go @@ -267,7 +267,7 @@ func (m *_LBusmonInd) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (additionalInformationLength) additionalInformationLength := uint8(m.GetAdditionalInformationLength()) - _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, (additionalInformationLength)) + _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, uint8((additionalInformationLength))) if _additionalInformationLengthErr != nil { return errors.Wrap(_additionalInformationLengthErr, "Error serializing 'additionalInformationLength' field") } @@ -305,7 +305,7 @@ func (m *_LBusmonInd) SerializeWithWriteBuffer(ctx context.Context, writeBuffer var crc *uint8 = nil if m.GetCrc() != nil { crc = m.GetCrc() - _crcErr := writeBuffer.WriteUint8("crc", 8, *(crc)) + _crcErr := writeBuffer.WriteUint8("crc", 8, uint8(*(crc))) if _crcErr != nil { return errors.Wrap(_crcErr, "Error serializing 'crc' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/LDataCon.go b/plc4go/protocols/knxnetip/readwrite/model/LDataCon.go index 85fbc9260f2..a6b2a858515 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/LDataCon.go +++ b/plc4go/protocols/knxnetip/readwrite/model/LDataCon.go @@ -243,7 +243,7 @@ func (m *_LDataCon) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Simple Field (additionalInformationLength) additionalInformationLength := uint8(m.GetAdditionalInformationLength()) - _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, (additionalInformationLength)) + _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, uint8((additionalInformationLength))) if _additionalInformationLengthErr != nil { return errors.Wrap(_additionalInformationLengthErr, "Error serializing 'additionalInformationLength' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/LDataExtended.go b/plc4go/protocols/knxnetip/readwrite/model/LDataExtended.go index 188fad8e7f8..ac4e811a101 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/LDataExtended.go +++ b/plc4go/protocols/knxnetip/readwrite/model/LDataExtended.go @@ -314,14 +314,14 @@ func (m *_LDataExtended) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (hopCount) hopCount := uint8(m.GetHopCount()) - _hopCountErr := writeBuffer.WriteUint8("hopCount", 3, (hopCount)) + _hopCountErr := writeBuffer.WriteUint8("hopCount", 3, uint8((hopCount))) if _hopCountErr != nil { return errors.Wrap(_hopCountErr, "Error serializing 'hopCount' field") } // Simple Field (extendedFrameFormat) extendedFrameFormat := uint8(m.GetExtendedFrameFormat()) - _extendedFrameFormatErr := writeBuffer.WriteUint8("extendedFrameFormat", 4, (extendedFrameFormat)) + _extendedFrameFormatErr := writeBuffer.WriteUint8("extendedFrameFormat", 4, uint8((extendedFrameFormat))) if _extendedFrameFormatErr != nil { return errors.Wrap(_extendedFrameFormatErr, "Error serializing 'extendedFrameFormat' field") } @@ -346,7 +346,7 @@ func (m *_LDataExtended) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Implicit Field (dataLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) dataLength := uint8(uint8(m.GetApdu().GetLengthInBytes(ctx)) - uint8(uint8(1))) - _dataLengthErr := writeBuffer.WriteUint8("dataLength", 8, (dataLength)) + _dataLengthErr := writeBuffer.WriteUint8("dataLength", 8, uint8((dataLength))) if _dataLengthErr != nil { return errors.Wrap(_dataLengthErr, "Error serializing 'dataLength' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/LDataInd.go b/plc4go/protocols/knxnetip/readwrite/model/LDataInd.go index e25a68579c5..66344de282a 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/LDataInd.go +++ b/plc4go/protocols/knxnetip/readwrite/model/LDataInd.go @@ -243,7 +243,7 @@ func (m *_LDataInd) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Simple Field (additionalInformationLength) additionalInformationLength := uint8(m.GetAdditionalInformationLength()) - _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, (additionalInformationLength)) + _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, uint8((additionalInformationLength))) if _additionalInformationLengthErr != nil { return errors.Wrap(_additionalInformationLengthErr, "Error serializing 'additionalInformationLength' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/LDataReq.go b/plc4go/protocols/knxnetip/readwrite/model/LDataReq.go index 04a089b3e4c..f923fb5b85a 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/LDataReq.go +++ b/plc4go/protocols/knxnetip/readwrite/model/LDataReq.go @@ -243,7 +243,7 @@ func (m *_LDataReq) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Simple Field (additionalInformationLength) additionalInformationLength := uint8(m.GetAdditionalInformationLength()) - _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, (additionalInformationLength)) + _additionalInformationLengthErr := writeBuffer.WriteUint8("additionalInformationLength", 8, uint8((additionalInformationLength))) if _additionalInformationLengthErr != nil { return errors.Wrap(_additionalInformationLengthErr, "Error serializing 'additionalInformationLength' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/LPollData.go b/plc4go/protocols/knxnetip/readwrite/model/LPollData.go index 44df3330b75..ecb19b66828 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/LPollData.go +++ b/plc4go/protocols/knxnetip/readwrite/model/LPollData.go @@ -283,7 +283,7 @@ func (m *_LPollData) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 4, reserved) + _err := writeBuffer.WriteUint8("reserved", 4, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -291,7 +291,7 @@ func (m *_LPollData) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u // Simple Field (numberExpectedPollData) numberExpectedPollData := uint8(m.GetNumberExpectedPollData()) - _numberExpectedPollDataErr := writeBuffer.WriteUint8("numberExpectedPollData", 6, (numberExpectedPollData)) + _numberExpectedPollDataErr := writeBuffer.WriteUint8("numberExpectedPollData", 6, uint8((numberExpectedPollData))) if _numberExpectedPollDataErr != nil { return errors.Wrap(_numberExpectedPollDataErr, "Error serializing 'numberExpectedPollData' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/MPropReadCon.go b/plc4go/protocols/knxnetip/readwrite/model/MPropReadCon.go index 77af6d68810..cc9156e7e08 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/MPropReadCon.go +++ b/plc4go/protocols/knxnetip/readwrite/model/MPropReadCon.go @@ -276,42 +276,42 @@ func (m *_MPropReadCon) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (interfaceObjectType) interfaceObjectType := uint16(m.GetInterfaceObjectType()) - _interfaceObjectTypeErr := writeBuffer.WriteUint16("interfaceObjectType", 16, (interfaceObjectType)) + _interfaceObjectTypeErr := writeBuffer.WriteUint16("interfaceObjectType", 16, uint16((interfaceObjectType))) if _interfaceObjectTypeErr != nil { return errors.Wrap(_interfaceObjectTypeErr, "Error serializing 'interfaceObjectType' field") } // Simple Field (objectInstance) objectInstance := uint8(m.GetObjectInstance()) - _objectInstanceErr := writeBuffer.WriteUint8("objectInstance", 8, (objectInstance)) + _objectInstanceErr := writeBuffer.WriteUint8("objectInstance", 8, uint8((objectInstance))) if _objectInstanceErr != nil { return errors.Wrap(_objectInstanceErr, "Error serializing 'objectInstance' field") } // Simple Field (propertyId) propertyId := uint8(m.GetPropertyId()) - _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, (propertyId)) + _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, uint8((propertyId))) if _propertyIdErr != nil { return errors.Wrap(_propertyIdErr, "Error serializing 'propertyId' field") } // Simple Field (numberOfElements) numberOfElements := uint8(m.GetNumberOfElements()) - _numberOfElementsErr := writeBuffer.WriteUint8("numberOfElements", 4, (numberOfElements)) + _numberOfElementsErr := writeBuffer.WriteUint8("numberOfElements", 4, uint8((numberOfElements))) if _numberOfElementsErr != nil { return errors.Wrap(_numberOfElementsErr, "Error serializing 'numberOfElements' field") } // Simple Field (startIndex) startIndex := uint16(m.GetStartIndex()) - _startIndexErr := writeBuffer.WriteUint16("startIndex", 12, (startIndex)) + _startIndexErr := writeBuffer.WriteUint16("startIndex", 12, uint16((startIndex))) if _startIndexErr != nil { return errors.Wrap(_startIndexErr, "Error serializing 'startIndex' field") } // Simple Field (data) data := uint16(m.GetData()) - _dataErr := writeBuffer.WriteUint16("data", 16, (data)) + _dataErr := writeBuffer.WriteUint16("data", 16, uint16((data))) if _dataErr != nil { return errors.Wrap(_dataErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/MPropReadReq.go b/plc4go/protocols/knxnetip/readwrite/model/MPropReadReq.go index 3dfff3f8b18..00c4b154367 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/MPropReadReq.go +++ b/plc4go/protocols/knxnetip/readwrite/model/MPropReadReq.go @@ -257,35 +257,35 @@ func (m *_MPropReadReq) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (interfaceObjectType) interfaceObjectType := uint16(m.GetInterfaceObjectType()) - _interfaceObjectTypeErr := writeBuffer.WriteUint16("interfaceObjectType", 16, (interfaceObjectType)) + _interfaceObjectTypeErr := writeBuffer.WriteUint16("interfaceObjectType", 16, uint16((interfaceObjectType))) if _interfaceObjectTypeErr != nil { return errors.Wrap(_interfaceObjectTypeErr, "Error serializing 'interfaceObjectType' field") } // Simple Field (objectInstance) objectInstance := uint8(m.GetObjectInstance()) - _objectInstanceErr := writeBuffer.WriteUint8("objectInstance", 8, (objectInstance)) + _objectInstanceErr := writeBuffer.WriteUint8("objectInstance", 8, uint8((objectInstance))) if _objectInstanceErr != nil { return errors.Wrap(_objectInstanceErr, "Error serializing 'objectInstance' field") } // Simple Field (propertyId) propertyId := uint8(m.GetPropertyId()) - _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, (propertyId)) + _propertyIdErr := writeBuffer.WriteUint8("propertyId", 8, uint8((propertyId))) if _propertyIdErr != nil { return errors.Wrap(_propertyIdErr, "Error serializing 'propertyId' field") } // Simple Field (numberOfElements) numberOfElements := uint8(m.GetNumberOfElements()) - _numberOfElementsErr := writeBuffer.WriteUint8("numberOfElements", 4, (numberOfElements)) + _numberOfElementsErr := writeBuffer.WriteUint8("numberOfElements", 4, uint8((numberOfElements))) if _numberOfElementsErr != nil { return errors.Wrap(_numberOfElementsErr, "Error serializing 'numberOfElements' field") } // Simple Field (startIndex) startIndex := uint16(m.GetStartIndex()) - _startIndexErr := writeBuffer.WriteUint16("startIndex", 12, (startIndex)) + _startIndexErr := writeBuffer.WriteUint16("startIndex", 12, uint16((startIndex))) if _startIndexErr != nil { return errors.Wrap(_startIndexErr, "Error serializing 'startIndex' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ProjectInstallationIdentifier.go b/plc4go/protocols/knxnetip/readwrite/model/ProjectInstallationIdentifier.go index 1b181371a4c..8fbb40cdc68 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ProjectInstallationIdentifier.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ProjectInstallationIdentifier.go @@ -166,14 +166,14 @@ func (m *_ProjectInstallationIdentifier) SerializeWithWriteBuffer(ctx context.Co // Simple Field (projectNumber) projectNumber := uint8(m.GetProjectNumber()) - _projectNumberErr := writeBuffer.WriteUint8("projectNumber", 8, (projectNumber)) + _projectNumberErr := writeBuffer.WriteUint8("projectNumber", 8, uint8((projectNumber))) if _projectNumberErr != nil { return errors.Wrap(_projectNumberErr, "Error serializing 'projectNumber' field") } // Simple Field (installationNumber) installationNumber := uint8(m.GetInstallationNumber()) - _installationNumberErr := writeBuffer.WriteUint8("installationNumber", 8, (installationNumber)) + _installationNumberErr := writeBuffer.WriteUint8("installationNumber", 8, uint8((installationNumber))) if _installationNumberErr != nil { return errors.Wrap(_installationNumberErr, "Error serializing 'installationNumber' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/RelativeTimestamp.go b/plc4go/protocols/knxnetip/readwrite/model/RelativeTimestamp.go index 70d02b0827e..97ecc2d58fc 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/RelativeTimestamp.go +++ b/plc4go/protocols/knxnetip/readwrite/model/RelativeTimestamp.go @@ -148,7 +148,7 @@ func (m *_RelativeTimestamp) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (timestamp) timestamp := uint16(m.GetTimestamp()) - _timestampErr := writeBuffer.WriteUint16("timestamp", 16, (timestamp)) + _timestampErr := writeBuffer.WriteUint16("timestamp", 16, uint16((timestamp))) if _timestampErr != nil { return errors.Wrap(_timestampErr, "Error serializing 'timestamp' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/ServiceId.go b/plc4go/protocols/knxnetip/readwrite/model/ServiceId.go index 0cf723c88ec..0680d784b26 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/ServiceId.go +++ b/plc4go/protocols/knxnetip/readwrite/model/ServiceId.go @@ -178,7 +178,7 @@ func (pm *_ServiceId) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Discriminator Field (serviceType) (Used as input to a switch field) serviceType := uint8(child.GetServiceType()) - _serviceTypeErr := writeBuffer.WriteUint8("serviceType", 8, (serviceType)) + _serviceTypeErr := writeBuffer.WriteUint8("serviceType", 8, uint8((serviceType))) if _serviceTypeErr != nil { return errors.Wrap(_serviceTypeErr, "Error serializing 'serviceType' field") diff --git a/plc4go/protocols/knxnetip/readwrite/model/Status.go b/plc4go/protocols/knxnetip/readwrite/model/Status.go index 94a1b1bfc36..6345ff61aa1 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/Status.go +++ b/plc4go/protocols/knxnetip/readwrite/model/Status.go @@ -192,7 +192,7 @@ func (e Status) Serialize() ([]byte, error) { func (e Status) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("Status", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("Status", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/SupportedPhysicalMedia.go b/plc4go/protocols/knxnetip/readwrite/model/SupportedPhysicalMedia.go index dc2f361b1e0..ec4cbc0b6ab 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/SupportedPhysicalMedia.go +++ b/plc4go/protocols/knxnetip/readwrite/model/SupportedPhysicalMedia.go @@ -451,7 +451,7 @@ func (e SupportedPhysicalMedia) Serialize() ([]byte, error) { func (e SupportedPhysicalMedia) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SupportedPhysicalMedia", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SupportedPhysicalMedia", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/knxnetip/readwrite/model/TunnelingRequestDataBlock.go b/plc4go/protocols/knxnetip/readwrite/model/TunnelingRequestDataBlock.go index ad7e4803bed..987e81fb32a 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/TunnelingRequestDataBlock.go +++ b/plc4go/protocols/knxnetip/readwrite/model/TunnelingRequestDataBlock.go @@ -199,21 +199,21 @@ func (m *_TunnelingRequestDataBlock) SerializeWithWriteBuffer(ctx context.Contex // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } // Simple Field (sequenceCounter) sequenceCounter := uint8(m.GetSequenceCounter()) - _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, (sequenceCounter)) + _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, uint8((sequenceCounter))) if _sequenceCounterErr != nil { return errors.Wrap(_sequenceCounterErr, "Error serializing 'sequenceCounter' field") } @@ -228,7 +228,7 @@ func (m *_TunnelingRequestDataBlock) SerializeWithWriteBuffer(ctx context.Contex }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/knxnetip/readwrite/model/TunnelingResponseDataBlock.go b/plc4go/protocols/knxnetip/readwrite/model/TunnelingResponseDataBlock.go index c0e0e15f133..b7267d4c672 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/TunnelingResponseDataBlock.go +++ b/plc4go/protocols/knxnetip/readwrite/model/TunnelingResponseDataBlock.go @@ -200,21 +200,21 @@ func (m *_TunnelingResponseDataBlock) SerializeWithWriteBuffer(ctx context.Conte // Implicit Field (structureLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) structureLength := uint8(uint8(m.GetLengthInBytes(ctx))) - _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, (structureLength)) + _structureLengthErr := writeBuffer.WriteUint8("structureLength", 8, uint8((structureLength))) if _structureLengthErr != nil { return errors.Wrap(_structureLengthErr, "Error serializing 'structureLength' field") } // Simple Field (communicationChannelId) communicationChannelId := uint8(m.GetCommunicationChannelId()) - _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, (communicationChannelId)) + _communicationChannelIdErr := writeBuffer.WriteUint8("communicationChannelId", 8, uint8((communicationChannelId))) if _communicationChannelIdErr != nil { return errors.Wrap(_communicationChannelIdErr, "Error serializing 'communicationChannelId' field") } // Simple Field (sequenceCounter) sequenceCounter := uint8(m.GetSequenceCounter()) - _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, (sequenceCounter)) + _sequenceCounterErr := writeBuffer.WriteUint8("sequenceCounter", 8, uint8((sequenceCounter))) if _sequenceCounterErr != nil { return errors.Wrap(_sequenceCounterErr, "Error serializing 'sequenceCounter' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/DataItem.go b/plc4go/protocols/modbus/readwrite/model/DataItem.go index 15be8cc0770..cbab2300009 100644 --- a/plc4go/protocols/modbus/readwrite/model/DataItem.go +++ b/plc4go/protocols/modbus/readwrite/model/DataItem.go @@ -391,7 +391,7 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri switch { case dataType == ModbusDataType_BOOL && numberOfValues == uint16(1): // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint16("reserved", 15, uint16(0x0000)); _err != nil { + if _err := writeBuffer.WriteUint16("reserved", 15, uint16(uint16(0x0000))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -409,12 +409,12 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } case dataType == ModbusDataType_BYTE && numberOfValues == uint16(1): // BYTE // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_BYTE: // List @@ -427,129 +427,129 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } case dataType == ModbusDataType_WORD: // WORD // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_DWORD: // DWORD // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_LWORD: // LWORD // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_SINT && numberOfValues == uint16(1): // SINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_SINT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt8("", 8, value.GetIndex(i).GetInt8()) + _itemErr := writeBuffer.WriteInt8("", 8, int8(value.GetIndex(i).GetInt8())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == ModbusDataType_INT && numberOfValues == uint16(1): // INT // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_INT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt16("", 16, value.GetIndex(i).GetInt16()) + _itemErr := writeBuffer.WriteInt16("", 16, int16(value.GetIndex(i).GetInt16())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == ModbusDataType_DINT && numberOfValues == uint16(1): // DINT // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_DINT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt32("", 32, value.GetIndex(i).GetInt32()) + _itemErr := writeBuffer.WriteInt32("", 32, int32(value.GetIndex(i).GetInt32())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == ModbusDataType_LINT && numberOfValues == uint16(1): // LINT // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_LINT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt64("", 64, value.GetIndex(i).GetInt64()) + _itemErr := writeBuffer.WriteInt64("", 64, int64(value.GetIndex(i).GetInt64())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == ModbusDataType_USINT && numberOfValues == uint16(1): // USINT // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 8, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 8, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_USINT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint8("", 8, value.GetIndex(i).GetUint8()) + _itemErr := writeBuffer.WriteUint8("", 8, uint8(value.GetIndex(i).GetUint8())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == ModbusDataType_UINT && numberOfValues == uint16(1): // UINT // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_UINT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint16("", 16, value.GetIndex(i).GetUint16()) + _itemErr := writeBuffer.WriteUint16("", 16, uint16(value.GetIndex(i).GetUint16())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == ModbusDataType_UDINT && numberOfValues == uint16(1): // UDINT // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_UDINT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint32("", 32, value.GetIndex(i).GetUint32()) + _itemErr := writeBuffer.WriteUint32("", 32, uint32(value.GetIndex(i).GetUint32())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == ModbusDataType_ULINT && numberOfValues == uint16(1): // ULINT // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == ModbusDataType_ULINT: // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint64("", 64, value.GetIndex(i).GetUint64()) + _itemErr := writeBuffer.WriteUint64("", 64, uint64(value.GetIndex(i).GetUint64())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/DriverType.go b/plc4go/protocols/modbus/readwrite/model/DriverType.go index e391a420e74..cab42a73fc5 100644 --- a/plc4go/protocols/modbus/readwrite/model/DriverType.go +++ b/plc4go/protocols/modbus/readwrite/model/DriverType.go @@ -138,7 +138,7 @@ func (e DriverType) Serialize() ([]byte, error) { func (e DriverType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("DriverType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("DriverType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusAsciiADU.go b/plc4go/protocols/modbus/readwrite/model/ModbusAsciiADU.go index bbc210ecb0f..4aaa00b5377 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusAsciiADU.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusAsciiADU.go @@ -225,7 +225,7 @@ func (m *_ModbusAsciiADU) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (address) address := uint8(m.GetAddress()) - _addressErr := writeBuffer.WriteUint8("address", 8, (address)) + _addressErr := writeBuffer.WriteUint8("address", 8, uint8((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } @@ -248,7 +248,7 @@ func (m *_ModbusAsciiADU) SerializeWithWriteBuffer(ctx context.Context, writeBuf if _checksumErr != nil { return errors.Wrap(_checksumErr, "Checksum calculation failed") } - _checksumWriteErr := writeBuffer.WriteUint8("checksum", 8, (_checksum)) + _checksumWriteErr := writeBuffer.WriteUint8("checksum", 8, uint8((_checksum))) if _checksumWriteErr != nil { return errors.Wrap(_checksumWriteErr, "Error serializing 'checksum' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusConstants.go b/plc4go/protocols/modbus/readwrite/model/ModbusConstants.go index 9de996289d0..95c9d923d2a 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusConstants.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusConstants.go @@ -147,7 +147,7 @@ func (m *_ModbusConstants) SerializeWithWriteBuffer(ctx context.Context, writeBu } // Const Field (modbusTcpDefaultPort) - _modbusTcpDefaultPortErr := writeBuffer.WriteUint16("modbusTcpDefaultPort", 16, 502) + _modbusTcpDefaultPortErr := writeBuffer.WriteUint16("modbusTcpDefaultPort", 16, uint16(502)) if _modbusTcpDefaultPortErr != nil { return errors.Wrap(_modbusTcpDefaultPortErr, "Error serializing 'modbusTcpDefaultPort' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusDataType.go b/plc4go/protocols/modbus/readwrite/model/ModbusDataType.go index f219699380e..8aa634ee4a2 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusDataType.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusDataType.go @@ -408,7 +408,7 @@ func (e ModbusDataType) Serialize() ([]byte, error) { func (e ModbusDataType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ModbusDataType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ModbusDataType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationConformityLevel.go b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationConformityLevel.go index 4c90ff36a81..88472b8ce9a 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationConformityLevel.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationConformityLevel.go @@ -138,7 +138,7 @@ func (e ModbusDeviceInformationConformityLevel) Serialize() ([]byte, error) { func (e ModbusDeviceInformationConformityLevel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ModbusDeviceInformationConformityLevel", 7, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ModbusDeviceInformationConformityLevel", 7, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationLevel.go b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationLevel.go index 1a354458937..676b33cc18b 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationLevel.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationLevel.go @@ -144,7 +144,7 @@ func (e ModbusDeviceInformationLevel) Serialize() ([]byte, error) { func (e ModbusDeviceInformationLevel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ModbusDeviceInformationLevel", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ModbusDeviceInformationLevel", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationMoreFollows.go b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationMoreFollows.go index d059aab0025..f6a62ef6e67 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationMoreFollows.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationMoreFollows.go @@ -132,7 +132,7 @@ func (e ModbusDeviceInformationMoreFollows) Serialize() ([]byte, error) { func (e ModbusDeviceInformationMoreFollows) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ModbusDeviceInformationMoreFollows", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ModbusDeviceInformationMoreFollows", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationObject.go b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationObject.go index 854bf70ee28..75970474ed8 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationObject.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusDeviceInformationObject.go @@ -177,14 +177,14 @@ func (m *_ModbusDeviceInformationObject) SerializeWithWriteBuffer(ctx context.Co // Simple Field (objectId) objectId := uint8(m.GetObjectId()) - _objectIdErr := writeBuffer.WriteUint8("objectId", 8, (objectId)) + _objectIdErr := writeBuffer.WriteUint8("objectId", 8, uint8((objectId))) if _objectIdErr != nil { return errors.Wrap(_objectIdErr, "Error serializing 'objectId' field") } // Implicit Field (objectLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) objectLength := uint8(uint8(len(m.GetData()))) - _objectLengthErr := writeBuffer.WriteUint8("objectLength", 8, (objectLength)) + _objectLengthErr := writeBuffer.WriteUint8("objectLength", 8, uint8((objectLength))) if _objectLengthErr != nil { return errors.Wrap(_objectLengthErr, "Error serializing 'objectLength' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusErrorCode.go b/plc4go/protocols/modbus/readwrite/model/ModbusErrorCode.go index aad8e424b22..619c8946d90 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusErrorCode.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusErrorCode.go @@ -180,7 +180,7 @@ func (e ModbusErrorCode) Serialize() ([]byte, error) { func (e ModbusErrorCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ModbusErrorCode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ModbusErrorCode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDU.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDU.go index bbdcaea2b67..77368eac1b8 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDU.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDU.go @@ -264,7 +264,7 @@ func (pm *_ModbusPDU) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Discriminator Field (functionFlag) (Used as input to a switch field) functionFlag := uint8(child.GetFunctionFlag()) - _functionFlagErr := writeBuffer.WriteUint8("functionFlag", 7, (functionFlag)) + _functionFlagErr := writeBuffer.WriteUint8("functionFlag", 7, uint8((functionFlag))) if _functionFlagErr != nil { return errors.Wrap(_functionFlagErr, "Error serializing 'functionFlag' field") diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticRequest.go index e4470e30bf7..c301b9096e5 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticRequest.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUDiagnosticRequest) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (subFunction) subFunction := uint16(m.GetSubFunction()) - _subFunctionErr := writeBuffer.WriteUint16("subFunction", 16, (subFunction)) + _subFunctionErr := writeBuffer.WriteUint16("subFunction", 16, uint16((subFunction))) if _subFunctionErr != nil { return errors.Wrap(_subFunctionErr, "Error serializing 'subFunction' field") } // Simple Field (data) data := uint16(m.GetData()) - _dataErr := writeBuffer.WriteUint16("data", 16, (data)) + _dataErr := writeBuffer.WriteUint16("data", 16, uint16((data))) if _dataErr != nil { return errors.Wrap(_dataErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticResponse.go index 26d0c0bf9be..f07cb1ec708 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUDiagnosticResponse.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUDiagnosticResponse) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (subFunction) subFunction := uint16(m.GetSubFunction()) - _subFunctionErr := writeBuffer.WriteUint16("subFunction", 16, (subFunction)) + _subFunctionErr := writeBuffer.WriteUint16("subFunction", 16, uint16((subFunction))) if _subFunctionErr != nil { return errors.Wrap(_subFunctionErr, "Error serializing 'subFunction' field") } // Simple Field (data) data := uint16(m.GetData()) - _dataErr := writeBuffer.WriteUint16("data", 16, (data)) + _dataErr := writeBuffer.WriteUint16("data", 16, uint16((data))) if _dataErr != nil { return errors.Wrap(_dataErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventCounterResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventCounterResponse.go index 133f2ac7473..471399a2b0b 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventCounterResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventCounterResponse.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUGetComEventCounterResponse) SerializeWithWriteBuffer(ctx cont // Simple Field (status) status := uint16(m.GetStatus()) - _statusErr := writeBuffer.WriteUint16("status", 16, (status)) + _statusErr := writeBuffer.WriteUint16("status", 16, uint16((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (eventCount) eventCount := uint16(m.GetEventCount()) - _eventCountErr := writeBuffer.WriteUint16("eventCount", 16, (eventCount)) + _eventCountErr := writeBuffer.WriteUint16("eventCount", 16, uint16((eventCount))) if _eventCountErr != nil { return errors.Wrap(_eventCountErr, "Error serializing 'eventCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventLogResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventLogResponse.go index 1663c1a3e49..1923763d974 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventLogResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUGetComEventLogResponse.go @@ -255,28 +255,28 @@ func (m *_ModbusPDUGetComEventLogResponse) SerializeWithWriteBuffer(ctx context. // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(uint8(len(m.GetEvents()))) + uint8(uint8(6))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } // Simple Field (status) status := uint16(m.GetStatus()) - _statusErr := writeBuffer.WriteUint16("status", 16, (status)) + _statusErr := writeBuffer.WriteUint16("status", 16, uint16((status))) if _statusErr != nil { return errors.Wrap(_statusErr, "Error serializing 'status' field") } // Simple Field (eventCount) eventCount := uint16(m.GetEventCount()) - _eventCountErr := writeBuffer.WriteUint16("eventCount", 16, (eventCount)) + _eventCountErr := writeBuffer.WriteUint16("eventCount", 16, uint16((eventCount))) if _eventCountErr != nil { return errors.Wrap(_eventCountErr, "Error serializing 'eventCount' field") } // Simple Field (messageCount) messageCount := uint16(m.GetMessageCount()) - _messageCountErr := writeBuffer.WriteUint16("messageCount", 16, (messageCount)) + _messageCountErr := writeBuffer.WriteUint16("messageCount", 16, uint16((messageCount))) if _messageCountErr != nil { return errors.Wrap(_messageCountErr, "Error serializing 'messageCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterRequest.go index 7d91c7e1ac8..509d147a4e3 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterRequest.go @@ -225,21 +225,21 @@ func (m *_ModbusPDUMaskWriteHoldingRegisterRequest) SerializeWithWriteBuffer(ctx // Simple Field (referenceAddress) referenceAddress := uint16(m.GetReferenceAddress()) - _referenceAddressErr := writeBuffer.WriteUint16("referenceAddress", 16, (referenceAddress)) + _referenceAddressErr := writeBuffer.WriteUint16("referenceAddress", 16, uint16((referenceAddress))) if _referenceAddressErr != nil { return errors.Wrap(_referenceAddressErr, "Error serializing 'referenceAddress' field") } // Simple Field (andMask) andMask := uint16(m.GetAndMask()) - _andMaskErr := writeBuffer.WriteUint16("andMask", 16, (andMask)) + _andMaskErr := writeBuffer.WriteUint16("andMask", 16, uint16((andMask))) if _andMaskErr != nil { return errors.Wrap(_andMaskErr, "Error serializing 'andMask' field") } // Simple Field (orMask) orMask := uint16(m.GetOrMask()) - _orMaskErr := writeBuffer.WriteUint16("orMask", 16, (orMask)) + _orMaskErr := writeBuffer.WriteUint16("orMask", 16, uint16((orMask))) if _orMaskErr != nil { return errors.Wrap(_orMaskErr, "Error serializing 'orMask' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterResponse.go index b8e5887b04d..ca74e2700ca 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUMaskWriteHoldingRegisterResponse.go @@ -225,21 +225,21 @@ func (m *_ModbusPDUMaskWriteHoldingRegisterResponse) SerializeWithWriteBuffer(ct // Simple Field (referenceAddress) referenceAddress := uint16(m.GetReferenceAddress()) - _referenceAddressErr := writeBuffer.WriteUint16("referenceAddress", 16, (referenceAddress)) + _referenceAddressErr := writeBuffer.WriteUint16("referenceAddress", 16, uint16((referenceAddress))) if _referenceAddressErr != nil { return errors.Wrap(_referenceAddressErr, "Error serializing 'referenceAddress' field") } // Simple Field (andMask) andMask := uint16(m.GetAndMask()) - _andMaskErr := writeBuffer.WriteUint16("andMask", 16, (andMask)) + _andMaskErr := writeBuffer.WriteUint16("andMask", 16, uint16((andMask))) if _andMaskErr != nil { return errors.Wrap(_andMaskErr, "Error serializing 'andMask' field") } // Simple Field (orMask) orMask := uint16(m.GetOrMask()) - _orMaskErr := writeBuffer.WriteUint16("orMask", 16, (orMask)) + _orMaskErr := writeBuffer.WriteUint16("orMask", 16, uint16((orMask))) if _orMaskErr != nil { return errors.Wrap(_orMaskErr, "Error serializing 'orMask' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsRequest.go index 1d6c2a1a76a..dafd24c0a2d 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsRequest.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUReadCoilsRequest) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsResponse.go index 0c854043cda..fdc232f9929 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadCoilsResponse.go @@ -198,7 +198,7 @@ func (m *_ModbusPDUReadCoilsResponse) SerializeWithWriteBuffer(ctx context.Conte // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationRequest.go index 2b3b3abc941..c1791cf5129 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationRequest.go @@ -239,7 +239,7 @@ func (m *_ModbusPDUReadDeviceIdentificationRequest) SerializeWithWriteBuffer(ctx } // Const Field (meiType) - _meiTypeErr := writeBuffer.WriteUint8("meiType", 8, 0x0E) + _meiTypeErr := writeBuffer.WriteUint8("meiType", 8, uint8(0x0E)) if _meiTypeErr != nil { return errors.Wrap(_meiTypeErr, "Error serializing 'meiType' field") } @@ -258,7 +258,7 @@ func (m *_ModbusPDUReadDeviceIdentificationRequest) SerializeWithWriteBuffer(ctx // Simple Field (objectId) objectId := uint8(m.GetObjectId()) - _objectIdErr := writeBuffer.WriteUint8("objectId", 8, (objectId)) + _objectIdErr := writeBuffer.WriteUint8("objectId", 8, uint8((objectId))) if _objectIdErr != nil { return errors.Wrap(_objectIdErr, "Error serializing 'objectId' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationResponse.go index 862c82748e4..7d699e09bf8 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDeviceIdentificationResponse.go @@ -364,7 +364,7 @@ func (m *_ModbusPDUReadDeviceIdentificationResponse) SerializeWithWriteBuffer(ct } // Const Field (meiType) - _meiTypeErr := writeBuffer.WriteUint8("meiType", 8, 0x0E) + _meiTypeErr := writeBuffer.WriteUint8("meiType", 8, uint8(0x0E)) if _meiTypeErr != nil { return errors.Wrap(_meiTypeErr, "Error serializing 'meiType' field") } @@ -414,14 +414,14 @@ func (m *_ModbusPDUReadDeviceIdentificationResponse) SerializeWithWriteBuffer(ct // Simple Field (nextObjectId) nextObjectId := uint8(m.GetNextObjectId()) - _nextObjectIdErr := writeBuffer.WriteUint8("nextObjectId", 8, (nextObjectId)) + _nextObjectIdErr := writeBuffer.WriteUint8("nextObjectId", 8, uint8((nextObjectId))) if _nextObjectIdErr != nil { return errors.Wrap(_nextObjectIdErr, "Error serializing 'nextObjectId' field") } // Implicit Field (numberOfObjects) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numberOfObjects := uint8(uint8(len(m.GetObjects()))) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsRequest.go index cc9037ef103..b6fb4e8f73c 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsRequest.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUReadDiscreteInputsRequest) SerializeWithWriteBuffer(ctx conte // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsResponse.go index 72391094854..df86d0648c0 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadDiscreteInputsResponse.go @@ -198,7 +198,7 @@ func (m *_ModbusPDUReadDiscreteInputsResponse) SerializeWithWriteBuffer(ctx cont // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadExceptionStatusResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadExceptionStatusResponse.go index 9a4d29c1c58..09259b0da39 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadExceptionStatusResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadExceptionStatusResponse.go @@ -187,7 +187,7 @@ func (m *_ModbusPDUReadExceptionStatusResponse) SerializeWithWriteBuffer(ctx con // Simple Field (value) value := uint8(m.GetValue()) - _valueErr := writeBuffer.WriteUint8("value", 8, (value)) + _valueErr := writeBuffer.WriteUint8("value", 8, uint8((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueRequest.go index a6169cd99f3..b0d74c1e653 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueRequest.go @@ -187,7 +187,7 @@ func (m *_ModbusPDUReadFifoQueueRequest) SerializeWithWriteBuffer(ctx context.Co // Simple Field (fifoPointerAddress) fifoPointerAddress := uint16(m.GetFifoPointerAddress()) - _fifoPointerAddressErr := writeBuffer.WriteUint16("fifoPointerAddress", 16, (fifoPointerAddress)) + _fifoPointerAddressErr := writeBuffer.WriteUint16("fifoPointerAddress", 16, uint16((fifoPointerAddress))) if _fifoPointerAddressErr != nil { return errors.Wrap(_fifoPointerAddressErr, "Error serializing 'fifoPointerAddress' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueResponse.go index 7e5fd053109..b57c19f20f8 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFifoQueueResponse.go @@ -229,14 +229,14 @@ func (m *_ModbusPDUReadFifoQueueResponse) SerializeWithWriteBuffer(ctx context.C // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint16(uint16((uint16(uint16(len(m.GetFifoValue()))) * uint16(uint16(2)))) + uint16(uint16(2))) - _byteCountErr := writeBuffer.WriteUint16("byteCount", 16, (byteCount)) + _byteCountErr := writeBuffer.WriteUint16("byteCount", 16, uint16((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } // Implicit Field (fifoCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) fifoCount := uint16(uint16((uint16(uint16(len(m.GetFifoValue()))) * uint16(uint16(2)))) / uint16(uint16(2))) - _fifoCountErr := writeBuffer.WriteUint16("fifoCount", 16, (fifoCount)) + _fifoCountErr := writeBuffer.WriteUint16("fifoCount", 16, uint16((fifoCount))) if _fifoCountErr != nil { return errors.Wrap(_fifoCountErr, "Error serializing 'fifoCount' field") } @@ -247,7 +247,7 @@ func (m *_ModbusPDUReadFifoQueueResponse) SerializeWithWriteBuffer(ctx context.C } for _curItem, _element := range m.GetFifoValue() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'fifoValue' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequest.go index 5be9367f98a..9bc14ce52c4 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequest.go @@ -222,7 +222,7 @@ func (m *_ModbusPDUReadFileRecordRequest) SerializeWithWriteBuffer(ctx context.C // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(itemsArraySizeInBytes(m.GetItems()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequestItem.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequestItem.go index 9203148cd06..45d563a6aae 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequestItem.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordRequestItem.go @@ -202,28 +202,28 @@ func (m *_ModbusPDUReadFileRecordRequestItem) SerializeWithWriteBuffer(ctx conte // Simple Field (referenceType) referenceType := uint8(m.GetReferenceType()) - _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, (referenceType)) + _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, uint8((referenceType))) if _referenceTypeErr != nil { return errors.Wrap(_referenceTypeErr, "Error serializing 'referenceType' field") } // Simple Field (fileNumber) fileNumber := uint16(m.GetFileNumber()) - _fileNumberErr := writeBuffer.WriteUint16("fileNumber", 16, (fileNumber)) + _fileNumberErr := writeBuffer.WriteUint16("fileNumber", 16, uint16((fileNumber))) if _fileNumberErr != nil { return errors.Wrap(_fileNumberErr, "Error serializing 'fileNumber' field") } // Simple Field (recordNumber) recordNumber := uint16(m.GetRecordNumber()) - _recordNumberErr := writeBuffer.WriteUint16("recordNumber", 16, (recordNumber)) + _recordNumberErr := writeBuffer.WriteUint16("recordNumber", 16, uint16((recordNumber))) if _recordNumberErr != nil { return errors.Wrap(_recordNumberErr, "Error serializing 'recordNumber' field") } // Simple Field (recordLength) recordLength := uint16(m.GetRecordLength()) - _recordLengthErr := writeBuffer.WriteUint16("recordLength", 16, (recordLength)) + _recordLengthErr := writeBuffer.WriteUint16("recordLength", 16, uint16((recordLength))) if _recordLengthErr != nil { return errors.Wrap(_recordLengthErr, "Error serializing 'recordLength' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponse.go index 53ebd3c09fa..8ad19858d80 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponse.go @@ -222,7 +222,7 @@ func (m *_ModbusPDUReadFileRecordResponse) SerializeWithWriteBuffer(ctx context. // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(itemsArraySizeInBytes(m.GetItems()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponseItem.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponseItem.go index ae458a5bf67..17e107ab81c 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponseItem.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadFileRecordResponseItem.go @@ -177,14 +177,14 @@ func (m *_ModbusPDUReadFileRecordResponseItem) SerializeWithWriteBuffer(ctx cont // Implicit Field (dataLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) dataLength := uint8(uint8(uint8(len(m.GetData()))) + uint8(uint8(1))) - _dataLengthErr := writeBuffer.WriteUint8("dataLength", 8, (dataLength)) + _dataLengthErr := writeBuffer.WriteUint8("dataLength", 8, uint8((dataLength))) if _dataLengthErr != nil { return errors.Wrap(_dataLengthErr, "Error serializing 'dataLength' field") } // Simple Field (referenceType) referenceType := uint8(m.GetReferenceType()) - _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, (referenceType)) + _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, uint8((referenceType))) if _referenceTypeErr != nil { return errors.Wrap(_referenceTypeErr, "Error serializing 'referenceType' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersRequest.go index 749e4307152..68e502c432c 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersRequest.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUReadHoldingRegistersRequest) SerializeWithWriteBuffer(ctx con // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersResponse.go index 2d4610588c5..56ec7e20f6f 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadHoldingRegistersResponse.go @@ -198,7 +198,7 @@ func (m *_ModbusPDUReadHoldingRegistersResponse) SerializeWithWriteBuffer(ctx co // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersRequest.go index 1a932b0af9a..8a1837004da 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersRequest.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUReadInputRegistersRequest) SerializeWithWriteBuffer(ctx conte // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersResponse.go index ae7a8a5206b..668527029fe 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadInputRegistersResponse.go @@ -198,7 +198,7 @@ func (m *_ModbusPDUReadInputRegistersResponse) SerializeWithWriteBuffer(ctx cont // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersRequest.go index 85ab72ea901..44cb801c0ec 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersRequest.go @@ -274,35 +274,35 @@ func (m *_ModbusPDUReadWriteMultipleHoldingRegistersRequest) SerializeWithWriteB // Simple Field (readStartingAddress) readStartingAddress := uint16(m.GetReadStartingAddress()) - _readStartingAddressErr := writeBuffer.WriteUint16("readStartingAddress", 16, (readStartingAddress)) + _readStartingAddressErr := writeBuffer.WriteUint16("readStartingAddress", 16, uint16((readStartingAddress))) if _readStartingAddressErr != nil { return errors.Wrap(_readStartingAddressErr, "Error serializing 'readStartingAddress' field") } // Simple Field (readQuantity) readQuantity := uint16(m.GetReadQuantity()) - _readQuantityErr := writeBuffer.WriteUint16("readQuantity", 16, (readQuantity)) + _readQuantityErr := writeBuffer.WriteUint16("readQuantity", 16, uint16((readQuantity))) if _readQuantityErr != nil { return errors.Wrap(_readQuantityErr, "Error serializing 'readQuantity' field") } // Simple Field (writeStartingAddress) writeStartingAddress := uint16(m.GetWriteStartingAddress()) - _writeStartingAddressErr := writeBuffer.WriteUint16("writeStartingAddress", 16, (writeStartingAddress)) + _writeStartingAddressErr := writeBuffer.WriteUint16("writeStartingAddress", 16, uint16((writeStartingAddress))) if _writeStartingAddressErr != nil { return errors.Wrap(_writeStartingAddressErr, "Error serializing 'writeStartingAddress' field") } // Simple Field (writeQuantity) writeQuantity := uint16(m.GetWriteQuantity()) - _writeQuantityErr := writeBuffer.WriteUint16("writeQuantity", 16, (writeQuantity)) + _writeQuantityErr := writeBuffer.WriteUint16("writeQuantity", 16, uint16((writeQuantity))) if _writeQuantityErr != nil { return errors.Wrap(_writeQuantityErr, "Error serializing 'writeQuantity' field") } // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersResponse.go index ad94957367c..d85ca35c8d9 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReadWriteMultipleHoldingRegistersResponse.go @@ -198,7 +198,7 @@ func (m *_ModbusPDUReadWriteMultipleHoldingRegistersResponse) SerializeWithWrite // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReportServerIdResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReportServerIdResponse.go index 3eb222307ca..7c9fc6f7a32 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUReportServerIdResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUReportServerIdResponse.go @@ -198,7 +198,7 @@ func (m *_ModbusPDUReportServerIdResponse) SerializeWithWriteBuffer(ctx context. // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequest.go index 266b16cb22b..7d00626057d 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequest.go @@ -222,7 +222,7 @@ func (m *_ModbusPDUWriteFileRecordRequest) SerializeWithWriteBuffer(ctx context. // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(itemsArraySizeInBytes(m.GetItems()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequestItem.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequestItem.go index 9e3a25c58ed..76401ef28ad 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequestItem.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordRequestItem.go @@ -213,28 +213,28 @@ func (m *_ModbusPDUWriteFileRecordRequestItem) SerializeWithWriteBuffer(ctx cont // Simple Field (referenceType) referenceType := uint8(m.GetReferenceType()) - _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, (referenceType)) + _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, uint8((referenceType))) if _referenceTypeErr != nil { return errors.Wrap(_referenceTypeErr, "Error serializing 'referenceType' field") } // Simple Field (fileNumber) fileNumber := uint16(m.GetFileNumber()) - _fileNumberErr := writeBuffer.WriteUint16("fileNumber", 16, (fileNumber)) + _fileNumberErr := writeBuffer.WriteUint16("fileNumber", 16, uint16((fileNumber))) if _fileNumberErr != nil { return errors.Wrap(_fileNumberErr, "Error serializing 'fileNumber' field") } // Simple Field (recordNumber) recordNumber := uint16(m.GetRecordNumber()) - _recordNumberErr := writeBuffer.WriteUint16("recordNumber", 16, (recordNumber)) + _recordNumberErr := writeBuffer.WriteUint16("recordNumber", 16, uint16((recordNumber))) if _recordNumberErr != nil { return errors.Wrap(_recordNumberErr, "Error serializing 'recordNumber' field") } // Implicit Field (recordLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) recordLength := uint16(uint16(uint16(len(m.GetRecordData()))) / uint16(uint16(2))) - _recordLengthErr := writeBuffer.WriteUint16("recordLength", 16, (recordLength)) + _recordLengthErr := writeBuffer.WriteUint16("recordLength", 16, uint16((recordLength))) if _recordLengthErr != nil { return errors.Wrap(_recordLengthErr, "Error serializing 'recordLength' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponse.go index d180ed034be..d1291770c70 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponse.go @@ -222,7 +222,7 @@ func (m *_ModbusPDUWriteFileRecordResponse) SerializeWithWriteBuffer(ctx context // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(itemsArraySizeInBytes(m.GetItems()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponseItem.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponseItem.go index 5517014ac26..61c17050fbf 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponseItem.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteFileRecordResponseItem.go @@ -213,28 +213,28 @@ func (m *_ModbusPDUWriteFileRecordResponseItem) SerializeWithWriteBuffer(ctx con // Simple Field (referenceType) referenceType := uint8(m.GetReferenceType()) - _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, (referenceType)) + _referenceTypeErr := writeBuffer.WriteUint8("referenceType", 8, uint8((referenceType))) if _referenceTypeErr != nil { return errors.Wrap(_referenceTypeErr, "Error serializing 'referenceType' field") } // Simple Field (fileNumber) fileNumber := uint16(m.GetFileNumber()) - _fileNumberErr := writeBuffer.WriteUint16("fileNumber", 16, (fileNumber)) + _fileNumberErr := writeBuffer.WriteUint16("fileNumber", 16, uint16((fileNumber))) if _fileNumberErr != nil { return errors.Wrap(_fileNumberErr, "Error serializing 'fileNumber' field") } // Simple Field (recordNumber) recordNumber := uint16(m.GetRecordNumber()) - _recordNumberErr := writeBuffer.WriteUint16("recordNumber", 16, (recordNumber)) + _recordNumberErr := writeBuffer.WriteUint16("recordNumber", 16, uint16((recordNumber))) if _recordNumberErr != nil { return errors.Wrap(_recordNumberErr, "Error serializing 'recordNumber' field") } // Implicit Field (recordLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) recordLength := uint16(uint16(uint16(len(m.GetRecordData()))) / uint16(uint16(2))) - _recordLengthErr := writeBuffer.WriteUint16("recordLength", 16, (recordLength)) + _recordLengthErr := writeBuffer.WriteUint16("recordLength", 16, uint16((recordLength))) if _recordLengthErr != nil { return errors.Wrap(_recordLengthErr, "Error serializing 'recordLength' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsRequest.go index 54e31f7948f..f37fa0a7917 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsRequest.go @@ -236,21 +236,21 @@ func (m *_ModbusPDUWriteMultipleCoilsRequest) SerializeWithWriteBuffer(ctx conte // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsResponse.go index bde6ddef03c..edbd8992a83 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleCoilsResponse.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUWriteMultipleCoilsResponse) SerializeWithWriteBuffer(ctx cont // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersRequest.go index 1d34d73d818..b8219961f56 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersRequest.go @@ -236,21 +236,21 @@ func (m *_ModbusPDUWriteMultipleHoldingRegistersRequest) SerializeWithWriteBuffe // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } // Implicit Field (byteCount) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) byteCount := uint8(uint8(len(m.GetValue()))) - _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, (byteCount)) + _byteCountErr := writeBuffer.WriteUint8("byteCount", 8, uint8((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersResponse.go index 96e8aa8776c..4d961af61b4 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteMultipleHoldingRegistersResponse.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUWriteMultipleHoldingRegistersResponse) SerializeWithWriteBuff // Simple Field (startingAddress) startingAddress := uint16(m.GetStartingAddress()) - _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, (startingAddress)) + _startingAddressErr := writeBuffer.WriteUint16("startingAddress", 16, uint16((startingAddress))) if _startingAddressErr != nil { return errors.Wrap(_startingAddressErr, "Error serializing 'startingAddress' field") } // Simple Field (quantity) quantity := uint16(m.GetQuantity()) - _quantityErr := writeBuffer.WriteUint16("quantity", 16, (quantity)) + _quantityErr := writeBuffer.WriteUint16("quantity", 16, uint16((quantity))) if _quantityErr != nil { return errors.Wrap(_quantityErr, "Error serializing 'quantity' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilRequest.go index 2dfae657e03..abc5974b7b8 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilRequest.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUWriteSingleCoilRequest) SerializeWithWriteBuffer(ctx context. // Simple Field (address) address := uint16(m.GetAddress()) - _addressErr := writeBuffer.WriteUint16("address", 16, (address)) + _addressErr := writeBuffer.WriteUint16("address", 16, uint16((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } // Simple Field (value) value := uint16(m.GetValue()) - _valueErr := writeBuffer.WriteUint16("value", 16, (value)) + _valueErr := writeBuffer.WriteUint16("value", 16, uint16((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilResponse.go index ede331df848..d58e126be40 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleCoilResponse.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUWriteSingleCoilResponse) SerializeWithWriteBuffer(ctx context // Simple Field (address) address := uint16(m.GetAddress()) - _addressErr := writeBuffer.WriteUint16("address", 16, (address)) + _addressErr := writeBuffer.WriteUint16("address", 16, uint16((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } // Simple Field (value) value := uint16(m.GetValue()) - _valueErr := writeBuffer.WriteUint16("value", 16, (value)) + _valueErr := writeBuffer.WriteUint16("value", 16, uint16((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterRequest.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterRequest.go index 31bb64bd591..b43b2041ad9 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterRequest.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterRequest.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUWriteSingleRegisterRequest) SerializeWithWriteBuffer(ctx cont // Simple Field (address) address := uint16(m.GetAddress()) - _addressErr := writeBuffer.WriteUint16("address", 16, (address)) + _addressErr := writeBuffer.WriteUint16("address", 16, uint16((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } // Simple Field (value) value := uint16(m.GetValue()) - _valueErr := writeBuffer.WriteUint16("value", 16, (value)) + _valueErr := writeBuffer.WriteUint16("value", 16, uint16((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterResponse.go b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterResponse.go index e856cadc4a9..d36f45f9c95 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterResponse.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusPDUWriteSingleRegisterResponse.go @@ -206,14 +206,14 @@ func (m *_ModbusPDUWriteSingleRegisterResponse) SerializeWithWriteBuffer(ctx con // Simple Field (address) address := uint16(m.GetAddress()) - _addressErr := writeBuffer.WriteUint16("address", 16, (address)) + _addressErr := writeBuffer.WriteUint16("address", 16, uint16((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } // Simple Field (value) value := uint16(m.GetValue()) - _valueErr := writeBuffer.WriteUint16("value", 16, (value)) + _valueErr := writeBuffer.WriteUint16("value", 16, uint16((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusRtuADU.go b/plc4go/protocols/modbus/readwrite/model/ModbusRtuADU.go index 86a07775201..de266011356 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusRtuADU.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusRtuADU.go @@ -225,7 +225,7 @@ func (m *_ModbusRtuADU) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (address) address := uint8(m.GetAddress()) - _addressErr := writeBuffer.WriteUint8("address", 8, (address)) + _addressErr := writeBuffer.WriteUint8("address", 8, uint8((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } @@ -248,7 +248,7 @@ func (m *_ModbusRtuADU) SerializeWithWriteBuffer(ctx context.Context, writeBuffe if _checksumErr != nil { return errors.Wrap(_checksumErr, "Checksum calculation failed") } - _checksumWriteErr := writeBuffer.WriteUint16("checksum", 16, (_checksum)) + _checksumWriteErr := writeBuffer.WriteUint16("checksum", 16, uint16((_checksum))) if _checksumWriteErr != nil { return errors.Wrap(_checksumWriteErr, "Error serializing 'checksum' field") } diff --git a/plc4go/protocols/modbus/readwrite/model/ModbusTcpADU.go b/plc4go/protocols/modbus/readwrite/model/ModbusTcpADU.go index 8234c3646a8..6a30678a697 100644 --- a/plc4go/protocols/modbus/readwrite/model/ModbusTcpADU.go +++ b/plc4go/protocols/modbus/readwrite/model/ModbusTcpADU.go @@ -264,27 +264,27 @@ func (m *_ModbusTcpADU) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (transactionIdentifier) transactionIdentifier := uint16(m.GetTransactionIdentifier()) - _transactionIdentifierErr := writeBuffer.WriteUint16("transactionIdentifier", 16, (transactionIdentifier)) + _transactionIdentifierErr := writeBuffer.WriteUint16("transactionIdentifier", 16, uint16((transactionIdentifier))) if _transactionIdentifierErr != nil { return errors.Wrap(_transactionIdentifierErr, "Error serializing 'transactionIdentifier' field") } // Const Field (protocolIdentifier) - _protocolIdentifierErr := writeBuffer.WriteUint16("protocolIdentifier", 16, 0x0000) + _protocolIdentifierErr := writeBuffer.WriteUint16("protocolIdentifier", 16, uint16(0x0000)) if _protocolIdentifierErr != nil { return errors.Wrap(_protocolIdentifierErr, "Error serializing 'protocolIdentifier' field") } // Implicit Field (length) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) length := uint16(uint16(m.GetPdu().GetLengthInBytes(ctx)) + uint16(uint16(1))) - _lengthErr := writeBuffer.WriteUint16("length", 16, (length)) + _lengthErr := writeBuffer.WriteUint16("length", 16, uint16((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } // Simple Field (unitIdentifier) unitIdentifier := uint8(m.GetUnitIdentifier()) - _unitIdentifierErr := writeBuffer.WriteUint8("unitIdentifier", 8, (unitIdentifier)) + _unitIdentifierErr := writeBuffer.WriteUint8("unitIdentifier", 8, uint8((unitIdentifier))) if _unitIdentifierErr != nil { return errors.Wrap(_unitIdentifierErr, "Error serializing 'unitIdentifier' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AccessLevelExType.go b/plc4go/protocols/opcua/readwrite/model/AccessLevelExType.go index 2359ab9e04d..1362a0f726d 100644 --- a/plc4go/protocols/opcua/readwrite/model/AccessLevelExType.go +++ b/plc4go/protocols/opcua/readwrite/model/AccessLevelExType.go @@ -204,7 +204,7 @@ func (e AccessLevelExType) Serialize() ([]byte, error) { func (e AccessLevelExType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("AccessLevelExType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("AccessLevelExType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/AccessLevelType.go b/plc4go/protocols/opcua/readwrite/model/AccessLevelType.go index 8c51a107771..5ee09b46ee4 100644 --- a/plc4go/protocols/opcua/readwrite/model/AccessLevelType.go +++ b/plc4go/protocols/opcua/readwrite/model/AccessLevelType.go @@ -168,7 +168,7 @@ func (e AccessLevelType) Serialize() ([]byte, error) { func (e AccessLevelType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AccessLevelType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AccessLevelType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/AccessRestrictionType.go b/plc4go/protocols/opcua/readwrite/model/AccessRestrictionType.go index 798c50c0f27..5e950acf960 100644 --- a/plc4go/protocols/opcua/readwrite/model/AccessRestrictionType.go +++ b/plc4go/protocols/opcua/readwrite/model/AccessRestrictionType.go @@ -150,7 +150,7 @@ func (e AccessRestrictionType) Serialize() ([]byte, error) { func (e AccessRestrictionType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("AccessRestrictionType", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("AccessRestrictionType", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ActivateSessionRequest.go b/plc4go/protocols/opcua/readwrite/model/ActivateSessionRequest.go index 5a21b500876..81167361e4a 100644 --- a/plc4go/protocols/opcua/readwrite/model/ActivateSessionRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/ActivateSessionRequest.go @@ -414,7 +414,7 @@ func (m *_ActivateSessionRequest) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfClientSoftwareCertificates) noOfClientSoftwareCertificates := int32(m.GetNoOfClientSoftwareCertificates()) - _noOfClientSoftwareCertificatesErr := writeBuffer.WriteInt32("noOfClientSoftwareCertificates", 32, (noOfClientSoftwareCertificates)) + _noOfClientSoftwareCertificatesErr := writeBuffer.WriteInt32("noOfClientSoftwareCertificates", 32, int32((noOfClientSoftwareCertificates))) if _noOfClientSoftwareCertificatesErr != nil { return errors.Wrap(_noOfClientSoftwareCertificatesErr, "Error serializing 'noOfClientSoftwareCertificates' field") } @@ -438,7 +438,7 @@ func (m *_ActivateSessionRequest) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfLocaleIds) noOfLocaleIds := int32(m.GetNoOfLocaleIds()) - _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, (noOfLocaleIds)) + _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, int32((noOfLocaleIds))) if _noOfLocaleIdsErr != nil { return errors.Wrap(_noOfLocaleIdsErr, "Error serializing 'noOfLocaleIds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ActivateSessionResponse.go b/plc4go/protocols/opcua/readwrite/model/ActivateSessionResponse.go index 95d57ead926..fa7e3e34037 100644 --- a/plc4go/protocols/opcua/readwrite/model/ActivateSessionResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/ActivateSessionResponse.go @@ -364,7 +364,7 @@ func (m *_ActivateSessionResponse) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -388,7 +388,7 @@ func (m *_ActivateSessionResponse) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AddNodesRequest.go b/plc4go/protocols/opcua/readwrite/model/AddNodesRequest.go index b4ba7a9a99f..d2dc31816eb 100644 --- a/plc4go/protocols/opcua/readwrite/model/AddNodesRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/AddNodesRequest.go @@ -262,7 +262,7 @@ func (m *_AddNodesRequest) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (noOfNodesToAdd) noOfNodesToAdd := int32(m.GetNoOfNodesToAdd()) - _noOfNodesToAddErr := writeBuffer.WriteInt32("noOfNodesToAdd", 32, (noOfNodesToAdd)) + _noOfNodesToAddErr := writeBuffer.WriteInt32("noOfNodesToAdd", 32, int32((noOfNodesToAdd))) if _noOfNodesToAddErr != nil { return errors.Wrap(_noOfNodesToAddErr, "Error serializing 'noOfNodesToAdd' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AddNodesResponse.go b/plc4go/protocols/opcua/readwrite/model/AddNodesResponse.go index 7d015b2df1a..d0d040fa54b 100644 --- a/plc4go/protocols/opcua/readwrite/model/AddNodesResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/AddNodesResponse.go @@ -327,7 +327,7 @@ func (m *_AddNodesResponse) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_AddNodesResponse) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AddReferencesItem.go b/plc4go/protocols/opcua/readwrite/model/AddReferencesItem.go index 40206b3ce2a..3e38775549d 100644 --- a/plc4go/protocols/opcua/readwrite/model/AddReferencesItem.go +++ b/plc4go/protocols/opcua/readwrite/model/AddReferencesItem.go @@ -359,7 +359,7 @@ func (m *_AddReferencesItem) SerializeWithWriteBuffer(ctx context.Context, write }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AddReferencesRequest.go b/plc4go/protocols/opcua/readwrite/model/AddReferencesRequest.go index 9f4c85e1b5d..7c32c5f1d64 100644 --- a/plc4go/protocols/opcua/readwrite/model/AddReferencesRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/AddReferencesRequest.go @@ -262,7 +262,7 @@ func (m *_AddReferencesRequest) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfReferencesToAdd) noOfReferencesToAdd := int32(m.GetNoOfReferencesToAdd()) - _noOfReferencesToAddErr := writeBuffer.WriteInt32("noOfReferencesToAdd", 32, (noOfReferencesToAdd)) + _noOfReferencesToAddErr := writeBuffer.WriteInt32("noOfReferencesToAdd", 32, int32((noOfReferencesToAdd))) if _noOfReferencesToAddErr != nil { return errors.Wrap(_noOfReferencesToAddErr, "Error serializing 'noOfReferencesToAdd' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AddReferencesResponse.go b/plc4go/protocols/opcua/readwrite/model/AddReferencesResponse.go index 9b790606da2..2e97b0eb53a 100644 --- a/plc4go/protocols/opcua/readwrite/model/AddReferencesResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/AddReferencesResponse.go @@ -327,7 +327,7 @@ func (m *_AddReferencesResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_AddReferencesResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AdditionalParametersType.go b/plc4go/protocols/opcua/readwrite/model/AdditionalParametersType.go index ef7ddace0a3..317f247f716 100644 --- a/plc4go/protocols/opcua/readwrite/model/AdditionalParametersType.go +++ b/plc4go/protocols/opcua/readwrite/model/AdditionalParametersType.go @@ -225,7 +225,7 @@ func (m *_AdditionalParametersType) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfParameters) noOfParameters := int32(m.GetNoOfParameters()) - _noOfParametersErr := writeBuffer.WriteInt32("noOfParameters", 32, (noOfParameters)) + _noOfParametersErr := writeBuffer.WriteInt32("noOfParameters", 32, int32((noOfParameters))) if _noOfParametersErr != nil { return errors.Wrap(_noOfParametersErr, "Error serializing 'noOfParameters' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AggregateConfiguration.go b/plc4go/protocols/opcua/readwrite/model/AggregateConfiguration.go index 613f4a80d57..948f3fc88c8 100644 --- a/plc4go/protocols/opcua/readwrite/model/AggregateConfiguration.go +++ b/plc4go/protocols/opcua/readwrite/model/AggregateConfiguration.go @@ -308,7 +308,7 @@ func (m *_AggregateConfiguration) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 6, reserved) + _err := writeBuffer.WriteUint8("reserved", 6, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -330,14 +330,14 @@ func (m *_AggregateConfiguration) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (percentDataBad) percentDataBad := uint8(m.GetPercentDataBad()) - _percentDataBadErr := writeBuffer.WriteUint8("percentDataBad", 8, (percentDataBad)) + _percentDataBadErr := writeBuffer.WriteUint8("percentDataBad", 8, uint8((percentDataBad))) if _percentDataBadErr != nil { return errors.Wrap(_percentDataBadErr, "Error serializing 'percentDataBad' field") } // Simple Field (percentDataGood) percentDataGood := uint8(m.GetPercentDataGood()) - _percentDataGoodErr := writeBuffer.WriteUint8("percentDataGood", 8, (percentDataGood)) + _percentDataGoodErr := writeBuffer.WriteUint8("percentDataGood", 8, uint8((percentDataGood))) if _percentDataGoodErr != nil { return errors.Wrap(_percentDataGoodErr, "Error serializing 'percentDataGood' field") } @@ -352,7 +352,7 @@ func (m *_AggregateConfiguration) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AlarmMask.go b/plc4go/protocols/opcua/readwrite/model/AlarmMask.go index 7c7f80cac91..77fd380571a 100644 --- a/plc4go/protocols/opcua/readwrite/model/AlarmMask.go +++ b/plc4go/protocols/opcua/readwrite/model/AlarmMask.go @@ -144,7 +144,7 @@ func (e AlarmMask) Serialize() ([]byte, error) { func (e AlarmMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("AlarmMask", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("AlarmMask", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/AliasNameDataType.go b/plc4go/protocols/opcua/readwrite/model/AliasNameDataType.go index 4acbf01b5d7..69b057f917e 100644 --- a/plc4go/protocols/opcua/readwrite/model/AliasNameDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/AliasNameDataType.go @@ -262,7 +262,7 @@ func (m *_AliasNameDataType) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfReferencedNodes) noOfReferencedNodes := int32(m.GetNoOfReferencedNodes()) - _noOfReferencedNodesErr := writeBuffer.WriteInt32("noOfReferencedNodes", 32, (noOfReferencedNodes)) + _noOfReferencedNodesErr := writeBuffer.WriteInt32("noOfReferencedNodes", 32, int32((noOfReferencedNodes))) if _noOfReferencedNodesErr != nil { return errors.Wrap(_noOfReferencedNodesErr, "Error serializing 'noOfReferencedNodes' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/Annotation.go b/plc4go/protocols/opcua/readwrite/model/Annotation.go index 8242f86731b..f182b579335 100644 --- a/plc4go/protocols/opcua/readwrite/model/Annotation.go +++ b/plc4go/protocols/opcua/readwrite/model/Annotation.go @@ -253,7 +253,7 @@ func (m *_Annotation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (annotationTime) annotationTime := int64(m.GetAnnotationTime()) - _annotationTimeErr := writeBuffer.WriteInt64("annotationTime", 64, (annotationTime)) + _annotationTimeErr := writeBuffer.WriteInt64("annotationTime", 64, int64((annotationTime))) if _annotationTimeErr != nil { return errors.Wrap(_annotationTimeErr, "Error serializing 'annotationTime' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ApplicationDescription.go b/plc4go/protocols/opcua/readwrite/model/ApplicationDescription.go index e19d6297ea8..ec58d896a3f 100644 --- a/plc4go/protocols/opcua/readwrite/model/ApplicationDescription.go +++ b/plc4go/protocols/opcua/readwrite/model/ApplicationDescription.go @@ -447,7 +447,7 @@ func (m *_ApplicationDescription) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfDiscoveryUrls) noOfDiscoveryUrls := int32(m.GetNoOfDiscoveryUrls()) - _noOfDiscoveryUrlsErr := writeBuffer.WriteInt32("noOfDiscoveryUrls", 32, (noOfDiscoveryUrls)) + _noOfDiscoveryUrlsErr := writeBuffer.WriteInt32("noOfDiscoveryUrls", 32, int32((noOfDiscoveryUrls))) if _noOfDiscoveryUrlsErr != nil { return errors.Wrap(_noOfDiscoveryUrlsErr, "Error serializing 'noOfDiscoveryUrls' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ApplicationType.go b/plc4go/protocols/opcua/readwrite/model/ApplicationType.go index 9b4127fbe3b..f3660247cda 100644 --- a/plc4go/protocols/opcua/readwrite/model/ApplicationType.go +++ b/plc4go/protocols/opcua/readwrite/model/ApplicationType.go @@ -144,7 +144,7 @@ func (e ApplicationType) Serialize() ([]byte, error) { func (e ApplicationType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("ApplicationType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("ApplicationType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/Argument.go b/plc4go/protocols/opcua/readwrite/model/Argument.go index a368b19951a..b706c827080 100644 --- a/plc4go/protocols/opcua/readwrite/model/Argument.go +++ b/plc4go/protocols/opcua/readwrite/model/Argument.go @@ -338,14 +338,14 @@ func (m *_Argument) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut // Simple Field (valueRank) valueRank := int32(m.GetValueRank()) - _valueRankErr := writeBuffer.WriteInt32("valueRank", 32, (valueRank)) + _valueRankErr := writeBuffer.WriteInt32("valueRank", 32, int32((valueRank))) if _valueRankErr != nil { return errors.Wrap(_valueRankErr, "Error serializing 'valueRank' field") } // Simple Field (noOfArrayDimensions) noOfArrayDimensions := int32(m.GetNoOfArrayDimensions()) - _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, (noOfArrayDimensions)) + _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, int32((noOfArrayDimensions))) if _noOfArrayDimensionsErr != nil { return errors.Wrap(_noOfArrayDimensionsErr, "Error serializing 'noOfArrayDimensions' field") } @@ -356,7 +356,7 @@ func (m *_Argument) SerializeWithWriteBuffer(ctx context.Context, writeBuffer ut } for _curItem, _element := range m.GetArrayDimensions() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'arrayDimensions' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AttributeWriteMask.go b/plc4go/protocols/opcua/readwrite/model/AttributeWriteMask.go index 3318f379109..605b25958f3 100644 --- a/plc4go/protocols/opcua/readwrite/model/AttributeWriteMask.go +++ b/plc4go/protocols/opcua/readwrite/model/AttributeWriteMask.go @@ -282,7 +282,7 @@ func (e AttributeWriteMask) Serialize() ([]byte, error) { func (e AttributeWriteMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("AttributeWriteMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("AttributeWriteMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/AxisInformation.go b/plc4go/protocols/opcua/readwrite/model/AxisInformation.go index 382505b8313..930d65c1236 100644 --- a/plc4go/protocols/opcua/readwrite/model/AxisInformation.go +++ b/plc4go/protocols/opcua/readwrite/model/AxisInformation.go @@ -368,7 +368,7 @@ func (m *_AxisInformation) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (noOfAxisSteps) noOfAxisSteps := int32(m.GetNoOfAxisSteps()) - _noOfAxisStepsErr := writeBuffer.WriteInt32("noOfAxisSteps", 32, (noOfAxisSteps)) + _noOfAxisStepsErr := writeBuffer.WriteInt32("noOfAxisSteps", 32, int32((noOfAxisSteps))) if _noOfAxisStepsErr != nil { return errors.Wrap(_noOfAxisStepsErr, "Error serializing 'noOfAxisSteps' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/AxisScaleEnumeration.go b/plc4go/protocols/opcua/readwrite/model/AxisScaleEnumeration.go index 0bca8f18c7e..b34c33ece18 100644 --- a/plc4go/protocols/opcua/readwrite/model/AxisScaleEnumeration.go +++ b/plc4go/protocols/opcua/readwrite/model/AxisScaleEnumeration.go @@ -138,7 +138,7 @@ func (e AxisScaleEnumeration) Serialize() ([]byte, error) { func (e AxisScaleEnumeration) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("AxisScaleEnumeration", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("AxisScaleEnumeration", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/BrokerTransportQualityOfService.go b/plc4go/protocols/opcua/readwrite/model/BrokerTransportQualityOfService.go index 38bfa80bc96..d14af283c26 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrokerTransportQualityOfService.go +++ b/plc4go/protocols/opcua/readwrite/model/BrokerTransportQualityOfService.go @@ -150,7 +150,7 @@ func (e BrokerTransportQualityOfService) Serialize() ([]byte, error) { func (e BrokerTransportQualityOfService) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("BrokerTransportQualityOfService", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("BrokerTransportQualityOfService", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseDescription.go b/plc4go/protocols/opcua/readwrite/model/BrowseDescription.go index 5cb23430820..164f8589948 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseDescription.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseDescription.go @@ -359,7 +359,7 @@ func (m *_BrowseDescription) SerializeWithWriteBuffer(ctx context.Context, write }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -374,14 +374,14 @@ func (m *_BrowseDescription) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (nodeClassMask) nodeClassMask := uint32(m.GetNodeClassMask()) - _nodeClassMaskErr := writeBuffer.WriteUint32("nodeClassMask", 32, (nodeClassMask)) + _nodeClassMaskErr := writeBuffer.WriteUint32("nodeClassMask", 32, uint32((nodeClassMask))) if _nodeClassMaskErr != nil { return errors.Wrap(_nodeClassMaskErr, "Error serializing 'nodeClassMask' field") } // Simple Field (resultMask) resultMask := uint32(m.GetResultMask()) - _resultMaskErr := writeBuffer.WriteUint32("resultMask", 32, (resultMask)) + _resultMaskErr := writeBuffer.WriteUint32("resultMask", 32, uint32((resultMask))) if _resultMaskErr != nil { return errors.Wrap(_resultMaskErr, "Error serializing 'resultMask' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseDirection.go b/plc4go/protocols/opcua/readwrite/model/BrowseDirection.go index bb1c97cc50e..14debcb5d0b 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseDirection.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseDirection.go @@ -144,7 +144,7 @@ func (e BrowseDirection) Serialize() ([]byte, error) { func (e BrowseDirection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("BrowseDirection", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("BrowseDirection", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseNextRequest.go b/plc4go/protocols/opcua/readwrite/model/BrowseNextRequest.go index eaca088b599..d5865c2ef95 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseNextRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseNextRequest.go @@ -312,7 +312,7 @@ func (m *_BrowseNextRequest) SerializeWithWriteBuffer(ctx context.Context, write }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -327,7 +327,7 @@ func (m *_BrowseNextRequest) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfContinuationPoints) noOfContinuationPoints := int32(m.GetNoOfContinuationPoints()) - _noOfContinuationPointsErr := writeBuffer.WriteInt32("noOfContinuationPoints", 32, (noOfContinuationPoints)) + _noOfContinuationPointsErr := writeBuffer.WriteInt32("noOfContinuationPoints", 32, int32((noOfContinuationPoints))) if _noOfContinuationPointsErr != nil { return errors.Wrap(_noOfContinuationPointsErr, "Error serializing 'noOfContinuationPoints' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseNextResponse.go b/plc4go/protocols/opcua/readwrite/model/BrowseNextResponse.go index 325cb644d93..8dade5ddd90 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseNextResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseNextResponse.go @@ -327,7 +327,7 @@ func (m *_BrowseNextResponse) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_BrowseNextResponse) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowsePathResult.go b/plc4go/protocols/opcua/readwrite/model/BrowsePathResult.go index 695fca7782b..53bd43802ab 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowsePathResult.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowsePathResult.go @@ -262,7 +262,7 @@ func (m *_BrowsePathResult) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfTargets) noOfTargets := int32(m.GetNoOfTargets()) - _noOfTargetsErr := writeBuffer.WriteInt32("noOfTargets", 32, (noOfTargets)) + _noOfTargetsErr := writeBuffer.WriteInt32("noOfTargets", 32, int32((noOfTargets))) if _noOfTargetsErr != nil { return errors.Wrap(_noOfTargetsErr, "Error serializing 'noOfTargets' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowsePathTarget.go b/plc4go/protocols/opcua/readwrite/model/BrowsePathTarget.go index d092bb33e05..c7ecf81cd48 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowsePathTarget.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowsePathTarget.go @@ -216,7 +216,7 @@ func (m *_BrowsePathTarget) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (remainingPathIndex) remainingPathIndex := uint32(m.GetRemainingPathIndex()) - _remainingPathIndexErr := writeBuffer.WriteUint32("remainingPathIndex", 32, (remainingPathIndex)) + _remainingPathIndexErr := writeBuffer.WriteUint32("remainingPathIndex", 32, uint32((remainingPathIndex))) if _remainingPathIndexErr != nil { return errors.Wrap(_remainingPathIndexErr, "Error serializing 'remainingPathIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseRequest.go b/plc4go/protocols/opcua/readwrite/model/BrowseRequest.go index 2b3e2aa49e2..4e7cb4f84fe 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseRequest.go @@ -318,14 +318,14 @@ func (m *_BrowseRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (requestedMaxReferencesPerNode) requestedMaxReferencesPerNode := uint32(m.GetRequestedMaxReferencesPerNode()) - _requestedMaxReferencesPerNodeErr := writeBuffer.WriteUint32("requestedMaxReferencesPerNode", 32, (requestedMaxReferencesPerNode)) + _requestedMaxReferencesPerNodeErr := writeBuffer.WriteUint32("requestedMaxReferencesPerNode", 32, uint32((requestedMaxReferencesPerNode))) if _requestedMaxReferencesPerNodeErr != nil { return errors.Wrap(_requestedMaxReferencesPerNodeErr, "Error serializing 'requestedMaxReferencesPerNode' field") } // Simple Field (noOfNodesToBrowse) noOfNodesToBrowse := int32(m.GetNoOfNodesToBrowse()) - _noOfNodesToBrowseErr := writeBuffer.WriteInt32("noOfNodesToBrowse", 32, (noOfNodesToBrowse)) + _noOfNodesToBrowseErr := writeBuffer.WriteInt32("noOfNodesToBrowse", 32, int32((noOfNodesToBrowse))) if _noOfNodesToBrowseErr != nil { return errors.Wrap(_noOfNodesToBrowseErr, "Error serializing 'noOfNodesToBrowse' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseResponse.go b/plc4go/protocols/opcua/readwrite/model/BrowseResponse.go index 409911fa94f..c05ece94aa9 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseResponse.go @@ -327,7 +327,7 @@ func (m *_BrowseResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_BrowseResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseResult.go b/plc4go/protocols/opcua/readwrite/model/BrowseResult.go index b50cf010218..64bca8fd8ce 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseResult.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseResult.go @@ -299,7 +299,7 @@ func (m *_BrowseResult) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfReferences) noOfReferences := int32(m.GetNoOfReferences()) - _noOfReferencesErr := writeBuffer.WriteInt32("noOfReferences", 32, (noOfReferences)) + _noOfReferencesErr := writeBuffer.WriteInt32("noOfReferences", 32, int32((noOfReferences))) if _noOfReferencesErr != nil { return errors.Wrap(_noOfReferencesErr, "Error serializing 'noOfReferences' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/BrowseResultMask.go b/plc4go/protocols/opcua/readwrite/model/BrowseResultMask.go index 77a7af74ad0..22850f732d3 100644 --- a/plc4go/protocols/opcua/readwrite/model/BrowseResultMask.go +++ b/plc4go/protocols/opcua/readwrite/model/BrowseResultMask.go @@ -180,7 +180,7 @@ func (e BrowseResultMask) Serialize() ([]byte, error) { func (e BrowseResultMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("BrowseResultMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("BrowseResultMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/BuildInfo.go b/plc4go/protocols/opcua/readwrite/model/BuildInfo.go index 08fe49726da..b59bd6493cd 100644 --- a/plc4go/protocols/opcua/readwrite/model/BuildInfo.go +++ b/plc4go/protocols/opcua/readwrite/model/BuildInfo.go @@ -364,7 +364,7 @@ func (m *_BuildInfo) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u // Simple Field (buildDate) buildDate := int64(m.GetBuildDate()) - _buildDateErr := writeBuffer.WriteInt64("buildDate", 64, (buildDate)) + _buildDateErr := writeBuffer.WriteInt64("buildDate", 64, int64((buildDate))) if _buildDateErr != nil { return errors.Wrap(_buildDateErr, "Error serializing 'buildDate' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ByteStringArray.go b/plc4go/protocols/opcua/readwrite/model/ByteStringArray.go index 9ab27115a78..37a4daad2d7 100644 --- a/plc4go/protocols/opcua/readwrite/model/ByteStringArray.go +++ b/plc4go/protocols/opcua/readwrite/model/ByteStringArray.go @@ -188,7 +188,7 @@ func (m *_ByteStringArray) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (arrayLength) arrayLength := int32(m.GetArrayLength()) - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, (arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32((arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -199,7 +199,7 @@ func (m *_ByteStringArray) SerializeWithWriteBuffer(ctx context.Context, writeBu } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ByteStringNodeId.go b/plc4go/protocols/opcua/readwrite/model/ByteStringNodeId.go index 55d4cc5bbe6..86b4e6df74c 100644 --- a/plc4go/protocols/opcua/readwrite/model/ByteStringNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/ByteStringNodeId.go @@ -172,7 +172,7 @@ func (m *_ByteStringNodeId) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CallMethodRequest.go b/plc4go/protocols/opcua/readwrite/model/CallMethodRequest.go index 7f3092e6b76..4869d94772f 100644 --- a/plc4go/protocols/opcua/readwrite/model/CallMethodRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/CallMethodRequest.go @@ -299,7 +299,7 @@ func (m *_CallMethodRequest) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfInputArguments) noOfInputArguments := int32(m.GetNoOfInputArguments()) - _noOfInputArgumentsErr := writeBuffer.WriteInt32("noOfInputArguments", 32, (noOfInputArguments)) + _noOfInputArgumentsErr := writeBuffer.WriteInt32("noOfInputArguments", 32, int32((noOfInputArguments))) if _noOfInputArgumentsErr != nil { return errors.Wrap(_noOfInputArgumentsErr, "Error serializing 'noOfInputArguments' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CallMethodResult.go b/plc4go/protocols/opcua/readwrite/model/CallMethodResult.go index 3a067cdfad8..4754a8d1dc8 100644 --- a/plc4go/protocols/opcua/readwrite/model/CallMethodResult.go +++ b/plc4go/protocols/opcua/readwrite/model/CallMethodResult.go @@ -392,7 +392,7 @@ func (m *_CallMethodResult) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfInputArgumentResults) noOfInputArgumentResults := int32(m.GetNoOfInputArgumentResults()) - _noOfInputArgumentResultsErr := writeBuffer.WriteInt32("noOfInputArgumentResults", 32, (noOfInputArgumentResults)) + _noOfInputArgumentResultsErr := writeBuffer.WriteInt32("noOfInputArgumentResults", 32, int32((noOfInputArgumentResults))) if _noOfInputArgumentResultsErr != nil { return errors.Wrap(_noOfInputArgumentResultsErr, "Error serializing 'noOfInputArgumentResults' field") } @@ -416,7 +416,7 @@ func (m *_CallMethodResult) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfInputArgumentDiagnosticInfos) noOfInputArgumentDiagnosticInfos := int32(m.GetNoOfInputArgumentDiagnosticInfos()) - _noOfInputArgumentDiagnosticInfosErr := writeBuffer.WriteInt32("noOfInputArgumentDiagnosticInfos", 32, (noOfInputArgumentDiagnosticInfos)) + _noOfInputArgumentDiagnosticInfosErr := writeBuffer.WriteInt32("noOfInputArgumentDiagnosticInfos", 32, int32((noOfInputArgumentDiagnosticInfos))) if _noOfInputArgumentDiagnosticInfosErr != nil { return errors.Wrap(_noOfInputArgumentDiagnosticInfosErr, "Error serializing 'noOfInputArgumentDiagnosticInfos' field") } @@ -440,7 +440,7 @@ func (m *_CallMethodResult) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfOutputArguments) noOfOutputArguments := int32(m.GetNoOfOutputArguments()) - _noOfOutputArgumentsErr := writeBuffer.WriteInt32("noOfOutputArguments", 32, (noOfOutputArguments)) + _noOfOutputArgumentsErr := writeBuffer.WriteInt32("noOfOutputArguments", 32, int32((noOfOutputArguments))) if _noOfOutputArgumentsErr != nil { return errors.Wrap(_noOfOutputArgumentsErr, "Error serializing 'noOfOutputArguments' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CallRequest.go b/plc4go/protocols/opcua/readwrite/model/CallRequest.go index 27a13500b54..3934dfad124 100644 --- a/plc4go/protocols/opcua/readwrite/model/CallRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/CallRequest.go @@ -262,7 +262,7 @@ func (m *_CallRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (noOfMethodsToCall) noOfMethodsToCall := int32(m.GetNoOfMethodsToCall()) - _noOfMethodsToCallErr := writeBuffer.WriteInt32("noOfMethodsToCall", 32, (noOfMethodsToCall)) + _noOfMethodsToCallErr := writeBuffer.WriteInt32("noOfMethodsToCall", 32, int32((noOfMethodsToCall))) if _noOfMethodsToCallErr != nil { return errors.Wrap(_noOfMethodsToCallErr, "Error serializing 'noOfMethodsToCall' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CallResponse.go b/plc4go/protocols/opcua/readwrite/model/CallResponse.go index edeac78625a..15cc0d4001c 100644 --- a/plc4go/protocols/opcua/readwrite/model/CallResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/CallResponse.go @@ -327,7 +327,7 @@ func (m *_CallResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_CallResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CancelRequest.go b/plc4go/protocols/opcua/readwrite/model/CancelRequest.go index 38da43c4937..e061048410d 100644 --- a/plc4go/protocols/opcua/readwrite/model/CancelRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/CancelRequest.go @@ -216,7 +216,7 @@ func (m *_CancelRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (requestHandle) requestHandle := uint32(m.GetRequestHandle()) - _requestHandleErr := writeBuffer.WriteUint32("requestHandle", 32, (requestHandle)) + _requestHandleErr := writeBuffer.WriteUint32("requestHandle", 32, uint32((requestHandle))) if _requestHandleErr != nil { return errors.Wrap(_requestHandleErr, "Error serializing 'requestHandle' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CancelResponse.go b/plc4go/protocols/opcua/readwrite/model/CancelResponse.go index 48b29686312..cf06c66cd08 100644 --- a/plc4go/protocols/opcua/readwrite/model/CancelResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/CancelResponse.go @@ -216,7 +216,7 @@ func (m *_CancelResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (cancelCount) cancelCount := uint32(m.GetCancelCount()) - _cancelCountErr := writeBuffer.WriteUint32("cancelCount", 32, (cancelCount)) + _cancelCountErr := writeBuffer.WriteUint32("cancelCount", 32, uint32((cancelCount))) if _cancelCountErr != nil { return errors.Wrap(_cancelCountErr, "Error serializing 'cancelCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ChannelSecurityToken.go b/plc4go/protocols/opcua/readwrite/model/ChannelSecurityToken.go index 83233a2de57..5724ff86741 100644 --- a/plc4go/protocols/opcua/readwrite/model/ChannelSecurityToken.go +++ b/plc4go/protocols/opcua/readwrite/model/ChannelSecurityToken.go @@ -236,28 +236,28 @@ func (m *_ChannelSecurityToken) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (channelId) channelId := uint32(m.GetChannelId()) - _channelIdErr := writeBuffer.WriteUint32("channelId", 32, (channelId)) + _channelIdErr := writeBuffer.WriteUint32("channelId", 32, uint32((channelId))) if _channelIdErr != nil { return errors.Wrap(_channelIdErr, "Error serializing 'channelId' field") } // Simple Field (tokenId) tokenId := uint32(m.GetTokenId()) - _tokenIdErr := writeBuffer.WriteUint32("tokenId", 32, (tokenId)) + _tokenIdErr := writeBuffer.WriteUint32("tokenId", 32, uint32((tokenId))) if _tokenIdErr != nil { return errors.Wrap(_tokenIdErr, "Error serializing 'tokenId' field") } // Simple Field (createdAt) createdAt := int64(m.GetCreatedAt()) - _createdAtErr := writeBuffer.WriteInt64("createdAt", 64, (createdAt)) + _createdAtErr := writeBuffer.WriteInt64("createdAt", 64, int64((createdAt))) if _createdAtErr != nil { return errors.Wrap(_createdAtErr, "Error serializing 'createdAt' field") } // Simple Field (revisedLifetime) revisedLifetime := uint32(m.GetRevisedLifetime()) - _revisedLifetimeErr := writeBuffer.WriteUint32("revisedLifetime", 32, (revisedLifetime)) + _revisedLifetimeErr := writeBuffer.WriteUint32("revisedLifetime", 32, uint32((revisedLifetime))) if _revisedLifetimeErr != nil { return errors.Wrap(_revisedLifetimeErr, "Error serializing 'revisedLifetime' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CloseSessionRequest.go b/plc4go/protocols/opcua/readwrite/model/CloseSessionRequest.go index c0107f7fe48..c3c24c88f54 100644 --- a/plc4go/protocols/opcua/readwrite/model/CloseSessionRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/CloseSessionRequest.go @@ -247,7 +247,7 @@ func (m *_CloseSessionRequest) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ConfigurationVersionDataType.go b/plc4go/protocols/opcua/readwrite/model/ConfigurationVersionDataType.go index 79f11b37735..6c6fe992e47 100644 --- a/plc4go/protocols/opcua/readwrite/model/ConfigurationVersionDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ConfigurationVersionDataType.go @@ -198,14 +198,14 @@ func (m *_ConfigurationVersionDataType) SerializeWithWriteBuffer(ctx context.Con // Simple Field (majorVersion) majorVersion := uint32(m.GetMajorVersion()) - _majorVersionErr := writeBuffer.WriteUint32("majorVersion", 32, (majorVersion)) + _majorVersionErr := writeBuffer.WriteUint32("majorVersion", 32, uint32((majorVersion))) if _majorVersionErr != nil { return errors.Wrap(_majorVersionErr, "Error serializing 'majorVersion' field") } // Simple Field (minorVersion) minorVersion := uint32(m.GetMinorVersion()) - _minorVersionErr := writeBuffer.WriteUint32("minorVersion", 32, (minorVersion)) + _minorVersionErr := writeBuffer.WriteUint32("minorVersion", 32, uint32((minorVersion))) if _minorVersionErr != nil { return errors.Wrap(_minorVersionErr, "Error serializing 'minorVersion' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ContentFilter.go b/plc4go/protocols/opcua/readwrite/model/ContentFilter.go index 4bc69f3b9c5..b083d70a0b7 100644 --- a/plc4go/protocols/opcua/readwrite/model/ContentFilter.go +++ b/plc4go/protocols/opcua/readwrite/model/ContentFilter.go @@ -225,7 +225,7 @@ func (m *_ContentFilter) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (noOfElements) noOfElements := int32(m.GetNoOfElements()) - _noOfElementsErr := writeBuffer.WriteInt32("noOfElements", 32, (noOfElements)) + _noOfElementsErr := writeBuffer.WriteInt32("noOfElements", 32, int32((noOfElements))) if _noOfElementsErr != nil { return errors.Wrap(_noOfElementsErr, "Error serializing 'noOfElements' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ContentFilterElement.go b/plc4go/protocols/opcua/readwrite/model/ContentFilterElement.go index 4f0086e2db9..5a1a67a0caf 100644 --- a/plc4go/protocols/opcua/readwrite/model/ContentFilterElement.go +++ b/plc4go/protocols/opcua/readwrite/model/ContentFilterElement.go @@ -262,7 +262,7 @@ func (m *_ContentFilterElement) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfFilterOperands) noOfFilterOperands := int32(m.GetNoOfFilterOperands()) - _noOfFilterOperandsErr := writeBuffer.WriteInt32("noOfFilterOperands", 32, (noOfFilterOperands)) + _noOfFilterOperandsErr := writeBuffer.WriteInt32("noOfFilterOperands", 32, int32((noOfFilterOperands))) if _noOfFilterOperandsErr != nil { return errors.Wrap(_noOfFilterOperandsErr, "Error serializing 'noOfFilterOperands' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ContentFilterElementResult.go b/plc4go/protocols/opcua/readwrite/model/ContentFilterElementResult.go index 3c1afbd75b4..1d5ed9a8c29 100644 --- a/plc4go/protocols/opcua/readwrite/model/ContentFilterElementResult.go +++ b/plc4go/protocols/opcua/readwrite/model/ContentFilterElementResult.go @@ -327,7 +327,7 @@ func (m *_ContentFilterElementResult) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfOperandStatusCodes) noOfOperandStatusCodes := int32(m.GetNoOfOperandStatusCodes()) - _noOfOperandStatusCodesErr := writeBuffer.WriteInt32("noOfOperandStatusCodes", 32, (noOfOperandStatusCodes)) + _noOfOperandStatusCodesErr := writeBuffer.WriteInt32("noOfOperandStatusCodes", 32, int32((noOfOperandStatusCodes))) if _noOfOperandStatusCodesErr != nil { return errors.Wrap(_noOfOperandStatusCodesErr, "Error serializing 'noOfOperandStatusCodes' field") } @@ -351,7 +351,7 @@ func (m *_ContentFilterElementResult) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfOperandDiagnosticInfos) noOfOperandDiagnosticInfos := int32(m.GetNoOfOperandDiagnosticInfos()) - _noOfOperandDiagnosticInfosErr := writeBuffer.WriteInt32("noOfOperandDiagnosticInfos", 32, (noOfOperandDiagnosticInfos)) + _noOfOperandDiagnosticInfosErr := writeBuffer.WriteInt32("noOfOperandDiagnosticInfos", 32, int32((noOfOperandDiagnosticInfos))) if _noOfOperandDiagnosticInfosErr != nil { return errors.Wrap(_noOfOperandDiagnosticInfosErr, "Error serializing 'noOfOperandDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ContentFilterResult.go b/plc4go/protocols/opcua/readwrite/model/ContentFilterResult.go index fb2b9517ad9..cf62555b249 100644 --- a/plc4go/protocols/opcua/readwrite/model/ContentFilterResult.go +++ b/plc4go/protocols/opcua/readwrite/model/ContentFilterResult.go @@ -290,7 +290,7 @@ func (m *_ContentFilterResult) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfElementResults) noOfElementResults := int32(m.GetNoOfElementResults()) - _noOfElementResultsErr := writeBuffer.WriteInt32("noOfElementResults", 32, (noOfElementResults)) + _noOfElementResultsErr := writeBuffer.WriteInt32("noOfElementResults", 32, int32((noOfElementResults))) if _noOfElementResultsErr != nil { return errors.Wrap(_noOfElementResultsErr, "Error serializing 'noOfElementResults' field") } @@ -314,7 +314,7 @@ func (m *_ContentFilterResult) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfElementDiagnosticInfos) noOfElementDiagnosticInfos := int32(m.GetNoOfElementDiagnosticInfos()) - _noOfElementDiagnosticInfosErr := writeBuffer.WriteInt32("noOfElementDiagnosticInfos", 32, (noOfElementDiagnosticInfos)) + _noOfElementDiagnosticInfosErr := writeBuffer.WriteInt32("noOfElementDiagnosticInfos", 32, int32((noOfElementDiagnosticInfos))) if _noOfElementDiagnosticInfosErr != nil { return errors.Wrap(_noOfElementDiagnosticInfosErr, "Error serializing 'noOfElementDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsRequest.go b/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsRequest.go index d7c47562fde..e507a028158 100644 --- a/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsRequest.go @@ -306,7 +306,7 @@ func (m *_CreateMonitoredItemsRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } @@ -325,7 +325,7 @@ func (m *_CreateMonitoredItemsRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfItemsToCreate) noOfItemsToCreate := int32(m.GetNoOfItemsToCreate()) - _noOfItemsToCreateErr := writeBuffer.WriteInt32("noOfItemsToCreate", 32, (noOfItemsToCreate)) + _noOfItemsToCreateErr := writeBuffer.WriteInt32("noOfItemsToCreate", 32, int32((noOfItemsToCreate))) if _noOfItemsToCreateErr != nil { return errors.Wrap(_noOfItemsToCreateErr, "Error serializing 'noOfItemsToCreate' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsResponse.go b/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsResponse.go index 2ce76ee6729..c9ededd42d7 100644 --- a/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/CreateMonitoredItemsResponse.go @@ -327,7 +327,7 @@ func (m *_CreateMonitoredItemsResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_CreateMonitoredItemsResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CreateSessionRequest.go b/plc4go/protocols/opcua/readwrite/model/CreateSessionRequest.go index 339c90b6778..f9dd55e14cb 100644 --- a/plc4go/protocols/opcua/readwrite/model/CreateSessionRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/CreateSessionRequest.go @@ -464,7 +464,7 @@ func (m *_CreateSessionRequest) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (maxResponseMessageSize) maxResponseMessageSize := uint32(m.GetMaxResponseMessageSize()) - _maxResponseMessageSizeErr := writeBuffer.WriteUint32("maxResponseMessageSize", 32, (maxResponseMessageSize)) + _maxResponseMessageSizeErr := writeBuffer.WriteUint32("maxResponseMessageSize", 32, uint32((maxResponseMessageSize))) if _maxResponseMessageSizeErr != nil { return errors.Wrap(_maxResponseMessageSizeErr, "Error serializing 'maxResponseMessageSize' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CreateSessionResponse.go b/plc4go/protocols/opcua/readwrite/model/CreateSessionResponse.go index 2a8660c347e..93fcdf88f1f 100644 --- a/plc4go/protocols/opcua/readwrite/model/CreateSessionResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/CreateSessionResponse.go @@ -545,7 +545,7 @@ func (m *_CreateSessionResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfServerEndpoints) noOfServerEndpoints := int32(m.GetNoOfServerEndpoints()) - _noOfServerEndpointsErr := writeBuffer.WriteInt32("noOfServerEndpoints", 32, (noOfServerEndpoints)) + _noOfServerEndpointsErr := writeBuffer.WriteInt32("noOfServerEndpoints", 32, int32((noOfServerEndpoints))) if _noOfServerEndpointsErr != nil { return errors.Wrap(_noOfServerEndpointsErr, "Error serializing 'noOfServerEndpoints' field") } @@ -569,7 +569,7 @@ func (m *_CreateSessionResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfServerSoftwareCertificates) noOfServerSoftwareCertificates := int32(m.GetNoOfServerSoftwareCertificates()) - _noOfServerSoftwareCertificatesErr := writeBuffer.WriteInt32("noOfServerSoftwareCertificates", 32, (noOfServerSoftwareCertificates)) + _noOfServerSoftwareCertificatesErr := writeBuffer.WriteInt32("noOfServerSoftwareCertificates", 32, int32((noOfServerSoftwareCertificates))) if _noOfServerSoftwareCertificatesErr != nil { return errors.Wrap(_noOfServerSoftwareCertificatesErr, "Error serializing 'noOfServerSoftwareCertificates' field") } @@ -605,7 +605,7 @@ func (m *_CreateSessionResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (maxRequestMessageSize) maxRequestMessageSize := uint32(m.GetMaxRequestMessageSize()) - _maxRequestMessageSizeErr := writeBuffer.WriteUint32("maxRequestMessageSize", 32, (maxRequestMessageSize)) + _maxRequestMessageSizeErr := writeBuffer.WriteUint32("maxRequestMessageSize", 32, uint32((maxRequestMessageSize))) if _maxRequestMessageSizeErr != nil { return errors.Wrap(_maxRequestMessageSizeErr, "Error serializing 'maxRequestMessageSize' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionRequest.go b/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionRequest.go index 116e0ea4b3a..824680960af 100644 --- a/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionRequest.go @@ -341,21 +341,21 @@ func (m *_CreateSubscriptionRequest) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (requestedLifetimeCount) requestedLifetimeCount := uint32(m.GetRequestedLifetimeCount()) - _requestedLifetimeCountErr := writeBuffer.WriteUint32("requestedLifetimeCount", 32, (requestedLifetimeCount)) + _requestedLifetimeCountErr := writeBuffer.WriteUint32("requestedLifetimeCount", 32, uint32((requestedLifetimeCount))) if _requestedLifetimeCountErr != nil { return errors.Wrap(_requestedLifetimeCountErr, "Error serializing 'requestedLifetimeCount' field") } // Simple Field (requestedMaxKeepAliveCount) requestedMaxKeepAliveCount := uint32(m.GetRequestedMaxKeepAliveCount()) - _requestedMaxKeepAliveCountErr := writeBuffer.WriteUint32("requestedMaxKeepAliveCount", 32, (requestedMaxKeepAliveCount)) + _requestedMaxKeepAliveCountErr := writeBuffer.WriteUint32("requestedMaxKeepAliveCount", 32, uint32((requestedMaxKeepAliveCount))) if _requestedMaxKeepAliveCountErr != nil { return errors.Wrap(_requestedMaxKeepAliveCountErr, "Error serializing 'requestedMaxKeepAliveCount' field") } // Simple Field (maxNotificationsPerPublish) maxNotificationsPerPublish := uint32(m.GetMaxNotificationsPerPublish()) - _maxNotificationsPerPublishErr := writeBuffer.WriteUint32("maxNotificationsPerPublish", 32, (maxNotificationsPerPublish)) + _maxNotificationsPerPublishErr := writeBuffer.WriteUint32("maxNotificationsPerPublish", 32, uint32((maxNotificationsPerPublish))) if _maxNotificationsPerPublishErr != nil { return errors.Wrap(_maxNotificationsPerPublishErr, "Error serializing 'maxNotificationsPerPublish' field") } @@ -370,7 +370,7 @@ func (m *_CreateSubscriptionRequest) SerializeWithWriteBuffer(ctx context.Contex }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -385,7 +385,7 @@ func (m *_CreateSubscriptionRequest) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (priority) priority := uint8(m.GetPriority()) - _priorityErr := writeBuffer.WriteUint8("priority", 8, (priority)) + _priorityErr := writeBuffer.WriteUint8("priority", 8, uint8((priority))) if _priorityErr != nil { return errors.Wrap(_priorityErr, "Error serializing 'priority' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionResponse.go b/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionResponse.go index a527e5badd6..135fcf50500 100644 --- a/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/CreateSubscriptionResponse.go @@ -273,7 +273,7 @@ func (m *_CreateSubscriptionResponse) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } @@ -287,14 +287,14 @@ func (m *_CreateSubscriptionResponse) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (revisedLifetimeCount) revisedLifetimeCount := uint32(m.GetRevisedLifetimeCount()) - _revisedLifetimeCountErr := writeBuffer.WriteUint32("revisedLifetimeCount", 32, (revisedLifetimeCount)) + _revisedLifetimeCountErr := writeBuffer.WriteUint32("revisedLifetimeCount", 32, uint32((revisedLifetimeCount))) if _revisedLifetimeCountErr != nil { return errors.Wrap(_revisedLifetimeCountErr, "Error serializing 'revisedLifetimeCount' field") } // Simple Field (revisedMaxKeepAliveCount) revisedMaxKeepAliveCount := uint32(m.GetRevisedMaxKeepAliveCount()) - _revisedMaxKeepAliveCountErr := writeBuffer.WriteUint32("revisedMaxKeepAliveCount", 32, (revisedMaxKeepAliveCount)) + _revisedMaxKeepAliveCountErr := writeBuffer.WriteUint32("revisedMaxKeepAliveCount", 32, uint32((revisedMaxKeepAliveCount))) if _revisedMaxKeepAliveCountErr != nil { return errors.Wrap(_revisedMaxKeepAliveCountErr, "Error serializing 'revisedMaxKeepAliveCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/CurrencyUnitType.go b/plc4go/protocols/opcua/readwrite/model/CurrencyUnitType.go index f68a77deb85..1582d6c531f 100644 --- a/plc4go/protocols/opcua/readwrite/model/CurrencyUnitType.go +++ b/plc4go/protocols/opcua/readwrite/model/CurrencyUnitType.go @@ -248,14 +248,14 @@ func (m *_CurrencyUnitType) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (numericCode) numericCode := int16(m.GetNumericCode()) - _numericCodeErr := writeBuffer.WriteInt16("numericCode", 16, (numericCode)) + _numericCodeErr := writeBuffer.WriteInt16("numericCode", 16, int16((numericCode))) if _numericCodeErr != nil { return errors.Wrap(_numericCodeErr, "Error serializing 'numericCode' field") } // Simple Field (exponent) exponent := int8(m.GetExponent()) - _exponentErr := writeBuffer.WriteInt8("exponent", 8, (exponent)) + _exponentErr := writeBuffer.WriteInt8("exponent", 8, int8((exponent))) if _exponentErr != nil { return errors.Wrap(_exponentErr, "Error serializing 'exponent' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DataChangeNotification.go b/plc4go/protocols/opcua/readwrite/model/DataChangeNotification.go index 1d063a12c17..c718807334a 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataChangeNotification.go +++ b/plc4go/protocols/opcua/readwrite/model/DataChangeNotification.go @@ -300,14 +300,14 @@ func (m *_DataChangeNotification) SerializeWithWriteBuffer(ctx context.Context, // Implicit Field (notificationLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) notificationLength := int32(int32(m.GetLengthInBytes(ctx))) - _notificationLengthErr := writeBuffer.WriteInt32("notificationLength", 32, (notificationLength)) + _notificationLengthErr := writeBuffer.WriteInt32("notificationLength", 32, int32((notificationLength))) if _notificationLengthErr != nil { return errors.Wrap(_notificationLengthErr, "Error serializing 'notificationLength' field") } // Simple Field (noOfMonitoredItems) noOfMonitoredItems := int32(m.GetNoOfMonitoredItems()) - _noOfMonitoredItemsErr := writeBuffer.WriteInt32("noOfMonitoredItems", 32, (noOfMonitoredItems)) + _noOfMonitoredItemsErr := writeBuffer.WriteInt32("noOfMonitoredItems", 32, int32((noOfMonitoredItems))) if _noOfMonitoredItemsErr != nil { return errors.Wrap(_noOfMonitoredItemsErr, "Error serializing 'noOfMonitoredItems' field") } @@ -331,7 +331,7 @@ func (m *_DataChangeNotification) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DataChangeTrigger.go b/plc4go/protocols/opcua/readwrite/model/DataChangeTrigger.go index d54a756216c..d6d5ee7bb10 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataChangeTrigger.go +++ b/plc4go/protocols/opcua/readwrite/model/DataChangeTrigger.go @@ -138,7 +138,7 @@ func (e DataChangeTrigger) Serialize() ([]byte, error) { func (e DataChangeTrigger) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("DataChangeTrigger", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("DataChangeTrigger", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/DataSetFieldContentMask.go b/plc4go/protocols/opcua/readwrite/model/DataSetFieldContentMask.go index 6e5ca634b71..407cf840b32 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataSetFieldContentMask.go +++ b/plc4go/protocols/opcua/readwrite/model/DataSetFieldContentMask.go @@ -162,7 +162,7 @@ func (e DataSetFieldContentMask) Serialize() ([]byte, error) { func (e DataSetFieldContentMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("DataSetFieldContentMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("DataSetFieldContentMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/DataSetFieldFlags.go b/plc4go/protocols/opcua/readwrite/model/DataSetFieldFlags.go index 4100ed202ee..b51234df96a 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataSetFieldFlags.go +++ b/plc4go/protocols/opcua/readwrite/model/DataSetFieldFlags.go @@ -132,7 +132,7 @@ func (e DataSetFieldFlags) Serialize() ([]byte, error) { func (e DataSetFieldFlags) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint16("DataSetFieldFlags", 16, uint16(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint16("DataSetFieldFlags", 16, uint16(uint16(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/DataSetOrderingType.go b/plc4go/protocols/opcua/readwrite/model/DataSetOrderingType.go index 9917f8699bd..936a18ddff0 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataSetOrderingType.go +++ b/plc4go/protocols/opcua/readwrite/model/DataSetOrderingType.go @@ -138,7 +138,7 @@ func (e DataSetOrderingType) Serialize() ([]byte, error) { func (e DataSetOrderingType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("DataSetOrderingType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("DataSetOrderingType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/DataSetWriterDataType.go b/plc4go/protocols/opcua/readwrite/model/DataSetWriterDataType.go index 286d6211f09..2d387a5307c 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataSetWriterDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/DataSetWriterDataType.go @@ -450,7 +450,7 @@ func (m *_DataSetWriterDataType) SerializeWithWriteBuffer(ctx context.Context, w }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -465,7 +465,7 @@ func (m *_DataSetWriterDataType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (dataSetWriterId) dataSetWriterId := uint16(m.GetDataSetWriterId()) - _dataSetWriterIdErr := writeBuffer.WriteUint16("dataSetWriterId", 16, (dataSetWriterId)) + _dataSetWriterIdErr := writeBuffer.WriteUint16("dataSetWriterId", 16, uint16((dataSetWriterId))) if _dataSetWriterIdErr != nil { return errors.Wrap(_dataSetWriterIdErr, "Error serializing 'dataSetWriterId' field") } @@ -484,7 +484,7 @@ func (m *_DataSetWriterDataType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (keyFrameCount) keyFrameCount := uint32(m.GetKeyFrameCount()) - _keyFrameCountErr := writeBuffer.WriteUint32("keyFrameCount", 32, (keyFrameCount)) + _keyFrameCountErr := writeBuffer.WriteUint32("keyFrameCount", 32, uint32((keyFrameCount))) if _keyFrameCountErr != nil { return errors.Wrap(_keyFrameCountErr, "Error serializing 'keyFrameCount' field") } @@ -503,7 +503,7 @@ func (m *_DataSetWriterDataType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfDataSetWriterProperties) noOfDataSetWriterProperties := int32(m.GetNoOfDataSetWriterProperties()) - _noOfDataSetWriterPropertiesErr := writeBuffer.WriteInt32("noOfDataSetWriterProperties", 32, (noOfDataSetWriterProperties)) + _noOfDataSetWriterPropertiesErr := writeBuffer.WriteInt32("noOfDataSetWriterProperties", 32, int32((noOfDataSetWriterProperties))) if _noOfDataSetWriterPropertiesErr != nil { return errors.Wrap(_noOfDataSetWriterPropertiesErr, "Error serializing 'noOfDataSetWriterProperties' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DataTypeSchemaHeader.go b/plc4go/protocols/opcua/readwrite/model/DataTypeSchemaHeader.go index 0dd50124707..0579486e355 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataTypeSchemaHeader.go +++ b/plc4go/protocols/opcua/readwrite/model/DataTypeSchemaHeader.go @@ -420,7 +420,7 @@ func (m *_DataTypeSchemaHeader) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfNamespaces) noOfNamespaces := int32(m.GetNoOfNamespaces()) - _noOfNamespacesErr := writeBuffer.WriteInt32("noOfNamespaces", 32, (noOfNamespaces)) + _noOfNamespacesErr := writeBuffer.WriteInt32("noOfNamespaces", 32, int32((noOfNamespaces))) if _noOfNamespacesErr != nil { return errors.Wrap(_noOfNamespacesErr, "Error serializing 'noOfNamespaces' field") } @@ -444,7 +444,7 @@ func (m *_DataTypeSchemaHeader) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfStructureDataTypes) noOfStructureDataTypes := int32(m.GetNoOfStructureDataTypes()) - _noOfStructureDataTypesErr := writeBuffer.WriteInt32("noOfStructureDataTypes", 32, (noOfStructureDataTypes)) + _noOfStructureDataTypesErr := writeBuffer.WriteInt32("noOfStructureDataTypes", 32, int32((noOfStructureDataTypes))) if _noOfStructureDataTypesErr != nil { return errors.Wrap(_noOfStructureDataTypesErr, "Error serializing 'noOfStructureDataTypes' field") } @@ -468,7 +468,7 @@ func (m *_DataTypeSchemaHeader) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfEnumDataTypes) noOfEnumDataTypes := int32(m.GetNoOfEnumDataTypes()) - _noOfEnumDataTypesErr := writeBuffer.WriteInt32("noOfEnumDataTypes", 32, (noOfEnumDataTypes)) + _noOfEnumDataTypesErr := writeBuffer.WriteInt32("noOfEnumDataTypes", 32, int32((noOfEnumDataTypes))) if _noOfEnumDataTypesErr != nil { return errors.Wrap(_noOfEnumDataTypesErr, "Error serializing 'noOfEnumDataTypes' field") } @@ -492,7 +492,7 @@ func (m *_DataTypeSchemaHeader) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfSimpleDataTypes) noOfSimpleDataTypes := int32(m.GetNoOfSimpleDataTypes()) - _noOfSimpleDataTypesErr := writeBuffer.WriteInt32("noOfSimpleDataTypes", 32, (noOfSimpleDataTypes)) + _noOfSimpleDataTypesErr := writeBuffer.WriteInt32("noOfSimpleDataTypes", 32, int32((noOfSimpleDataTypes))) if _noOfSimpleDataTypesErr != nil { return errors.Wrap(_noOfSimpleDataTypesErr, "Error serializing 'noOfSimpleDataTypes' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DataValue.go b/plc4go/protocols/opcua/readwrite/model/DataValue.go index 708b7aa2c17..4e29384d0af 100644 --- a/plc4go/protocols/opcua/readwrite/model/DataValue.go +++ b/plc4go/protocols/opcua/readwrite/model/DataValue.go @@ -432,7 +432,7 @@ func (m *_DataValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 2, reserved) + _err := writeBuffer.WriteUint8("reserved", 2, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -516,7 +516,7 @@ func (m *_DataValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u var sourceTimestamp *int64 = nil if m.GetSourceTimestamp() != nil { sourceTimestamp = m.GetSourceTimestamp() - _sourceTimestampErr := writeBuffer.WriteInt64("sourceTimestamp", 64, *(sourceTimestamp)) + _sourceTimestampErr := writeBuffer.WriteInt64("sourceTimestamp", 64, int64(*(sourceTimestamp))) if _sourceTimestampErr != nil { return errors.Wrap(_sourceTimestampErr, "Error serializing 'sourceTimestamp' field") } @@ -526,7 +526,7 @@ func (m *_DataValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u var sourcePicoseconds *uint16 = nil if m.GetSourcePicoseconds() != nil { sourcePicoseconds = m.GetSourcePicoseconds() - _sourcePicosecondsErr := writeBuffer.WriteUint16("sourcePicoseconds", 16, *(sourcePicoseconds)) + _sourcePicosecondsErr := writeBuffer.WriteUint16("sourcePicoseconds", 16, uint16(*(sourcePicoseconds))) if _sourcePicosecondsErr != nil { return errors.Wrap(_sourcePicosecondsErr, "Error serializing 'sourcePicoseconds' field") } @@ -536,7 +536,7 @@ func (m *_DataValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u var serverTimestamp *int64 = nil if m.GetServerTimestamp() != nil { serverTimestamp = m.GetServerTimestamp() - _serverTimestampErr := writeBuffer.WriteInt64("serverTimestamp", 64, *(serverTimestamp)) + _serverTimestampErr := writeBuffer.WriteInt64("serverTimestamp", 64, int64(*(serverTimestamp))) if _serverTimestampErr != nil { return errors.Wrap(_serverTimestampErr, "Error serializing 'serverTimestamp' field") } @@ -546,7 +546,7 @@ func (m *_DataValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u var serverPicoseconds *uint16 = nil if m.GetServerPicoseconds() != nil { serverPicoseconds = m.GetServerPicoseconds() - _serverPicosecondsErr := writeBuffer.WriteUint16("serverPicoseconds", 16, *(serverPicoseconds)) + _serverPicosecondsErr := writeBuffer.WriteUint16("serverPicoseconds", 16, uint16(*(serverPicoseconds))) if _serverPicosecondsErr != nil { return errors.Wrap(_serverPicosecondsErr, "Error serializing 'serverPicoseconds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeadbandType.go b/plc4go/protocols/opcua/readwrite/model/DeadbandType.go index 1d2428f8ee2..3c41f8fef39 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeadbandType.go +++ b/plc4go/protocols/opcua/readwrite/model/DeadbandType.go @@ -138,7 +138,7 @@ func (e DeadbandType) Serialize() ([]byte, error) { func (e DeadbandType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("DeadbandType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("DeadbandType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsRequest.go b/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsRequest.go index 5a85760499d..d53e48be146 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsRequest.go @@ -276,14 +276,14 @@ func (m *_DeleteMonitoredItemsRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } // Simple Field (noOfMonitoredItemIds) noOfMonitoredItemIds := int32(m.GetNoOfMonitoredItemIds()) - _noOfMonitoredItemIdsErr := writeBuffer.WriteInt32("noOfMonitoredItemIds", 32, (noOfMonitoredItemIds)) + _noOfMonitoredItemIdsErr := writeBuffer.WriteInt32("noOfMonitoredItemIds", 32, int32((noOfMonitoredItemIds))) if _noOfMonitoredItemIdsErr != nil { return errors.Wrap(_noOfMonitoredItemIdsErr, "Error serializing 'noOfMonitoredItemIds' field") } @@ -294,7 +294,7 @@ func (m *_DeleteMonitoredItemsRequest) SerializeWithWriteBuffer(ctx context.Cont } for _curItem, _element := range m.GetMonitoredItemIds() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'monitoredItemIds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsResponse.go b/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsResponse.go index 159f2c786d8..fc04ff8608c 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteMonitoredItemsResponse.go @@ -327,7 +327,7 @@ func (m *_DeleteMonitoredItemsResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_DeleteMonitoredItemsResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteNodesItem.go b/plc4go/protocols/opcua/readwrite/model/DeleteNodesItem.go index 911a742ea92..df3ffe5bb2e 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteNodesItem.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteNodesItem.go @@ -247,7 +247,7 @@ func (m *_DeleteNodesItem) SerializeWithWriteBuffer(ctx context.Context, writeBu }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteNodesRequest.go b/plc4go/protocols/opcua/readwrite/model/DeleteNodesRequest.go index d512f526e71..229bca07d9f 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteNodesRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteNodesRequest.go @@ -262,7 +262,7 @@ func (m *_DeleteNodesRequest) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfNodesToDelete) noOfNodesToDelete := int32(m.GetNoOfNodesToDelete()) - _noOfNodesToDeleteErr := writeBuffer.WriteInt32("noOfNodesToDelete", 32, (noOfNodesToDelete)) + _noOfNodesToDeleteErr := writeBuffer.WriteInt32("noOfNodesToDelete", 32, int32((noOfNodesToDelete))) if _noOfNodesToDeleteErr != nil { return errors.Wrap(_noOfNodesToDeleteErr, "Error serializing 'noOfNodesToDelete' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteNodesResponse.go b/plc4go/protocols/opcua/readwrite/model/DeleteNodesResponse.go index d45c11ab9c8..365f1a85ef7 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteNodesResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteNodesResponse.go @@ -327,7 +327,7 @@ func (m *_DeleteNodesResponse) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_DeleteNodesResponse) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteReferencesItem.go b/plc4go/protocols/opcua/readwrite/model/DeleteReferencesItem.go index ba298eb97d0..0dc5b1fd2d0 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteReferencesItem.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteReferencesItem.go @@ -350,7 +350,7 @@ func (m *_DeleteReferencesItem) SerializeWithWriteBuffer(ctx context.Context, wr }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -385,7 +385,7 @@ func (m *_DeleteReferencesItem) SerializeWithWriteBuffer(ctx context.Context, wr }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteReferencesRequest.go b/plc4go/protocols/opcua/readwrite/model/DeleteReferencesRequest.go index e412827029c..faaccef912c 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteReferencesRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteReferencesRequest.go @@ -262,7 +262,7 @@ func (m *_DeleteReferencesRequest) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfReferencesToDelete) noOfReferencesToDelete := int32(m.GetNoOfReferencesToDelete()) - _noOfReferencesToDeleteErr := writeBuffer.WriteInt32("noOfReferencesToDelete", 32, (noOfReferencesToDelete)) + _noOfReferencesToDeleteErr := writeBuffer.WriteInt32("noOfReferencesToDelete", 32, int32((noOfReferencesToDelete))) if _noOfReferencesToDeleteErr != nil { return errors.Wrap(_noOfReferencesToDeleteErr, "Error serializing 'noOfReferencesToDelete' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteReferencesResponse.go b/plc4go/protocols/opcua/readwrite/model/DeleteReferencesResponse.go index e794895df07..62bada2c63c 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteReferencesResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteReferencesResponse.go @@ -327,7 +327,7 @@ func (m *_DeleteReferencesResponse) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_DeleteReferencesResponse) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsRequest.go b/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsRequest.go index 2ba4b704672..afd733c00f3 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsRequest.go @@ -257,7 +257,7 @@ func (m *_DeleteSubscriptionsRequest) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfSubscriptionIds) noOfSubscriptionIds := int32(m.GetNoOfSubscriptionIds()) - _noOfSubscriptionIdsErr := writeBuffer.WriteInt32("noOfSubscriptionIds", 32, (noOfSubscriptionIds)) + _noOfSubscriptionIdsErr := writeBuffer.WriteInt32("noOfSubscriptionIds", 32, int32((noOfSubscriptionIds))) if _noOfSubscriptionIdsErr != nil { return errors.Wrap(_noOfSubscriptionIdsErr, "Error serializing 'noOfSubscriptionIds' field") } @@ -268,7 +268,7 @@ func (m *_DeleteSubscriptionsRequest) SerializeWithWriteBuffer(ctx context.Conte } for _curItem, _element := range m.GetSubscriptionIds() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'subscriptionIds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsResponse.go b/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsResponse.go index 5d31b185370..1b0ab65572a 100644 --- a/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/DeleteSubscriptionsResponse.go @@ -327,7 +327,7 @@ func (m *_DeleteSubscriptionsResponse) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_DeleteSubscriptionsResponse) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DiagnosticInfo.go b/plc4go/protocols/opcua/readwrite/model/DiagnosticInfo.go index fcb376fcfd7..d8e034a2f91 100644 --- a/plc4go/protocols/opcua/readwrite/model/DiagnosticInfo.go +++ b/plc4go/protocols/opcua/readwrite/model/DiagnosticInfo.go @@ -544,7 +544,7 @@ func (m *_DiagnosticInfo) SerializeWithWriteBuffer(ctx context.Context, writeBuf var symbolicId *int32 = nil if m.GetSymbolicId() != nil { symbolicId = m.GetSymbolicId() - _symbolicIdErr := writeBuffer.WriteInt32("symbolicId", 32, *(symbolicId)) + _symbolicIdErr := writeBuffer.WriteInt32("symbolicId", 32, int32(*(symbolicId))) if _symbolicIdErr != nil { return errors.Wrap(_symbolicIdErr, "Error serializing 'symbolicId' field") } @@ -554,7 +554,7 @@ func (m *_DiagnosticInfo) SerializeWithWriteBuffer(ctx context.Context, writeBuf var namespaceURI *int32 = nil if m.GetNamespaceURI() != nil { namespaceURI = m.GetNamespaceURI() - _namespaceURIErr := writeBuffer.WriteInt32("namespaceURI", 32, *(namespaceURI)) + _namespaceURIErr := writeBuffer.WriteInt32("namespaceURI", 32, int32(*(namespaceURI))) if _namespaceURIErr != nil { return errors.Wrap(_namespaceURIErr, "Error serializing 'namespaceURI' field") } @@ -564,7 +564,7 @@ func (m *_DiagnosticInfo) SerializeWithWriteBuffer(ctx context.Context, writeBuf var locale *int32 = nil if m.GetLocale() != nil { locale = m.GetLocale() - _localeErr := writeBuffer.WriteInt32("locale", 32, *(locale)) + _localeErr := writeBuffer.WriteInt32("locale", 32, int32(*(locale))) if _localeErr != nil { return errors.Wrap(_localeErr, "Error serializing 'locale' field") } @@ -574,7 +574,7 @@ func (m *_DiagnosticInfo) SerializeWithWriteBuffer(ctx context.Context, writeBuf var localizedText *int32 = nil if m.GetLocalizedText() != nil { localizedText = m.GetLocalizedText() - _localizedTextErr := writeBuffer.WriteInt32("localizedText", 32, *(localizedText)) + _localizedTextErr := writeBuffer.WriteInt32("localizedText", 32, int32(*(localizedText))) if _localizedTextErr != nil { return errors.Wrap(_localizedTextErr, "Error serializing 'localizedText' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/DiagnosticsLevel.go b/plc4go/protocols/opcua/readwrite/model/DiagnosticsLevel.go index 340ef6c8ea1..f4735e277b4 100644 --- a/plc4go/protocols/opcua/readwrite/model/DiagnosticsLevel.go +++ b/plc4go/protocols/opcua/readwrite/model/DiagnosticsLevel.go @@ -150,7 +150,7 @@ func (e DiagnosticsLevel) Serialize() ([]byte, error) { func (e DiagnosticsLevel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("DiagnosticsLevel", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("DiagnosticsLevel", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/Duplex.go b/plc4go/protocols/opcua/readwrite/model/Duplex.go index d05b8625611..7ba4e8a66f1 100644 --- a/plc4go/protocols/opcua/readwrite/model/Duplex.go +++ b/plc4go/protocols/opcua/readwrite/model/Duplex.go @@ -138,7 +138,7 @@ func (e Duplex) Serialize() ([]byte, error) { func (e Duplex) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("Duplex", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("Duplex", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/EUInformation.go b/plc4go/protocols/opcua/readwrite/model/EUInformation.go index 45118d97c50..9c7eda270a8 100644 --- a/plc4go/protocols/opcua/readwrite/model/EUInformation.go +++ b/plc4go/protocols/opcua/readwrite/model/EUInformation.go @@ -266,7 +266,7 @@ func (m *_EUInformation) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (unitId) unitId := int32(m.GetUnitId()) - _unitIdErr := writeBuffer.WriteInt32("unitId", 32, (unitId)) + _unitIdErr := writeBuffer.WriteInt32("unitId", 32, int32((unitId))) if _unitIdErr != nil { return errors.Wrap(_unitIdErr, "Error serializing 'unitId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/EndpointConfiguration.go b/plc4go/protocols/opcua/readwrite/model/EndpointConfiguration.go index 9295190f427..881690f5747 100644 --- a/plc4go/protocols/opcua/readwrite/model/EndpointConfiguration.go +++ b/plc4go/protocols/opcua/readwrite/model/EndpointConfiguration.go @@ -354,7 +354,7 @@ func (m *_EndpointConfiguration) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (operationTimeout) operationTimeout := int32(m.GetOperationTimeout()) - _operationTimeoutErr := writeBuffer.WriteInt32("operationTimeout", 32, (operationTimeout)) + _operationTimeoutErr := writeBuffer.WriteInt32("operationTimeout", 32, int32((operationTimeout))) if _operationTimeoutErr != nil { return errors.Wrap(_operationTimeoutErr, "Error serializing 'operationTimeout' field") } @@ -369,7 +369,7 @@ func (m *_EndpointConfiguration) SerializeWithWriteBuffer(ctx context.Context, w }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -384,49 +384,49 @@ func (m *_EndpointConfiguration) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (maxStringLength) maxStringLength := int32(m.GetMaxStringLength()) - _maxStringLengthErr := writeBuffer.WriteInt32("maxStringLength", 32, (maxStringLength)) + _maxStringLengthErr := writeBuffer.WriteInt32("maxStringLength", 32, int32((maxStringLength))) if _maxStringLengthErr != nil { return errors.Wrap(_maxStringLengthErr, "Error serializing 'maxStringLength' field") } // Simple Field (maxByteStringLength) maxByteStringLength := int32(m.GetMaxByteStringLength()) - _maxByteStringLengthErr := writeBuffer.WriteInt32("maxByteStringLength", 32, (maxByteStringLength)) + _maxByteStringLengthErr := writeBuffer.WriteInt32("maxByteStringLength", 32, int32((maxByteStringLength))) if _maxByteStringLengthErr != nil { return errors.Wrap(_maxByteStringLengthErr, "Error serializing 'maxByteStringLength' field") } // Simple Field (maxArrayLength) maxArrayLength := int32(m.GetMaxArrayLength()) - _maxArrayLengthErr := writeBuffer.WriteInt32("maxArrayLength", 32, (maxArrayLength)) + _maxArrayLengthErr := writeBuffer.WriteInt32("maxArrayLength", 32, int32((maxArrayLength))) if _maxArrayLengthErr != nil { return errors.Wrap(_maxArrayLengthErr, "Error serializing 'maxArrayLength' field") } // Simple Field (maxMessageSize) maxMessageSize := int32(m.GetMaxMessageSize()) - _maxMessageSizeErr := writeBuffer.WriteInt32("maxMessageSize", 32, (maxMessageSize)) + _maxMessageSizeErr := writeBuffer.WriteInt32("maxMessageSize", 32, int32((maxMessageSize))) if _maxMessageSizeErr != nil { return errors.Wrap(_maxMessageSizeErr, "Error serializing 'maxMessageSize' field") } // Simple Field (maxBufferSize) maxBufferSize := int32(m.GetMaxBufferSize()) - _maxBufferSizeErr := writeBuffer.WriteInt32("maxBufferSize", 32, (maxBufferSize)) + _maxBufferSizeErr := writeBuffer.WriteInt32("maxBufferSize", 32, int32((maxBufferSize))) if _maxBufferSizeErr != nil { return errors.Wrap(_maxBufferSizeErr, "Error serializing 'maxBufferSize' field") } // Simple Field (channelLifetime) channelLifetime := int32(m.GetChannelLifetime()) - _channelLifetimeErr := writeBuffer.WriteInt32("channelLifetime", 32, (channelLifetime)) + _channelLifetimeErr := writeBuffer.WriteInt32("channelLifetime", 32, int32((channelLifetime))) if _channelLifetimeErr != nil { return errors.Wrap(_channelLifetimeErr, "Error serializing 'channelLifetime' field") } // Simple Field (securityTokenLifetime) securityTokenLifetime := int32(m.GetSecurityTokenLifetime()) - _securityTokenLifetimeErr := writeBuffer.WriteInt32("securityTokenLifetime", 32, (securityTokenLifetime)) + _securityTokenLifetimeErr := writeBuffer.WriteInt32("securityTokenLifetime", 32, int32((securityTokenLifetime))) if _securityTokenLifetimeErr != nil { return errors.Wrap(_securityTokenLifetimeErr, "Error serializing 'securityTokenLifetime' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/EndpointDescription.go b/plc4go/protocols/opcua/readwrite/model/EndpointDescription.go index 764f2a475da..38cf224cf21 100644 --- a/plc4go/protocols/opcua/readwrite/model/EndpointDescription.go +++ b/plc4go/protocols/opcua/readwrite/model/EndpointDescription.go @@ -454,7 +454,7 @@ func (m *_EndpointDescription) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfUserIdentityTokens) noOfUserIdentityTokens := int32(m.GetNoOfUserIdentityTokens()) - _noOfUserIdentityTokensErr := writeBuffer.WriteInt32("noOfUserIdentityTokens", 32, (noOfUserIdentityTokens)) + _noOfUserIdentityTokensErr := writeBuffer.WriteInt32("noOfUserIdentityTokens", 32, int32((noOfUserIdentityTokens))) if _noOfUserIdentityTokensErr != nil { return errors.Wrap(_noOfUserIdentityTokensErr, "Error serializing 'noOfUserIdentityTokens' field") } @@ -490,7 +490,7 @@ func (m *_EndpointDescription) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (securityLevel) securityLevel := uint8(m.GetSecurityLevel()) - _securityLevelErr := writeBuffer.WriteUint8("securityLevel", 8, (securityLevel)) + _securityLevelErr := writeBuffer.WriteUint8("securityLevel", 8, uint8((securityLevel))) if _securityLevelErr != nil { return errors.Wrap(_securityLevelErr, "Error serializing 'securityLevel' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/EndpointUrlListDataType.go b/plc4go/protocols/opcua/readwrite/model/EndpointUrlListDataType.go index 4dcaaca0d7e..46f57266551 100644 --- a/plc4go/protocols/opcua/readwrite/model/EndpointUrlListDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/EndpointUrlListDataType.go @@ -225,7 +225,7 @@ func (m *_EndpointUrlListDataType) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfEndpointUrlList) noOfEndpointUrlList := int32(m.GetNoOfEndpointUrlList()) - _noOfEndpointUrlListErr := writeBuffer.WriteInt32("noOfEndpointUrlList", 32, (noOfEndpointUrlList)) + _noOfEndpointUrlListErr := writeBuffer.WriteInt32("noOfEndpointUrlList", 32, int32((noOfEndpointUrlList))) if _noOfEndpointUrlListErr != nil { return errors.Wrap(_noOfEndpointUrlListErr, "Error serializing 'noOfEndpointUrlList' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/EnumValueType.go b/plc4go/protocols/opcua/readwrite/model/EnumValueType.go index 04a623175d5..441a0912729 100644 --- a/plc4go/protocols/opcua/readwrite/model/EnumValueType.go +++ b/plc4go/protocols/opcua/readwrite/model/EnumValueType.go @@ -229,7 +229,7 @@ func (m *_EnumValueType) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (value) value := int64(m.GetValue()) - _valueErr := writeBuffer.WriteInt64("value", 64, (value)) + _valueErr := writeBuffer.WriteInt64("value", 64, int64((value))) if _valueErr != nil { return errors.Wrap(_valueErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/EventFieldList.go b/plc4go/protocols/opcua/readwrite/model/EventFieldList.go index 574f0ecadd5..2ccbea70f9f 100644 --- a/plc4go/protocols/opcua/readwrite/model/EventFieldList.go +++ b/plc4go/protocols/opcua/readwrite/model/EventFieldList.go @@ -244,14 +244,14 @@ func (m *_EventFieldList) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (clientHandle) clientHandle := uint32(m.GetClientHandle()) - _clientHandleErr := writeBuffer.WriteUint32("clientHandle", 32, (clientHandle)) + _clientHandleErr := writeBuffer.WriteUint32("clientHandle", 32, uint32((clientHandle))) if _clientHandleErr != nil { return errors.Wrap(_clientHandleErr, "Error serializing 'clientHandle' field") } // Simple Field (noOfEventFields) noOfEventFields := int32(m.GetNoOfEventFields()) - _noOfEventFieldsErr := writeBuffer.WriteInt32("noOfEventFields", 32, (noOfEventFields)) + _noOfEventFieldsErr := writeBuffer.WriteInt32("noOfEventFields", 32, int32((noOfEventFields))) if _noOfEventFieldsErr != nil { return errors.Wrap(_noOfEventFieldsErr, "Error serializing 'noOfEventFields' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/EventNotificationList.go b/plc4go/protocols/opcua/readwrite/model/EventNotificationList.go index 277ee8715de..a88a6b94ecf 100644 --- a/plc4go/protocols/opcua/readwrite/model/EventNotificationList.go +++ b/plc4go/protocols/opcua/readwrite/model/EventNotificationList.go @@ -235,14 +235,14 @@ func (m *_EventNotificationList) SerializeWithWriteBuffer(ctx context.Context, w // Implicit Field (notificationLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) notificationLength := int32(int32(m.GetLengthInBytes(ctx))) - _notificationLengthErr := writeBuffer.WriteInt32("notificationLength", 32, (notificationLength)) + _notificationLengthErr := writeBuffer.WriteInt32("notificationLength", 32, int32((notificationLength))) if _notificationLengthErr != nil { return errors.Wrap(_notificationLengthErr, "Error serializing 'notificationLength' field") } // Simple Field (noOfEvents) noOfEvents := int32(m.GetNoOfEvents()) - _noOfEventsErr := writeBuffer.WriteInt32("noOfEvents", 32, (noOfEvents)) + _noOfEventsErr := writeBuffer.WriteInt32("noOfEvents", 32, int32((noOfEvents))) if _noOfEventsErr != nil { return errors.Wrap(_noOfEventsErr, "Error serializing 'noOfEvents' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/EventNotifierType.go b/plc4go/protocols/opcua/readwrite/model/EventNotifierType.go index 5250a934f85..59b4d2e8ac4 100644 --- a/plc4go/protocols/opcua/readwrite/model/EventNotifierType.go +++ b/plc4go/protocols/opcua/readwrite/model/EventNotifierType.go @@ -144,7 +144,7 @@ func (e EventNotifierType) Serialize() ([]byte, error) { func (e EventNotifierType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("EventNotifierType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("EventNotifierType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ExceptionDeviationFormat.go b/plc4go/protocols/opcua/readwrite/model/ExceptionDeviationFormat.go index 6d68d4b54e2..3b2cd312c72 100644 --- a/plc4go/protocols/opcua/readwrite/model/ExceptionDeviationFormat.go +++ b/plc4go/protocols/opcua/readwrite/model/ExceptionDeviationFormat.go @@ -150,7 +150,7 @@ func (e ExceptionDeviationFormat) Serialize() ([]byte, error) { func (e ExceptionDeviationFormat) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("ExceptionDeviationFormat", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("ExceptionDeviationFormat", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ExpandedNodeId.go b/plc4go/protocols/opcua/readwrite/model/ExpandedNodeId.go index 0bdb2d5a42d..fedcebf99e3 100644 --- a/plc4go/protocols/opcua/readwrite/model/ExpandedNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/ExpandedNodeId.go @@ -327,7 +327,7 @@ func (m *_ExpandedNodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuf var serverIndex *uint32 = nil if m.GetServerIndex() != nil { serverIndex = m.GetServerIndex() - _serverIndexErr := writeBuffer.WriteUint32("serverIndex", 32, *(serverIndex)) + _serverIndexErr := writeBuffer.WriteUint32("serverIndex", 32, uint32(*(serverIndex))) if _serverIndexErr != nil { return errors.Wrap(_serverIndexErr, "Error serializing 'serverIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ExtensionHeader.go b/plc4go/protocols/opcua/readwrite/model/ExtensionHeader.go index 44cff8381b1..7fe6057ffea 100644 --- a/plc4go/protocols/opcua/readwrite/model/ExtensionHeader.go +++ b/plc4go/protocols/opcua/readwrite/model/ExtensionHeader.go @@ -197,7 +197,7 @@ func (m *_ExtensionHeader) SerializeWithWriteBuffer(ctx context.Context, writeBu }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteInt8("reserved", 5, reserved) + _err := writeBuffer.WriteInt8("reserved", 5, int8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ExtensionObjectEncodingMask.go b/plc4go/protocols/opcua/readwrite/model/ExtensionObjectEncodingMask.go index cc5a8d65640..791e3b9773c 100644 --- a/plc4go/protocols/opcua/readwrite/model/ExtensionObjectEncodingMask.go +++ b/plc4go/protocols/opcua/readwrite/model/ExtensionObjectEncodingMask.go @@ -215,7 +215,7 @@ func (m *_ExtensionObjectEncodingMask) SerializeWithWriteBuffer(ctx context.Cont }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteInt8("reserved", 5, reserved) + _err := writeBuffer.WriteInt8("reserved", 5, int8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/FieldMetaData.go b/plc4go/protocols/opcua/readwrite/model/FieldMetaData.go index 123f9b97958..c672e911892 100644 --- a/plc4go/protocols/opcua/readwrite/model/FieldMetaData.go +++ b/plc4go/protocols/opcua/readwrite/model/FieldMetaData.go @@ -503,7 +503,7 @@ func (m *_FieldMetaData) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (builtInType) builtInType := uint8(m.GetBuiltInType()) - _builtInTypeErr := writeBuffer.WriteUint8("builtInType", 8, (builtInType)) + _builtInTypeErr := writeBuffer.WriteUint8("builtInType", 8, uint8((builtInType))) if _builtInTypeErr != nil { return errors.Wrap(_builtInTypeErr, "Error serializing 'builtInType' field") } @@ -522,14 +522,14 @@ func (m *_FieldMetaData) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (valueRank) valueRank := int32(m.GetValueRank()) - _valueRankErr := writeBuffer.WriteInt32("valueRank", 32, (valueRank)) + _valueRankErr := writeBuffer.WriteInt32("valueRank", 32, int32((valueRank))) if _valueRankErr != nil { return errors.Wrap(_valueRankErr, "Error serializing 'valueRank' field") } // Simple Field (noOfArrayDimensions) noOfArrayDimensions := int32(m.GetNoOfArrayDimensions()) - _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, (noOfArrayDimensions)) + _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, int32((noOfArrayDimensions))) if _noOfArrayDimensionsErr != nil { return errors.Wrap(_noOfArrayDimensionsErr, "Error serializing 'noOfArrayDimensions' field") } @@ -540,7 +540,7 @@ func (m *_FieldMetaData) SerializeWithWriteBuffer(ctx context.Context, writeBuff } for _curItem, _element := range m.GetArrayDimensions() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'arrayDimensions' field") } @@ -551,7 +551,7 @@ func (m *_FieldMetaData) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (maxStringLength) maxStringLength := uint32(m.GetMaxStringLength()) - _maxStringLengthErr := writeBuffer.WriteUint32("maxStringLength", 32, (maxStringLength)) + _maxStringLengthErr := writeBuffer.WriteUint32("maxStringLength", 32, uint32((maxStringLength))) if _maxStringLengthErr != nil { return errors.Wrap(_maxStringLengthErr, "Error serializing 'maxStringLength' field") } @@ -570,7 +570,7 @@ func (m *_FieldMetaData) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (noOfProperties) noOfProperties := int32(m.GetNoOfProperties()) - _noOfPropertiesErr := writeBuffer.WriteInt32("noOfProperties", 32, (noOfProperties)) + _noOfPropertiesErr := writeBuffer.WriteInt32("noOfProperties", 32, int32((noOfProperties))) if _noOfPropertiesErr != nil { return errors.Wrap(_noOfPropertiesErr, "Error serializing 'noOfProperties' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/FieldTargetDataType.go b/plc4go/protocols/opcua/readwrite/model/FieldTargetDataType.go index f1ddbfebd78..d13b052a2c0 100644 --- a/plc4go/protocols/opcua/readwrite/model/FieldTargetDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/FieldTargetDataType.go @@ -365,7 +365,7 @@ func (m *_FieldTargetDataType) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (attributeId) attributeId := uint32(m.GetAttributeId()) - _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, (attributeId)) + _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, uint32((attributeId))) if _attributeIdErr != nil { return errors.Wrap(_attributeIdErr, "Error serializing 'attributeId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/FilterOperator.go b/plc4go/protocols/opcua/readwrite/model/FilterOperator.go index 0171207193e..9b6dc66abc0 100644 --- a/plc4go/protocols/opcua/readwrite/model/FilterOperator.go +++ b/plc4go/protocols/opcua/readwrite/model/FilterOperator.go @@ -228,7 +228,7 @@ func (e FilterOperator) Serialize() ([]byte, error) { func (e FilterOperator) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("FilterOperator", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("FilterOperator", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkRequest.go b/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkRequest.go index 538123e62d8..57d2656cb0c 100644 --- a/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkRequest.go @@ -300,21 +300,21 @@ func (m *_FindServersOnNetworkRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (startingRecordId) startingRecordId := uint32(m.GetStartingRecordId()) - _startingRecordIdErr := writeBuffer.WriteUint32("startingRecordId", 32, (startingRecordId)) + _startingRecordIdErr := writeBuffer.WriteUint32("startingRecordId", 32, uint32((startingRecordId))) if _startingRecordIdErr != nil { return errors.Wrap(_startingRecordIdErr, "Error serializing 'startingRecordId' field") } // Simple Field (maxRecordsToReturn) maxRecordsToReturn := uint32(m.GetMaxRecordsToReturn()) - _maxRecordsToReturnErr := writeBuffer.WriteUint32("maxRecordsToReturn", 32, (maxRecordsToReturn)) + _maxRecordsToReturnErr := writeBuffer.WriteUint32("maxRecordsToReturn", 32, uint32((maxRecordsToReturn))) if _maxRecordsToReturnErr != nil { return errors.Wrap(_maxRecordsToReturnErr, "Error serializing 'maxRecordsToReturn' field") } // Simple Field (noOfServerCapabilityFilter) noOfServerCapabilityFilter := int32(m.GetNoOfServerCapabilityFilter()) - _noOfServerCapabilityFilterErr := writeBuffer.WriteInt32("noOfServerCapabilityFilter", 32, (noOfServerCapabilityFilter)) + _noOfServerCapabilityFilterErr := writeBuffer.WriteInt32("noOfServerCapabilityFilter", 32, int32((noOfServerCapabilityFilter))) if _noOfServerCapabilityFilterErr != nil { return errors.Wrap(_noOfServerCapabilityFilterErr, "Error serializing 'noOfServerCapabilityFilter' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkResponse.go b/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkResponse.go index 9be489ed092..673a1b9d572 100644 --- a/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/FindServersOnNetworkResponse.go @@ -281,14 +281,14 @@ func (m *_FindServersOnNetworkResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (lastCounterResetTime) lastCounterResetTime := int64(m.GetLastCounterResetTime()) - _lastCounterResetTimeErr := writeBuffer.WriteInt64("lastCounterResetTime", 64, (lastCounterResetTime)) + _lastCounterResetTimeErr := writeBuffer.WriteInt64("lastCounterResetTime", 64, int64((lastCounterResetTime))) if _lastCounterResetTimeErr != nil { return errors.Wrap(_lastCounterResetTimeErr, "Error serializing 'lastCounterResetTime' field") } // Simple Field (noOfServers) noOfServers := int32(m.GetNoOfServers()) - _noOfServersErr := writeBuffer.WriteInt32("noOfServers", 32, (noOfServers)) + _noOfServersErr := writeBuffer.WriteInt32("noOfServers", 32, int32((noOfServers))) if _noOfServersErr != nil { return errors.Wrap(_noOfServersErr, "Error serializing 'noOfServers' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/FindServersRequest.go b/plc4go/protocols/opcua/readwrite/model/FindServersRequest.go index 59ba645d03f..629382913f0 100644 --- a/plc4go/protocols/opcua/readwrite/model/FindServersRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/FindServersRequest.go @@ -364,7 +364,7 @@ func (m *_FindServersRequest) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfLocaleIds) noOfLocaleIds := int32(m.GetNoOfLocaleIds()) - _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, (noOfLocaleIds)) + _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, int32((noOfLocaleIds))) if _noOfLocaleIdsErr != nil { return errors.Wrap(_noOfLocaleIdsErr, "Error serializing 'noOfLocaleIds' field") } @@ -388,7 +388,7 @@ func (m *_FindServersRequest) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfServerUris) noOfServerUris := int32(m.GetNoOfServerUris()) - _noOfServerUrisErr := writeBuffer.WriteInt32("noOfServerUris", 32, (noOfServerUris)) + _noOfServerUrisErr := writeBuffer.WriteInt32("noOfServerUris", 32, int32((noOfServerUris))) if _noOfServerUrisErr != nil { return errors.Wrap(_noOfServerUrisErr, "Error serializing 'noOfServerUris' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/FindServersResponse.go b/plc4go/protocols/opcua/readwrite/model/FindServersResponse.go index ad028dab3b2..07b3babd951 100644 --- a/plc4go/protocols/opcua/readwrite/model/FindServersResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/FindServersResponse.go @@ -262,7 +262,7 @@ func (m *_FindServersResponse) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfServers) noOfServers := int32(m.GetNoOfServers()) - _noOfServersErr := writeBuffer.WriteInt32("noOfServers", 32, (noOfServers)) + _noOfServersErr := writeBuffer.WriteInt32("noOfServers", 32, int32((noOfServers))) if _noOfServersErr != nil { return errors.Wrap(_noOfServersErr, "Error serializing 'noOfServers' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/FourByteNodeId.go b/plc4go/protocols/opcua/readwrite/model/FourByteNodeId.go index 57155c6d3aa..7ba44a44e0a 100644 --- a/plc4go/protocols/opcua/readwrite/model/FourByteNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/FourByteNodeId.go @@ -166,14 +166,14 @@ func (m *_FourByteNodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (namespaceIndex) namespaceIndex := uint8(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint8("namespaceIndex", 8, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint8("namespaceIndex", 8, uint8((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } // Simple Field (identifier) identifier := uint16(m.GetIdentifier()) - _identifierErr := writeBuffer.WriteUint16("identifier", 16, (identifier)) + _identifierErr := writeBuffer.WriteUint16("identifier", 16, uint16((identifier))) if _identifierErr != nil { return errors.Wrap(_identifierErr, "Error serializing 'identifier' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/GenericAttributeValue.go b/plc4go/protocols/opcua/readwrite/model/GenericAttributeValue.go index e63de95966d..312d3f6e7c5 100644 --- a/plc4go/protocols/opcua/readwrite/model/GenericAttributeValue.go +++ b/plc4go/protocols/opcua/readwrite/model/GenericAttributeValue.go @@ -204,7 +204,7 @@ func (m *_GenericAttributeValue) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (attributeId) attributeId := uint32(m.GetAttributeId()) - _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, (attributeId)) + _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, uint32((attributeId))) if _attributeIdErr != nil { return errors.Wrap(_attributeIdErr, "Error serializing 'attributeId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/GetEndpointsRequest.go b/plc4go/protocols/opcua/readwrite/model/GetEndpointsRequest.go index 333f2d5eb1e..778819ac61e 100644 --- a/plc4go/protocols/opcua/readwrite/model/GetEndpointsRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/GetEndpointsRequest.go @@ -364,7 +364,7 @@ func (m *_GetEndpointsRequest) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfLocaleIds) noOfLocaleIds := int32(m.GetNoOfLocaleIds()) - _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, (noOfLocaleIds)) + _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, int32((noOfLocaleIds))) if _noOfLocaleIdsErr != nil { return errors.Wrap(_noOfLocaleIdsErr, "Error serializing 'noOfLocaleIds' field") } @@ -388,7 +388,7 @@ func (m *_GetEndpointsRequest) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfProfileUris) noOfProfileUris := int32(m.GetNoOfProfileUris()) - _noOfProfileUrisErr := writeBuffer.WriteInt32("noOfProfileUris", 32, (noOfProfileUris)) + _noOfProfileUrisErr := writeBuffer.WriteInt32("noOfProfileUris", 32, int32((noOfProfileUris))) if _noOfProfileUrisErr != nil { return errors.Wrap(_noOfProfileUrisErr, "Error serializing 'noOfProfileUris' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/GetEndpointsResponse.go b/plc4go/protocols/opcua/readwrite/model/GetEndpointsResponse.go index fa172ae1421..542ed76e71e 100644 --- a/plc4go/protocols/opcua/readwrite/model/GetEndpointsResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/GetEndpointsResponse.go @@ -262,7 +262,7 @@ func (m *_GetEndpointsResponse) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfEndpoints) noOfEndpoints := int32(m.GetNoOfEndpoints()) - _noOfEndpointsErr := writeBuffer.WriteInt32("noOfEndpoints", 32, (noOfEndpoints)) + _noOfEndpointsErr := writeBuffer.WriteInt32("noOfEndpoints", 32, int32((noOfEndpoints))) if _noOfEndpointsErr != nil { return errors.Wrap(_noOfEndpointsErr, "Error serializing 'noOfEndpoints' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/GuidNodeId.go b/plc4go/protocols/opcua/readwrite/model/GuidNodeId.go index 666fad2fb3a..7f2cc284c09 100644 --- a/plc4go/protocols/opcua/readwrite/model/GuidNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/GuidNodeId.go @@ -172,7 +172,7 @@ func (m *_GuidNodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/GuidValue.go b/plc4go/protocols/opcua/readwrite/model/GuidValue.go index 6aebdd30c9d..66fcb024277 100644 --- a/plc4go/protocols/opcua/readwrite/model/GuidValue.go +++ b/plc4go/protocols/opcua/readwrite/model/GuidValue.go @@ -222,21 +222,21 @@ func (m *_GuidValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer u // Simple Field (data1) data1 := uint32(m.GetData1()) - _data1Err := writeBuffer.WriteUint32("data1", 32, (data1)) + _data1Err := writeBuffer.WriteUint32("data1", 32, uint32((data1))) if _data1Err != nil { return errors.Wrap(_data1Err, "Error serializing 'data1' field") } // Simple Field (data2) data2 := uint16(m.GetData2()) - _data2Err := writeBuffer.WriteUint16("data2", 16, (data2)) + _data2Err := writeBuffer.WriteUint16("data2", 16, uint16((data2))) if _data2Err != nil { return errors.Wrap(_data2Err, "Error serializing 'data2' field") } // Simple Field (data3) data3 := uint16(m.GetData3()) - _data3Err := writeBuffer.WriteUint16("data3", 16, (data3)) + _data3Err := writeBuffer.WriteUint16("data3", 16, uint16((data3))) if _data3Err != nil { return errors.Wrap(_data3Err, "Error serializing 'data3' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryData.go b/plc4go/protocols/opcua/readwrite/model/HistoryData.go index 91bcc513eb1..5a3bc964a6f 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryData.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryData.go @@ -225,7 +225,7 @@ func (m *_HistoryData) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (noOfDataValues) noOfDataValues := int32(m.GetNoOfDataValues()) - _noOfDataValuesErr := writeBuffer.WriteInt32("noOfDataValues", 32, (noOfDataValues)) + _noOfDataValuesErr := writeBuffer.WriteInt32("noOfDataValues", 32, int32((noOfDataValues))) if _noOfDataValuesErr != nil { return errors.Wrap(_noOfDataValuesErr, "Error serializing 'noOfDataValues' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryEvent.go b/plc4go/protocols/opcua/readwrite/model/HistoryEvent.go index 35bdc10594c..de9c103fc7c 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryEvent.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryEvent.go @@ -225,7 +225,7 @@ func (m *_HistoryEvent) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfEvents) noOfEvents := int32(m.GetNoOfEvents()) - _noOfEventsErr := writeBuffer.WriteInt32("noOfEvents", 32, (noOfEvents)) + _noOfEventsErr := writeBuffer.WriteInt32("noOfEvents", 32, int32((noOfEvents))) if _noOfEventsErr != nil { return errors.Wrap(_noOfEventsErr, "Error serializing 'noOfEvents' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryEventFieldList.go b/plc4go/protocols/opcua/readwrite/model/HistoryEventFieldList.go index e1dfaafbfcc..59f6d935e86 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryEventFieldList.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryEventFieldList.go @@ -225,7 +225,7 @@ func (m *_HistoryEventFieldList) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfEventFields) noOfEventFields := int32(m.GetNoOfEventFields()) - _noOfEventFieldsErr := writeBuffer.WriteInt32("noOfEventFields", 32, (noOfEventFields)) + _noOfEventFieldsErr := writeBuffer.WriteInt32("noOfEventFields", 32, int32((noOfEventFields))) if _noOfEventFieldsErr != nil { return errors.Wrap(_noOfEventFieldsErr, "Error serializing 'noOfEventFields' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryReadRequest.go b/plc4go/protocols/opcua/readwrite/model/HistoryReadRequest.go index 5e855dde8f0..84849a996d8 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryReadRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryReadRequest.go @@ -386,7 +386,7 @@ func (m *_HistoryReadRequest) SerializeWithWriteBuffer(ctx context.Context, writ }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -401,7 +401,7 @@ func (m *_HistoryReadRequest) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfNodesToRead) noOfNodesToRead := int32(m.GetNoOfNodesToRead()) - _noOfNodesToReadErr := writeBuffer.WriteInt32("noOfNodesToRead", 32, (noOfNodesToRead)) + _noOfNodesToReadErr := writeBuffer.WriteInt32("noOfNodesToRead", 32, int32((noOfNodesToRead))) if _noOfNodesToReadErr != nil { return errors.Wrap(_noOfNodesToReadErr, "Error serializing 'noOfNodesToRead' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryReadResponse.go b/plc4go/protocols/opcua/readwrite/model/HistoryReadResponse.go index 86a16ece02f..013911acf16 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryReadResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryReadResponse.go @@ -327,7 +327,7 @@ func (m *_HistoryReadResponse) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_HistoryReadResponse) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateRequest.go b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateRequest.go index 96957b24d0b..86bce6ba812 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateRequest.go @@ -262,7 +262,7 @@ func (m *_HistoryUpdateRequest) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfHistoryUpdateDetails) noOfHistoryUpdateDetails := int32(m.GetNoOfHistoryUpdateDetails()) - _noOfHistoryUpdateDetailsErr := writeBuffer.WriteInt32("noOfHistoryUpdateDetails", 32, (noOfHistoryUpdateDetails)) + _noOfHistoryUpdateDetailsErr := writeBuffer.WriteInt32("noOfHistoryUpdateDetails", 32, int32((noOfHistoryUpdateDetails))) if _noOfHistoryUpdateDetailsErr != nil { return errors.Wrap(_noOfHistoryUpdateDetailsErr, "Error serializing 'noOfHistoryUpdateDetails' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResponse.go b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResponse.go index 2bbb5d87b6f..6bf33f0b314 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResponse.go @@ -327,7 +327,7 @@ func (m *_HistoryUpdateResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_HistoryUpdateResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResult.go b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResult.go index 3d97d343bc8..d405c8e1780 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResult.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateResult.go @@ -327,7 +327,7 @@ func (m *_HistoryUpdateResult) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfOperationResults) noOfOperationResults := int32(m.GetNoOfOperationResults()) - _noOfOperationResultsErr := writeBuffer.WriteInt32("noOfOperationResults", 32, (noOfOperationResults)) + _noOfOperationResultsErr := writeBuffer.WriteInt32("noOfOperationResults", 32, int32((noOfOperationResults))) if _noOfOperationResultsErr != nil { return errors.Wrap(_noOfOperationResultsErr, "Error serializing 'noOfOperationResults' field") } @@ -351,7 +351,7 @@ func (m *_HistoryUpdateResult) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateType.go b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateType.go index 8fc93f56f93..4fe1aa7a86f 100644 --- a/plc4go/protocols/opcua/readwrite/model/HistoryUpdateType.go +++ b/plc4go/protocols/opcua/readwrite/model/HistoryUpdateType.go @@ -144,7 +144,7 @@ func (e HistoryUpdateType) Serialize() ([]byte, error) { func (e HistoryUpdateType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("HistoryUpdateType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("HistoryUpdateType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/IdType.go b/plc4go/protocols/opcua/readwrite/model/IdType.go index 02c21f226be..c88c0dcff94 100644 --- a/plc4go/protocols/opcua/readwrite/model/IdType.go +++ b/plc4go/protocols/opcua/readwrite/model/IdType.go @@ -144,7 +144,7 @@ func (e IdType) Serialize() ([]byte, error) { func (e IdType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("IdType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("IdType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/IdentityCriteriaType.go b/plc4go/protocols/opcua/readwrite/model/IdentityCriteriaType.go index 06533a1706c..1383d41d172 100644 --- a/plc4go/protocols/opcua/readwrite/model/IdentityCriteriaType.go +++ b/plc4go/protocols/opcua/readwrite/model/IdentityCriteriaType.go @@ -168,7 +168,7 @@ func (e IdentityCriteriaType) Serialize() ([]byte, error) { func (e IdentityCriteriaType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("IdentityCriteriaType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("IdentityCriteriaType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/InterfaceAdminStatus.go b/plc4go/protocols/opcua/readwrite/model/InterfaceAdminStatus.go index 1cf6cf2b595..ecdcf183fcd 100644 --- a/plc4go/protocols/opcua/readwrite/model/InterfaceAdminStatus.go +++ b/plc4go/protocols/opcua/readwrite/model/InterfaceAdminStatus.go @@ -138,7 +138,7 @@ func (e InterfaceAdminStatus) Serialize() ([]byte, error) { func (e InterfaceAdminStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("InterfaceAdminStatus", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("InterfaceAdminStatus", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/InterfaceOperStatus.go b/plc4go/protocols/opcua/readwrite/model/InterfaceOperStatus.go index 9a43b28f9b3..f0951d7289e 100644 --- a/plc4go/protocols/opcua/readwrite/model/InterfaceOperStatus.go +++ b/plc4go/protocols/opcua/readwrite/model/InterfaceOperStatus.go @@ -162,7 +162,7 @@ func (e InterfaceOperStatus) Serialize() ([]byte, error) { func (e InterfaceOperStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("InterfaceOperStatus", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("InterfaceOperStatus", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/JsonDataSetMessageContentMask.go b/plc4go/protocols/opcua/readwrite/model/JsonDataSetMessageContentMask.go index 0560e844ca1..e5aee772a64 100644 --- a/plc4go/protocols/opcua/readwrite/model/JsonDataSetMessageContentMask.go +++ b/plc4go/protocols/opcua/readwrite/model/JsonDataSetMessageContentMask.go @@ -174,7 +174,7 @@ func (e JsonDataSetMessageContentMask) Serialize() ([]byte, error) { func (e JsonDataSetMessageContentMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("JsonDataSetMessageContentMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("JsonDataSetMessageContentMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/JsonNetworkMessageContentMask.go b/plc4go/protocols/opcua/readwrite/model/JsonNetworkMessageContentMask.go index b1d3944d0c9..4657969ffc2 100644 --- a/plc4go/protocols/opcua/readwrite/model/JsonNetworkMessageContentMask.go +++ b/plc4go/protocols/opcua/readwrite/model/JsonNetworkMessageContentMask.go @@ -162,7 +162,7 @@ func (e JsonNetworkMessageContentMask) Serialize() ([]byte, error) { func (e JsonNetworkMessageContentMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("JsonNetworkMessageContentMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("JsonNetworkMessageContentMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/LocalizedText.go b/plc4go/protocols/opcua/readwrite/model/LocalizedText.go index a81362d066c..fc98fea21ab 100644 --- a/plc4go/protocols/opcua/readwrite/model/LocalizedText.go +++ b/plc4go/protocols/opcua/readwrite/model/LocalizedText.go @@ -268,7 +268,7 @@ func (m *_LocalizedText) SerializeWithWriteBuffer(ctx context.Context, writeBuff }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 6, reserved) + _err := writeBuffer.WriteUint8("reserved", 6, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/MessageSecurityMode.go b/plc4go/protocols/opcua/readwrite/model/MessageSecurityMode.go index ad54519c7e9..ffff80a50bf 100644 --- a/plc4go/protocols/opcua/readwrite/model/MessageSecurityMode.go +++ b/plc4go/protocols/opcua/readwrite/model/MessageSecurityMode.go @@ -144,7 +144,7 @@ func (e MessageSecurityMode) Serialize() ([]byte, error) { func (e MessageSecurityMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("MessageSecurityMode", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("MessageSecurityMode", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureDataType.go b/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureDataType.go index 40f3abea07e..ed9af034fee 100644 --- a/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureDataType.go @@ -253,7 +253,7 @@ func (m *_ModelChangeStructureDataType) SerializeWithWriteBuffer(ctx context.Con // Simple Field (verb) verb := uint8(m.GetVerb()) - _verbErr := writeBuffer.WriteUint8("verb", 8, (verb)) + _verbErr := writeBuffer.WriteUint8("verb", 8, uint8((verb))) if _verbErr != nil { return errors.Wrap(_verbErr, "Error serializing 'verb' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureVerbMask.go b/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureVerbMask.go index bb351f48692..57fbf1ea355 100644 --- a/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureVerbMask.go +++ b/plc4go/protocols/opcua/readwrite/model/ModelChangeStructureVerbMask.go @@ -150,7 +150,7 @@ func (e ModelChangeStructureVerbMask) Serialize() ([]byte, error) { func (e ModelChangeStructureVerbMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("ModelChangeStructureVerbMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("ModelChangeStructureVerbMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ModificationInfo.go b/plc4go/protocols/opcua/readwrite/model/ModificationInfo.go index d446a01b01a..0c918e95801 100644 --- a/plc4go/protocols/opcua/readwrite/model/ModificationInfo.go +++ b/plc4go/protocols/opcua/readwrite/model/ModificationInfo.go @@ -229,7 +229,7 @@ func (m *_ModificationInfo) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (modificationTime) modificationTime := int64(m.GetModificationTime()) - _modificationTimeErr := writeBuffer.WriteInt64("modificationTime", 64, (modificationTime)) + _modificationTimeErr := writeBuffer.WriteInt64("modificationTime", 64, int64((modificationTime))) if _modificationTimeErr != nil { return errors.Wrap(_modificationTimeErr, "Error serializing 'modificationTime' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsRequest.go b/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsRequest.go index 197783ef252..72ef86d11f8 100644 --- a/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsRequest.go @@ -306,7 +306,7 @@ func (m *_ModifyMonitoredItemsRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } @@ -325,7 +325,7 @@ func (m *_ModifyMonitoredItemsRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfItemsToModify) noOfItemsToModify := int32(m.GetNoOfItemsToModify()) - _noOfItemsToModifyErr := writeBuffer.WriteInt32("noOfItemsToModify", 32, (noOfItemsToModify)) + _noOfItemsToModifyErr := writeBuffer.WriteInt32("noOfItemsToModify", 32, int32((noOfItemsToModify))) if _noOfItemsToModifyErr != nil { return errors.Wrap(_noOfItemsToModifyErr, "Error serializing 'noOfItemsToModify' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsResponse.go b/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsResponse.go index 59ffaea8d6d..0606d852192 100644 --- a/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/ModifyMonitoredItemsResponse.go @@ -327,7 +327,7 @@ func (m *_ModifyMonitoredItemsResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_ModifyMonitoredItemsResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionRequest.go b/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionRequest.go index 5560b44fe8b..da7d0a7ab70 100644 --- a/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionRequest.go @@ -311,7 +311,7 @@ func (m *_ModifySubscriptionRequest) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } @@ -325,28 +325,28 @@ func (m *_ModifySubscriptionRequest) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (requestedLifetimeCount) requestedLifetimeCount := uint32(m.GetRequestedLifetimeCount()) - _requestedLifetimeCountErr := writeBuffer.WriteUint32("requestedLifetimeCount", 32, (requestedLifetimeCount)) + _requestedLifetimeCountErr := writeBuffer.WriteUint32("requestedLifetimeCount", 32, uint32((requestedLifetimeCount))) if _requestedLifetimeCountErr != nil { return errors.Wrap(_requestedLifetimeCountErr, "Error serializing 'requestedLifetimeCount' field") } // Simple Field (requestedMaxKeepAliveCount) requestedMaxKeepAliveCount := uint32(m.GetRequestedMaxKeepAliveCount()) - _requestedMaxKeepAliveCountErr := writeBuffer.WriteUint32("requestedMaxKeepAliveCount", 32, (requestedMaxKeepAliveCount)) + _requestedMaxKeepAliveCountErr := writeBuffer.WriteUint32("requestedMaxKeepAliveCount", 32, uint32((requestedMaxKeepAliveCount))) if _requestedMaxKeepAliveCountErr != nil { return errors.Wrap(_requestedMaxKeepAliveCountErr, "Error serializing 'requestedMaxKeepAliveCount' field") } // Simple Field (maxNotificationsPerPublish) maxNotificationsPerPublish := uint32(m.GetMaxNotificationsPerPublish()) - _maxNotificationsPerPublishErr := writeBuffer.WriteUint32("maxNotificationsPerPublish", 32, (maxNotificationsPerPublish)) + _maxNotificationsPerPublishErr := writeBuffer.WriteUint32("maxNotificationsPerPublish", 32, uint32((maxNotificationsPerPublish))) if _maxNotificationsPerPublishErr != nil { return errors.Wrap(_maxNotificationsPerPublishErr, "Error serializing 'maxNotificationsPerPublish' field") } // Simple Field (priority) priority := uint8(m.GetPriority()) - _priorityErr := writeBuffer.WriteUint8("priority", 8, (priority)) + _priorityErr := writeBuffer.WriteUint8("priority", 8, uint8((priority))) if _priorityErr != nil { return errors.Wrap(_priorityErr, "Error serializing 'priority' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionResponse.go b/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionResponse.go index 3653c8714c5..1c5da6e3993 100644 --- a/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/ModifySubscriptionResponse.go @@ -261,14 +261,14 @@ func (m *_ModifySubscriptionResponse) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (revisedLifetimeCount) revisedLifetimeCount := uint32(m.GetRevisedLifetimeCount()) - _revisedLifetimeCountErr := writeBuffer.WriteUint32("revisedLifetimeCount", 32, (revisedLifetimeCount)) + _revisedLifetimeCountErr := writeBuffer.WriteUint32("revisedLifetimeCount", 32, uint32((revisedLifetimeCount))) if _revisedLifetimeCountErr != nil { return errors.Wrap(_revisedLifetimeCountErr, "Error serializing 'revisedLifetimeCount' field") } // Simple Field (revisedMaxKeepAliveCount) revisedMaxKeepAliveCount := uint32(m.GetRevisedMaxKeepAliveCount()) - _revisedMaxKeepAliveCountErr := writeBuffer.WriteUint32("revisedMaxKeepAliveCount", 32, (revisedMaxKeepAliveCount)) + _revisedMaxKeepAliveCountErr := writeBuffer.WriteUint32("revisedMaxKeepAliveCount", 32, uint32((revisedMaxKeepAliveCount))) if _revisedMaxKeepAliveCountErr != nil { return errors.Wrap(_revisedMaxKeepAliveCountErr, "Error serializing 'revisedMaxKeepAliveCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/MonitoredItemCreateResult.go b/plc4go/protocols/opcua/readwrite/model/MonitoredItemCreateResult.go index a0a0ee9111e..485d936a6f9 100644 --- a/plc4go/protocols/opcua/readwrite/model/MonitoredItemCreateResult.go +++ b/plc4go/protocols/opcua/readwrite/model/MonitoredItemCreateResult.go @@ -279,7 +279,7 @@ func (m *_MonitoredItemCreateResult) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (monitoredItemId) monitoredItemId := uint32(m.GetMonitoredItemId()) - _monitoredItemIdErr := writeBuffer.WriteUint32("monitoredItemId", 32, (monitoredItemId)) + _monitoredItemIdErr := writeBuffer.WriteUint32("monitoredItemId", 32, uint32((monitoredItemId))) if _monitoredItemIdErr != nil { return errors.Wrap(_monitoredItemIdErr, "Error serializing 'monitoredItemId' field") } @@ -293,7 +293,7 @@ func (m *_MonitoredItemCreateResult) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (revisedQueueSize) revisedQueueSize := uint32(m.GetRevisedQueueSize()) - _revisedQueueSizeErr := writeBuffer.WriteUint32("revisedQueueSize", 32, (revisedQueueSize)) + _revisedQueueSizeErr := writeBuffer.WriteUint32("revisedQueueSize", 32, uint32((revisedQueueSize))) if _revisedQueueSizeErr != nil { return errors.Wrap(_revisedQueueSizeErr, "Error serializing 'revisedQueueSize' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyRequest.go b/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyRequest.go index 9fbd9c4e404..f11ee2b2eb6 100644 --- a/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyRequest.go @@ -204,7 +204,7 @@ func (m *_MonitoredItemModifyRequest) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (monitoredItemId) monitoredItemId := uint32(m.GetMonitoredItemId()) - _monitoredItemIdErr := writeBuffer.WriteUint32("monitoredItemId", 32, (monitoredItemId)) + _monitoredItemIdErr := writeBuffer.WriteUint32("monitoredItemId", 32, uint32((monitoredItemId))) if _monitoredItemIdErr != nil { return errors.Wrap(_monitoredItemIdErr, "Error serializing 'monitoredItemId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyResult.go b/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyResult.go index 3d85a78b21d..6ab757ac8f8 100644 --- a/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyResult.go +++ b/plc4go/protocols/opcua/readwrite/model/MonitoredItemModifyResult.go @@ -267,7 +267,7 @@ func (m *_MonitoredItemModifyResult) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (revisedQueueSize) revisedQueueSize := uint32(m.GetRevisedQueueSize()) - _revisedQueueSizeErr := writeBuffer.WriteUint32("revisedQueueSize", 32, (revisedQueueSize)) + _revisedQueueSizeErr := writeBuffer.WriteUint32("revisedQueueSize", 32, uint32((revisedQueueSize))) if _revisedQueueSizeErr != nil { return errors.Wrap(_revisedQueueSizeErr, "Error serializing 'revisedQueueSize' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/MonitoredItemNotification.go b/plc4go/protocols/opcua/readwrite/model/MonitoredItemNotification.go index f838706ee34..4c309df8fa6 100644 --- a/plc4go/protocols/opcua/readwrite/model/MonitoredItemNotification.go +++ b/plc4go/protocols/opcua/readwrite/model/MonitoredItemNotification.go @@ -204,7 +204,7 @@ func (m *_MonitoredItemNotification) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (clientHandle) clientHandle := uint32(m.GetClientHandle()) - _clientHandleErr := writeBuffer.WriteUint32("clientHandle", 32, (clientHandle)) + _clientHandleErr := writeBuffer.WriteUint32("clientHandle", 32, uint32((clientHandle))) if _clientHandleErr != nil { return errors.Wrap(_clientHandleErr, "Error serializing 'clientHandle' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/MonitoringMode.go b/plc4go/protocols/opcua/readwrite/model/MonitoringMode.go index f7ce17983a3..a288836f569 100644 --- a/plc4go/protocols/opcua/readwrite/model/MonitoringMode.go +++ b/plc4go/protocols/opcua/readwrite/model/MonitoringMode.go @@ -138,7 +138,7 @@ func (e MonitoringMode) Serialize() ([]byte, error) { func (e MonitoringMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("MonitoringMode", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("MonitoringMode", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/MonitoringParameters.go b/plc4go/protocols/opcua/readwrite/model/MonitoringParameters.go index 4edae289a3c..891b0d120e0 100644 --- a/plc4go/protocols/opcua/readwrite/model/MonitoringParameters.go +++ b/plc4go/protocols/opcua/readwrite/model/MonitoringParameters.go @@ -284,7 +284,7 @@ func (m *_MonitoringParameters) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (clientHandle) clientHandle := uint32(m.GetClientHandle()) - _clientHandleErr := writeBuffer.WriteUint32("clientHandle", 32, (clientHandle)) + _clientHandleErr := writeBuffer.WriteUint32("clientHandle", 32, uint32((clientHandle))) if _clientHandleErr != nil { return errors.Wrap(_clientHandleErr, "Error serializing 'clientHandle' field") } @@ -310,7 +310,7 @@ func (m *_MonitoringParameters) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (queueSize) queueSize := uint32(m.GetQueueSize()) - _queueSizeErr := writeBuffer.WriteUint32("queueSize", 32, (queueSize)) + _queueSizeErr := writeBuffer.WriteUint32("queueSize", 32, uint32((queueSize))) if _queueSizeErr != nil { return errors.Wrap(_queueSizeErr, "Error serializing 'queueSize' field") } @@ -325,7 +325,7 @@ func (m *_MonitoringParameters) SerializeWithWriteBuffer(ctx context.Context, wr }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NamingRuleType.go b/plc4go/protocols/opcua/readwrite/model/NamingRuleType.go index ada1e7b1dff..8a85df03964 100644 --- a/plc4go/protocols/opcua/readwrite/model/NamingRuleType.go +++ b/plc4go/protocols/opcua/readwrite/model/NamingRuleType.go @@ -138,7 +138,7 @@ func (e NamingRuleType) Serialize() ([]byte, error) { func (e NamingRuleType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("NamingRuleType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("NamingRuleType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/NegotiationStatus.go b/plc4go/protocols/opcua/readwrite/model/NegotiationStatus.go index 79d6ce3ef49..47f45cf9780 100644 --- a/plc4go/protocols/opcua/readwrite/model/NegotiationStatus.go +++ b/plc4go/protocols/opcua/readwrite/model/NegotiationStatus.go @@ -150,7 +150,7 @@ func (e NegotiationStatus) Serialize() ([]byte, error) { func (e NegotiationStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("NegotiationStatus", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("NegotiationStatus", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/NetworkGroupDataType.go b/plc4go/protocols/opcua/readwrite/model/NetworkGroupDataType.go index bff4ec8af17..e830a504fe8 100644 --- a/plc4go/protocols/opcua/readwrite/model/NetworkGroupDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/NetworkGroupDataType.go @@ -262,7 +262,7 @@ func (m *_NetworkGroupDataType) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfNetworkPaths) noOfNetworkPaths := int32(m.GetNoOfNetworkPaths()) - _noOfNetworkPathsErr := writeBuffer.WriteInt32("noOfNetworkPaths", 32, (noOfNetworkPaths)) + _noOfNetworkPathsErr := writeBuffer.WriteInt32("noOfNetworkPaths", 32, int32((noOfNetworkPaths))) if _noOfNetworkPathsErr != nil { return errors.Wrap(_noOfNetworkPathsErr, "Error serializing 'noOfNetworkPaths' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeAttributes.go b/plc4go/protocols/opcua/readwrite/model/NodeAttributes.go index e5d698399e2..85bf33bcf41 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeAttributes.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeAttributes.go @@ -267,7 +267,7 @@ func (m *_NodeAttributes) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (specifiedAttributes) specifiedAttributes := uint32(m.GetSpecifiedAttributes()) - _specifiedAttributesErr := writeBuffer.WriteUint32("specifiedAttributes", 32, (specifiedAttributes)) + _specifiedAttributesErr := writeBuffer.WriteUint32("specifiedAttributes", 32, uint32((specifiedAttributes))) if _specifiedAttributesErr != nil { return errors.Wrap(_specifiedAttributesErr, "Error serializing 'specifiedAttributes' field") } @@ -298,14 +298,14 @@ func (m *_NodeAttributes) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (writeMask) writeMask := uint32(m.GetWriteMask()) - _writeMaskErr := writeBuffer.WriteUint32("writeMask", 32, (writeMask)) + _writeMaskErr := writeBuffer.WriteUint32("writeMask", 32, uint32((writeMask))) if _writeMaskErr != nil { return errors.Wrap(_writeMaskErr, "Error serializing 'writeMask' field") } // Simple Field (userWriteMask) userWriteMask := uint32(m.GetUserWriteMask()) - _userWriteMaskErr := writeBuffer.WriteUint32("userWriteMask", 32, (userWriteMask)) + _userWriteMaskErr := writeBuffer.WriteUint32("userWriteMask", 32, uint32((userWriteMask))) if _userWriteMaskErr != nil { return errors.Wrap(_userWriteMaskErr, "Error serializing 'userWriteMask' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeAttributesMask.go b/plc4go/protocols/opcua/readwrite/model/NodeAttributesMask.go index 830272ca7e4..182fc646e5f 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeAttributesMask.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeAttributesMask.go @@ -330,7 +330,7 @@ func (e NodeAttributesMask) Serialize() ([]byte, error) { func (e NodeAttributesMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("NodeAttributesMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("NodeAttributesMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/NodeClass.go b/plc4go/protocols/opcua/readwrite/model/NodeClass.go index c186bd34642..397ecea0d62 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeClass.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeClass.go @@ -174,7 +174,7 @@ func (e NodeClass) Serialize() ([]byte, error) { func (e NodeClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("NodeClass", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("NodeClass", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/NodeId.go b/plc4go/protocols/opcua/readwrite/model/NodeId.go index 4da2b36e3a4..0429e553284 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeId.go @@ -209,7 +209,7 @@ func (m *_NodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer util }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteInt8("reserved", 2, reserved) + _err := writeBuffer.WriteInt8("reserved", 2, int8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeIdByteString.go b/plc4go/protocols/opcua/readwrite/model/NodeIdByteString.go index 4012e874284..844581dba37 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeIdByteString.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeIdByteString.go @@ -228,7 +228,7 @@ func (m *_NodeIdByteString) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeIdFourByte.go b/plc4go/protocols/opcua/readwrite/model/NodeIdFourByte.go index 8bc9f09c2e9..5551054681d 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeIdFourByte.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeIdFourByte.go @@ -222,14 +222,14 @@ func (m *_NodeIdFourByte) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (namespaceIndex) namespaceIndex := uint8(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint8("namespaceIndex", 8, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint8("namespaceIndex", 8, uint8((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } // Simple Field (id) id := uint16(m.GetId()) - _idErr := writeBuffer.WriteUint16("id", 16, (id)) + _idErr := writeBuffer.WriteUint16("id", 16, uint16((id))) if _idErr != nil { return errors.Wrap(_idErr, "Error serializing 'id' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeIdGuid.go b/plc4go/protocols/opcua/readwrite/model/NodeIdGuid.go index 65565087ed4..4787a3c111f 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeIdGuid.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeIdGuid.go @@ -223,7 +223,7 @@ func (m *_NodeIdGuid) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeIdNumeric.go b/plc4go/protocols/opcua/readwrite/model/NodeIdNumeric.go index 58db8a4ae1e..167bd40b3c1 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeIdNumeric.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeIdNumeric.go @@ -222,14 +222,14 @@ func (m *_NodeIdNumeric) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } // Simple Field (id) id := uint32(m.GetId()) - _idErr := writeBuffer.WriteUint32("id", 32, (id)) + _idErr := writeBuffer.WriteUint32("id", 32, uint32((id))) if _idErr != nil { return errors.Wrap(_idErr, "Error serializing 'id' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeIdString.go b/plc4go/protocols/opcua/readwrite/model/NodeIdString.go index c068461fd6b..03379b8da84 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeIdString.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeIdString.go @@ -228,7 +228,7 @@ func (m *_NodeIdString) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeIdTwoByte.go b/plc4go/protocols/opcua/readwrite/model/NodeIdTwoByte.go index 1a112a4197a..ff5d54d7227 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeIdTwoByte.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeIdTwoByte.go @@ -203,7 +203,7 @@ func (m *_NodeIdTwoByte) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (id) id := uint8(m.GetId()) - _idErr := writeBuffer.WriteUint8("id", 8, (id)) + _idErr := writeBuffer.WriteUint8("id", 8, uint8((id))) if _idErr != nil { return errors.Wrap(_idErr, "Error serializing 'id' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeIdType.go b/plc4go/protocols/opcua/readwrite/model/NodeIdType.go index 682d3540bfd..8ca3eafb7c9 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeIdType.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeIdType.go @@ -156,7 +156,7 @@ func (e NodeIdType) Serialize() ([]byte, error) { func (e NodeIdType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("NodeIdType", 6, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("NodeIdType", 6, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/NodeReference.go b/plc4go/protocols/opcua/readwrite/model/NodeReference.go index 0f5d8bd2d47..0aef5b80e36 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeReference.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeReference.go @@ -349,7 +349,7 @@ func (m *_NodeReference) SerializeWithWriteBuffer(ctx context.Context, writeBuff }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -364,7 +364,7 @@ func (m *_NodeReference) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (noOfReferencedNodeIds) noOfReferencedNodeIds := int32(m.GetNoOfReferencedNodeIds()) - _noOfReferencedNodeIdsErr := writeBuffer.WriteInt32("noOfReferencedNodeIds", 32, (noOfReferencedNodeIds)) + _noOfReferencedNodeIdsErr := writeBuffer.WriteInt32("noOfReferencedNodeIds", 32, int32((noOfReferencedNodeIds))) if _noOfReferencedNodeIdsErr != nil { return errors.Wrap(_noOfReferencedNodeIdsErr, "Error serializing 'noOfReferencedNodeIds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NodeTypeDescription.go b/plc4go/protocols/opcua/readwrite/model/NodeTypeDescription.go index 3da8a211dc8..21741c77b10 100644 --- a/plc4go/protocols/opcua/readwrite/model/NodeTypeDescription.go +++ b/plc4go/protocols/opcua/readwrite/model/NodeTypeDescription.go @@ -312,7 +312,7 @@ func (m *_NodeTypeDescription) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -327,7 +327,7 @@ func (m *_NodeTypeDescription) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfDataToReturn) noOfDataToReturn := int32(m.GetNoOfDataToReturn()) - _noOfDataToReturnErr := writeBuffer.WriteInt32("noOfDataToReturn", 32, (noOfDataToReturn)) + _noOfDataToReturnErr := writeBuffer.WriteInt32("noOfDataToReturn", 32, int32((noOfDataToReturn))) if _noOfDataToReturnErr != nil { return errors.Wrap(_noOfDataToReturnErr, "Error serializing 'noOfDataToReturn' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NotificationMessage.go b/plc4go/protocols/opcua/readwrite/model/NotificationMessage.go index d1b37dce022..32037994691 100644 --- a/plc4go/protocols/opcua/readwrite/model/NotificationMessage.go +++ b/plc4go/protocols/opcua/readwrite/model/NotificationMessage.go @@ -263,21 +263,21 @@ func (m *_NotificationMessage) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (sequenceNumber) sequenceNumber := uint32(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteUint32("sequenceNumber", 32, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint32("sequenceNumber", 32, uint32((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } // Simple Field (publishTime) publishTime := int64(m.GetPublishTime()) - _publishTimeErr := writeBuffer.WriteInt64("publishTime", 64, (publishTime)) + _publishTimeErr := writeBuffer.WriteInt64("publishTime", 64, int64((publishTime))) if _publishTimeErr != nil { return errors.Wrap(_publishTimeErr, "Error serializing 'publishTime' field") } // Simple Field (noOfNotificationData) noOfNotificationData := int32(m.GetNoOfNotificationData()) - _noOfNotificationDataErr := writeBuffer.WriteInt32("noOfNotificationData", 32, (noOfNotificationData)) + _noOfNotificationDataErr := writeBuffer.WriteInt32("noOfNotificationData", 32, int32((noOfNotificationData))) if _noOfNotificationDataErr != nil { return errors.Wrap(_noOfNotificationDataErr, "Error serializing 'noOfNotificationData' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/NumericNodeId.go b/plc4go/protocols/opcua/readwrite/model/NumericNodeId.go index 06c6c07600b..75f35473dd8 100644 --- a/plc4go/protocols/opcua/readwrite/model/NumericNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/NumericNodeId.go @@ -166,14 +166,14 @@ func (m *_NumericNodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } // Simple Field (identifier) identifier := uint32(m.GetIdentifier()) - _identifierErr := writeBuffer.WriteUint32("identifier", 32, (identifier)) + _identifierErr := writeBuffer.WriteUint32("identifier", 32, uint32((identifier))) if _identifierErr != nil { return errors.Wrap(_identifierErr, "Error serializing 'identifier' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaAcknowledgeResponse.go b/plc4go/protocols/opcua/readwrite/model/OpcuaAcknowledgeResponse.go index 10c07b927e2..10b3314e3db 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaAcknowledgeResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaAcknowledgeResponse.go @@ -295,42 +295,42 @@ func (m *_OpcuaAcknowledgeResponse) SerializeWithWriteBuffer(ctx context.Context // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } // Simple Field (version) version := int32(m.GetVersion()) - _versionErr := writeBuffer.WriteInt32("version", 32, (version)) + _versionErr := writeBuffer.WriteInt32("version", 32, int32((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } // Simple Field (receiveBufferSize) receiveBufferSize := int32(m.GetReceiveBufferSize()) - _receiveBufferSizeErr := writeBuffer.WriteInt32("receiveBufferSize", 32, (receiveBufferSize)) + _receiveBufferSizeErr := writeBuffer.WriteInt32("receiveBufferSize", 32, int32((receiveBufferSize))) if _receiveBufferSizeErr != nil { return errors.Wrap(_receiveBufferSizeErr, "Error serializing 'receiveBufferSize' field") } // Simple Field (sendBufferSize) sendBufferSize := int32(m.GetSendBufferSize()) - _sendBufferSizeErr := writeBuffer.WriteInt32("sendBufferSize", 32, (sendBufferSize)) + _sendBufferSizeErr := writeBuffer.WriteInt32("sendBufferSize", 32, int32((sendBufferSize))) if _sendBufferSizeErr != nil { return errors.Wrap(_sendBufferSizeErr, "Error serializing 'sendBufferSize' field") } // Simple Field (maxMessageSize) maxMessageSize := int32(m.GetMaxMessageSize()) - _maxMessageSizeErr := writeBuffer.WriteInt32("maxMessageSize", 32, (maxMessageSize)) + _maxMessageSizeErr := writeBuffer.WriteInt32("maxMessageSize", 32, int32((maxMessageSize))) if _maxMessageSizeErr != nil { return errors.Wrap(_maxMessageSizeErr, "Error serializing 'maxMessageSize' field") } // Simple Field (maxChunkCount) maxChunkCount := int32(m.GetMaxChunkCount()) - _maxChunkCountErr := writeBuffer.WriteInt32("maxChunkCount", 32, (maxChunkCount)) + _maxChunkCountErr := writeBuffer.WriteInt32("maxChunkCount", 32, int32((maxChunkCount))) if _maxChunkCountErr != nil { return errors.Wrap(_maxChunkCountErr, "Error serializing 'maxChunkCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaCloseRequest.go b/plc4go/protocols/opcua/readwrite/model/OpcuaCloseRequest.go index 557580d0528..234446b357a 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaCloseRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaCloseRequest.go @@ -301,35 +301,35 @@ func (m *_OpcuaCloseRequest) SerializeWithWriteBuffer(ctx context.Context, write // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } // Simple Field (secureChannelId) secureChannelId := int32(m.GetSecureChannelId()) - _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, (secureChannelId)) + _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, int32((secureChannelId))) if _secureChannelIdErr != nil { return errors.Wrap(_secureChannelIdErr, "Error serializing 'secureChannelId' field") } // Simple Field (secureTokenId) secureTokenId := int32(m.GetSecureTokenId()) - _secureTokenIdErr := writeBuffer.WriteInt32("secureTokenId", 32, (secureTokenId)) + _secureTokenIdErr := writeBuffer.WriteInt32("secureTokenId", 32, int32((secureTokenId))) if _secureTokenIdErr != nil { return errors.Wrap(_secureTokenIdErr, "Error serializing 'secureTokenId' field") } // Simple Field (sequenceNumber) sequenceNumber := int32(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, int32((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } // Simple Field (requestId) requestId := int32(m.GetRequestId()) - _requestIdErr := writeBuffer.WriteInt32("requestId", 32, (requestId)) + _requestIdErr := writeBuffer.WriteInt32("requestId", 32, int32((requestId))) if _requestIdErr != nil { return errors.Wrap(_requestIdErr, "Error serializing 'requestId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaHelloRequest.go b/plc4go/protocols/opcua/readwrite/model/OpcuaHelloRequest.go index e0b13dfde94..28e98e0283d 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaHelloRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaHelloRequest.go @@ -320,42 +320,42 @@ func (m *_OpcuaHelloRequest) SerializeWithWriteBuffer(ctx context.Context, write // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } // Simple Field (version) version := int32(m.GetVersion()) - _versionErr := writeBuffer.WriteInt32("version", 32, (version)) + _versionErr := writeBuffer.WriteInt32("version", 32, int32((version))) if _versionErr != nil { return errors.Wrap(_versionErr, "Error serializing 'version' field") } // Simple Field (receiveBufferSize) receiveBufferSize := int32(m.GetReceiveBufferSize()) - _receiveBufferSizeErr := writeBuffer.WriteInt32("receiveBufferSize", 32, (receiveBufferSize)) + _receiveBufferSizeErr := writeBuffer.WriteInt32("receiveBufferSize", 32, int32((receiveBufferSize))) if _receiveBufferSizeErr != nil { return errors.Wrap(_receiveBufferSizeErr, "Error serializing 'receiveBufferSize' field") } // Simple Field (sendBufferSize) sendBufferSize := int32(m.GetSendBufferSize()) - _sendBufferSizeErr := writeBuffer.WriteInt32("sendBufferSize", 32, (sendBufferSize)) + _sendBufferSizeErr := writeBuffer.WriteInt32("sendBufferSize", 32, int32((sendBufferSize))) if _sendBufferSizeErr != nil { return errors.Wrap(_sendBufferSizeErr, "Error serializing 'sendBufferSize' field") } // Simple Field (maxMessageSize) maxMessageSize := int32(m.GetMaxMessageSize()) - _maxMessageSizeErr := writeBuffer.WriteInt32("maxMessageSize", 32, (maxMessageSize)) + _maxMessageSizeErr := writeBuffer.WriteInt32("maxMessageSize", 32, int32((maxMessageSize))) if _maxMessageSizeErr != nil { return errors.Wrap(_maxMessageSizeErr, "Error serializing 'maxMessageSize' field") } // Simple Field (maxChunkCount) maxChunkCount := int32(m.GetMaxChunkCount()) - _maxChunkCountErr := writeBuffer.WriteInt32("maxChunkCount", 32, (maxChunkCount)) + _maxChunkCountErr := writeBuffer.WriteInt32("maxChunkCount", 32, int32((maxChunkCount))) if _maxChunkCountErr != nil { return errors.Wrap(_maxChunkCountErr, "Error serializing 'maxChunkCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaMessageError.go b/plc4go/protocols/opcua/readwrite/model/OpcuaMessageError.go index 4a2dba0ba39..49eeb2541a4 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaMessageError.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaMessageError.go @@ -250,7 +250,7 @@ func (m *_OpcuaMessageError) SerializeWithWriteBuffer(ctx context.Context, write // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaMessageRequest.go b/plc4go/protocols/opcua/readwrite/model/OpcuaMessageRequest.go index fc99a6b9e80..86dfe9ff6d8 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaMessageRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaMessageRequest.go @@ -296,35 +296,35 @@ func (m *_OpcuaMessageRequest) SerializeWithWriteBuffer(ctx context.Context, wri // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } // Simple Field (secureChannelId) secureChannelId := int32(m.GetSecureChannelId()) - _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, (secureChannelId)) + _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, int32((secureChannelId))) if _secureChannelIdErr != nil { return errors.Wrap(_secureChannelIdErr, "Error serializing 'secureChannelId' field") } // Simple Field (secureTokenId) secureTokenId := int32(m.GetSecureTokenId()) - _secureTokenIdErr := writeBuffer.WriteInt32("secureTokenId", 32, (secureTokenId)) + _secureTokenIdErr := writeBuffer.WriteInt32("secureTokenId", 32, int32((secureTokenId))) if _secureTokenIdErr != nil { return errors.Wrap(_secureTokenIdErr, "Error serializing 'secureTokenId' field") } // Simple Field (sequenceNumber) sequenceNumber := int32(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, int32((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } // Simple Field (requestId) requestId := int32(m.GetRequestId()) - _requestIdErr := writeBuffer.WriteInt32("requestId", 32, (requestId)) + _requestIdErr := writeBuffer.WriteInt32("requestId", 32, int32((requestId))) if _requestIdErr != nil { return errors.Wrap(_requestIdErr, "Error serializing 'requestId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaMessageResponse.go b/plc4go/protocols/opcua/readwrite/model/OpcuaMessageResponse.go index 098d1f271e4..5dc106f5111 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaMessageResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaMessageResponse.go @@ -296,35 +296,35 @@ func (m *_OpcuaMessageResponse) SerializeWithWriteBuffer(ctx context.Context, wr // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } // Simple Field (secureChannelId) secureChannelId := int32(m.GetSecureChannelId()) - _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, (secureChannelId)) + _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, int32((secureChannelId))) if _secureChannelIdErr != nil { return errors.Wrap(_secureChannelIdErr, "Error serializing 'secureChannelId' field") } // Simple Field (secureTokenId) secureTokenId := int32(m.GetSecureTokenId()) - _secureTokenIdErr := writeBuffer.WriteInt32("secureTokenId", 32, (secureTokenId)) + _secureTokenIdErr := writeBuffer.WriteInt32("secureTokenId", 32, int32((secureTokenId))) if _secureTokenIdErr != nil { return errors.Wrap(_secureTokenIdErr, "Error serializing 'secureTokenId' field") } // Simple Field (sequenceNumber) sequenceNumber := int32(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, int32((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } // Simple Field (requestId) requestId := int32(m.GetRequestId()) - _requestIdErr := writeBuffer.WriteInt32("requestId", 32, (requestId)) + _requestIdErr := writeBuffer.WriteInt32("requestId", 32, int32((requestId))) if _requestIdErr != nil { return errors.Wrap(_requestIdErr, "Error serializing 'requestId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesDataType.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesDataType.go index 2a6c65d12cb..3eac9c56e8f 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesDataType.go @@ -2748,7 +2748,7 @@ func (e OpcuaNodeIdServicesDataType) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesDataType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesDataType", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesDataType", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesMethod.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesMethod.go index e7ef1e65d75..25f81667ee9 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesMethod.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesMethod.go @@ -13956,7 +13956,7 @@ func (e OpcuaNodeIdServicesMethod) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesMethod) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesMethod", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesMethod", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObject.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObject.go index f1e3c20688f..e994b86785f 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObject.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObject.go @@ -9534,7 +9534,7 @@ func (e OpcuaNodeIdServicesObject) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesObject) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesObject", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesObject", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObjectType.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObjectType.go index ea360c9b679..8132d50a191 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObjectType.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesObjectType.go @@ -1632,7 +1632,7 @@ func (e OpcuaNodeIdServicesObjectType) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesObjectType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesObjectType", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesObjectType", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesReferenceType.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesReferenceType.go index b8d43b1baa3..07368a66df2 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesReferenceType.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesReferenceType.go @@ -522,7 +522,7 @@ func (e OpcuaNodeIdServicesReferenceType) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesReferenceType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesReferenceType", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesReferenceType", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAccess.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAccess.go index 9f78255490b..a3870c7d357 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAccess.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAccess.go @@ -138,7 +138,7 @@ func (e OpcuaNodeIdServicesVariableAccess) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAccess) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAccess", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAccess", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAcknowledgeable.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAcknowledgeable.go index bf2416dc184..fe8442c0f0b 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAcknowledgeable.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAcknowledgeable.go @@ -456,7 +456,7 @@ func (e OpcuaNodeIdServicesVariableAcknowledgeable) Serialize() ([]byte, error) func (e OpcuaNodeIdServicesVariableAcknowledgeable) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAcknowledgeable", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAcknowledgeable", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAdd.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAdd.go index 73a7749ccc2..daf7c3300b6 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAdd.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAdd.go @@ -318,7 +318,7 @@ func (e OpcuaNodeIdServicesVariableAdd) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAdd) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAdd", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAdd", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAddress.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAddress.go index 9cbc8ebd396..7485b8a0186 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAddress.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAddress.go @@ -216,7 +216,7 @@ func (e OpcuaNodeIdServicesVariableAddress) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAddress) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAddress", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAddress", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAggregate.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAggregate.go index 6fdc9f087aa..e121fba50bc 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAggregate.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAggregate.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableAggregate) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAggregate) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAggregate", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAggregate", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlarm.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlarm.go index 691b0e887d7..c154d748b60 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlarm.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlarm.go @@ -2688,7 +2688,7 @@ func (e OpcuaNodeIdServicesVariableAlarm) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAlarm) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAlarm", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAlarm", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlias.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlias.go index 9cdc08e2ef1..dc68bba5e45 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlias.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAlias.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableAlias) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAlias) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAlias", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAlias", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAliases.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAliases.go index 79d61065687..47f223b1619 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAliases.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAliases.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableAliases) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAliases) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAliases", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAliases", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAllow.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAllow.go index fb5a6fd168c..45e81886cae 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAllow.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAllow.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableAllow) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAllow) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAllow", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAllow", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnalog.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnalog.go index 0b15afca74e..97385da054e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnalog.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnalog.go @@ -210,7 +210,7 @@ func (e OpcuaNodeIdServicesVariableAnalog) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAnalog) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAnalog", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAnalog", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnnotations.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnnotations.go index 34e234c70f7..cdebfdc4489 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnnotations.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAnnotations.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableAnnotations) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAnnotations) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAnnotations", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAnnotations", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableApplication.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableApplication.go index 279eb141666..610079a1784 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableApplication.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableApplication.go @@ -5784,7 +5784,7 @@ func (e OpcuaNodeIdServicesVariableApplication) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableApplication) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableApplication", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableApplication", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableArray.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableArray.go index fce4d3fe52a..1440c98e3fe 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableArray.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableArray.go @@ -162,7 +162,7 @@ func (e OpcuaNodeIdServicesVariableArray) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableArray) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableArray", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableArray", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAttribute.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAttribute.go index 1edf789408d..3137740d258 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAttribute.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAttribute.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableAttribute) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAttribute) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAttribute", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAttribute", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudio.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudio.go index bd16795d332..e13c2be2976 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudio.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudio.go @@ -138,7 +138,7 @@ func (e OpcuaNodeIdServicesVariableAudio) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAudio) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAudio", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAudio", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudit.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudit.go index 297cd642827..61d7e0f573f 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudit.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAudit.go @@ -6030,7 +6030,7 @@ func (e OpcuaNodeIdServicesVariableAudit) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAudit) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAudit", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAudit", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAuthorization.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAuthorization.go index 4cdab2a0892..0ac4018d7bb 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAuthorization.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAuthorization.go @@ -156,7 +156,7 @@ func (e OpcuaNodeIdServicesVariableAuthorization) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAuthorization) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAuthorization", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAuthorization", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAxis.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAxis.go index 21f9e260dc6..27e49b516dd 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAxis.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableAxis.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableAxis) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableAxis) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAxis", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableAxis", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBase.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBase.go index bf6d5e2308e..e68ae4825a8 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBase.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBase.go @@ -306,7 +306,7 @@ func (e OpcuaNodeIdServicesVariableBase) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableBase) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBase", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBase", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBroker.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBroker.go index eafc19e9b1d..3bb43c4969a 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBroker.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBroker.go @@ -228,7 +228,7 @@ func (e OpcuaNodeIdServicesVariableBroker) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableBroker) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBroker", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBroker", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBrowse.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBrowse.go index 687c2bf7f91..f05a4e8f14b 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBrowse.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBrowse.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableBrowse) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableBrowse) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBrowse", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBrowse", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBuild.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBuild.go index 8d717cae83a..757038b4599 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBuild.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableBuild.go @@ -156,7 +156,7 @@ func (e OpcuaNodeIdServicesVariableBuild) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableBuild) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBuild", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableBuild", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCartesian.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCartesian.go index cf97cb9fe43..a5596860a7e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCartesian.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCartesian.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableCartesian) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableCartesian) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCartesian", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCartesian", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCertificate.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCertificate.go index 2d6230c6553..f9c155d2314 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCertificate.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCertificate.go @@ -10428,7 +10428,7 @@ func (e OpcuaNodeIdServicesVariableCertificate) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableCertificate) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCertificate", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCertificate", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChange.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChange.go index 3747de8fa1c..8cb69c62f93 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChange.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChange.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableChange) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableChange) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableChange", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableChange", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChoice.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChoice.go index 962474da677..9458d3b2478 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChoice.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableChoice.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableChoice) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableChoice) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableChoice", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableChoice", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableClose.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableClose.go index 388d70dc7e2..80e54c019b0 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableClose.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableClose.go @@ -150,7 +150,7 @@ func (e OpcuaNodeIdServicesVariableClose) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableClose) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableClose", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableClose", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCondition.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCondition.go index 3dd1402663e..17228f65f9a 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCondition.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCondition.go @@ -354,7 +354,7 @@ func (e OpcuaNodeIdServicesVariableCondition) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableCondition) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCondition", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCondition", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableConnect.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableConnect.go index 6bef67b5633..a054cddb860 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableConnect.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableConnect.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableConnect) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableConnect) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableConnect", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableConnect", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCreate.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCreate.go index 460521f4466..38a0a92d944 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCreate.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCreate.go @@ -168,7 +168,7 @@ func (e OpcuaNodeIdServicesVariableCreate) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableCreate) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCreate", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCreate", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCube.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCube.go index 9884126c7c8..95073e04f3c 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCube.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCube.go @@ -180,7 +180,7 @@ func (e OpcuaNodeIdServicesVariableCube) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableCube) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCube", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCube", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCurrency.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCurrency.go index 31b340a2b99..c7463edf3ec 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCurrency.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableCurrency.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableCurrency) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableCurrency) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCurrency", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableCurrency", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableData.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableData.go index aaa76a9a8f5..bca43b5cb58 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableData.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableData.go @@ -2364,7 +2364,7 @@ func (e OpcuaNodeIdServicesVariableData) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableData) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableData", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableData", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDatagram.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDatagram.go index b86418b0d2e..05e88482147 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDatagram.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDatagram.go @@ -270,7 +270,7 @@ func (e OpcuaNodeIdServicesVariableDatagram) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDatagram) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDatagram", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDatagram", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDeadband.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDeadband.go index 25a03b6fdf5..7f2985e6f2b 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDeadband.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDeadband.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableDeadband) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDeadband) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDeadband", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDeadband", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDefault.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDefault.go index bd715b851ba..7a2f9f723e7 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDefault.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDefault.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableDefault) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDefault) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDefault", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDefault", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDelete.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDelete.go index be4beb1ce15..6e036b24bc4 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDelete.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDelete.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableDelete) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDelete) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDelete", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDelete", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDevice.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDevice.go index 4714ed9bf70..67c71cc94c1 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDevice.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDevice.go @@ -198,7 +198,7 @@ func (e OpcuaNodeIdServicesVariableDevice) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDevice) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDevice", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDevice", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiagnostics.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiagnostics.go index 50fca8a9c48..e0c2767e10d 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiagnostics.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiagnostics.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableDiagnostics) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDiagnostics) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDiagnostics", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDiagnostics", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDialog.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDialog.go index 437ba88916a..99dbdd2a901 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDialog.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDialog.go @@ -450,7 +450,7 @@ func (e OpcuaNodeIdServicesVariableDialog) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDialog) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDialog", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDialog", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDisconnect.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDisconnect.go index d17716ed688..325e23cad95 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDisconnect.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDisconnect.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableDisconnect) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDisconnect) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDisconnect", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDisconnect", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrepancy.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrepancy.go index 3c926b3f866..08586b092e8 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrepancy.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrepancy.go @@ -966,7 +966,7 @@ func (e OpcuaNodeIdServicesVariableDiscrepancy) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDiscrepancy) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDiscrepancy", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDiscrepancy", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrete.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrete.go index f88b592d2bd..df261dcda21 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrete.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDiscrete.go @@ -960,7 +960,7 @@ func (e OpcuaNodeIdServicesVariableDiscrete) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDiscrete) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDiscrete", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDiscrete", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDuplex.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDuplex.go index 60489146cd8..3830b6c8986 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDuplex.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableDuplex.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableDuplex) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableDuplex) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDuplex", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableDuplex", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEngineering.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEngineering.go index b66a81ce0ce..0c2b808a6e4 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEngineering.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEngineering.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableEngineering) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableEngineering) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableEngineering", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableEngineering", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEnum.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEnum.go index b8061a25778..f8817e996a5 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEnum.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEnum.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableEnum) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableEnum) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableEnum", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableEnum", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEvent.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEvent.go index 0bbd0d4959f..5cf035dad2e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEvent.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableEvent.go @@ -204,7 +204,7 @@ func (e OpcuaNodeIdServicesVariableEvent) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableEvent) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableEvent", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableEvent", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableException.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableException.go index 819c927a5db..112867be442 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableException.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableException.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableException) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableException) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableException", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableException", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExclusive.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExclusive.go index 645d152f7f7..e8862ccab42 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExclusive.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExclusive.go @@ -4272,7 +4272,7 @@ func (e OpcuaNodeIdServicesVariableExclusive) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableExclusive) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableExclusive", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableExclusive", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExpression.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExpression.go index 2d3242dff1b..266b508665a 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExpression.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExpression.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableExpression) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableExpression) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableExpression", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableExpression", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExtension.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExtension.go index 4d551532b7c..ddecd19ec1c 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExtension.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableExtension.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableExtension) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableExtension) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableExtension", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableExtension", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFile.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFile.go index 12046c45281..038adc4d928 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFile.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFile.go @@ -738,7 +738,7 @@ func (e OpcuaNodeIdServicesVariableFile) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableFile) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFile", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFile", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFilter.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFilter.go index fd979fae98e..0e0da95452e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFilter.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFilter.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableFilter) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableFilter) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFilter", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFilter", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFind.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFind.go index e419514f458..182ffaab315 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFind.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFind.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableFind) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableFind) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFind", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFind", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFinite.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFinite.go index ee7573c4dd8..f45846637cd 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFinite.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFinite.go @@ -252,7 +252,7 @@ func (e OpcuaNodeIdServicesVariableFinite) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableFinite) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFinite", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFinite", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFrame.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFrame.go index 8283bcb4014..b037519d39e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFrame.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableFrame.go @@ -162,7 +162,7 @@ func (e OpcuaNodeIdServicesVariableFrame) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableFrame) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFrame", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableFrame", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGeneral.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGeneral.go index f88036e09a0..23e835b574a 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGeneral.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGeneral.go @@ -204,7 +204,7 @@ func (e OpcuaNodeIdServicesVariableGeneral) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableGeneral) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableGeneral", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableGeneral", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGenerate.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGenerate.go index 9750d34c2c4..e4f9aeb64f3 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGenerate.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGenerate.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableGenerate) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableGenerate) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableGenerate", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableGenerate", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGet.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGet.go index c6a13e14c8e..5723940754e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGet.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableGet.go @@ -252,7 +252,7 @@ func (e OpcuaNodeIdServicesVariableGet) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableGet) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableGet", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableGet", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableH.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableH.go index 19fe23c8814..c57c64bcead 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableH.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableH.go @@ -198,7 +198,7 @@ func (e OpcuaNodeIdServicesVariableH) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableH) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableH", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableH", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistorical.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistorical.go index 9db4c266665..eb7968a3b5b 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistorical.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistorical.go @@ -204,7 +204,7 @@ func (e OpcuaNodeIdServicesVariableHistorical) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableHistorical) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableHistorical", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableHistorical", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistory.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistory.go index ce09029cd44..708aacb5c09 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistory.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableHistory.go @@ -306,7 +306,7 @@ func (e OpcuaNodeIdServicesVariableHistory) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableHistory) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableHistory", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableHistory", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableI.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableI.go index 3e66642b32e..ebf3a85a4e3 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableI.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableI.go @@ -432,7 +432,7 @@ func (e OpcuaNodeIdServicesVariableI) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableI) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableI", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableI", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIcon.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIcon.go index 37804336b2b..6057c189404 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIcon.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIcon.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableIcon) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableIcon) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableIcon", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableIcon", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableId.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableId.go index 097da3f9f31..049994c0b89 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableId.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableId.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableId) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableId", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableId", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIdentity.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIdentity.go index f09563e6f29..d13bb58a30d 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIdentity.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIdentity.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableIdentity) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableIdentity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableIdentity", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableIdentity", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIetf.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIetf.go index 1c54a3fef2d..61e54ba4b40 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIetf.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableIetf.go @@ -174,7 +174,7 @@ func (e OpcuaNodeIdServicesVariableIetf) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableIetf) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableIetf", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableIetf", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableImage.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableImage.go index 40a7dee4786..837215fe894 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableImage.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableImage.go @@ -174,7 +174,7 @@ func (e OpcuaNodeIdServicesVariableImage) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableImage) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableImage", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableImage", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInitial.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInitial.go index 67c859be921..015cdf34d6b 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInitial.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInitial.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableInitial) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableInitial) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInitial", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInitial", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInput.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInput.go index 4535923c548..b27cb1868e2 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInput.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInput.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableInput) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableInput) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInput", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInput", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInstrument.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInstrument.go index b6e5dd1acfd..c2a05bf41f4 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInstrument.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInstrument.go @@ -954,7 +954,7 @@ func (e OpcuaNodeIdServicesVariableInstrument) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableInstrument) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInstrument", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInstrument", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInterface.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInterface.go index 7c97bbf5265..7cc6365ca1f 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInterface.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableInterface.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableInterface) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableInterface) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInterface", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableInterface", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableJson.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableJson.go index c20490a61b2..9b025084646 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableJson.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableJson.go @@ -156,7 +156,7 @@ func (e OpcuaNodeIdServicesVariableJson) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableJson) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableJson", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableJson", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableKey.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableKey.go index b529109ee69..7e863544462 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableKey.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableKey.go @@ -654,7 +654,7 @@ func (e OpcuaNodeIdServicesVariableKey) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableKey) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableKey", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableKey", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLimit.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLimit.go index 6138b8569e7..2ebde7d3b03 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLimit.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLimit.go @@ -1044,7 +1044,7 @@ func (e OpcuaNodeIdServicesVariableLimit) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableLimit) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableLimit", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableLimit", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLocal.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLocal.go index 05cdda09f8e..b453c9b21fb 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLocal.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableLocal.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableLocal) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableLocal) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableLocal", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableLocal", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMax.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMax.go index dd8bc40065c..65705a20040 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMax.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMax.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableMax) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableMax) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMax", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMax", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMessage.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMessage.go index 79e4347d258..14fb1c03623 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMessage.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMessage.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableMessage) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableMessage) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMessage", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMessage", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModel.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModel.go index a425a0dc5db..1146d44c8fb 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModel.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModel.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableModel) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableModel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableModel", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableModel", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModify.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModify.go index e295af66302..026efb27f24 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModify.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableModify.go @@ -186,7 +186,7 @@ func (e OpcuaNodeIdServicesVariableModify) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableModify) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableModify", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableModify", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMonitoring.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMonitoring.go index 6e4dbe9fed8..03072b6b0c1 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMonitoring.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMonitoring.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableMonitoring) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableMonitoring) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMonitoring", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMonitoring", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMove.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMove.go index 84a304f07f9..ad77f6248f6 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMove.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMove.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableMove) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableMove) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMove", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMove", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMulti.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMulti.go index 9df840edad3..88656e48beb 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMulti.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableMulti.go @@ -234,7 +234,7 @@ func (e OpcuaNodeIdServicesVariableMulti) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableMulti) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMulti", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableMulti", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableN.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableN.go index 525f3c8ca35..fca406fe673 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableN.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableN.go @@ -168,7 +168,7 @@ func (e OpcuaNodeIdServicesVariableN) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableN) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableN", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableN", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespace.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespace.go index 56c9f4d90f3..7b9bbd94b32 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespace.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespace.go @@ -282,7 +282,7 @@ func (e OpcuaNodeIdServicesVariableNamespace) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableNamespace) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNamespace", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNamespace", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespaces.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespaces.go index 2e173c6203b..01f44ba91ff 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespaces.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNamespaces.go @@ -282,7 +282,7 @@ func (e OpcuaNodeIdServicesVariableNamespaces) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableNamespaces) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNamespaces", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNamespaces", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNaming.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNaming.go index f43cc59b414..16409078b05 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNaming.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNaming.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableNaming) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableNaming) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNaming", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNaming", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNegotiation.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNegotiation.go index 293f333f181..4e38bebea7e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNegotiation.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNegotiation.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableNegotiation) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableNegotiation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNegotiation", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNegotiation", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNetwork.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNetwork.go index eba324db304..aafad3003fd 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNetwork.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNetwork.go @@ -174,7 +174,7 @@ func (e OpcuaNodeIdServicesVariableNetwork) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableNetwork) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNetwork", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNetwork", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNode.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNode.go index fef9fef9839..559aaca3e96 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNode.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNode.go @@ -138,7 +138,7 @@ func (e OpcuaNodeIdServicesVariableNode) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableNode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNode", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNode", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNon.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNon.go index a41b811da6a..64eeb2542bf 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNon.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableNon.go @@ -4728,7 +4728,7 @@ func (e OpcuaNodeIdServicesVariableNon) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableNon) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNon", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableNon", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableO.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableO.go index 8e830fa9489..e70c136ef64 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableO.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableO.go @@ -282,7 +282,7 @@ func (e OpcuaNodeIdServicesVariableO) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableO) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableO", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableO", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOff.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOff.go index de8c306a6cb..1249fa9edbc 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOff.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOff.go @@ -954,7 +954,7 @@ func (e OpcuaNodeIdServicesVariableOff) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOff) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOff", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOff", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpc.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpc.go index 377fa8e2533..33194b03011 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpc.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpc.go @@ -5748,7 +5748,7 @@ func (e OpcuaNodeIdServicesVariableOpc) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOpc) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOpc", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOpc", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpen.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpen.go index 34e60b2889a..7b05b9c9d5d 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpen.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOpen.go @@ -150,7 +150,7 @@ func (e OpcuaNodeIdServicesVariableOpen) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOpen) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOpen", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOpen", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOperation.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOperation.go index b32bb4de165..62f81d86bc9 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOperation.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOperation.go @@ -192,7 +192,7 @@ func (e OpcuaNodeIdServicesVariableOperation) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOperation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOperation", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOperation", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOption.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOption.go index b448f0b0328..6835f52a269 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOption.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOption.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableOption) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOption) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOption", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOption", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrdered.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrdered.go index 6e53e328efa..0e204eba7e1 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrdered.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrdered.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableOrdered) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOrdered) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOrdered", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOrdered", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrientation.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrientation.go index ab110b7dd21..d6cad550b9a 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrientation.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOrientation.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableOrientation) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOrientation) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOrientation", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOrientation", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOutput.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOutput.go index b1aa625ef6b..50372e6f952 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOutput.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOutput.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableOutput) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOutput) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOutput", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOutput", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOverride.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOverride.go index ca0c4cfb8c6..cccad949a08 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOverride.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableOverride.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableOverride) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableOverride) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOverride", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableOverride", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePassword.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePassword.go index 69e2908e573..1f57857380d 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePassword.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePassword.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariablePassword) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariablePassword) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePassword", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePassword", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePerform.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePerform.go index 4ef54d29cf8..0164515c1fa 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePerform.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePerform.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariablePerform) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariablePerform) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePerform", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePerform", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePermission.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePermission.go index 5ffbeb50ed9..e7be178b706 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePermission.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePermission.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariablePermission) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariablePermission) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePermission", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePermission", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePriority.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePriority.go index 184a2092e90..916ac9f0857 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePriority.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePriority.go @@ -138,7 +138,7 @@ func (e OpcuaNodeIdServicesVariablePriority) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariablePriority) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePriority", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePriority", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgram.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgram.go index 7a4f138513a..3356659e4f4 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgram.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgram.go @@ -876,7 +876,7 @@ func (e OpcuaNodeIdServicesVariableProgram) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableProgram) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableProgram", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableProgram", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgress.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgress.go index f5baceeff69..f4ca1773137 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgress.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProgress.go @@ -210,7 +210,7 @@ func (e OpcuaNodeIdServicesVariableProgress) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableProgress) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableProgress", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableProgress", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProvisionable.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProvisionable.go index de60eba12a5..87f892f7bed 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProvisionable.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableProvisionable.go @@ -11472,7 +11472,7 @@ func (e OpcuaNodeIdServicesVariableProvisionable) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableProvisionable) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableProvisionable", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableProvisionable", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePub.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePub.go index 1952277aa5b..14b11ec8d87 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePub.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePub.go @@ -4680,7 +4680,7 @@ func (e OpcuaNodeIdServicesVariablePub) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariablePub) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePub", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePub", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublish.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublish.go index cd9edb6b589..f43e37d5846 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublish.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublish.go @@ -2364,7 +2364,7 @@ func (e OpcuaNodeIdServicesVariablePublish) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariablePublish) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePublish", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePublish", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublished.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublished.go index 65389cf240c..98d02973d78 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublished.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariablePublished.go @@ -1422,7 +1422,7 @@ func (e OpcuaNodeIdServicesVariablePublished) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariablePublished) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePublished", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariablePublished", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRational.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRational.go index 81a8cd54577..09cb488bda4 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRational.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRational.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableRational) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableRational) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRational", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRational", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRead.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRead.go index f3f2d65b68b..2acdc9fddcc 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRead.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRead.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableRead) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableRead) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRead", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRead", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReader.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReader.go index d9b289fe7f7..436db770e19 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReader.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReader.go @@ -1026,7 +1026,7 @@ func (e OpcuaNodeIdServicesVariableReader) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableReader) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableReader", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableReader", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRedundancy.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRedundancy.go index 7a83037af92..af534904910 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRedundancy.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRedundancy.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableRedundancy) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableRedundancy) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRedundancy", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRedundancy", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReference.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReference.go index 161beb9ebb1..c7a0f299693 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReference.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableReference.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableReference) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableReference) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableReference", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableReference", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRefresh.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRefresh.go index 992956d76cd..0f43a6dcdac 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRefresh.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRefresh.go @@ -354,7 +354,7 @@ func (e OpcuaNodeIdServicesVariableRefresh) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableRefresh) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRefresh", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRefresh", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRemove.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRemove.go index 8a045ec10f8..bbb9d40da82 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRemove.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRemove.go @@ -210,7 +210,7 @@ func (e OpcuaNodeIdServicesVariableRemove) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableRemove) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRemove", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRemove", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRequest.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRequest.go index f08e9179976..418ae36efe2 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRequest.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableRequest) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRequest", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRequest", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableResend.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableResend.go index 084ab1c8334..34015a0f1c0 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableResend.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableResend.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableResend) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableResend) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableResend", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableResend", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRole.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRole.go index c03912f450a..cb5359121b6 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRole.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableRole.go @@ -402,7 +402,7 @@ func (e OpcuaNodeIdServicesVariableRole) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableRole) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRole", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableRole", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSampling.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSampling.go index 8c1fd73fd1d..906ba954da0 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSampling.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSampling.go @@ -174,7 +174,7 @@ func (e OpcuaNodeIdServicesVariableSampling) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSampling) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSampling", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSampling", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSecurity.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSecurity.go index 65e7afda8a9..66b4f36c5a9 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSecurity.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSecurity.go @@ -270,7 +270,7 @@ func (e OpcuaNodeIdServicesVariableSecurity) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSecurity) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSecurity", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSecurity", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSelection.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSelection.go index cb8c8663dfc..80f1dc5a77b 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSelection.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSelection.go @@ -138,7 +138,7 @@ func (e OpcuaNodeIdServicesVariableSelection) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSelection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSelection", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSelection", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSemantic.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSemantic.go index d698adb73ad..df4de702eee 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSemantic.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSemantic.go @@ -204,7 +204,7 @@ func (e OpcuaNodeIdServicesVariableSemantic) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSemantic) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSemantic", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSemantic", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableServer.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableServer.go index 8bf4b595298..0ac9d43d64c 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableServer.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableServer.go @@ -12870,7 +12870,7 @@ func (e OpcuaNodeIdServicesVariableServer) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableServer) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableServer", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableServer", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSession.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSession.go index c9a523da92c..69ad5511252 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSession.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSession.go @@ -1086,7 +1086,7 @@ func (e OpcuaNodeIdServicesVariableSession) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSession) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSession", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSession", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSessions.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSessions.go index 9b70c9c8d0a..4ff06913c75 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSessions.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSessions.go @@ -462,7 +462,7 @@ func (e OpcuaNodeIdServicesVariableSessions) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSessions) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSessions", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSessions", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSet.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSet.go index dbc9de933fe..47b7a73b96f 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSet.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSet.go @@ -150,7 +150,7 @@ func (e OpcuaNodeIdServicesVariableSet) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSet) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSet", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSet", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableShelved.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableShelved.go index afe1a8206a5..56590d9e764 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableShelved.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableShelved.go @@ -282,7 +282,7 @@ func (e OpcuaNodeIdServicesVariableShelved) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableShelved) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableShelved", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableShelved", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStandalone.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStandalone.go index e6bc797b93c..8cb67623b6b 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStandalone.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStandalone.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableStandalone) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableStandalone) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableStandalone", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableStandalone", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableState.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableState.go index c1c67fa3619..2aeb2f8b082 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableState.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableState.go @@ -216,7 +216,7 @@ func (e OpcuaNodeIdServicesVariableState) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableState", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableState", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStructure.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStructure.go index 8c5867fe8b0..c3b9ee7f122 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStructure.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableStructure.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableStructure) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableStructure) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableStructure", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableStructure", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscribed.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscribed.go index 3b729ce685e..3312fc9d2f3 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscribed.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscribed.go @@ -204,7 +204,7 @@ func (e OpcuaNodeIdServicesVariableSubscribed) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSubscribed) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSubscribed", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSubscribed", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscription.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscription.go index 6ad52c5d870..31c4fb65241 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscription.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSubscription.go @@ -498,7 +498,7 @@ func (e OpcuaNodeIdServicesVariableSubscription) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSubscription) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSubscription", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSubscription", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSystem.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSystem.go index 8ad452c856f..e6a027bc8ab 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSystem.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableSystem.go @@ -1950,7 +1950,7 @@ func (e OpcuaNodeIdServicesVariableSystem) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableSystem) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSystem", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableSystem", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTag.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTag.go index 7c70ca6359e..ae77d4120e2 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTag.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTag.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableTag) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTag) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTag", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTag", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTarget.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTarget.go index b6a3d3af647..a58ac2dcdcc 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTarget.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTarget.go @@ -174,7 +174,7 @@ func (e OpcuaNodeIdServicesVariableTarget) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTarget) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTarget", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTarget", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTemporary.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTemporary.go index 61cb52834da..31be658afe7 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTemporary.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTemporary.go @@ -240,7 +240,7 @@ func (e OpcuaNodeIdServicesVariableTemporary) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTemporary) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTemporary", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTemporary", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableThree.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableThree.go index af475aaad66..55ebf320a45 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableThree.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableThree.go @@ -270,7 +270,7 @@ func (e OpcuaNodeIdServicesVariableThree) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableThree) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableThree", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableThree", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimed.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimed.go index 7607ac00595..7afaa7be830 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimed.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimed.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableTimed) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTimed) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTimed", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTimed", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimestamps.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimestamps.go index 87297dd646b..cf5286ff96e 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimestamps.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTimestamps.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableTimestamps) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTimestamps) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTimestamps", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTimestamps", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTopics.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTopics.go index 61f77ab16aa..0eec5e128e4 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTopics.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTopics.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableTopics) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTopics) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTopics", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTopics", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransaction.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransaction.go index a61c1143e3d..b5abae74811 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransaction.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransaction.go @@ -156,7 +156,7 @@ func (e OpcuaNodeIdServicesVariableTransaction) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTransaction) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTransaction", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTransaction", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransition.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransition.go index 21fca492764..7209ffa9581 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransition.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransition.go @@ -330,7 +330,7 @@ func (e OpcuaNodeIdServicesVariableTransition) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTransition) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTransition", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTransition", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransparent.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransparent.go index f55587e474c..ea17986f9a5 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransparent.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTransparent.go @@ -138,7 +138,7 @@ func (e OpcuaNodeIdServicesVariableTransparent) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTransparent) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTransparent", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTransparent", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrip.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrip.go index 752fbc0b7a8..9325d7d8f1f 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrip.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrip.go @@ -954,7 +954,7 @@ func (e OpcuaNodeIdServicesVariableTrip) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTrip) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTrip", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTrip", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrust.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrust.go index 35ad2a2ef52..668f9696b59 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrust.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTrust.go @@ -1374,7 +1374,7 @@ func (e OpcuaNodeIdServicesVariableTrust) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTrust) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTrust", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTrust", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTsn.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTsn.go index 24c9047de5b..c57639309f6 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTsn.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTsn.go @@ -144,7 +144,7 @@ func (e OpcuaNodeIdServicesVariableTsn) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTsn) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTsn", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTsn", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTwo.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTwo.go index d4cb889022c..87dadcd8be2 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTwo.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableTwo.go @@ -192,7 +192,7 @@ func (e OpcuaNodeIdServicesVariableTwo) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableTwo) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTwo", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableTwo", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableType.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableType.go index 50e49c15f56..f64aa08c2a9 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableType.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableType.go @@ -486,7 +486,7 @@ func (e OpcuaNodeIdServicesVariableType) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableType", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableType", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUadp.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUadp.go index 0d841e0eec1..c1ea4628cef 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUadp.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUadp.go @@ -240,7 +240,7 @@ func (e OpcuaNodeIdServicesVariableUadp) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableUadp) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableUadp", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableUadp", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUpdate.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUpdate.go index 230ad7a2887..55ed39ba7fc 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUpdate.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUpdate.go @@ -132,7 +132,7 @@ func (e OpcuaNodeIdServicesVariableUpdate) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableUpdate) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableUpdate", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableUpdate", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUser.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUser.go index 6c838996466..669bd390651 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUser.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableUser.go @@ -228,7 +228,7 @@ func (e OpcuaNodeIdServicesVariableUser) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableUser) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableUser", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableUser", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableValue.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableValue.go index d994cb8c44c..91e2f0eef53 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableValue.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableValue.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableValue) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableValue", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableValue", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableVector.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableVector.go index f096b77aa91..6b58c904389 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableVector.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableVector.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableVector) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableVector) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableVector", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableVector", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableView.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableView.go index 8b506604dac..d5db2d083a5 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableView.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableView.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableView) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableView) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableView", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableView", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWell.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWell.go index 898d5ea38e6..0aeb0c47a84 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWell.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWell.go @@ -912,7 +912,7 @@ func (e OpcuaNodeIdServicesVariableWell) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableWell) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWell", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWell", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWith.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWith.go index 74fdd97ba99..c89b84deecb 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWith.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWith.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableWith) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableWith) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWith", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWith", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWrite.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWrite.go index 4ca0fbb686b..d3485032d23 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWrite.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWrite.go @@ -126,7 +126,7 @@ func (e OpcuaNodeIdServicesVariableWrite) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableWrite) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWrite", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWrite", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWriter.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWriter.go index 8a630ea2f4c..0aa8211c139 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWriter.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableWriter.go @@ -960,7 +960,7 @@ func (e OpcuaNodeIdServicesVariableWriter) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableWriter) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWriter", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableWriter", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableX.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableX.go index b3c759fbd7f..86dcb1744b7 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableX.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableX.go @@ -168,7 +168,7 @@ func (e OpcuaNodeIdServicesVariableX) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableX) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableX", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableX", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableY.go b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableY.go index 87a977a131e..2720b2da51c 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableY.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaNodeIdServicesVariableY.go @@ -168,7 +168,7 @@ func (e OpcuaNodeIdServicesVariableY) Serialize() ([]byte, error) { func (e OpcuaNodeIdServicesVariableY) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableY", 32, int32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteInt32("OpcuaNodeIdServicesVariableY", 32, int32(int32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaOpenRequest.go b/plc4go/protocols/opcua/readwrite/model/OpcuaOpenRequest.go index ed79645e50a..69d6ad691b9 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaOpenRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaOpenRequest.go @@ -352,14 +352,14 @@ func (m *_OpcuaOpenRequest) SerializeWithWriteBuffer(ctx context.Context, writeB // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } // Simple Field (secureChannelId) secureChannelId := int32(m.GetSecureChannelId()) - _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, (secureChannelId)) + _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, int32((secureChannelId))) if _secureChannelIdErr != nil { return errors.Wrap(_secureChannelIdErr, "Error serializing 'secureChannelId' field") } @@ -402,14 +402,14 @@ func (m *_OpcuaOpenRequest) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (sequenceNumber) sequenceNumber := int32(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, int32((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } // Simple Field (requestId) requestId := int32(m.GetRequestId()) - _requestIdErr := writeBuffer.WriteInt32("requestId", 32, (requestId)) + _requestIdErr := writeBuffer.WriteInt32("requestId", 32, int32((requestId))) if _requestIdErr != nil { return errors.Wrap(_requestIdErr, "Error serializing 'requestId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaOpenResponse.go b/plc4go/protocols/opcua/readwrite/model/OpcuaOpenResponse.go index 289aeab68dc..67245eb9464 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaOpenResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaOpenResponse.go @@ -352,14 +352,14 @@ func (m *_OpcuaOpenResponse) SerializeWithWriteBuffer(ctx context.Context, write // Implicit Field (messageSize) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) messageSize := int32(int32(m.GetLengthInBytes(ctx))) - _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, (messageSize)) + _messageSizeErr := writeBuffer.WriteInt32("messageSize", 32, int32((messageSize))) if _messageSizeErr != nil { return errors.Wrap(_messageSizeErr, "Error serializing 'messageSize' field") } // Simple Field (secureChannelId) secureChannelId := int32(m.GetSecureChannelId()) - _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, (secureChannelId)) + _secureChannelIdErr := writeBuffer.WriteInt32("secureChannelId", 32, int32((secureChannelId))) if _secureChannelIdErr != nil { return errors.Wrap(_secureChannelIdErr, "Error serializing 'secureChannelId' field") } @@ -402,14 +402,14 @@ func (m *_OpcuaOpenResponse) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (sequenceNumber) sequenceNumber := int32(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteInt32("sequenceNumber", 32, int32((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } // Simple Field (requestId) requestId := int32(m.GetRequestId()) - _requestIdErr := writeBuffer.WriteInt32("requestId", 32, (requestId)) + _requestIdErr := writeBuffer.WriteInt32("requestId", 32, int32((requestId))) if _requestIdErr != nil { return errors.Wrap(_requestIdErr, "Error serializing 'requestId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpcuaStatusCode.go b/plc4go/protocols/opcua/readwrite/model/OpcuaStatusCode.go index 991ba1206f9..8ba184e4f30 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpcuaStatusCode.go +++ b/plc4go/protocols/opcua/readwrite/model/OpcuaStatusCode.go @@ -1704,7 +1704,7 @@ func (e OpcuaStatusCode) Serialize() ([]byte, error) { func (e OpcuaStatusCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("OpcuaStatusCode", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("OpcuaStatusCode", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpenFileMode.go b/plc4go/protocols/opcua/readwrite/model/OpenFileMode.go index 88097cf1b06..9d56ba5cfb9 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpenFileMode.go +++ b/plc4go/protocols/opcua/readwrite/model/OpenFileMode.go @@ -144,7 +144,7 @@ func (e OpenFileMode) Serialize() ([]byte, error) { func (e OpenFileMode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("OpenFileMode", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("OpenFileMode", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelRequest.go b/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelRequest.go index aafe72b1a86..5344b34093a 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelRequest.go @@ -310,7 +310,7 @@ func (m *_OpenSecureChannelRequest) SerializeWithWriteBuffer(ctx context.Context // Simple Field (clientProtocolVersion) clientProtocolVersion := uint32(m.GetClientProtocolVersion()) - _clientProtocolVersionErr := writeBuffer.WriteUint32("clientProtocolVersion", 32, (clientProtocolVersion)) + _clientProtocolVersionErr := writeBuffer.WriteUint32("clientProtocolVersion", 32, uint32((clientProtocolVersion))) if _clientProtocolVersionErr != nil { return errors.Wrap(_clientProtocolVersionErr, "Error serializing 'clientProtocolVersion' field") } @@ -353,7 +353,7 @@ func (m *_OpenSecureChannelRequest) SerializeWithWriteBuffer(ctx context.Context // Simple Field (requestedLifetime) requestedLifetime := uint32(m.GetRequestedLifetime()) - _requestedLifetimeErr := writeBuffer.WriteUint32("requestedLifetime", 32, (requestedLifetime)) + _requestedLifetimeErr := writeBuffer.WriteUint32("requestedLifetime", 32, uint32((requestedLifetime))) if _requestedLifetimeErr != nil { return errors.Wrap(_requestedLifetimeErr, "Error serializing 'requestedLifetime' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelResponse.go b/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelResponse.go index 866a2c25068..30b75fc1940 100644 --- a/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/OpenSecureChannelResponse.go @@ -266,7 +266,7 @@ func (m *_OpenSecureChannelResponse) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (serverProtocolVersion) serverProtocolVersion := uint32(m.GetServerProtocolVersion()) - _serverProtocolVersionErr := writeBuffer.WriteUint32("serverProtocolVersion", 32, (serverProtocolVersion)) + _serverProtocolVersionErr := writeBuffer.WriteUint32("serverProtocolVersion", 32, uint32((serverProtocolVersion))) if _serverProtocolVersionErr != nil { return errors.Wrap(_serverProtocolVersionErr, "Error serializing 'serverProtocolVersion' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/OverrideValueHandling.go b/plc4go/protocols/opcua/readwrite/model/OverrideValueHandling.go index 3002c1eda3b..473521237eb 100644 --- a/plc4go/protocols/opcua/readwrite/model/OverrideValueHandling.go +++ b/plc4go/protocols/opcua/readwrite/model/OverrideValueHandling.go @@ -138,7 +138,7 @@ func (e OverrideValueHandling) Serialize() ([]byte, error) { func (e OverrideValueHandling) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("OverrideValueHandling", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("OverrideValueHandling", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ParsingResult.go b/plc4go/protocols/opcua/readwrite/model/ParsingResult.go index 6e212ce4ab6..032e96f8b64 100644 --- a/plc4go/protocols/opcua/readwrite/model/ParsingResult.go +++ b/plc4go/protocols/opcua/readwrite/model/ParsingResult.go @@ -327,7 +327,7 @@ func (m *_ParsingResult) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (noOfDataStatusCodes) noOfDataStatusCodes := int32(m.GetNoOfDataStatusCodes()) - _noOfDataStatusCodesErr := writeBuffer.WriteInt32("noOfDataStatusCodes", 32, (noOfDataStatusCodes)) + _noOfDataStatusCodesErr := writeBuffer.WriteInt32("noOfDataStatusCodes", 32, int32((noOfDataStatusCodes))) if _noOfDataStatusCodesErr != nil { return errors.Wrap(_noOfDataStatusCodesErr, "Error serializing 'noOfDataStatusCodes' field") } @@ -351,7 +351,7 @@ func (m *_ParsingResult) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (noOfDataDiagnosticInfos) noOfDataDiagnosticInfos := int32(m.GetNoOfDataDiagnosticInfos()) - _noOfDataDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDataDiagnosticInfos", 32, (noOfDataDiagnosticInfos)) + _noOfDataDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDataDiagnosticInfos", 32, int32((noOfDataDiagnosticInfos))) if _noOfDataDiagnosticInfosErr != nil { return errors.Wrap(_noOfDataDiagnosticInfosErr, "Error serializing 'noOfDataDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PascalByteString.go b/plc4go/protocols/opcua/readwrite/model/PascalByteString.go index df28426b58c..bfe35715b78 100644 --- a/plc4go/protocols/opcua/readwrite/model/PascalByteString.go +++ b/plc4go/protocols/opcua/readwrite/model/PascalByteString.go @@ -167,7 +167,7 @@ func (m *_PascalByteString) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (stringLength) stringLength := int32(m.GetStringLength()) - _stringLengthErr := writeBuffer.WriteInt32("stringLength", 32, (stringLength)) + _stringLengthErr := writeBuffer.WriteInt32("stringLength", 32, int32((stringLength))) if _stringLengthErr != nil { return errors.Wrap(_stringLengthErr, "Error serializing 'stringLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PascalString.go b/plc4go/protocols/opcua/readwrite/model/PascalString.go index 614d25de17a..0c66e4534fe 100644 --- a/plc4go/protocols/opcua/readwrite/model/PascalString.go +++ b/plc4go/protocols/opcua/readwrite/model/PascalString.go @@ -182,7 +182,7 @@ func (m *_PascalString) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Implicit Field (sLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) sLength := int32(Utf8LengthToPascalLength(ctx, m.GetStringValue())) - _sLengthErr := writeBuffer.WriteInt32("sLength", 32, (sLength)) + _sLengthErr := writeBuffer.WriteInt32("sLength", 32, int32((sLength))) if _sLengthErr != nil { return errors.Wrap(_sLengthErr, "Error serializing 'sLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PasswordOptionsMask.go b/plc4go/protocols/opcua/readwrite/model/PasswordOptionsMask.go index 94e5fa37400..af145c8cc55 100644 --- a/plc4go/protocols/opcua/readwrite/model/PasswordOptionsMask.go +++ b/plc4go/protocols/opcua/readwrite/model/PasswordOptionsMask.go @@ -180,7 +180,7 @@ func (e PasswordOptionsMask) Serialize() ([]byte, error) { func (e PasswordOptionsMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("PasswordOptionsMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("PasswordOptionsMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/PerformUpdateType.go b/plc4go/protocols/opcua/readwrite/model/PerformUpdateType.go index 7f486ae35ab..9bf339d7e6e 100644 --- a/plc4go/protocols/opcua/readwrite/model/PerformUpdateType.go +++ b/plc4go/protocols/opcua/readwrite/model/PerformUpdateType.go @@ -144,7 +144,7 @@ func (e PerformUpdateType) Serialize() ([]byte, error) { func (e PerformUpdateType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("PerformUpdateType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("PerformUpdateType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/PermissionType.go b/plc4go/protocols/opcua/readwrite/model/PermissionType.go index ef36e9cf055..4eadddfdeef 100644 --- a/plc4go/protocols/opcua/readwrite/model/PermissionType.go +++ b/plc4go/protocols/opcua/readwrite/model/PermissionType.go @@ -228,7 +228,7 @@ func (e PermissionType) Serialize() ([]byte, error) { func (e PermissionType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("PermissionType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("PermissionType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/PriorityMappingEntryType.go b/plc4go/protocols/opcua/readwrite/model/PriorityMappingEntryType.go index ffaee7aad6d..53652b85543 100644 --- a/plc4go/protocols/opcua/readwrite/model/PriorityMappingEntryType.go +++ b/plc4go/protocols/opcua/readwrite/model/PriorityMappingEntryType.go @@ -272,14 +272,14 @@ func (m *_PriorityMappingEntryType) SerializeWithWriteBuffer(ctx context.Context // Simple Field (priorityValue_PCP) priorityValue_PCP := uint8(m.GetPriorityValue_PCP()) - _priorityValue_PCPErr := writeBuffer.WriteUint8("priorityValue_PCP", 8, (priorityValue_PCP)) + _priorityValue_PCPErr := writeBuffer.WriteUint8("priorityValue_PCP", 8, uint8((priorityValue_PCP))) if _priorityValue_PCPErr != nil { return errors.Wrap(_priorityValue_PCPErr, "Error serializing 'priorityValue_PCP' field") } // Simple Field (priorityValue_DSCP) priorityValue_DSCP := uint32(m.GetPriorityValue_DSCP()) - _priorityValue_DSCPErr := writeBuffer.WriteUint32("priorityValue_DSCP", 32, (priorityValue_DSCP)) + _priorityValue_DSCPErr := writeBuffer.WriteUint32("priorityValue_DSCP", 32, uint32((priorityValue_DSCP))) if _priorityValue_DSCPErr != nil { return errors.Wrap(_priorityValue_DSCPErr, "Error serializing 'priorityValue_DSCP' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ProgramDiagnostic2DataType.go b/plc4go/protocols/opcua/readwrite/model/ProgramDiagnostic2DataType.go index e6827395a26..b10c23dc60f 100644 --- a/plc4go/protocols/opcua/readwrite/model/ProgramDiagnostic2DataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ProgramDiagnostic2DataType.go @@ -626,14 +626,14 @@ func (m *_ProgramDiagnostic2DataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (invocationCreationTime) invocationCreationTime := int64(m.GetInvocationCreationTime()) - _invocationCreationTimeErr := writeBuffer.WriteInt64("invocationCreationTime", 64, (invocationCreationTime)) + _invocationCreationTimeErr := writeBuffer.WriteInt64("invocationCreationTime", 64, int64((invocationCreationTime))) if _invocationCreationTimeErr != nil { return errors.Wrap(_invocationCreationTimeErr, "Error serializing 'invocationCreationTime' field") } // Simple Field (lastTransitionTime) lastTransitionTime := int64(m.GetLastTransitionTime()) - _lastTransitionTimeErr := writeBuffer.WriteInt64("lastTransitionTime", 64, (lastTransitionTime)) + _lastTransitionTimeErr := writeBuffer.WriteInt64("lastTransitionTime", 64, int64((lastTransitionTime))) if _lastTransitionTimeErr != nil { return errors.Wrap(_lastTransitionTimeErr, "Error serializing 'lastTransitionTime' field") } @@ -664,7 +664,7 @@ func (m *_ProgramDiagnostic2DataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfLastMethodInputArguments) noOfLastMethodInputArguments := int32(m.GetNoOfLastMethodInputArguments()) - _noOfLastMethodInputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodInputArguments", 32, (noOfLastMethodInputArguments)) + _noOfLastMethodInputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodInputArguments", 32, int32((noOfLastMethodInputArguments))) if _noOfLastMethodInputArgumentsErr != nil { return errors.Wrap(_noOfLastMethodInputArgumentsErr, "Error serializing 'noOfLastMethodInputArguments' field") } @@ -688,7 +688,7 @@ func (m *_ProgramDiagnostic2DataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfLastMethodOutputArguments) noOfLastMethodOutputArguments := int32(m.GetNoOfLastMethodOutputArguments()) - _noOfLastMethodOutputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodOutputArguments", 32, (noOfLastMethodOutputArguments)) + _noOfLastMethodOutputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodOutputArguments", 32, int32((noOfLastMethodOutputArguments))) if _noOfLastMethodOutputArgumentsErr != nil { return errors.Wrap(_noOfLastMethodOutputArgumentsErr, "Error serializing 'noOfLastMethodOutputArguments' field") } @@ -712,7 +712,7 @@ func (m *_ProgramDiagnostic2DataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfLastMethodInputValues) noOfLastMethodInputValues := int32(m.GetNoOfLastMethodInputValues()) - _noOfLastMethodInputValuesErr := writeBuffer.WriteInt32("noOfLastMethodInputValues", 32, (noOfLastMethodInputValues)) + _noOfLastMethodInputValuesErr := writeBuffer.WriteInt32("noOfLastMethodInputValues", 32, int32((noOfLastMethodInputValues))) if _noOfLastMethodInputValuesErr != nil { return errors.Wrap(_noOfLastMethodInputValuesErr, "Error serializing 'noOfLastMethodInputValues' field") } @@ -736,7 +736,7 @@ func (m *_ProgramDiagnostic2DataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfLastMethodOutputValues) noOfLastMethodOutputValues := int32(m.GetNoOfLastMethodOutputValues()) - _noOfLastMethodOutputValuesErr := writeBuffer.WriteInt32("noOfLastMethodOutputValues", 32, (noOfLastMethodOutputValues)) + _noOfLastMethodOutputValuesErr := writeBuffer.WriteInt32("noOfLastMethodOutputValues", 32, int32((noOfLastMethodOutputValues))) if _noOfLastMethodOutputValuesErr != nil { return errors.Wrap(_noOfLastMethodOutputValuesErr, "Error serializing 'noOfLastMethodOutputValues' field") } @@ -760,7 +760,7 @@ func (m *_ProgramDiagnostic2DataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (lastMethodCallTime) lastMethodCallTime := int64(m.GetLastMethodCallTime()) - _lastMethodCallTimeErr := writeBuffer.WriteInt64("lastMethodCallTime", 64, (lastMethodCallTime)) + _lastMethodCallTimeErr := writeBuffer.WriteInt64("lastMethodCallTime", 64, int64((lastMethodCallTime))) if _lastMethodCallTimeErr != nil { return errors.Wrap(_lastMethodCallTimeErr, "Error serializing 'lastMethodCallTime' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ProgramDiagnosticDataType.go b/plc4go/protocols/opcua/readwrite/model/ProgramDiagnosticDataType.go index 7261c90fed8..f9cc6890710 100644 --- a/plc4go/protocols/opcua/readwrite/model/ProgramDiagnosticDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ProgramDiagnosticDataType.go @@ -496,14 +496,14 @@ func (m *_ProgramDiagnosticDataType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (invocationCreationTime) invocationCreationTime := int64(m.GetInvocationCreationTime()) - _invocationCreationTimeErr := writeBuffer.WriteInt64("invocationCreationTime", 64, (invocationCreationTime)) + _invocationCreationTimeErr := writeBuffer.WriteInt64("invocationCreationTime", 64, int64((invocationCreationTime))) if _invocationCreationTimeErr != nil { return errors.Wrap(_invocationCreationTimeErr, "Error serializing 'invocationCreationTime' field") } // Simple Field (lastTransitionTime) lastTransitionTime := int64(m.GetLastTransitionTime()) - _lastTransitionTimeErr := writeBuffer.WriteInt64("lastTransitionTime", 64, (lastTransitionTime)) + _lastTransitionTimeErr := writeBuffer.WriteInt64("lastTransitionTime", 64, int64((lastTransitionTime))) if _lastTransitionTimeErr != nil { return errors.Wrap(_lastTransitionTimeErr, "Error serializing 'lastTransitionTime' field") } @@ -534,7 +534,7 @@ func (m *_ProgramDiagnosticDataType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (noOfLastMethodInputArguments) noOfLastMethodInputArguments := int32(m.GetNoOfLastMethodInputArguments()) - _noOfLastMethodInputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodInputArguments", 32, (noOfLastMethodInputArguments)) + _noOfLastMethodInputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodInputArguments", 32, int32((noOfLastMethodInputArguments))) if _noOfLastMethodInputArgumentsErr != nil { return errors.Wrap(_noOfLastMethodInputArgumentsErr, "Error serializing 'noOfLastMethodInputArguments' field") } @@ -558,7 +558,7 @@ func (m *_ProgramDiagnosticDataType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (noOfLastMethodOutputArguments) noOfLastMethodOutputArguments := int32(m.GetNoOfLastMethodOutputArguments()) - _noOfLastMethodOutputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodOutputArguments", 32, (noOfLastMethodOutputArguments)) + _noOfLastMethodOutputArgumentsErr := writeBuffer.WriteInt32("noOfLastMethodOutputArguments", 32, int32((noOfLastMethodOutputArguments))) if _noOfLastMethodOutputArgumentsErr != nil { return errors.Wrap(_noOfLastMethodOutputArgumentsErr, "Error serializing 'noOfLastMethodOutputArguments' field") } @@ -582,7 +582,7 @@ func (m *_ProgramDiagnosticDataType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (lastMethodCallTime) lastMethodCallTime := int64(m.GetLastMethodCallTime()) - _lastMethodCallTimeErr := writeBuffer.WriteInt64("lastMethodCallTime", 64, (lastMethodCallTime)) + _lastMethodCallTimeErr := writeBuffer.WriteInt64("lastMethodCallTime", 64, int64((lastMethodCallTime))) if _lastMethodCallTimeErr != nil { return errors.Wrap(_lastMethodCallTimeErr, "Error serializing 'lastMethodCallTime' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationDataType.go b/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationDataType.go index b561e528c7f..7ee13b5a787 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationDataType.go @@ -332,7 +332,7 @@ func (m *_PubSubConfigurationDataType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfPublishedDataSets) noOfPublishedDataSets := int32(m.GetNoOfPublishedDataSets()) - _noOfPublishedDataSetsErr := writeBuffer.WriteInt32("noOfPublishedDataSets", 32, (noOfPublishedDataSets)) + _noOfPublishedDataSetsErr := writeBuffer.WriteInt32("noOfPublishedDataSets", 32, int32((noOfPublishedDataSets))) if _noOfPublishedDataSetsErr != nil { return errors.Wrap(_noOfPublishedDataSetsErr, "Error serializing 'noOfPublishedDataSets' field") } @@ -356,7 +356,7 @@ func (m *_PubSubConfigurationDataType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfConnections) noOfConnections := int32(m.GetNoOfConnections()) - _noOfConnectionsErr := writeBuffer.WriteInt32("noOfConnections", 32, (noOfConnections)) + _noOfConnectionsErr := writeBuffer.WriteInt32("noOfConnections", 32, int32((noOfConnections))) if _noOfConnectionsErr != nil { return errors.Wrap(_noOfConnectionsErr, "Error serializing 'noOfConnections' field") } @@ -388,7 +388,7 @@ func (m *_PubSubConfigurationDataType) SerializeWithWriteBuffer(ctx context.Cont }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefDataType.go b/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefDataType.go index 616adc92524..9764efff43c 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefDataType.go @@ -254,21 +254,21 @@ func (m *_PubSubConfigurationRefDataType) SerializeWithWriteBuffer(ctx context.C // Simple Field (elementIndex) elementIndex := uint16(m.GetElementIndex()) - _elementIndexErr := writeBuffer.WriteUint16("elementIndex", 16, (elementIndex)) + _elementIndexErr := writeBuffer.WriteUint16("elementIndex", 16, uint16((elementIndex))) if _elementIndexErr != nil { return errors.Wrap(_elementIndexErr, "Error serializing 'elementIndex' field") } // Simple Field (connectionIndex) connectionIndex := uint16(m.GetConnectionIndex()) - _connectionIndexErr := writeBuffer.WriteUint16("connectionIndex", 16, (connectionIndex)) + _connectionIndexErr := writeBuffer.WriteUint16("connectionIndex", 16, uint16((connectionIndex))) if _connectionIndexErr != nil { return errors.Wrap(_connectionIndexErr, "Error serializing 'connectionIndex' field") } // Simple Field (groupIndex) groupIndex := uint16(m.GetGroupIndex()) - _groupIndexErr := writeBuffer.WriteUint16("groupIndex", 16, (groupIndex)) + _groupIndexErr := writeBuffer.WriteUint16("groupIndex", 16, uint16((groupIndex))) if _groupIndexErr != nil { return errors.Wrap(_groupIndexErr, "Error serializing 'groupIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefMask.go b/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefMask.go index ece4ca8efb8..ebbb34aabf7 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefMask.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubConfigurationRefMask.go @@ -204,7 +204,7 @@ func (e PubSubConfigurationRefMask) Serialize() ([]byte, error) { func (e PubSubConfigurationRefMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("PubSubConfigurationRefMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("PubSubConfigurationRefMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubConnectionDataType.go b/plc4go/protocols/opcua/readwrite/model/PubSubConnectionDataType.go index fa5c6759a39..159d6d321ad 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubConnectionDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubConnectionDataType.go @@ -542,7 +542,7 @@ func (m *_PubSubConnectionDataType) SerializeWithWriteBuffer(ctx context.Context }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -593,7 +593,7 @@ func (m *_PubSubConnectionDataType) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfConnectionProperties) noOfConnectionProperties := int32(m.GetNoOfConnectionProperties()) - _noOfConnectionPropertiesErr := writeBuffer.WriteInt32("noOfConnectionProperties", 32, (noOfConnectionProperties)) + _noOfConnectionPropertiesErr := writeBuffer.WriteInt32("noOfConnectionProperties", 32, int32((noOfConnectionProperties))) if _noOfConnectionPropertiesErr != nil { return errors.Wrap(_noOfConnectionPropertiesErr, "Error serializing 'noOfConnectionProperties' field") } @@ -629,7 +629,7 @@ func (m *_PubSubConnectionDataType) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfWriterGroups) noOfWriterGroups := int32(m.GetNoOfWriterGroups()) - _noOfWriterGroupsErr := writeBuffer.WriteInt32("noOfWriterGroups", 32, (noOfWriterGroups)) + _noOfWriterGroupsErr := writeBuffer.WriteInt32("noOfWriterGroups", 32, int32((noOfWriterGroups))) if _noOfWriterGroupsErr != nil { return errors.Wrap(_noOfWriterGroupsErr, "Error serializing 'noOfWriterGroups' field") } @@ -653,7 +653,7 @@ func (m *_PubSubConnectionDataType) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfReaderGroups) noOfReaderGroups := int32(m.GetNoOfReaderGroups()) - _noOfReaderGroupsErr := writeBuffer.WriteInt32("noOfReaderGroups", 32, (noOfReaderGroups)) + _noOfReaderGroupsErr := writeBuffer.WriteInt32("noOfReaderGroups", 32, int32((noOfReaderGroups))) if _noOfReaderGroupsErr != nil { return errors.Wrap(_noOfReaderGroupsErr, "Error serializing 'noOfReaderGroups' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubDiagnosticsCounterClassification.go b/plc4go/protocols/opcua/readwrite/model/PubSubDiagnosticsCounterClassification.go index 537926221b7..70f84558a6f 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubDiagnosticsCounterClassification.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubDiagnosticsCounterClassification.go @@ -132,7 +132,7 @@ func (e PubSubDiagnosticsCounterClassification) Serialize() ([]byte, error) { func (e PubSubDiagnosticsCounterClassification) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("PubSubDiagnosticsCounterClassification", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("PubSubDiagnosticsCounterClassification", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubGroupDataType.go b/plc4go/protocols/opcua/readwrite/model/PubSubGroupDataType.go index 04e5159e59f..fd6afd19603 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubGroupDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubGroupDataType.go @@ -446,7 +446,7 @@ func (m *_PubSubGroupDataType) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -485,7 +485,7 @@ func (m *_PubSubGroupDataType) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (noOfSecurityKeyServices) noOfSecurityKeyServices := int32(m.GetNoOfSecurityKeyServices()) - _noOfSecurityKeyServicesErr := writeBuffer.WriteInt32("noOfSecurityKeyServices", 32, (noOfSecurityKeyServices)) + _noOfSecurityKeyServicesErr := writeBuffer.WriteInt32("noOfSecurityKeyServices", 32, int32((noOfSecurityKeyServices))) if _noOfSecurityKeyServicesErr != nil { return errors.Wrap(_noOfSecurityKeyServicesErr, "Error serializing 'noOfSecurityKeyServices' field") } @@ -509,14 +509,14 @@ func (m *_PubSubGroupDataType) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (maxNetworkMessageSize) maxNetworkMessageSize := uint32(m.GetMaxNetworkMessageSize()) - _maxNetworkMessageSizeErr := writeBuffer.WriteUint32("maxNetworkMessageSize", 32, (maxNetworkMessageSize)) + _maxNetworkMessageSizeErr := writeBuffer.WriteUint32("maxNetworkMessageSize", 32, uint32((maxNetworkMessageSize))) if _maxNetworkMessageSizeErr != nil { return errors.Wrap(_maxNetworkMessageSizeErr, "Error serializing 'maxNetworkMessageSize' field") } // Simple Field (noOfGroupProperties) noOfGroupProperties := int32(m.GetNoOfGroupProperties()) - _noOfGroupPropertiesErr := writeBuffer.WriteInt32("noOfGroupProperties", 32, (noOfGroupProperties)) + _noOfGroupPropertiesErr := writeBuffer.WriteInt32("noOfGroupProperties", 32, int32((noOfGroupProperties))) if _noOfGroupPropertiesErr != nil { return errors.Wrap(_noOfGroupPropertiesErr, "Error serializing 'noOfGroupProperties' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubKeyPushTargetDataType.go b/plc4go/protocols/opcua/readwrite/model/PubSubKeyPushTargetDataType.go index 6aea67b45c8..7871f6737bb 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubKeyPushTargetDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubKeyPushTargetDataType.go @@ -505,7 +505,7 @@ func (m *_PubSubKeyPushTargetDataType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfPushTargetFolder) noOfPushTargetFolder := int32(m.GetNoOfPushTargetFolder()) - _noOfPushTargetFolderErr := writeBuffer.WriteInt32("noOfPushTargetFolder", 32, (noOfPushTargetFolder)) + _noOfPushTargetFolderErr := writeBuffer.WriteInt32("noOfPushTargetFolder", 32, int32((noOfPushTargetFolder))) if _noOfPushTargetFolderErr != nil { return errors.Wrap(_noOfPushTargetFolderErr, "Error serializing 'noOfPushTargetFolder' field") } @@ -565,7 +565,7 @@ func (m *_PubSubKeyPushTargetDataType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (requestedKeyCount) requestedKeyCount := uint16(m.GetRequestedKeyCount()) - _requestedKeyCountErr := writeBuffer.WriteUint16("requestedKeyCount", 16, (requestedKeyCount)) + _requestedKeyCountErr := writeBuffer.WriteUint16("requestedKeyCount", 16, uint16((requestedKeyCount))) if _requestedKeyCountErr != nil { return errors.Wrap(_requestedKeyCountErr, "Error serializing 'requestedKeyCount' field") } @@ -579,7 +579,7 @@ func (m *_PubSubKeyPushTargetDataType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfPushTargetProperties) noOfPushTargetProperties := int32(m.GetNoOfPushTargetProperties()) - _noOfPushTargetPropertiesErr := writeBuffer.WriteInt32("noOfPushTargetProperties", 32, (noOfPushTargetProperties)) + _noOfPushTargetPropertiesErr := writeBuffer.WriteInt32("noOfPushTargetProperties", 32, int32((noOfPushTargetProperties))) if _noOfPushTargetPropertiesErr != nil { return errors.Wrap(_noOfPushTargetPropertiesErr, "Error serializing 'noOfPushTargetProperties' field") } @@ -603,7 +603,7 @@ func (m *_PubSubKeyPushTargetDataType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (noOfSecurityGroups) noOfSecurityGroups := int32(m.GetNoOfSecurityGroups()) - _noOfSecurityGroupsErr := writeBuffer.WriteInt32("noOfSecurityGroups", 32, (noOfSecurityGroups)) + _noOfSecurityGroupsErr := writeBuffer.WriteInt32("noOfSecurityGroups", 32, int32((noOfSecurityGroups))) if _noOfSecurityGroupsErr != nil { return errors.Wrap(_noOfSecurityGroupsErr, "Error serializing 'noOfSecurityGroups' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PubSubState.go b/plc4go/protocols/opcua/readwrite/model/PubSubState.go index c4eeaccef57..1e437b3e692 100644 --- a/plc4go/protocols/opcua/readwrite/model/PubSubState.go +++ b/plc4go/protocols/opcua/readwrite/model/PubSubState.go @@ -150,7 +150,7 @@ func (e PubSubState) Serialize() ([]byte, error) { func (e PubSubState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("PubSubState", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("PubSubState", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/PublishRequest.go b/plc4go/protocols/opcua/readwrite/model/PublishRequest.go index eff1162bea0..ffd3492a076 100644 --- a/plc4go/protocols/opcua/readwrite/model/PublishRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/PublishRequest.go @@ -262,7 +262,7 @@ func (m *_PublishRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (noOfSubscriptionAcknowledgements) noOfSubscriptionAcknowledgements := int32(m.GetNoOfSubscriptionAcknowledgements()) - _noOfSubscriptionAcknowledgementsErr := writeBuffer.WriteInt32("noOfSubscriptionAcknowledgements", 32, (noOfSubscriptionAcknowledgements)) + _noOfSubscriptionAcknowledgementsErr := writeBuffer.WriteInt32("noOfSubscriptionAcknowledgements", 32, int32((noOfSubscriptionAcknowledgements))) if _noOfSubscriptionAcknowledgementsErr != nil { return errors.Wrap(_noOfSubscriptionAcknowledgementsErr, "Error serializing 'noOfSubscriptionAcknowledgements' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PublishResponse.go b/plc4go/protocols/opcua/readwrite/model/PublishResponse.go index 1e9db3a355c..502f94d4fe6 100644 --- a/plc4go/protocols/opcua/readwrite/model/PublishResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/PublishResponse.go @@ -473,14 +473,14 @@ func (m *_PublishResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } // Simple Field (noOfAvailableSequenceNumbers) noOfAvailableSequenceNumbers := int32(m.GetNoOfAvailableSequenceNumbers()) - _noOfAvailableSequenceNumbersErr := writeBuffer.WriteInt32("noOfAvailableSequenceNumbers", 32, (noOfAvailableSequenceNumbers)) + _noOfAvailableSequenceNumbersErr := writeBuffer.WriteInt32("noOfAvailableSequenceNumbers", 32, int32((noOfAvailableSequenceNumbers))) if _noOfAvailableSequenceNumbersErr != nil { return errors.Wrap(_noOfAvailableSequenceNumbersErr, "Error serializing 'noOfAvailableSequenceNumbers' field") } @@ -491,7 +491,7 @@ func (m *_PublishResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu } for _curItem, _element := range m.GetAvailableSequenceNumbers() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'availableSequenceNumbers' field") } @@ -510,7 +510,7 @@ func (m *_PublishResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -537,7 +537,7 @@ func (m *_PublishResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -561,7 +561,7 @@ func (m *_PublishResponse) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/PublishedVariableDataType.go b/plc4go/protocols/opcua/readwrite/model/PublishedVariableDataType.go index 8dc8d227ba5..83f6b17ea52 100644 --- a/plc4go/protocols/opcua/readwrite/model/PublishedVariableDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/PublishedVariableDataType.go @@ -388,7 +388,7 @@ func (m *_PublishedVariableDataType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (attributeId) attributeId := uint32(m.GetAttributeId()) - _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, (attributeId)) + _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, uint32((attributeId))) if _attributeIdErr != nil { return errors.Wrap(_attributeIdErr, "Error serializing 'attributeId' field") } @@ -402,7 +402,7 @@ func (m *_PublishedVariableDataType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (deadbandType) deadbandType := uint32(m.GetDeadbandType()) - _deadbandTypeErr := writeBuffer.WriteUint32("deadbandType", 32, (deadbandType)) + _deadbandTypeErr := writeBuffer.WriteUint32("deadbandType", 32, uint32((deadbandType))) if _deadbandTypeErr != nil { return errors.Wrap(_deadbandTypeErr, "Error serializing 'deadbandType' field") } @@ -440,7 +440,7 @@ func (m *_PublishedVariableDataType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (noOfMetaDataProperties) noOfMetaDataProperties := int32(m.GetNoOfMetaDataProperties()) - _noOfMetaDataPropertiesErr := writeBuffer.WriteInt32("noOfMetaDataProperties", 32, (noOfMetaDataProperties)) + _noOfMetaDataPropertiesErr := writeBuffer.WriteInt32("noOfMetaDataProperties", 32, int32((noOfMetaDataProperties))) if _noOfMetaDataPropertiesErr != nil { return errors.Wrap(_noOfMetaDataPropertiesErr, "Error serializing 'noOfMetaDataProperties' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/QualifiedName.go b/plc4go/protocols/opcua/readwrite/model/QualifiedName.go index 522e7722b37..b0c37a18790 100644 --- a/plc4go/protocols/opcua/readwrite/model/QualifiedName.go +++ b/plc4go/protocols/opcua/readwrite/model/QualifiedName.go @@ -172,7 +172,7 @@ func (m *_QualifiedName) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/QueryDataDescription.go b/plc4go/protocols/opcua/readwrite/model/QueryDataDescription.go index 02d0b97920f..8c58bc94245 100644 --- a/plc4go/protocols/opcua/readwrite/model/QueryDataDescription.go +++ b/plc4go/protocols/opcua/readwrite/model/QueryDataDescription.go @@ -241,7 +241,7 @@ func (m *_QueryDataDescription) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (attributeId) attributeId := uint32(m.GetAttributeId()) - _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, (attributeId)) + _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, uint32((attributeId))) if _attributeIdErr != nil { return errors.Wrap(_attributeIdErr, "Error serializing 'attributeId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/QueryDataSet.go b/plc4go/protocols/opcua/readwrite/model/QueryDataSet.go index 0a50f3066d4..30db537ef65 100644 --- a/plc4go/protocols/opcua/readwrite/model/QueryDataSet.go +++ b/plc4go/protocols/opcua/readwrite/model/QueryDataSet.go @@ -299,7 +299,7 @@ func (m *_QueryDataSet) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfValues) noOfValues := int32(m.GetNoOfValues()) - _noOfValuesErr := writeBuffer.WriteInt32("noOfValues", 32, (noOfValues)) + _noOfValuesErr := writeBuffer.WriteInt32("noOfValues", 32, int32((noOfValues))) if _noOfValuesErr != nil { return errors.Wrap(_noOfValuesErr, "Error serializing 'noOfValues' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/QueryFirstRequest.go b/plc4go/protocols/opcua/readwrite/model/QueryFirstRequest.go index 0bbcf35dfbe..38ba06f42d7 100644 --- a/plc4go/protocols/opcua/readwrite/model/QueryFirstRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/QueryFirstRequest.go @@ -362,7 +362,7 @@ func (m *_QueryFirstRequest) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfNodeTypes) noOfNodeTypes := int32(m.GetNoOfNodeTypes()) - _noOfNodeTypesErr := writeBuffer.WriteInt32("noOfNodeTypes", 32, (noOfNodeTypes)) + _noOfNodeTypesErr := writeBuffer.WriteInt32("noOfNodeTypes", 32, int32((noOfNodeTypes))) if _noOfNodeTypesErr != nil { return errors.Wrap(_noOfNodeTypesErr, "Error serializing 'noOfNodeTypes' field") } @@ -398,14 +398,14 @@ func (m *_QueryFirstRequest) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (maxDataSetsToReturn) maxDataSetsToReturn := uint32(m.GetMaxDataSetsToReturn()) - _maxDataSetsToReturnErr := writeBuffer.WriteUint32("maxDataSetsToReturn", 32, (maxDataSetsToReturn)) + _maxDataSetsToReturnErr := writeBuffer.WriteUint32("maxDataSetsToReturn", 32, uint32((maxDataSetsToReturn))) if _maxDataSetsToReturnErr != nil { return errors.Wrap(_maxDataSetsToReturnErr, "Error serializing 'maxDataSetsToReturn' field") } // Simple Field (maxReferencesToReturn) maxReferencesToReturn := uint32(m.GetMaxReferencesToReturn()) - _maxReferencesToReturnErr := writeBuffer.WriteUint32("maxReferencesToReturn", 32, (maxReferencesToReturn)) + _maxReferencesToReturnErr := writeBuffer.WriteUint32("maxReferencesToReturn", 32, uint32((maxReferencesToReturn))) if _maxReferencesToReturnErr != nil { return errors.Wrap(_maxReferencesToReturnErr, "Error serializing 'maxReferencesToReturn' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/QueryFirstResponse.go b/plc4go/protocols/opcua/readwrite/model/QueryFirstResponse.go index 57783c19718..32e9ab6bb6f 100644 --- a/plc4go/protocols/opcua/readwrite/model/QueryFirstResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/QueryFirstResponse.go @@ -442,7 +442,7 @@ func (m *_QueryFirstResponse) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfQueryDataSets) noOfQueryDataSets := int32(m.GetNoOfQueryDataSets()) - _noOfQueryDataSetsErr := writeBuffer.WriteInt32("noOfQueryDataSets", 32, (noOfQueryDataSets)) + _noOfQueryDataSetsErr := writeBuffer.WriteInt32("noOfQueryDataSets", 32, int32((noOfQueryDataSets))) if _noOfQueryDataSetsErr != nil { return errors.Wrap(_noOfQueryDataSetsErr, "Error serializing 'noOfQueryDataSets' field") } @@ -478,7 +478,7 @@ func (m *_QueryFirstResponse) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfParsingResults) noOfParsingResults := int32(m.GetNoOfParsingResults()) - _noOfParsingResultsErr := writeBuffer.WriteInt32("noOfParsingResults", 32, (noOfParsingResults)) + _noOfParsingResultsErr := writeBuffer.WriteInt32("noOfParsingResults", 32, int32((noOfParsingResults))) if _noOfParsingResultsErr != nil { return errors.Wrap(_noOfParsingResultsErr, "Error serializing 'noOfParsingResults' field") } @@ -502,7 +502,7 @@ func (m *_QueryFirstResponse) SerializeWithWriteBuffer(ctx context.Context, writ // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/QueryNextRequest.go b/plc4go/protocols/opcua/readwrite/model/QueryNextRequest.go index 9b9ecec276c..0cd2097b7d4 100644 --- a/plc4go/protocols/opcua/readwrite/model/QueryNextRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/QueryNextRequest.go @@ -272,7 +272,7 @@ func (m *_QueryNextRequest) SerializeWithWriteBuffer(ctx context.Context, writeB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/QueryNextResponse.go b/plc4go/protocols/opcua/readwrite/model/QueryNextResponse.go index 6e8cdc6c6fa..752e57bf9e2 100644 --- a/plc4go/protocols/opcua/readwrite/model/QueryNextResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/QueryNextResponse.go @@ -287,7 +287,7 @@ func (m *_QueryNextResponse) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfQueryDataSets) noOfQueryDataSets := int32(m.GetNoOfQueryDataSets()) - _noOfQueryDataSetsErr := writeBuffer.WriteInt32("noOfQueryDataSets", 32, (noOfQueryDataSets)) + _noOfQueryDataSetsErr := writeBuffer.WriteInt32("noOfQueryDataSets", 32, int32((noOfQueryDataSets))) if _noOfQueryDataSetsErr != nil { return errors.Wrap(_noOfQueryDataSetsErr, "Error serializing 'noOfQueryDataSets' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RationalNumber.go b/plc4go/protocols/opcua/readwrite/model/RationalNumber.go index 56de822cd15..da00a1f327f 100644 --- a/plc4go/protocols/opcua/readwrite/model/RationalNumber.go +++ b/plc4go/protocols/opcua/readwrite/model/RationalNumber.go @@ -198,14 +198,14 @@ func (m *_RationalNumber) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (numerator) numerator := int32(m.GetNumerator()) - _numeratorErr := writeBuffer.WriteInt32("numerator", 32, (numerator)) + _numeratorErr := writeBuffer.WriteInt32("numerator", 32, int32((numerator))) if _numeratorErr != nil { return errors.Wrap(_numeratorErr, "Error serializing 'numerator' field") } // Simple Field (denominator) denominator := uint32(m.GetDenominator()) - _denominatorErr := writeBuffer.WriteUint32("denominator", 32, (denominator)) + _denominatorErr := writeBuffer.WriteUint32("denominator", 32, uint32((denominator))) if _denominatorErr != nil { return errors.Wrap(_denominatorErr, "Error serializing 'denominator' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ReadRequest.go b/plc4go/protocols/opcua/readwrite/model/ReadRequest.go index 8cec38c552d..36aba879bd9 100644 --- a/plc4go/protocols/opcua/readwrite/model/ReadRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/ReadRequest.go @@ -325,7 +325,7 @@ func (m *_ReadRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (noOfNodesToRead) noOfNodesToRead := int32(m.GetNoOfNodesToRead()) - _noOfNodesToReadErr := writeBuffer.WriteInt32("noOfNodesToRead", 32, (noOfNodesToRead)) + _noOfNodesToReadErr := writeBuffer.WriteInt32("noOfNodesToRead", 32, int32((noOfNodesToRead))) if _noOfNodesToReadErr != nil { return errors.Wrap(_noOfNodesToReadErr, "Error serializing 'noOfNodesToRead' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ReadResponse.go b/plc4go/protocols/opcua/readwrite/model/ReadResponse.go index 4ed49165c4f..c1579179b32 100644 --- a/plc4go/protocols/opcua/readwrite/model/ReadResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/ReadResponse.go @@ -327,7 +327,7 @@ func (m *_ReadResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_ReadResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ReadValueId.go b/plc4go/protocols/opcua/readwrite/model/ReadValueId.go index 595f5efb5a0..6c3e26b82c4 100644 --- a/plc4go/protocols/opcua/readwrite/model/ReadValueId.go +++ b/plc4go/protocols/opcua/readwrite/model/ReadValueId.go @@ -266,7 +266,7 @@ func (m *_ReadValueId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (attributeId) attributeId := uint32(m.GetAttributeId()) - _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, (attributeId)) + _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, uint32((attributeId))) if _attributeIdErr != nil { return errors.Wrap(_attributeIdErr, "Error serializing 'attributeId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RedundancySupport.go b/plc4go/protocols/opcua/readwrite/model/RedundancySupport.go index 1d11f636ce6..f7a2ee75cab 100644 --- a/plc4go/protocols/opcua/readwrite/model/RedundancySupport.go +++ b/plc4go/protocols/opcua/readwrite/model/RedundancySupport.go @@ -156,7 +156,7 @@ func (e RedundancySupport) Serialize() ([]byte, error) { func (e RedundancySupport) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("RedundancySupport", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("RedundancySupport", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/RedundantServerDataType.go b/plc4go/protocols/opcua/readwrite/model/RedundantServerDataType.go index 83d552bfce8..549aa5687cf 100644 --- a/plc4go/protocols/opcua/readwrite/model/RedundantServerDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/RedundantServerDataType.go @@ -241,7 +241,7 @@ func (m *_RedundantServerDataType) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (serviceLevel) serviceLevel := uint8(m.GetServiceLevel()) - _serviceLevelErr := writeBuffer.WriteUint8("serviceLevel", 8, (serviceLevel)) + _serviceLevelErr := writeBuffer.WriteUint8("serviceLevel", 8, uint8((serviceLevel))) if _serviceLevelErr != nil { return errors.Wrap(_serviceLevelErr, "Error serializing 'serviceLevel' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ReferenceDescription.go b/plc4go/protocols/opcua/readwrite/model/ReferenceDescription.go index 37b83ab02e9..05a61be6119 100644 --- a/plc4go/protocols/opcua/readwrite/model/ReferenceDescription.go +++ b/plc4go/protocols/opcua/readwrite/model/ReferenceDescription.go @@ -372,7 +372,7 @@ func (m *_ReferenceDescription) SerializeWithWriteBuffer(ctx context.Context, wr }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ReferenceDescriptionDataType.go b/plc4go/protocols/opcua/readwrite/model/ReferenceDescriptionDataType.go index 446291cdb47..47ad14ca0d6 100644 --- a/plc4go/protocols/opcua/readwrite/model/ReferenceDescriptionDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ReferenceDescriptionDataType.go @@ -309,7 +309,7 @@ func (m *_ReferenceDescriptionDataType) SerializeWithWriteBuffer(ctx context.Con }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ReferenceListEntryDataType.go b/plc4go/protocols/opcua/readwrite/model/ReferenceListEntryDataType.go index a1589d585d6..2523f3425d0 100644 --- a/plc4go/protocols/opcua/readwrite/model/ReferenceListEntryDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ReferenceListEntryDataType.go @@ -272,7 +272,7 @@ func (m *_ReferenceListEntryDataType) SerializeWithWriteBuffer(ctx context.Conte }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RegisterNodesRequest.go b/plc4go/protocols/opcua/readwrite/model/RegisterNodesRequest.go index 689cb0b60d2..1c36d2aba53 100644 --- a/plc4go/protocols/opcua/readwrite/model/RegisterNodesRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/RegisterNodesRequest.go @@ -262,7 +262,7 @@ func (m *_RegisterNodesRequest) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfNodesToRegister) noOfNodesToRegister := int32(m.GetNoOfNodesToRegister()) - _noOfNodesToRegisterErr := writeBuffer.WriteInt32("noOfNodesToRegister", 32, (noOfNodesToRegister)) + _noOfNodesToRegisterErr := writeBuffer.WriteInt32("noOfNodesToRegister", 32, int32((noOfNodesToRegister))) if _noOfNodesToRegisterErr != nil { return errors.Wrap(_noOfNodesToRegisterErr, "Error serializing 'noOfNodesToRegister' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RegisterNodesResponse.go b/plc4go/protocols/opcua/readwrite/model/RegisterNodesResponse.go index a955e0b03c0..29fc19bfc9e 100644 --- a/plc4go/protocols/opcua/readwrite/model/RegisterNodesResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/RegisterNodesResponse.go @@ -262,7 +262,7 @@ func (m *_RegisterNodesResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfRegisteredNodeIds) noOfRegisteredNodeIds := int32(m.GetNoOfRegisteredNodeIds()) - _noOfRegisteredNodeIdsErr := writeBuffer.WriteInt32("noOfRegisteredNodeIds", 32, (noOfRegisteredNodeIds)) + _noOfRegisteredNodeIdsErr := writeBuffer.WriteInt32("noOfRegisteredNodeIds", 32, int32((noOfRegisteredNodeIds))) if _noOfRegisteredNodeIdsErr != nil { return errors.Wrap(_noOfRegisteredNodeIdsErr, "Error serializing 'noOfRegisteredNodeIds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RegisterServer2Request.go b/plc4go/protocols/opcua/readwrite/model/RegisterServer2Request.go index 01d07cdeeef..e68a57d4f1d 100644 --- a/plc4go/protocols/opcua/readwrite/model/RegisterServer2Request.go +++ b/plc4go/protocols/opcua/readwrite/model/RegisterServer2Request.go @@ -299,7 +299,7 @@ func (m *_RegisterServer2Request) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfDiscoveryConfiguration) noOfDiscoveryConfiguration := int32(m.GetNoOfDiscoveryConfiguration()) - _noOfDiscoveryConfigurationErr := writeBuffer.WriteInt32("noOfDiscoveryConfiguration", 32, (noOfDiscoveryConfiguration)) + _noOfDiscoveryConfigurationErr := writeBuffer.WriteInt32("noOfDiscoveryConfiguration", 32, int32((noOfDiscoveryConfiguration))) if _noOfDiscoveryConfigurationErr != nil { return errors.Wrap(_noOfDiscoveryConfigurationErr, "Error serializing 'noOfDiscoveryConfiguration' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RegisterServer2Response.go b/plc4go/protocols/opcua/readwrite/model/RegisterServer2Response.go index 6818fe009ff..f16aedf2635 100644 --- a/plc4go/protocols/opcua/readwrite/model/RegisterServer2Response.go +++ b/plc4go/protocols/opcua/readwrite/model/RegisterServer2Response.go @@ -327,7 +327,7 @@ func (m *_RegisterServer2Response) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfConfigurationResults) noOfConfigurationResults := int32(m.GetNoOfConfigurationResults()) - _noOfConfigurationResultsErr := writeBuffer.WriteInt32("noOfConfigurationResults", 32, (noOfConfigurationResults)) + _noOfConfigurationResultsErr := writeBuffer.WriteInt32("noOfConfigurationResults", 32, int32((noOfConfigurationResults))) if _noOfConfigurationResultsErr != nil { return errors.Wrap(_noOfConfigurationResultsErr, "Error serializing 'noOfConfigurationResults' field") } @@ -351,7 +351,7 @@ func (m *_RegisterServer2Response) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RegisteredServer.go b/plc4go/protocols/opcua/readwrite/model/RegisteredServer.go index cae57855e5d..026fed3a311 100644 --- a/plc4go/protocols/opcua/readwrite/model/RegisteredServer.go +++ b/plc4go/protocols/opcua/readwrite/model/RegisteredServer.go @@ -481,7 +481,7 @@ func (m *_RegisteredServer) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfServerNames) noOfServerNames := int32(m.GetNoOfServerNames()) - _noOfServerNamesErr := writeBuffer.WriteInt32("noOfServerNames", 32, (noOfServerNames)) + _noOfServerNamesErr := writeBuffer.WriteInt32("noOfServerNames", 32, int32((noOfServerNames))) if _noOfServerNamesErr != nil { return errors.Wrap(_noOfServerNamesErr, "Error serializing 'noOfServerNames' field") } @@ -529,7 +529,7 @@ func (m *_RegisteredServer) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (noOfDiscoveryUrls) noOfDiscoveryUrls := int32(m.GetNoOfDiscoveryUrls()) - _noOfDiscoveryUrlsErr := writeBuffer.WriteInt32("noOfDiscoveryUrls", 32, (noOfDiscoveryUrls)) + _noOfDiscoveryUrlsErr := writeBuffer.WriteInt32("noOfDiscoveryUrls", 32, int32((noOfDiscoveryUrls))) if _noOfDiscoveryUrlsErr != nil { return errors.Wrap(_noOfDiscoveryUrlsErr, "Error serializing 'noOfDiscoveryUrls' field") } @@ -573,7 +573,7 @@ func (m *_RegisteredServer) SerializeWithWriteBuffer(ctx context.Context, writeB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RelativePath.go b/plc4go/protocols/opcua/readwrite/model/RelativePath.go index 2bb54be5385..63b2c8bdeb3 100644 --- a/plc4go/protocols/opcua/readwrite/model/RelativePath.go +++ b/plc4go/protocols/opcua/readwrite/model/RelativePath.go @@ -225,7 +225,7 @@ func (m *_RelativePath) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfElements) noOfElements := int32(m.GetNoOfElements()) - _noOfElementsErr := writeBuffer.WriteInt32("noOfElements", 32, (noOfElements)) + _noOfElementsErr := writeBuffer.WriteInt32("noOfElements", 32, int32((noOfElements))) if _noOfElementsErr != nil { return errors.Wrap(_noOfElementsErr, "Error serializing 'noOfElements' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RelativePathElement.go b/plc4go/protocols/opcua/readwrite/model/RelativePathElement.go index 2a749bbf3cc..152223c8bdc 100644 --- a/plc4go/protocols/opcua/readwrite/model/RelativePathElement.go +++ b/plc4go/protocols/opcua/readwrite/model/RelativePathElement.go @@ -291,7 +291,7 @@ func (m *_RelativePathElement) SerializeWithWriteBuffer(ctx context.Context, wri }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 6, reserved) + _err := writeBuffer.WriteUint8("reserved", 6, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RepublishRequest.go b/plc4go/protocols/opcua/readwrite/model/RepublishRequest.go index 66e0759863a..8a64bdafa99 100644 --- a/plc4go/protocols/opcua/readwrite/model/RepublishRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/RepublishRequest.go @@ -235,14 +235,14 @@ func (m *_RepublishRequest) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } // Simple Field (retransmitSequenceNumber) retransmitSequenceNumber := uint32(m.GetRetransmitSequenceNumber()) - _retransmitSequenceNumberErr := writeBuffer.WriteUint32("retransmitSequenceNumber", 32, (retransmitSequenceNumber)) + _retransmitSequenceNumberErr := writeBuffer.WriteUint32("retransmitSequenceNumber", 32, uint32((retransmitSequenceNumber))) if _retransmitSequenceNumberErr != nil { return errors.Wrap(_retransmitSequenceNumberErr, "Error serializing 'retransmitSequenceNumber' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/RequestHeader.go b/plc4go/protocols/opcua/readwrite/model/RequestHeader.go index 882dcda1ca5..e8d3d58316f 100644 --- a/plc4go/protocols/opcua/readwrite/model/RequestHeader.go +++ b/plc4go/protocols/opcua/readwrite/model/RequestHeader.go @@ -323,21 +323,21 @@ func (m *_RequestHeader) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (timestamp) timestamp := int64(m.GetTimestamp()) - _timestampErr := writeBuffer.WriteInt64("timestamp", 64, (timestamp)) + _timestampErr := writeBuffer.WriteInt64("timestamp", 64, int64((timestamp))) if _timestampErr != nil { return errors.Wrap(_timestampErr, "Error serializing 'timestamp' field") } // Simple Field (requestHandle) requestHandle := uint32(m.GetRequestHandle()) - _requestHandleErr := writeBuffer.WriteUint32("requestHandle", 32, (requestHandle)) + _requestHandleErr := writeBuffer.WriteUint32("requestHandle", 32, uint32((requestHandle))) if _requestHandleErr != nil { return errors.Wrap(_requestHandleErr, "Error serializing 'requestHandle' field") } // Simple Field (returnDiagnostics) returnDiagnostics := uint32(m.GetReturnDiagnostics()) - _returnDiagnosticsErr := writeBuffer.WriteUint32("returnDiagnostics", 32, (returnDiagnostics)) + _returnDiagnosticsErr := writeBuffer.WriteUint32("returnDiagnostics", 32, uint32((returnDiagnostics))) if _returnDiagnosticsErr != nil { return errors.Wrap(_returnDiagnosticsErr, "Error serializing 'returnDiagnostics' field") } @@ -356,7 +356,7 @@ func (m *_RequestHeader) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (timeoutHint) timeoutHint := uint32(m.GetTimeoutHint()) - _timeoutHintErr := writeBuffer.WriteUint32("timeoutHint", 32, (timeoutHint)) + _timeoutHintErr := writeBuffer.WriteUint32("timeoutHint", 32, uint32((timeoutHint))) if _timeoutHintErr != nil { return errors.Wrap(_timeoutHintErr, "Error serializing 'timeoutHint' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ResponseHeader.go b/plc4go/protocols/opcua/readwrite/model/ResponseHeader.go index b9ffebabb93..d5901fec613 100644 --- a/plc4go/protocols/opcua/readwrite/model/ResponseHeader.go +++ b/plc4go/protocols/opcua/readwrite/model/ResponseHeader.go @@ -338,14 +338,14 @@ func (m *_ResponseHeader) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (timestamp) timestamp := int64(m.GetTimestamp()) - _timestampErr := writeBuffer.WriteInt64("timestamp", 64, (timestamp)) + _timestampErr := writeBuffer.WriteInt64("timestamp", 64, int64((timestamp))) if _timestampErr != nil { return errors.Wrap(_timestampErr, "Error serializing 'timestamp' field") } // Simple Field (requestHandle) requestHandle := uint32(m.GetRequestHandle()) - _requestHandleErr := writeBuffer.WriteUint32("requestHandle", 32, (requestHandle)) + _requestHandleErr := writeBuffer.WriteUint32("requestHandle", 32, uint32((requestHandle))) if _requestHandleErr != nil { return errors.Wrap(_requestHandleErr, "Error serializing 'requestHandle' field") } @@ -376,7 +376,7 @@ func (m *_ResponseHeader) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (noOfStringTable) noOfStringTable := int32(m.GetNoOfStringTable()) - _noOfStringTableErr := writeBuffer.WriteInt32("noOfStringTable", 32, (noOfStringTable)) + _noOfStringTableErr := writeBuffer.WriteInt32("noOfStringTable", 32, int32((noOfStringTable))) if _noOfStringTableErr != nil { return errors.Wrap(_noOfStringTableErr, "Error serializing 'noOfStringTable' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SamplingIntervalDiagnosticsDataType.go b/plc4go/protocols/opcua/readwrite/model/SamplingIntervalDiagnosticsDataType.go index 734e13d337d..935800e0bfa 100644 --- a/plc4go/protocols/opcua/readwrite/model/SamplingIntervalDiagnosticsDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/SamplingIntervalDiagnosticsDataType.go @@ -243,21 +243,21 @@ func (m *_SamplingIntervalDiagnosticsDataType) SerializeWithWriteBuffer(ctx cont // Simple Field (monitoredItemCount) monitoredItemCount := uint32(m.GetMonitoredItemCount()) - _monitoredItemCountErr := writeBuffer.WriteUint32("monitoredItemCount", 32, (monitoredItemCount)) + _monitoredItemCountErr := writeBuffer.WriteUint32("monitoredItemCount", 32, uint32((monitoredItemCount))) if _monitoredItemCountErr != nil { return errors.Wrap(_monitoredItemCountErr, "Error serializing 'monitoredItemCount' field") } // Simple Field (maxMonitoredItemCount) maxMonitoredItemCount := uint32(m.GetMaxMonitoredItemCount()) - _maxMonitoredItemCountErr := writeBuffer.WriteUint32("maxMonitoredItemCount", 32, (maxMonitoredItemCount)) + _maxMonitoredItemCountErr := writeBuffer.WriteUint32("maxMonitoredItemCount", 32, uint32((maxMonitoredItemCount))) if _maxMonitoredItemCountErr != nil { return errors.Wrap(_maxMonitoredItemCountErr, "Error serializing 'maxMonitoredItemCount' field") } // Simple Field (disabledMonitoredItemCount) disabledMonitoredItemCount := uint32(m.GetDisabledMonitoredItemCount()) - _disabledMonitoredItemCountErr := writeBuffer.WriteUint32("disabledMonitoredItemCount", 32, (disabledMonitoredItemCount)) + _disabledMonitoredItemCountErr := writeBuffer.WriteUint32("disabledMonitoredItemCount", 32, uint32((disabledMonitoredItemCount))) if _disabledMonitoredItemCountErr != nil { return errors.Wrap(_disabledMonitoredItemCountErr, "Error serializing 'disabledMonitoredItemCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SecurityGroupDataType.go b/plc4go/protocols/opcua/readwrite/model/SecurityGroupDataType.go index 26076a231e4..7bb872dc085 100644 --- a/plc4go/protocols/opcua/readwrite/model/SecurityGroupDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/SecurityGroupDataType.go @@ -499,7 +499,7 @@ func (m *_SecurityGroupDataType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfSecurityGroupFolder) noOfSecurityGroupFolder := int32(m.GetNoOfSecurityGroupFolder()) - _noOfSecurityGroupFolderErr := writeBuffer.WriteInt32("noOfSecurityGroupFolder", 32, (noOfSecurityGroupFolder)) + _noOfSecurityGroupFolderErr := writeBuffer.WriteInt32("noOfSecurityGroupFolder", 32, int32((noOfSecurityGroupFolder))) if _noOfSecurityGroupFolderErr != nil { return errors.Wrap(_noOfSecurityGroupFolderErr, "Error serializing 'noOfSecurityGroupFolder' field") } @@ -542,14 +542,14 @@ func (m *_SecurityGroupDataType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (maxFutureKeyCount) maxFutureKeyCount := uint32(m.GetMaxFutureKeyCount()) - _maxFutureKeyCountErr := writeBuffer.WriteUint32("maxFutureKeyCount", 32, (maxFutureKeyCount)) + _maxFutureKeyCountErr := writeBuffer.WriteUint32("maxFutureKeyCount", 32, uint32((maxFutureKeyCount))) if _maxFutureKeyCountErr != nil { return errors.Wrap(_maxFutureKeyCountErr, "Error serializing 'maxFutureKeyCount' field") } // Simple Field (maxPastKeyCount) maxPastKeyCount := uint32(m.GetMaxPastKeyCount()) - _maxPastKeyCountErr := writeBuffer.WriteUint32("maxPastKeyCount", 32, (maxPastKeyCount)) + _maxPastKeyCountErr := writeBuffer.WriteUint32("maxPastKeyCount", 32, uint32((maxPastKeyCount))) if _maxPastKeyCountErr != nil { return errors.Wrap(_maxPastKeyCountErr, "Error serializing 'maxPastKeyCount' field") } @@ -568,7 +568,7 @@ func (m *_SecurityGroupDataType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfRolePermissions) noOfRolePermissions := int32(m.GetNoOfRolePermissions()) - _noOfRolePermissionsErr := writeBuffer.WriteInt32("noOfRolePermissions", 32, (noOfRolePermissions)) + _noOfRolePermissionsErr := writeBuffer.WriteInt32("noOfRolePermissions", 32, int32((noOfRolePermissions))) if _noOfRolePermissionsErr != nil { return errors.Wrap(_noOfRolePermissionsErr, "Error serializing 'noOfRolePermissions' field") } @@ -592,7 +592,7 @@ func (m *_SecurityGroupDataType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfGroupProperties) noOfGroupProperties := int32(m.GetNoOfGroupProperties()) - _noOfGroupPropertiesErr := writeBuffer.WriteInt32("noOfGroupProperties", 32, (noOfGroupProperties)) + _noOfGroupPropertiesErr := writeBuffer.WriteInt32("noOfGroupProperties", 32, int32((noOfGroupProperties))) if _noOfGroupPropertiesErr != nil { return errors.Wrap(_noOfGroupPropertiesErr, "Error serializing 'noOfGroupProperties' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SecurityTokenRequestType.go b/plc4go/protocols/opcua/readwrite/model/SecurityTokenRequestType.go index 9190ba2f8ea..6abce7c8e85 100644 --- a/plc4go/protocols/opcua/readwrite/model/SecurityTokenRequestType.go +++ b/plc4go/protocols/opcua/readwrite/model/SecurityTokenRequestType.go @@ -132,7 +132,7 @@ func (e SecurityTokenRequestType) Serialize() ([]byte, error) { func (e SecurityTokenRequestType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("SecurityTokenRequestType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("SecurityTokenRequestType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ServerDiagnosticsSummaryDataType.go b/plc4go/protocols/opcua/readwrite/model/ServerDiagnosticsSummaryDataType.go index 336357fb695..ede321acf2b 100644 --- a/plc4go/protocols/opcua/readwrite/model/ServerDiagnosticsSummaryDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ServerDiagnosticsSummaryDataType.go @@ -388,84 +388,84 @@ func (m *_ServerDiagnosticsSummaryDataType) SerializeWithWriteBuffer(ctx context // Simple Field (serverViewCount) serverViewCount := uint32(m.GetServerViewCount()) - _serverViewCountErr := writeBuffer.WriteUint32("serverViewCount", 32, (serverViewCount)) + _serverViewCountErr := writeBuffer.WriteUint32("serverViewCount", 32, uint32((serverViewCount))) if _serverViewCountErr != nil { return errors.Wrap(_serverViewCountErr, "Error serializing 'serverViewCount' field") } // Simple Field (currentSessionCount) currentSessionCount := uint32(m.GetCurrentSessionCount()) - _currentSessionCountErr := writeBuffer.WriteUint32("currentSessionCount", 32, (currentSessionCount)) + _currentSessionCountErr := writeBuffer.WriteUint32("currentSessionCount", 32, uint32((currentSessionCount))) if _currentSessionCountErr != nil { return errors.Wrap(_currentSessionCountErr, "Error serializing 'currentSessionCount' field") } // Simple Field (cumulatedSessionCount) cumulatedSessionCount := uint32(m.GetCumulatedSessionCount()) - _cumulatedSessionCountErr := writeBuffer.WriteUint32("cumulatedSessionCount", 32, (cumulatedSessionCount)) + _cumulatedSessionCountErr := writeBuffer.WriteUint32("cumulatedSessionCount", 32, uint32((cumulatedSessionCount))) if _cumulatedSessionCountErr != nil { return errors.Wrap(_cumulatedSessionCountErr, "Error serializing 'cumulatedSessionCount' field") } // Simple Field (securityRejectedSessionCount) securityRejectedSessionCount := uint32(m.GetSecurityRejectedSessionCount()) - _securityRejectedSessionCountErr := writeBuffer.WriteUint32("securityRejectedSessionCount", 32, (securityRejectedSessionCount)) + _securityRejectedSessionCountErr := writeBuffer.WriteUint32("securityRejectedSessionCount", 32, uint32((securityRejectedSessionCount))) if _securityRejectedSessionCountErr != nil { return errors.Wrap(_securityRejectedSessionCountErr, "Error serializing 'securityRejectedSessionCount' field") } // Simple Field (rejectedSessionCount) rejectedSessionCount := uint32(m.GetRejectedSessionCount()) - _rejectedSessionCountErr := writeBuffer.WriteUint32("rejectedSessionCount", 32, (rejectedSessionCount)) + _rejectedSessionCountErr := writeBuffer.WriteUint32("rejectedSessionCount", 32, uint32((rejectedSessionCount))) if _rejectedSessionCountErr != nil { return errors.Wrap(_rejectedSessionCountErr, "Error serializing 'rejectedSessionCount' field") } // Simple Field (sessionTimeoutCount) sessionTimeoutCount := uint32(m.GetSessionTimeoutCount()) - _sessionTimeoutCountErr := writeBuffer.WriteUint32("sessionTimeoutCount", 32, (sessionTimeoutCount)) + _sessionTimeoutCountErr := writeBuffer.WriteUint32("sessionTimeoutCount", 32, uint32((sessionTimeoutCount))) if _sessionTimeoutCountErr != nil { return errors.Wrap(_sessionTimeoutCountErr, "Error serializing 'sessionTimeoutCount' field") } // Simple Field (sessionAbortCount) sessionAbortCount := uint32(m.GetSessionAbortCount()) - _sessionAbortCountErr := writeBuffer.WriteUint32("sessionAbortCount", 32, (sessionAbortCount)) + _sessionAbortCountErr := writeBuffer.WriteUint32("sessionAbortCount", 32, uint32((sessionAbortCount))) if _sessionAbortCountErr != nil { return errors.Wrap(_sessionAbortCountErr, "Error serializing 'sessionAbortCount' field") } // Simple Field (currentSubscriptionCount) currentSubscriptionCount := uint32(m.GetCurrentSubscriptionCount()) - _currentSubscriptionCountErr := writeBuffer.WriteUint32("currentSubscriptionCount", 32, (currentSubscriptionCount)) + _currentSubscriptionCountErr := writeBuffer.WriteUint32("currentSubscriptionCount", 32, uint32((currentSubscriptionCount))) if _currentSubscriptionCountErr != nil { return errors.Wrap(_currentSubscriptionCountErr, "Error serializing 'currentSubscriptionCount' field") } // Simple Field (cumulatedSubscriptionCount) cumulatedSubscriptionCount := uint32(m.GetCumulatedSubscriptionCount()) - _cumulatedSubscriptionCountErr := writeBuffer.WriteUint32("cumulatedSubscriptionCount", 32, (cumulatedSubscriptionCount)) + _cumulatedSubscriptionCountErr := writeBuffer.WriteUint32("cumulatedSubscriptionCount", 32, uint32((cumulatedSubscriptionCount))) if _cumulatedSubscriptionCountErr != nil { return errors.Wrap(_cumulatedSubscriptionCountErr, "Error serializing 'cumulatedSubscriptionCount' field") } // Simple Field (publishingIntervalCount) publishingIntervalCount := uint32(m.GetPublishingIntervalCount()) - _publishingIntervalCountErr := writeBuffer.WriteUint32("publishingIntervalCount", 32, (publishingIntervalCount)) + _publishingIntervalCountErr := writeBuffer.WriteUint32("publishingIntervalCount", 32, uint32((publishingIntervalCount))) if _publishingIntervalCountErr != nil { return errors.Wrap(_publishingIntervalCountErr, "Error serializing 'publishingIntervalCount' field") } // Simple Field (securityRejectedRequestsCount) securityRejectedRequestsCount := uint32(m.GetSecurityRejectedRequestsCount()) - _securityRejectedRequestsCountErr := writeBuffer.WriteUint32("securityRejectedRequestsCount", 32, (securityRejectedRequestsCount)) + _securityRejectedRequestsCountErr := writeBuffer.WriteUint32("securityRejectedRequestsCount", 32, uint32((securityRejectedRequestsCount))) if _securityRejectedRequestsCountErr != nil { return errors.Wrap(_securityRejectedRequestsCountErr, "Error serializing 'securityRejectedRequestsCount' field") } // Simple Field (rejectedRequestsCount) rejectedRequestsCount := uint32(m.GetRejectedRequestsCount()) - _rejectedRequestsCountErr := writeBuffer.WriteUint32("rejectedRequestsCount", 32, (rejectedRequestsCount)) + _rejectedRequestsCountErr := writeBuffer.WriteUint32("rejectedRequestsCount", 32, uint32((rejectedRequestsCount))) if _rejectedRequestsCountErr != nil { return errors.Wrap(_rejectedRequestsCountErr, "Error serializing 'rejectedRequestsCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ServerOnNetwork.go b/plc4go/protocols/opcua/readwrite/model/ServerOnNetwork.go index 988daac2bdd..c91ab32bd18 100644 --- a/plc4go/protocols/opcua/readwrite/model/ServerOnNetwork.go +++ b/plc4go/protocols/opcua/readwrite/model/ServerOnNetwork.go @@ -294,7 +294,7 @@ func (m *_ServerOnNetwork) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (recordId) recordId := uint32(m.GetRecordId()) - _recordIdErr := writeBuffer.WriteUint32("recordId", 32, (recordId)) + _recordIdErr := writeBuffer.WriteUint32("recordId", 32, uint32((recordId))) if _recordIdErr != nil { return errors.Wrap(_recordIdErr, "Error serializing 'recordId' field") } @@ -325,7 +325,7 @@ func (m *_ServerOnNetwork) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (noOfServerCapabilities) noOfServerCapabilities := int32(m.GetNoOfServerCapabilities()) - _noOfServerCapabilitiesErr := writeBuffer.WriteInt32("noOfServerCapabilities", 32, (noOfServerCapabilities)) + _noOfServerCapabilitiesErr := writeBuffer.WriteInt32("noOfServerCapabilities", 32, int32((noOfServerCapabilities))) if _noOfServerCapabilitiesErr != nil { return errors.Wrap(_noOfServerCapabilitiesErr, "Error serializing 'noOfServerCapabilities' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ServerState.go b/plc4go/protocols/opcua/readwrite/model/ServerState.go index dc93e28d81e..37e45d206fc 100644 --- a/plc4go/protocols/opcua/readwrite/model/ServerState.go +++ b/plc4go/protocols/opcua/readwrite/model/ServerState.go @@ -168,7 +168,7 @@ func (e ServerState) Serialize() ([]byte, error) { func (e ServerState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("ServerState", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("ServerState", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/ServerStatusDataType.go b/plc4go/protocols/opcua/readwrite/model/ServerStatusDataType.go index 180efc8d237..88f12b66e52 100644 --- a/plc4go/protocols/opcua/readwrite/model/ServerStatusDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ServerStatusDataType.go @@ -292,14 +292,14 @@ func (m *_ServerStatusDataType) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (startTime) startTime := int64(m.GetStartTime()) - _startTimeErr := writeBuffer.WriteInt64("startTime", 64, (startTime)) + _startTimeErr := writeBuffer.WriteInt64("startTime", 64, int64((startTime))) if _startTimeErr != nil { return errors.Wrap(_startTimeErr, "Error serializing 'startTime' field") } // Simple Field (currentTime) currentTime := int64(m.GetCurrentTime()) - _currentTimeErr := writeBuffer.WriteInt64("currentTime", 64, (currentTime)) + _currentTimeErr := writeBuffer.WriteInt64("currentTime", 64, int64((currentTime))) if _currentTimeErr != nil { return errors.Wrap(_currentTimeErr, "Error serializing 'currentTime' field") } @@ -330,7 +330,7 @@ func (m *_ServerStatusDataType) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (secondsTillShutdown) secondsTillShutdown := uint32(m.GetSecondsTillShutdown()) - _secondsTillShutdownErr := writeBuffer.WriteUint32("secondsTillShutdown", 32, (secondsTillShutdown)) + _secondsTillShutdownErr := writeBuffer.WriteUint32("secondsTillShutdown", 32, uint32((secondsTillShutdown))) if _secondsTillShutdownErr != nil { return errors.Wrap(_secondsTillShutdownErr, "Error serializing 'secondsTillShutdown' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ServiceCounterDataType.go b/plc4go/protocols/opcua/readwrite/model/ServiceCounterDataType.go index ac4d6a865b6..fe6784d7320 100644 --- a/plc4go/protocols/opcua/readwrite/model/ServiceCounterDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/ServiceCounterDataType.go @@ -198,14 +198,14 @@ func (m *_ServiceCounterDataType) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (totalCount) totalCount := uint32(m.GetTotalCount()) - _totalCountErr := writeBuffer.WriteUint32("totalCount", 32, (totalCount)) + _totalCountErr := writeBuffer.WriteUint32("totalCount", 32, uint32((totalCount))) if _totalCountErr != nil { return errors.Wrap(_totalCountErr, "Error serializing 'totalCount' field") } // Simple Field (errorCount) errorCount := uint32(m.GetErrorCount()) - _errorCountErr := writeBuffer.WriteUint32("errorCount", 32, (errorCount)) + _errorCountErr := writeBuffer.WriteUint32("errorCount", 32, uint32((errorCount))) if _errorCountErr != nil { return errors.Wrap(_errorCountErr, "Error serializing 'errorCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SessionDiagnosticsDataType.go b/plc4go/protocols/opcua/readwrite/model/SessionDiagnosticsDataType.go index 01db7dac3e7..6f694392a84 100644 --- a/plc4go/protocols/opcua/readwrite/model/SessionDiagnosticsDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/SessionDiagnosticsDataType.go @@ -1287,7 +1287,7 @@ func (m *_SessionDiagnosticsDataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (noOfLocaleIds) noOfLocaleIds := int32(m.GetNoOfLocaleIds()) - _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, (noOfLocaleIds)) + _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, int32((noOfLocaleIds))) if _noOfLocaleIdsErr != nil { return errors.Wrap(_noOfLocaleIdsErr, "Error serializing 'noOfLocaleIds' field") } @@ -1318,42 +1318,42 @@ func (m *_SessionDiagnosticsDataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (maxResponseMessageSize) maxResponseMessageSize := uint32(m.GetMaxResponseMessageSize()) - _maxResponseMessageSizeErr := writeBuffer.WriteUint32("maxResponseMessageSize", 32, (maxResponseMessageSize)) + _maxResponseMessageSizeErr := writeBuffer.WriteUint32("maxResponseMessageSize", 32, uint32((maxResponseMessageSize))) if _maxResponseMessageSizeErr != nil { return errors.Wrap(_maxResponseMessageSizeErr, "Error serializing 'maxResponseMessageSize' field") } // Simple Field (clientConnectionTime) clientConnectionTime := int64(m.GetClientConnectionTime()) - _clientConnectionTimeErr := writeBuffer.WriteInt64("clientConnectionTime", 64, (clientConnectionTime)) + _clientConnectionTimeErr := writeBuffer.WriteInt64("clientConnectionTime", 64, int64((clientConnectionTime))) if _clientConnectionTimeErr != nil { return errors.Wrap(_clientConnectionTimeErr, "Error serializing 'clientConnectionTime' field") } // Simple Field (clientLastContactTime) clientLastContactTime := int64(m.GetClientLastContactTime()) - _clientLastContactTimeErr := writeBuffer.WriteInt64("clientLastContactTime", 64, (clientLastContactTime)) + _clientLastContactTimeErr := writeBuffer.WriteInt64("clientLastContactTime", 64, int64((clientLastContactTime))) if _clientLastContactTimeErr != nil { return errors.Wrap(_clientLastContactTimeErr, "Error serializing 'clientLastContactTime' field") } // Simple Field (currentSubscriptionsCount) currentSubscriptionsCount := uint32(m.GetCurrentSubscriptionsCount()) - _currentSubscriptionsCountErr := writeBuffer.WriteUint32("currentSubscriptionsCount", 32, (currentSubscriptionsCount)) + _currentSubscriptionsCountErr := writeBuffer.WriteUint32("currentSubscriptionsCount", 32, uint32((currentSubscriptionsCount))) if _currentSubscriptionsCountErr != nil { return errors.Wrap(_currentSubscriptionsCountErr, "Error serializing 'currentSubscriptionsCount' field") } // Simple Field (currentMonitoredItemsCount) currentMonitoredItemsCount := uint32(m.GetCurrentMonitoredItemsCount()) - _currentMonitoredItemsCountErr := writeBuffer.WriteUint32("currentMonitoredItemsCount", 32, (currentMonitoredItemsCount)) + _currentMonitoredItemsCountErr := writeBuffer.WriteUint32("currentMonitoredItemsCount", 32, uint32((currentMonitoredItemsCount))) if _currentMonitoredItemsCountErr != nil { return errors.Wrap(_currentMonitoredItemsCountErr, "Error serializing 'currentMonitoredItemsCount' field") } // Simple Field (currentPublishRequestsInQueue) currentPublishRequestsInQueue := uint32(m.GetCurrentPublishRequestsInQueue()) - _currentPublishRequestsInQueueErr := writeBuffer.WriteUint32("currentPublishRequestsInQueue", 32, (currentPublishRequestsInQueue)) + _currentPublishRequestsInQueueErr := writeBuffer.WriteUint32("currentPublishRequestsInQueue", 32, uint32((currentPublishRequestsInQueue))) if _currentPublishRequestsInQueueErr != nil { return errors.Wrap(_currentPublishRequestsInQueueErr, "Error serializing 'currentPublishRequestsInQueue' field") } @@ -1372,7 +1372,7 @@ func (m *_SessionDiagnosticsDataType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (unauthorizedRequestCount) unauthorizedRequestCount := uint32(m.GetUnauthorizedRequestCount()) - _unauthorizedRequestCountErr := writeBuffer.WriteUint32("unauthorizedRequestCount", 32, (unauthorizedRequestCount)) + _unauthorizedRequestCountErr := writeBuffer.WriteUint32("unauthorizedRequestCount", 32, uint32((unauthorizedRequestCount))) if _unauthorizedRequestCountErr != nil { return errors.Wrap(_unauthorizedRequestCountErr, "Error serializing 'unauthorizedRequestCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SessionSecurityDiagnosticsDataType.go b/plc4go/protocols/opcua/readwrite/model/SessionSecurityDiagnosticsDataType.go index 5ef61ab895e..50e371df27c 100644 --- a/plc4go/protocols/opcua/readwrite/model/SessionSecurityDiagnosticsDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/SessionSecurityDiagnosticsDataType.go @@ -449,7 +449,7 @@ func (m *_SessionSecurityDiagnosticsDataType) SerializeWithWriteBuffer(ctx conte // Simple Field (noOfClientUserIdHistory) noOfClientUserIdHistory := int32(m.GetNoOfClientUserIdHistory()) - _noOfClientUserIdHistoryErr := writeBuffer.WriteInt32("noOfClientUserIdHistory", 32, (noOfClientUserIdHistory)) + _noOfClientUserIdHistoryErr := writeBuffer.WriteInt32("noOfClientUserIdHistory", 32, int32((noOfClientUserIdHistory))) if _noOfClientUserIdHistoryErr != nil { return errors.Wrap(_noOfClientUserIdHistoryErr, "Error serializing 'noOfClientUserIdHistory' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeRequestType.go b/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeRequestType.go index b91fa6198d1..955c75c5dce 100644 --- a/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeRequestType.go +++ b/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeRequestType.go @@ -393,14 +393,14 @@ func (m *_SessionlessInvokeRequestType) SerializeWithWriteBuffer(ctx context.Con // Simple Field (urisVersion) urisVersion := uint32(m.GetUrisVersion()) - _urisVersionErr := writeBuffer.WriteUint32("urisVersion", 32, (urisVersion)) + _urisVersionErr := writeBuffer.WriteUint32("urisVersion", 32, uint32((urisVersion))) if _urisVersionErr != nil { return errors.Wrap(_urisVersionErr, "Error serializing 'urisVersion' field") } // Simple Field (noOfNamespaceUris) noOfNamespaceUris := int32(m.GetNoOfNamespaceUris()) - _noOfNamespaceUrisErr := writeBuffer.WriteInt32("noOfNamespaceUris", 32, (noOfNamespaceUris)) + _noOfNamespaceUrisErr := writeBuffer.WriteInt32("noOfNamespaceUris", 32, int32((noOfNamespaceUris))) if _noOfNamespaceUrisErr != nil { return errors.Wrap(_noOfNamespaceUrisErr, "Error serializing 'noOfNamespaceUris' field") } @@ -424,7 +424,7 @@ func (m *_SessionlessInvokeRequestType) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfServerUris) noOfServerUris := int32(m.GetNoOfServerUris()) - _noOfServerUrisErr := writeBuffer.WriteInt32("noOfServerUris", 32, (noOfServerUris)) + _noOfServerUrisErr := writeBuffer.WriteInt32("noOfServerUris", 32, int32((noOfServerUris))) if _noOfServerUrisErr != nil { return errors.Wrap(_noOfServerUrisErr, "Error serializing 'noOfServerUris' field") } @@ -448,7 +448,7 @@ func (m *_SessionlessInvokeRequestType) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfLocaleIds) noOfLocaleIds := int32(m.GetNoOfLocaleIds()) - _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, (noOfLocaleIds)) + _noOfLocaleIdsErr := writeBuffer.WriteInt32("noOfLocaleIds", 32, int32((noOfLocaleIds))) if _noOfLocaleIdsErr != nil { return errors.Wrap(_noOfLocaleIdsErr, "Error serializing 'noOfLocaleIds' field") } @@ -472,7 +472,7 @@ func (m *_SessionlessInvokeRequestType) SerializeWithWriteBuffer(ctx context.Con // Simple Field (serviceId) serviceId := uint32(m.GetServiceId()) - _serviceIdErr := writeBuffer.WriteUint32("serviceId", 32, (serviceId)) + _serviceIdErr := writeBuffer.WriteUint32("serviceId", 32, uint32((serviceId))) if _serviceIdErr != nil { return errors.Wrap(_serviceIdErr, "Error serializing 'serviceId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeResponseType.go b/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeResponseType.go index 198ccb44061..e4b88d0a21d 100644 --- a/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeResponseType.go +++ b/plc4go/protocols/opcua/readwrite/model/SessionlessInvokeResponseType.go @@ -309,7 +309,7 @@ func (m *_SessionlessInvokeResponseType) SerializeWithWriteBuffer(ctx context.Co // Simple Field (noOfNamespaceUris) noOfNamespaceUris := int32(m.GetNoOfNamespaceUris()) - _noOfNamespaceUrisErr := writeBuffer.WriteInt32("noOfNamespaceUris", 32, (noOfNamespaceUris)) + _noOfNamespaceUrisErr := writeBuffer.WriteInt32("noOfNamespaceUris", 32, int32((noOfNamespaceUris))) if _noOfNamespaceUrisErr != nil { return errors.Wrap(_noOfNamespaceUrisErr, "Error serializing 'noOfNamespaceUris' field") } @@ -333,7 +333,7 @@ func (m *_SessionlessInvokeResponseType) SerializeWithWriteBuffer(ctx context.Co // Simple Field (noOfServerUris) noOfServerUris := int32(m.GetNoOfServerUris()) - _noOfServerUrisErr := writeBuffer.WriteInt32("noOfServerUris", 32, (noOfServerUris)) + _noOfServerUrisErr := writeBuffer.WriteInt32("noOfServerUris", 32, int32((noOfServerUris))) if _noOfServerUrisErr != nil { return errors.Wrap(_noOfServerUrisErr, "Error serializing 'noOfServerUris' field") } @@ -357,7 +357,7 @@ func (m *_SessionlessInvokeResponseType) SerializeWithWriteBuffer(ctx context.Co // Simple Field (serviceId) serviceId := uint32(m.GetServiceId()) - _serviceIdErr := writeBuffer.WriteUint32("serviceId", 32, (serviceId)) + _serviceIdErr := writeBuffer.WriteUint32("serviceId", 32, uint32((serviceId))) if _serviceIdErr != nil { return errors.Wrap(_serviceIdErr, "Error serializing 'serviceId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeRequest.go b/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeRequest.go index 476afd84d99..7148432cc71 100644 --- a/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeRequest.go @@ -301,7 +301,7 @@ func (m *_SetMonitoringModeRequest) SerializeWithWriteBuffer(ctx context.Context // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } @@ -320,7 +320,7 @@ func (m *_SetMonitoringModeRequest) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfMonitoredItemIds) noOfMonitoredItemIds := int32(m.GetNoOfMonitoredItemIds()) - _noOfMonitoredItemIdsErr := writeBuffer.WriteInt32("noOfMonitoredItemIds", 32, (noOfMonitoredItemIds)) + _noOfMonitoredItemIdsErr := writeBuffer.WriteInt32("noOfMonitoredItemIds", 32, int32((noOfMonitoredItemIds))) if _noOfMonitoredItemIdsErr != nil { return errors.Wrap(_noOfMonitoredItemIdsErr, "Error serializing 'noOfMonitoredItemIds' field") } @@ -331,7 +331,7 @@ func (m *_SetMonitoringModeRequest) SerializeWithWriteBuffer(ctx context.Context } for _curItem, _element := range m.GetMonitoredItemIds() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'monitoredItemIds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeResponse.go b/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeResponse.go index d10d8f6f9ed..83cafbfc3e3 100644 --- a/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/SetMonitoringModeResponse.go @@ -327,7 +327,7 @@ func (m *_SetMonitoringModeResponse) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_SetMonitoringModeResponse) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SetPublishingModeRequest.go b/plc4go/protocols/opcua/readwrite/model/SetPublishingModeRequest.go index 19aeb571fb8..57d9ced23cf 100644 --- a/plc4go/protocols/opcua/readwrite/model/SetPublishingModeRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/SetPublishingModeRequest.go @@ -307,7 +307,7 @@ func (m *_SetPublishingModeRequest) SerializeWithWriteBuffer(ctx context.Context }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -322,7 +322,7 @@ func (m *_SetPublishingModeRequest) SerializeWithWriteBuffer(ctx context.Context // Simple Field (noOfSubscriptionIds) noOfSubscriptionIds := int32(m.GetNoOfSubscriptionIds()) - _noOfSubscriptionIdsErr := writeBuffer.WriteInt32("noOfSubscriptionIds", 32, (noOfSubscriptionIds)) + _noOfSubscriptionIdsErr := writeBuffer.WriteInt32("noOfSubscriptionIds", 32, int32((noOfSubscriptionIds))) if _noOfSubscriptionIdsErr != nil { return errors.Wrap(_noOfSubscriptionIdsErr, "Error serializing 'noOfSubscriptionIds' field") } @@ -333,7 +333,7 @@ func (m *_SetPublishingModeRequest) SerializeWithWriteBuffer(ctx context.Context } for _curItem, _element := range m.GetSubscriptionIds() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'subscriptionIds' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SetPublishingModeResponse.go b/plc4go/protocols/opcua/readwrite/model/SetPublishingModeResponse.go index 95116b01a9d..40c64e17d51 100644 --- a/plc4go/protocols/opcua/readwrite/model/SetPublishingModeResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/SetPublishingModeResponse.go @@ -327,7 +327,7 @@ func (m *_SetPublishingModeResponse) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_SetPublishingModeResponse) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SetTriggeringRequest.go b/plc4go/protocols/opcua/readwrite/model/SetTriggeringRequest.go index fed0d4037b6..d96e2c9cd25 100644 --- a/plc4go/protocols/opcua/readwrite/model/SetTriggeringRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/SetTriggeringRequest.go @@ -355,21 +355,21 @@ func (m *_SetTriggeringRequest) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } // Simple Field (triggeringItemId) triggeringItemId := uint32(m.GetTriggeringItemId()) - _triggeringItemIdErr := writeBuffer.WriteUint32("triggeringItemId", 32, (triggeringItemId)) + _triggeringItemIdErr := writeBuffer.WriteUint32("triggeringItemId", 32, uint32((triggeringItemId))) if _triggeringItemIdErr != nil { return errors.Wrap(_triggeringItemIdErr, "Error serializing 'triggeringItemId' field") } // Simple Field (noOfLinksToAdd) noOfLinksToAdd := int32(m.GetNoOfLinksToAdd()) - _noOfLinksToAddErr := writeBuffer.WriteInt32("noOfLinksToAdd", 32, (noOfLinksToAdd)) + _noOfLinksToAddErr := writeBuffer.WriteInt32("noOfLinksToAdd", 32, int32((noOfLinksToAdd))) if _noOfLinksToAddErr != nil { return errors.Wrap(_noOfLinksToAddErr, "Error serializing 'noOfLinksToAdd' field") } @@ -380,7 +380,7 @@ func (m *_SetTriggeringRequest) SerializeWithWriteBuffer(ctx context.Context, wr } for _curItem, _element := range m.GetLinksToAdd() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'linksToAdd' field") } @@ -391,7 +391,7 @@ func (m *_SetTriggeringRequest) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (noOfLinksToRemove) noOfLinksToRemove := int32(m.GetNoOfLinksToRemove()) - _noOfLinksToRemoveErr := writeBuffer.WriteInt32("noOfLinksToRemove", 32, (noOfLinksToRemove)) + _noOfLinksToRemoveErr := writeBuffer.WriteInt32("noOfLinksToRemove", 32, int32((noOfLinksToRemove))) if _noOfLinksToRemoveErr != nil { return errors.Wrap(_noOfLinksToRemoveErr, "Error serializing 'noOfLinksToRemove' field") } @@ -402,7 +402,7 @@ func (m *_SetTriggeringRequest) SerializeWithWriteBuffer(ctx context.Context, wr } for _curItem, _element := range m.GetLinksToRemove() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'linksToRemove' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SetTriggeringResponse.go b/plc4go/protocols/opcua/readwrite/model/SetTriggeringResponse.go index 439816a1960..5f208867eba 100644 --- a/plc4go/protocols/opcua/readwrite/model/SetTriggeringResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/SetTriggeringResponse.go @@ -457,7 +457,7 @@ func (m *_SetTriggeringResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfAddResults) noOfAddResults := int32(m.GetNoOfAddResults()) - _noOfAddResultsErr := writeBuffer.WriteInt32("noOfAddResults", 32, (noOfAddResults)) + _noOfAddResultsErr := writeBuffer.WriteInt32("noOfAddResults", 32, int32((noOfAddResults))) if _noOfAddResultsErr != nil { return errors.Wrap(_noOfAddResultsErr, "Error serializing 'noOfAddResults' field") } @@ -481,7 +481,7 @@ func (m *_SetTriggeringResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfAddDiagnosticInfos) noOfAddDiagnosticInfos := int32(m.GetNoOfAddDiagnosticInfos()) - _noOfAddDiagnosticInfosErr := writeBuffer.WriteInt32("noOfAddDiagnosticInfos", 32, (noOfAddDiagnosticInfos)) + _noOfAddDiagnosticInfosErr := writeBuffer.WriteInt32("noOfAddDiagnosticInfos", 32, int32((noOfAddDiagnosticInfos))) if _noOfAddDiagnosticInfosErr != nil { return errors.Wrap(_noOfAddDiagnosticInfosErr, "Error serializing 'noOfAddDiagnosticInfos' field") } @@ -505,7 +505,7 @@ func (m *_SetTriggeringResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfRemoveResults) noOfRemoveResults := int32(m.GetNoOfRemoveResults()) - _noOfRemoveResultsErr := writeBuffer.WriteInt32("noOfRemoveResults", 32, (noOfRemoveResults)) + _noOfRemoveResultsErr := writeBuffer.WriteInt32("noOfRemoveResults", 32, int32((noOfRemoveResults))) if _noOfRemoveResultsErr != nil { return errors.Wrap(_noOfRemoveResultsErr, "Error serializing 'noOfRemoveResults' field") } @@ -529,7 +529,7 @@ func (m *_SetTriggeringResponse) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (noOfRemoveDiagnosticInfos) noOfRemoveDiagnosticInfos := int32(m.GetNoOfRemoveDiagnosticInfos()) - _noOfRemoveDiagnosticInfosErr := writeBuffer.WriteInt32("noOfRemoveDiagnosticInfos", 32, (noOfRemoveDiagnosticInfos)) + _noOfRemoveDiagnosticInfosErr := writeBuffer.WriteInt32("noOfRemoveDiagnosticInfos", 32, int32((noOfRemoveDiagnosticInfos))) if _noOfRemoveDiagnosticInfosErr != nil { return errors.Wrap(_noOfRemoveDiagnosticInfosErr, "Error serializing 'noOfRemoveDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/StatusChangeNotification.go b/plc4go/protocols/opcua/readwrite/model/StatusChangeNotification.go index f26528a2d9d..89ce811434c 100644 --- a/plc4go/protocols/opcua/readwrite/model/StatusChangeNotification.go +++ b/plc4go/protocols/opcua/readwrite/model/StatusChangeNotification.go @@ -220,7 +220,7 @@ func (m *_StatusChangeNotification) SerializeWithWriteBuffer(ctx context.Context // Implicit Field (notificationLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) notificationLength := int32(int32(m.GetLengthInBytes(ctx))) - _notificationLengthErr := writeBuffer.WriteInt32("notificationLength", 32, (notificationLength)) + _notificationLengthErr := writeBuffer.WriteInt32("notificationLength", 32, int32((notificationLength))) if _notificationLengthErr != nil { return errors.Wrap(_notificationLengthErr, "Error serializing 'notificationLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/StatusCode.go b/plc4go/protocols/opcua/readwrite/model/StatusCode.go index 17815f62ecd..7798318b1f6 100644 --- a/plc4go/protocols/opcua/readwrite/model/StatusCode.go +++ b/plc4go/protocols/opcua/readwrite/model/StatusCode.go @@ -148,7 +148,7 @@ func (m *_StatusCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (statusCode) statusCode := uint32(m.GetStatusCode()) - _statusCodeErr := writeBuffer.WriteUint32("statusCode", 32, (statusCode)) + _statusCodeErr := writeBuffer.WriteUint32("statusCode", 32, uint32((statusCode))) if _statusCodeErr != nil { return errors.Wrap(_statusCodeErr, "Error serializing 'statusCode' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/StringNodeId.go b/plc4go/protocols/opcua/readwrite/model/StringNodeId.go index 189e6e8c021..cfd33a4bd52 100644 --- a/plc4go/protocols/opcua/readwrite/model/StringNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/StringNodeId.go @@ -172,7 +172,7 @@ func (m *_StringNodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (namespaceIndex) namespaceIndex := uint16(m.GetNamespaceIndex()) - _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, (namespaceIndex)) + _namespaceIndexErr := writeBuffer.WriteUint16("namespaceIndex", 16, uint16((namespaceIndex))) if _namespaceIndexErr != nil { return errors.Wrap(_namespaceIndexErr, "Error serializing 'namespaceIndex' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/StructureField.go b/plc4go/protocols/opcua/readwrite/model/StructureField.go index da253242605..42576a9bc44 100644 --- a/plc4go/protocols/opcua/readwrite/model/StructureField.go +++ b/plc4go/protocols/opcua/readwrite/model/StructureField.go @@ -411,14 +411,14 @@ func (m *_StructureField) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (valueRank) valueRank := int32(m.GetValueRank()) - _valueRankErr := writeBuffer.WriteInt32("valueRank", 32, (valueRank)) + _valueRankErr := writeBuffer.WriteInt32("valueRank", 32, int32((valueRank))) if _valueRankErr != nil { return errors.Wrap(_valueRankErr, "Error serializing 'valueRank' field") } // Simple Field (noOfArrayDimensions) noOfArrayDimensions := int32(m.GetNoOfArrayDimensions()) - _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, (noOfArrayDimensions)) + _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, int32((noOfArrayDimensions))) if _noOfArrayDimensionsErr != nil { return errors.Wrap(_noOfArrayDimensionsErr, "Error serializing 'noOfArrayDimensions' field") } @@ -429,7 +429,7 @@ func (m *_StructureField) SerializeWithWriteBuffer(ctx context.Context, writeBuf } for _curItem, _element := range m.GetArrayDimensions() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'arrayDimensions' field") } @@ -440,7 +440,7 @@ func (m *_StructureField) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (maxStringLength) maxStringLength := uint32(m.GetMaxStringLength()) - _maxStringLengthErr := writeBuffer.WriteUint32("maxStringLength", 32, (maxStringLength)) + _maxStringLengthErr := writeBuffer.WriteUint32("maxStringLength", 32, uint32((maxStringLength))) if _maxStringLengthErr != nil { return errors.Wrap(_maxStringLengthErr, "Error serializing 'maxStringLength' field") } @@ -455,7 +455,7 @@ func (m *_StructureField) SerializeWithWriteBuffer(ctx context.Context, writeBuf }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/StructureType.go b/plc4go/protocols/opcua/readwrite/model/StructureType.go index 3847eca739b..162ab5df441 100644 --- a/plc4go/protocols/opcua/readwrite/model/StructureType.go +++ b/plc4go/protocols/opcua/readwrite/model/StructureType.go @@ -150,7 +150,7 @@ func (e StructureType) Serialize() ([]byte, error) { func (e StructureType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("StructureType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("StructureType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/SubscriptionAcknowledgement.go b/plc4go/protocols/opcua/readwrite/model/SubscriptionAcknowledgement.go index 2808a4a02de..95ddd157a30 100644 --- a/plc4go/protocols/opcua/readwrite/model/SubscriptionAcknowledgement.go +++ b/plc4go/protocols/opcua/readwrite/model/SubscriptionAcknowledgement.go @@ -198,14 +198,14 @@ func (m *_SubscriptionAcknowledgement) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } // Simple Field (sequenceNumber) sequenceNumber := uint32(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteUint32("sequenceNumber", 32, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint32("sequenceNumber", 32, uint32((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/SubscriptionDiagnosticsDataType.go b/plc4go/protocols/opcua/readwrite/model/SubscriptionDiagnosticsDataType.go index 8fea865e0ae..0799dddabaf 100644 --- a/plc4go/protocols/opcua/readwrite/model/SubscriptionDiagnosticsDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/SubscriptionDiagnosticsDataType.go @@ -790,14 +790,14 @@ func (m *_SubscriptionDiagnosticsDataType) SerializeWithWriteBuffer(ctx context. // Simple Field (subscriptionId) subscriptionId := uint32(m.GetSubscriptionId()) - _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, (subscriptionId)) + _subscriptionIdErr := writeBuffer.WriteUint32("subscriptionId", 32, uint32((subscriptionId))) if _subscriptionIdErr != nil { return errors.Wrap(_subscriptionIdErr, "Error serializing 'subscriptionId' field") } // Simple Field (priority) priority := uint8(m.GetPriority()) - _priorityErr := writeBuffer.WriteUint8("priority", 8, (priority)) + _priorityErr := writeBuffer.WriteUint8("priority", 8, uint8((priority))) if _priorityErr != nil { return errors.Wrap(_priorityErr, "Error serializing 'priority' field") } @@ -811,21 +811,21 @@ func (m *_SubscriptionDiagnosticsDataType) SerializeWithWriteBuffer(ctx context. // Simple Field (maxKeepAliveCount) maxKeepAliveCount := uint32(m.GetMaxKeepAliveCount()) - _maxKeepAliveCountErr := writeBuffer.WriteUint32("maxKeepAliveCount", 32, (maxKeepAliveCount)) + _maxKeepAliveCountErr := writeBuffer.WriteUint32("maxKeepAliveCount", 32, uint32((maxKeepAliveCount))) if _maxKeepAliveCountErr != nil { return errors.Wrap(_maxKeepAliveCountErr, "Error serializing 'maxKeepAliveCount' field") } // Simple Field (maxLifetimeCount) maxLifetimeCount := uint32(m.GetMaxLifetimeCount()) - _maxLifetimeCountErr := writeBuffer.WriteUint32("maxLifetimeCount", 32, (maxLifetimeCount)) + _maxLifetimeCountErr := writeBuffer.WriteUint32("maxLifetimeCount", 32, uint32((maxLifetimeCount))) if _maxLifetimeCountErr != nil { return errors.Wrap(_maxLifetimeCountErr, "Error serializing 'maxLifetimeCount' field") } // Simple Field (maxNotificationsPerPublish) maxNotificationsPerPublish := uint32(m.GetMaxNotificationsPerPublish()) - _maxNotificationsPerPublishErr := writeBuffer.WriteUint32("maxNotificationsPerPublish", 32, (maxNotificationsPerPublish)) + _maxNotificationsPerPublishErr := writeBuffer.WriteUint32("maxNotificationsPerPublish", 32, uint32((maxNotificationsPerPublish))) if _maxNotificationsPerPublishErr != nil { return errors.Wrap(_maxNotificationsPerPublishErr, "Error serializing 'maxNotificationsPerPublish' field") } @@ -840,7 +840,7 @@ func (m *_SubscriptionDiagnosticsDataType) SerializeWithWriteBuffer(ctx context. }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -855,161 +855,161 @@ func (m *_SubscriptionDiagnosticsDataType) SerializeWithWriteBuffer(ctx context. // Simple Field (modifyCount) modifyCount := uint32(m.GetModifyCount()) - _modifyCountErr := writeBuffer.WriteUint32("modifyCount", 32, (modifyCount)) + _modifyCountErr := writeBuffer.WriteUint32("modifyCount", 32, uint32((modifyCount))) if _modifyCountErr != nil { return errors.Wrap(_modifyCountErr, "Error serializing 'modifyCount' field") } // Simple Field (enableCount) enableCount := uint32(m.GetEnableCount()) - _enableCountErr := writeBuffer.WriteUint32("enableCount", 32, (enableCount)) + _enableCountErr := writeBuffer.WriteUint32("enableCount", 32, uint32((enableCount))) if _enableCountErr != nil { return errors.Wrap(_enableCountErr, "Error serializing 'enableCount' field") } // Simple Field (disableCount) disableCount := uint32(m.GetDisableCount()) - _disableCountErr := writeBuffer.WriteUint32("disableCount", 32, (disableCount)) + _disableCountErr := writeBuffer.WriteUint32("disableCount", 32, uint32((disableCount))) if _disableCountErr != nil { return errors.Wrap(_disableCountErr, "Error serializing 'disableCount' field") } // Simple Field (republishRequestCount) republishRequestCount := uint32(m.GetRepublishRequestCount()) - _republishRequestCountErr := writeBuffer.WriteUint32("republishRequestCount", 32, (republishRequestCount)) + _republishRequestCountErr := writeBuffer.WriteUint32("republishRequestCount", 32, uint32((republishRequestCount))) if _republishRequestCountErr != nil { return errors.Wrap(_republishRequestCountErr, "Error serializing 'republishRequestCount' field") } // Simple Field (republishMessageRequestCount) republishMessageRequestCount := uint32(m.GetRepublishMessageRequestCount()) - _republishMessageRequestCountErr := writeBuffer.WriteUint32("republishMessageRequestCount", 32, (republishMessageRequestCount)) + _republishMessageRequestCountErr := writeBuffer.WriteUint32("republishMessageRequestCount", 32, uint32((republishMessageRequestCount))) if _republishMessageRequestCountErr != nil { return errors.Wrap(_republishMessageRequestCountErr, "Error serializing 'republishMessageRequestCount' field") } // Simple Field (republishMessageCount) republishMessageCount := uint32(m.GetRepublishMessageCount()) - _republishMessageCountErr := writeBuffer.WriteUint32("republishMessageCount", 32, (republishMessageCount)) + _republishMessageCountErr := writeBuffer.WriteUint32("republishMessageCount", 32, uint32((republishMessageCount))) if _republishMessageCountErr != nil { return errors.Wrap(_republishMessageCountErr, "Error serializing 'republishMessageCount' field") } // Simple Field (transferRequestCount) transferRequestCount := uint32(m.GetTransferRequestCount()) - _transferRequestCountErr := writeBuffer.WriteUint32("transferRequestCount", 32, (transferRequestCount)) + _transferRequestCountErr := writeBuffer.WriteUint32("transferRequestCount", 32, uint32((transferRequestCount))) if _transferRequestCountErr != nil { return errors.Wrap(_transferRequestCountErr, "Error serializing 'transferRequestCount' field") } // Simple Field (transferredToAltClientCount) transferredToAltClientCount := uint32(m.GetTransferredToAltClientCount()) - _transferredToAltClientCountErr := writeBuffer.WriteUint32("transferredToAltClientCount", 32, (transferredToAltClientCount)) + _transferredToAltClientCountErr := writeBuffer.WriteUint32("transferredToAltClientCount", 32, uint32((transferredToAltClientCount))) if _transferredToAltClientCountErr != nil { return errors.Wrap(_transferredToAltClientCountErr, "Error serializing 'transferredToAltClientCount' field") } // Simple Field (transferredToSameClientCount) transferredToSameClientCount := uint32(m.GetTransferredToSameClientCount()) - _transferredToSameClientCountErr := writeBuffer.WriteUint32("transferredToSameClientCount", 32, (transferredToSameClientCount)) + _transferredToSameClientCountErr := writeBuffer.WriteUint32("transferredToSameClientCount", 32, uint32((transferredToSameClientCount))) if _transferredToSameClientCountErr != nil { return errors.Wrap(_transferredToSameClientCountErr, "Error serializing 'transferredToSameClientCount' field") } // Simple Field (publishRequestCount) publishRequestCount := uint32(m.GetPublishRequestCount()) - _publishRequestCountErr := writeBuffer.WriteUint32("publishRequestCount", 32, (publishRequestCount)) + _publishRequestCountErr := writeBuffer.WriteUint32("publishRequestCount", 32, uint32((publishRequestCount))) if _publishRequestCountErr != nil { return errors.Wrap(_publishRequestCountErr, "Error serializing 'publishRequestCount' field") } // Simple Field (dataChangeNotificationsCount) dataChangeNotificationsCount := uint32(m.GetDataChangeNotificationsCount()) - _dataChangeNotificationsCountErr := writeBuffer.WriteUint32("dataChangeNotificationsCount", 32, (dataChangeNotificationsCount)) + _dataChangeNotificationsCountErr := writeBuffer.WriteUint32("dataChangeNotificationsCount", 32, uint32((dataChangeNotificationsCount))) if _dataChangeNotificationsCountErr != nil { return errors.Wrap(_dataChangeNotificationsCountErr, "Error serializing 'dataChangeNotificationsCount' field") } // Simple Field (eventNotificationsCount) eventNotificationsCount := uint32(m.GetEventNotificationsCount()) - _eventNotificationsCountErr := writeBuffer.WriteUint32("eventNotificationsCount", 32, (eventNotificationsCount)) + _eventNotificationsCountErr := writeBuffer.WriteUint32("eventNotificationsCount", 32, uint32((eventNotificationsCount))) if _eventNotificationsCountErr != nil { return errors.Wrap(_eventNotificationsCountErr, "Error serializing 'eventNotificationsCount' field") } // Simple Field (notificationsCount) notificationsCount := uint32(m.GetNotificationsCount()) - _notificationsCountErr := writeBuffer.WriteUint32("notificationsCount", 32, (notificationsCount)) + _notificationsCountErr := writeBuffer.WriteUint32("notificationsCount", 32, uint32((notificationsCount))) if _notificationsCountErr != nil { return errors.Wrap(_notificationsCountErr, "Error serializing 'notificationsCount' field") } // Simple Field (latePublishRequestCount) latePublishRequestCount := uint32(m.GetLatePublishRequestCount()) - _latePublishRequestCountErr := writeBuffer.WriteUint32("latePublishRequestCount", 32, (latePublishRequestCount)) + _latePublishRequestCountErr := writeBuffer.WriteUint32("latePublishRequestCount", 32, uint32((latePublishRequestCount))) if _latePublishRequestCountErr != nil { return errors.Wrap(_latePublishRequestCountErr, "Error serializing 'latePublishRequestCount' field") } // Simple Field (currentKeepAliveCount) currentKeepAliveCount := uint32(m.GetCurrentKeepAliveCount()) - _currentKeepAliveCountErr := writeBuffer.WriteUint32("currentKeepAliveCount", 32, (currentKeepAliveCount)) + _currentKeepAliveCountErr := writeBuffer.WriteUint32("currentKeepAliveCount", 32, uint32((currentKeepAliveCount))) if _currentKeepAliveCountErr != nil { return errors.Wrap(_currentKeepAliveCountErr, "Error serializing 'currentKeepAliveCount' field") } // Simple Field (currentLifetimeCount) currentLifetimeCount := uint32(m.GetCurrentLifetimeCount()) - _currentLifetimeCountErr := writeBuffer.WriteUint32("currentLifetimeCount", 32, (currentLifetimeCount)) + _currentLifetimeCountErr := writeBuffer.WriteUint32("currentLifetimeCount", 32, uint32((currentLifetimeCount))) if _currentLifetimeCountErr != nil { return errors.Wrap(_currentLifetimeCountErr, "Error serializing 'currentLifetimeCount' field") } // Simple Field (unacknowledgedMessageCount) unacknowledgedMessageCount := uint32(m.GetUnacknowledgedMessageCount()) - _unacknowledgedMessageCountErr := writeBuffer.WriteUint32("unacknowledgedMessageCount", 32, (unacknowledgedMessageCount)) + _unacknowledgedMessageCountErr := writeBuffer.WriteUint32("unacknowledgedMessageCount", 32, uint32((unacknowledgedMessageCount))) if _unacknowledgedMessageCountErr != nil { return errors.Wrap(_unacknowledgedMessageCountErr, "Error serializing 'unacknowledgedMessageCount' field") } // Simple Field (discardedMessageCount) discardedMessageCount := uint32(m.GetDiscardedMessageCount()) - _discardedMessageCountErr := writeBuffer.WriteUint32("discardedMessageCount", 32, (discardedMessageCount)) + _discardedMessageCountErr := writeBuffer.WriteUint32("discardedMessageCount", 32, uint32((discardedMessageCount))) if _discardedMessageCountErr != nil { return errors.Wrap(_discardedMessageCountErr, "Error serializing 'discardedMessageCount' field") } // Simple Field (monitoredItemCount) monitoredItemCount := uint32(m.GetMonitoredItemCount()) - _monitoredItemCountErr := writeBuffer.WriteUint32("monitoredItemCount", 32, (monitoredItemCount)) + _monitoredItemCountErr := writeBuffer.WriteUint32("monitoredItemCount", 32, uint32((monitoredItemCount))) if _monitoredItemCountErr != nil { return errors.Wrap(_monitoredItemCountErr, "Error serializing 'monitoredItemCount' field") } // Simple Field (disabledMonitoredItemCount) disabledMonitoredItemCount := uint32(m.GetDisabledMonitoredItemCount()) - _disabledMonitoredItemCountErr := writeBuffer.WriteUint32("disabledMonitoredItemCount", 32, (disabledMonitoredItemCount)) + _disabledMonitoredItemCountErr := writeBuffer.WriteUint32("disabledMonitoredItemCount", 32, uint32((disabledMonitoredItemCount))) if _disabledMonitoredItemCountErr != nil { return errors.Wrap(_disabledMonitoredItemCountErr, "Error serializing 'disabledMonitoredItemCount' field") } // Simple Field (monitoringQueueOverflowCount) monitoringQueueOverflowCount := uint32(m.GetMonitoringQueueOverflowCount()) - _monitoringQueueOverflowCountErr := writeBuffer.WriteUint32("monitoringQueueOverflowCount", 32, (monitoringQueueOverflowCount)) + _monitoringQueueOverflowCountErr := writeBuffer.WriteUint32("monitoringQueueOverflowCount", 32, uint32((monitoringQueueOverflowCount))) if _monitoringQueueOverflowCountErr != nil { return errors.Wrap(_monitoringQueueOverflowCountErr, "Error serializing 'monitoringQueueOverflowCount' field") } // Simple Field (nextSequenceNumber) nextSequenceNumber := uint32(m.GetNextSequenceNumber()) - _nextSequenceNumberErr := writeBuffer.WriteUint32("nextSequenceNumber", 32, (nextSequenceNumber)) + _nextSequenceNumberErr := writeBuffer.WriteUint32("nextSequenceNumber", 32, uint32((nextSequenceNumber))) if _nextSequenceNumberErr != nil { return errors.Wrap(_nextSequenceNumberErr, "Error serializing 'nextSequenceNumber' field") } // Simple Field (eventQueueOverFlowCount) eventQueueOverFlowCount := uint32(m.GetEventQueueOverFlowCount()) - _eventQueueOverFlowCountErr := writeBuffer.WriteUint32("eventQueueOverFlowCount", 32, (eventQueueOverFlowCount)) + _eventQueueOverFlowCountErr := writeBuffer.WriteUint32("eventQueueOverFlowCount", 32, uint32((eventQueueOverFlowCount))) if _eventQueueOverFlowCountErr != nil { return errors.Wrap(_eventQueueOverFlowCountErr, "Error serializing 'eventQueueOverFlowCount' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TimeZoneDataType.go b/plc4go/protocols/opcua/readwrite/model/TimeZoneDataType.go index 84cc1c857d8..f1b2471143a 100644 --- a/plc4go/protocols/opcua/readwrite/model/TimeZoneDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/TimeZoneDataType.go @@ -221,7 +221,7 @@ func (m *_TimeZoneDataType) SerializeWithWriteBuffer(ctx context.Context, writeB // Simple Field (offset) offset := int16(m.GetOffset()) - _offsetErr := writeBuffer.WriteInt16("offset", 16, (offset)) + _offsetErr := writeBuffer.WriteInt16("offset", 16, int16((offset))) if _offsetErr != nil { return errors.Wrap(_offsetErr, "Error serializing 'offset' field") } @@ -236,7 +236,7 @@ func (m *_TimeZoneDataType) SerializeWithWriteBuffer(ctx context.Context, writeB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TimestampsToReturn.go b/plc4go/protocols/opcua/readwrite/model/TimestampsToReturn.go index 202b2b6f50c..0a513b38229 100644 --- a/plc4go/protocols/opcua/readwrite/model/TimestampsToReturn.go +++ b/plc4go/protocols/opcua/readwrite/model/TimestampsToReturn.go @@ -150,7 +150,7 @@ func (e TimestampsToReturn) Serialize() ([]byte, error) { func (e TimestampsToReturn) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("TimestampsToReturn", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("TimestampsToReturn", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/TransferResult.go b/plc4go/protocols/opcua/readwrite/model/TransferResult.go index 96f363d5d7f..64c918912ab 100644 --- a/plc4go/protocols/opcua/readwrite/model/TransferResult.go +++ b/plc4go/protocols/opcua/readwrite/model/TransferResult.go @@ -257,7 +257,7 @@ func (m *_TransferResult) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (noOfAvailableSequenceNumbers) noOfAvailableSequenceNumbers := int32(m.GetNoOfAvailableSequenceNumbers()) - _noOfAvailableSequenceNumbersErr := writeBuffer.WriteInt32("noOfAvailableSequenceNumbers", 32, (noOfAvailableSequenceNumbers)) + _noOfAvailableSequenceNumbersErr := writeBuffer.WriteInt32("noOfAvailableSequenceNumbers", 32, int32((noOfAvailableSequenceNumbers))) if _noOfAvailableSequenceNumbersErr != nil { return errors.Wrap(_noOfAvailableSequenceNumbersErr, "Error serializing 'noOfAvailableSequenceNumbers' field") } @@ -268,7 +268,7 @@ func (m *_TransferResult) SerializeWithWriteBuffer(ctx context.Context, writeBuf } for _curItem, _element := range m.GetAvailableSequenceNumbers() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'availableSequenceNumbers' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsRequest.go b/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsRequest.go index 56f8b2f4d3c..aa5c44f12e1 100644 --- a/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsRequest.go @@ -299,7 +299,7 @@ func (m *_TransferSubscriptionsRequest) SerializeWithWriteBuffer(ctx context.Con // Simple Field (noOfSubscriptionIds) noOfSubscriptionIds := int32(m.GetNoOfSubscriptionIds()) - _noOfSubscriptionIdsErr := writeBuffer.WriteInt32("noOfSubscriptionIds", 32, (noOfSubscriptionIds)) + _noOfSubscriptionIdsErr := writeBuffer.WriteInt32("noOfSubscriptionIds", 32, int32((noOfSubscriptionIds))) if _noOfSubscriptionIdsErr != nil { return errors.Wrap(_noOfSubscriptionIdsErr, "Error serializing 'noOfSubscriptionIds' field") } @@ -310,7 +310,7 @@ func (m *_TransferSubscriptionsRequest) SerializeWithWriteBuffer(ctx context.Con } for _curItem, _element := range m.GetSubscriptionIds() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'subscriptionIds' field") } @@ -329,7 +329,7 @@ func (m *_TransferSubscriptionsRequest) SerializeWithWriteBuffer(ctx context.Con }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 7, reserved) + _err := writeBuffer.WriteUint8("reserved", 7, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsResponse.go b/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsResponse.go index 20ddf1c2026..b3ef69a2e3f 100644 --- a/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/TransferSubscriptionsResponse.go @@ -327,7 +327,7 @@ func (m *_TransferSubscriptionsResponse) SerializeWithWriteBuffer(ctx context.Co // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_TransferSubscriptionsResponse) SerializeWithWriteBuffer(ctx context.Co // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsRequest.go b/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsRequest.go index 01704255744..023ab54fa1f 100644 --- a/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsRequest.go @@ -262,7 +262,7 @@ func (m *_TranslateBrowsePathsToNodeIdsRequest) SerializeWithWriteBuffer(ctx con // Simple Field (noOfBrowsePaths) noOfBrowsePaths := int32(m.GetNoOfBrowsePaths()) - _noOfBrowsePathsErr := writeBuffer.WriteInt32("noOfBrowsePaths", 32, (noOfBrowsePaths)) + _noOfBrowsePathsErr := writeBuffer.WriteInt32("noOfBrowsePaths", 32, int32((noOfBrowsePaths))) if _noOfBrowsePathsErr != nil { return errors.Wrap(_noOfBrowsePathsErr, "Error serializing 'noOfBrowsePaths' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsResponse.go b/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsResponse.go index 43130e8140d..075933b3192 100644 --- a/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/TranslateBrowsePathsToNodeIdsResponse.go @@ -327,7 +327,7 @@ func (m *_TranslateBrowsePathsToNodeIdsResponse) SerializeWithWriteBuffer(ctx co // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_TranslateBrowsePathsToNodeIdsResponse) SerializeWithWriteBuffer(ctx co // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TrustListDataType.go b/plc4go/protocols/opcua/readwrite/model/TrustListDataType.go index f85a2d81fd8..d4169737c16 100644 --- a/plc4go/protocols/opcua/readwrite/model/TrustListDataType.go +++ b/plc4go/protocols/opcua/readwrite/model/TrustListDataType.go @@ -439,14 +439,14 @@ func (m *_TrustListDataType) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (specifiedLists) specifiedLists := uint32(m.GetSpecifiedLists()) - _specifiedListsErr := writeBuffer.WriteUint32("specifiedLists", 32, (specifiedLists)) + _specifiedListsErr := writeBuffer.WriteUint32("specifiedLists", 32, uint32((specifiedLists))) if _specifiedListsErr != nil { return errors.Wrap(_specifiedListsErr, "Error serializing 'specifiedLists' field") } // Simple Field (noOfTrustedCertificates) noOfTrustedCertificates := int32(m.GetNoOfTrustedCertificates()) - _noOfTrustedCertificatesErr := writeBuffer.WriteInt32("noOfTrustedCertificates", 32, (noOfTrustedCertificates)) + _noOfTrustedCertificatesErr := writeBuffer.WriteInt32("noOfTrustedCertificates", 32, int32((noOfTrustedCertificates))) if _noOfTrustedCertificatesErr != nil { return errors.Wrap(_noOfTrustedCertificatesErr, "Error serializing 'noOfTrustedCertificates' field") } @@ -470,7 +470,7 @@ func (m *_TrustListDataType) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfTrustedCrls) noOfTrustedCrls := int32(m.GetNoOfTrustedCrls()) - _noOfTrustedCrlsErr := writeBuffer.WriteInt32("noOfTrustedCrls", 32, (noOfTrustedCrls)) + _noOfTrustedCrlsErr := writeBuffer.WriteInt32("noOfTrustedCrls", 32, int32((noOfTrustedCrls))) if _noOfTrustedCrlsErr != nil { return errors.Wrap(_noOfTrustedCrlsErr, "Error serializing 'noOfTrustedCrls' field") } @@ -494,7 +494,7 @@ func (m *_TrustListDataType) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfIssuerCertificates) noOfIssuerCertificates := int32(m.GetNoOfIssuerCertificates()) - _noOfIssuerCertificatesErr := writeBuffer.WriteInt32("noOfIssuerCertificates", 32, (noOfIssuerCertificates)) + _noOfIssuerCertificatesErr := writeBuffer.WriteInt32("noOfIssuerCertificates", 32, int32((noOfIssuerCertificates))) if _noOfIssuerCertificatesErr != nil { return errors.Wrap(_noOfIssuerCertificatesErr, "Error serializing 'noOfIssuerCertificates' field") } @@ -518,7 +518,7 @@ func (m *_TrustListDataType) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (noOfIssuerCrls) noOfIssuerCrls := int32(m.GetNoOfIssuerCrls()) - _noOfIssuerCrlsErr := writeBuffer.WriteInt32("noOfIssuerCrls", 32, (noOfIssuerCrls)) + _noOfIssuerCrlsErr := writeBuffer.WriteInt32("noOfIssuerCrls", 32, int32((noOfIssuerCrls))) if _noOfIssuerCrlsErr != nil { return errors.Wrap(_noOfIssuerCrlsErr, "Error serializing 'noOfIssuerCrls' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/TrustListMasks.go b/plc4go/protocols/opcua/readwrite/model/TrustListMasks.go index f4f86173f99..1a175cd9a66 100644 --- a/plc4go/protocols/opcua/readwrite/model/TrustListMasks.go +++ b/plc4go/protocols/opcua/readwrite/model/TrustListMasks.go @@ -156,7 +156,7 @@ func (e TrustListMasks) Serialize() ([]byte, error) { func (e TrustListMasks) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("TrustListMasks", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("TrustListMasks", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/TrustListValidationOptions.go b/plc4go/protocols/opcua/readwrite/model/TrustListValidationOptions.go index 5cfda8865fb..5716e88f6e8 100644 --- a/plc4go/protocols/opcua/readwrite/model/TrustListValidationOptions.go +++ b/plc4go/protocols/opcua/readwrite/model/TrustListValidationOptions.go @@ -168,7 +168,7 @@ func (e TrustListValidationOptions) Serialize() ([]byte, error) { func (e TrustListValidationOptions) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("TrustListValidationOptions", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("TrustListValidationOptions", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/TsnFailureCode.go b/plc4go/protocols/opcua/readwrite/model/TsnFailureCode.go index 656dd740896..a3f877c2826 100644 --- a/plc4go/protocols/opcua/readwrite/model/TsnFailureCode.go +++ b/plc4go/protocols/opcua/readwrite/model/TsnFailureCode.go @@ -276,7 +276,7 @@ func (e TsnFailureCode) Serialize() ([]byte, error) { func (e TsnFailureCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("TsnFailureCode", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("TsnFailureCode", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/TsnListenerStatus.go b/plc4go/protocols/opcua/readwrite/model/TsnListenerStatus.go index 0b401ff044b..ab53d13f7a3 100644 --- a/plc4go/protocols/opcua/readwrite/model/TsnListenerStatus.go +++ b/plc4go/protocols/opcua/readwrite/model/TsnListenerStatus.go @@ -144,7 +144,7 @@ func (e TsnListenerStatus) Serialize() ([]byte, error) { func (e TsnListenerStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("TsnListenerStatus", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("TsnListenerStatus", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/TsnStreamState.go b/plc4go/protocols/opcua/readwrite/model/TsnStreamState.go index 068c278c970..93a8d9a60dd 100644 --- a/plc4go/protocols/opcua/readwrite/model/TsnStreamState.go +++ b/plc4go/protocols/opcua/readwrite/model/TsnStreamState.go @@ -150,7 +150,7 @@ func (e TsnStreamState) Serialize() ([]byte, error) { func (e TsnStreamState) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("TsnStreamState", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("TsnStreamState", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/TsnTalkerStatus.go b/plc4go/protocols/opcua/readwrite/model/TsnTalkerStatus.go index 3ed26e851f2..ee00474bccc 100644 --- a/plc4go/protocols/opcua/readwrite/model/TsnTalkerStatus.go +++ b/plc4go/protocols/opcua/readwrite/model/TsnTalkerStatus.go @@ -138,7 +138,7 @@ func (e TsnTalkerStatus) Serialize() ([]byte, error) { func (e TsnTalkerStatus) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("TsnTalkerStatus", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("TsnTalkerStatus", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/TwoByteNodeId.go b/plc4go/protocols/opcua/readwrite/model/TwoByteNodeId.go index f833ad6e104..3033bff879f 100644 --- a/plc4go/protocols/opcua/readwrite/model/TwoByteNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/TwoByteNodeId.go @@ -148,7 +148,7 @@ func (m *_TwoByteNodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (identifier) identifier := uint8(m.GetIdentifier()) - _identifierErr := writeBuffer.WriteUint8("identifier", 8, (identifier)) + _identifierErr := writeBuffer.WriteUint8("identifier", 8, uint8((identifier))) if _identifierErr != nil { return errors.Wrap(_identifierErr, "Error serializing 'identifier' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/UadpDataSetMessageContentMask.go b/plc4go/protocols/opcua/readwrite/model/UadpDataSetMessageContentMask.go index 9e7a86d84d2..7ad60dcd31b 100644 --- a/plc4go/protocols/opcua/readwrite/model/UadpDataSetMessageContentMask.go +++ b/plc4go/protocols/opcua/readwrite/model/UadpDataSetMessageContentMask.go @@ -162,7 +162,7 @@ func (e UadpDataSetMessageContentMask) Serialize() ([]byte, error) { func (e UadpDataSetMessageContentMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("UadpDataSetMessageContentMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("UadpDataSetMessageContentMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/UadpNetworkMessageContentMask.go b/plc4go/protocols/opcua/readwrite/model/UadpNetworkMessageContentMask.go index 6001c7a37f3..7342c2b6779 100644 --- a/plc4go/protocols/opcua/readwrite/model/UadpNetworkMessageContentMask.go +++ b/plc4go/protocols/opcua/readwrite/model/UadpNetworkMessageContentMask.go @@ -192,7 +192,7 @@ func (e UadpNetworkMessageContentMask) Serialize() ([]byte, error) { func (e UadpNetworkMessageContentMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("UadpNetworkMessageContentMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("UadpNetworkMessageContentMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/UnregisterNodesRequest.go b/plc4go/protocols/opcua/readwrite/model/UnregisterNodesRequest.go index 16525bb0250..d9ec925b6b5 100644 --- a/plc4go/protocols/opcua/readwrite/model/UnregisterNodesRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/UnregisterNodesRequest.go @@ -262,7 +262,7 @@ func (m *_UnregisterNodesRequest) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (noOfNodesToUnregister) noOfNodesToUnregister := int32(m.GetNoOfNodesToUnregister()) - _noOfNodesToUnregisterErr := writeBuffer.WriteInt32("noOfNodesToUnregister", 32, (noOfNodesToUnregister)) + _noOfNodesToUnregisterErr := writeBuffer.WriteInt32("noOfNodesToUnregister", 32, int32((noOfNodesToUnregister))) if _noOfNodesToUnregisterErr != nil { return errors.Wrap(_noOfNodesToUnregisterErr, "Error serializing 'noOfNodesToUnregister' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/UnsignedRationalNumber.go b/plc4go/protocols/opcua/readwrite/model/UnsignedRationalNumber.go index e560116f4d5..83607b9f302 100644 --- a/plc4go/protocols/opcua/readwrite/model/UnsignedRationalNumber.go +++ b/plc4go/protocols/opcua/readwrite/model/UnsignedRationalNumber.go @@ -198,14 +198,14 @@ func (m *_UnsignedRationalNumber) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (numerator) numerator := uint32(m.GetNumerator()) - _numeratorErr := writeBuffer.WriteUint32("numerator", 32, (numerator)) + _numeratorErr := writeBuffer.WriteUint32("numerator", 32, uint32((numerator))) if _numeratorErr != nil { return errors.Wrap(_numeratorErr, "Error serializing 'numerator' field") } // Simple Field (denominator) denominator := uint32(m.GetDenominator()) - _denominatorErr := writeBuffer.WriteUint32("denominator", 32, (denominator)) + _denominatorErr := writeBuffer.WriteUint32("denominator", 32, uint32((denominator))) if _denominatorErr != nil { return errors.Wrap(_denominatorErr, "Error serializing 'denominator' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/UserConfigurationMask.go b/plc4go/protocols/opcua/readwrite/model/UserConfigurationMask.go index 99e27ef7752..615df6c685e 100644 --- a/plc4go/protocols/opcua/readwrite/model/UserConfigurationMask.go +++ b/plc4go/protocols/opcua/readwrite/model/UserConfigurationMask.go @@ -150,7 +150,7 @@ func (e UserConfigurationMask) Serialize() ([]byte, error) { func (e UserConfigurationMask) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("UserConfigurationMask", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("UserConfigurationMask", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/UserIdentityToken.go b/plc4go/protocols/opcua/readwrite/model/UserIdentityToken.go index edbe1cc93dc..4bed96266d6 100644 --- a/plc4go/protocols/opcua/readwrite/model/UserIdentityToken.go +++ b/plc4go/protocols/opcua/readwrite/model/UserIdentityToken.go @@ -220,7 +220,7 @@ func (m *_UserIdentityToken) SerializeWithWriteBuffer(ctx context.Context, write // Implicit Field (policyLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) policyLength := int32(int32(m.GetPolicyId().GetLengthInBytes(ctx)) + int32(m.GetUserIdentityTokenDefinition().GetLengthInBytes(ctx))) - _policyLengthErr := writeBuffer.WriteInt32("policyLength", 32, (policyLength)) + _policyLengthErr := writeBuffer.WriteInt32("policyLength", 32, int32((policyLength))) if _policyLengthErr != nil { return errors.Wrap(_policyLengthErr, "Error serializing 'policyLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/UserTokenType.go b/plc4go/protocols/opcua/readwrite/model/UserTokenType.go index 5d00e5528ae..791d0aaf00d 100644 --- a/plc4go/protocols/opcua/readwrite/model/UserTokenType.go +++ b/plc4go/protocols/opcua/readwrite/model/UserTokenType.go @@ -144,7 +144,7 @@ func (e UserTokenType) Serialize() ([]byte, error) { func (e UserTokenType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint32("UserTokenType", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint32("UserTokenType", 32, uint32(uint32(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/opcua/readwrite/model/Variant.go b/plc4go/protocols/opcua/readwrite/model/Variant.go index 624cb47f950..640c4387d85 100644 --- a/plc4go/protocols/opcua/readwrite/model/Variant.go +++ b/plc4go/protocols/opcua/readwrite/model/Variant.go @@ -336,7 +336,7 @@ func (pm *_Variant) SerializeParent(ctx context.Context, writeBuffer utils.Write // Discriminator Field (VariantType) (Used as input to a switch field) VariantType := uint8(child.GetVariantType()) - _VariantTypeErr := writeBuffer.WriteUint8("VariantType", 6, (VariantType)) + _VariantTypeErr := writeBuffer.WriteUint8("VariantType", 6, uint8((VariantType))) if _VariantTypeErr != nil { return errors.Wrap(_VariantTypeErr, "Error serializing 'VariantType' field") @@ -351,7 +351,7 @@ func (pm *_Variant) SerializeParent(ctx context.Context, writeBuffer utils.Write var noOfArrayDimensions *int32 = nil if m.GetNoOfArrayDimensions() != nil { noOfArrayDimensions = m.GetNoOfArrayDimensions() - _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, *(noOfArrayDimensions)) + _noOfArrayDimensionsErr := writeBuffer.WriteInt32("noOfArrayDimensions", 32, int32(*(noOfArrayDimensions))) if _noOfArrayDimensionsErr != nil { return errors.Wrap(_noOfArrayDimensionsErr, "Error serializing 'noOfArrayDimensions' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantBoolean.go b/plc4go/protocols/opcua/readwrite/model/VariantBoolean.go index 351de4ed08d..d2bec2cdb34 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantBoolean.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantBoolean.go @@ -211,7 +211,7 @@ func (m *_VariantBoolean) SerializeWithWriteBuffer(ctx context.Context, writeBuf var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantByte.go b/plc4go/protocols/opcua/readwrite/model/VariantByte.go index 25cce084ec2..05b3b192b11 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantByte.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantByte.go @@ -232,7 +232,7 @@ func (m *_VariantByte) SerializeWithWriteBuffer(ctx context.Context, writeBuffer var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantByte) SerializeWithWriteBuffer(ctx context.Context, writeBuffer } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantByteString.go b/plc4go/protocols/opcua/readwrite/model/VariantByteString.go index 149af953410..749304b945c 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantByteString.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantByteString.go @@ -237,7 +237,7 @@ func (m *_VariantByteString) SerializeWithWriteBuffer(ctx context.Context, write var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantDataValue.go b/plc4go/protocols/opcua/readwrite/model/VariantDataValue.go index 163944921fd..6c3a79273ab 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantDataValue.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantDataValue.go @@ -237,7 +237,7 @@ func (m *_VariantDataValue) SerializeWithWriteBuffer(ctx context.Context, writeB var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantDateTime.go b/plc4go/protocols/opcua/readwrite/model/VariantDateTime.go index 9e458982ed3..092b22bd44e 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantDateTime.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantDateTime.go @@ -232,7 +232,7 @@ func (m *_VariantDateTime) SerializeWithWriteBuffer(ctx context.Context, writeBu var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantDateTime) SerializeWithWriteBuffer(ctx context.Context, writeBu } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteInt64("", 64, _element) + _elementErr := writeBuffer.WriteInt64("", 64, int64(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantDiagnosticInfo.go b/plc4go/protocols/opcua/readwrite/model/VariantDiagnosticInfo.go index d7346b22916..b9098ea29ba 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantDiagnosticInfo.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantDiagnosticInfo.go @@ -237,7 +237,7 @@ func (m *_VariantDiagnosticInfo) SerializeWithWriteBuffer(ctx context.Context, w var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantDouble.go b/plc4go/protocols/opcua/readwrite/model/VariantDouble.go index 0d708d7c3e3..3c574f77344 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantDouble.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantDouble.go @@ -232,7 +232,7 @@ func (m *_VariantDouble) SerializeWithWriteBuffer(ctx context.Context, writeBuff var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantExpandedNodeId.go b/plc4go/protocols/opcua/readwrite/model/VariantExpandedNodeId.go index 3e8c0bd81ee..3d01dc5d539 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantExpandedNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantExpandedNodeId.go @@ -237,7 +237,7 @@ func (m *_VariantExpandedNodeId) SerializeWithWriteBuffer(ctx context.Context, w var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantExtensionObject.go b/plc4go/protocols/opcua/readwrite/model/VariantExtensionObject.go index b795fa3c93c..0fa2a198eee 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantExtensionObject.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantExtensionObject.go @@ -237,7 +237,7 @@ func (m *_VariantExtensionObject) SerializeWithWriteBuffer(ctx context.Context, var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantFloat.go b/plc4go/protocols/opcua/readwrite/model/VariantFloat.go index cf1f6bc70f3..7ba30f1ceb1 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantFloat.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantFloat.go @@ -232,7 +232,7 @@ func (m *_VariantFloat) SerializeWithWriteBuffer(ctx context.Context, writeBuffe var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantGuid.go b/plc4go/protocols/opcua/readwrite/model/VariantGuid.go index 4be4098f690..ef81a987e93 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantGuid.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantGuid.go @@ -237,7 +237,7 @@ func (m *_VariantGuid) SerializeWithWriteBuffer(ctx context.Context, writeBuffer var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantInt16.go b/plc4go/protocols/opcua/readwrite/model/VariantInt16.go index 3404d95bfeb..42fd8587164 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantInt16.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantInt16.go @@ -232,7 +232,7 @@ func (m *_VariantInt16) SerializeWithWriteBuffer(ctx context.Context, writeBuffe var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantInt16) SerializeWithWriteBuffer(ctx context.Context, writeBuffe } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteInt16("", 16, _element) + _elementErr := writeBuffer.WriteInt16("", 16, int16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantInt32.go b/plc4go/protocols/opcua/readwrite/model/VariantInt32.go index 8120a0838b6..1b68584ed9e 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantInt32.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantInt32.go @@ -232,7 +232,7 @@ func (m *_VariantInt32) SerializeWithWriteBuffer(ctx context.Context, writeBuffe var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantInt32) SerializeWithWriteBuffer(ctx context.Context, writeBuffe } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteInt32("", 32, _element) + _elementErr := writeBuffer.WriteInt32("", 32, int32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantInt64.go b/plc4go/protocols/opcua/readwrite/model/VariantInt64.go index 42f8cf15518..39959c0662e 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantInt64.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantInt64.go @@ -232,7 +232,7 @@ func (m *_VariantInt64) SerializeWithWriteBuffer(ctx context.Context, writeBuffe var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantInt64) SerializeWithWriteBuffer(ctx context.Context, writeBuffe } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteInt64("", 64, _element) + _elementErr := writeBuffer.WriteInt64("", 64, int64(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantLocalizedText.go b/plc4go/protocols/opcua/readwrite/model/VariantLocalizedText.go index 4eee1f5b6f5..5b28cc4f7db 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantLocalizedText.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantLocalizedText.go @@ -237,7 +237,7 @@ func (m *_VariantLocalizedText) SerializeWithWriteBuffer(ctx context.Context, wr var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantNodeId.go b/plc4go/protocols/opcua/readwrite/model/VariantNodeId.go index 9ad55fa70b7..6435ffbe993 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantNodeId.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantNodeId.go @@ -237,7 +237,7 @@ func (m *_VariantNodeId) SerializeWithWriteBuffer(ctx context.Context, writeBuff var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantQualifiedName.go b/plc4go/protocols/opcua/readwrite/model/VariantQualifiedName.go index 0faf1575dca..84ba1195674 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantQualifiedName.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantQualifiedName.go @@ -237,7 +237,7 @@ func (m *_VariantQualifiedName) SerializeWithWriteBuffer(ctx context.Context, wr var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantSByte.go b/plc4go/protocols/opcua/readwrite/model/VariantSByte.go index 9a25ee79e94..ac225f827f9 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantSByte.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantSByte.go @@ -211,7 +211,7 @@ func (m *_VariantSByte) SerializeWithWriteBuffer(ctx context.Context, writeBuffe var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantStatusCode.go b/plc4go/protocols/opcua/readwrite/model/VariantStatusCode.go index 28e88ef77fc..71667c34e00 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantStatusCode.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantStatusCode.go @@ -237,7 +237,7 @@ func (m *_VariantStatusCode) SerializeWithWriteBuffer(ctx context.Context, write var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantString.go b/plc4go/protocols/opcua/readwrite/model/VariantString.go index 3a8e7efbebc..3d6c8b5b577 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantString.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantString.go @@ -237,7 +237,7 @@ func (m *_VariantString) SerializeWithWriteBuffer(ctx context.Context, writeBuff var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantUInt16.go b/plc4go/protocols/opcua/readwrite/model/VariantUInt16.go index c4f6442a082..c1e9b998050 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantUInt16.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantUInt16.go @@ -232,7 +232,7 @@ func (m *_VariantUInt16) SerializeWithWriteBuffer(ctx context.Context, writeBuff var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantUInt16) SerializeWithWriteBuffer(ctx context.Context, writeBuff } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteUint16("", 16, _element) + _elementErr := writeBuffer.WriteUint16("", 16, uint16(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantUInt32.go b/plc4go/protocols/opcua/readwrite/model/VariantUInt32.go index 343fd75af9a..4bbd155012d 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantUInt32.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantUInt32.go @@ -232,7 +232,7 @@ func (m *_VariantUInt32) SerializeWithWriteBuffer(ctx context.Context, writeBuff var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantUInt32) SerializeWithWriteBuffer(ctx context.Context, writeBuff } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteUint32("", 32, _element) + _elementErr := writeBuffer.WriteUint32("", 32, uint32(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantUInt64.go b/plc4go/protocols/opcua/readwrite/model/VariantUInt64.go index c06f5c86ee0..e6232c031cf 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantUInt64.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantUInt64.go @@ -232,7 +232,7 @@ func (m *_VariantUInt64) SerializeWithWriteBuffer(ctx context.Context, writeBuff var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } @@ -244,7 +244,7 @@ func (m *_VariantUInt64) SerializeWithWriteBuffer(ctx context.Context, writeBuff } for _curItem, _element := range m.GetValue() { _ = _curItem - _elementErr := writeBuffer.WriteUint64("", 64, _element) + _elementErr := writeBuffer.WriteUint64("", 64, uint64(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantVariant.go b/plc4go/protocols/opcua/readwrite/model/VariantVariant.go index cc92e938c74..408d42e35de 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantVariant.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantVariant.go @@ -237,7 +237,7 @@ func (m *_VariantVariant) SerializeWithWriteBuffer(ctx context.Context, writeBuf var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/VariantXmlElement.go b/plc4go/protocols/opcua/readwrite/model/VariantXmlElement.go index 807bbe73ca7..b93bba84c98 100644 --- a/plc4go/protocols/opcua/readwrite/model/VariantXmlElement.go +++ b/plc4go/protocols/opcua/readwrite/model/VariantXmlElement.go @@ -237,7 +237,7 @@ func (m *_VariantXmlElement) SerializeWithWriteBuffer(ctx context.Context, write var arrayLength *int32 = nil if m.GetArrayLength() != nil { arrayLength = m.GetArrayLength() - _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, *(arrayLength)) + _arrayLengthErr := writeBuffer.WriteInt32("arrayLength", 32, int32(*(arrayLength))) if _arrayLengthErr != nil { return errors.Wrap(_arrayLengthErr, "Error serializing 'arrayLength' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/ViewDescription.go b/plc4go/protocols/opcua/readwrite/model/ViewDescription.go index 60655985721..240233febb2 100644 --- a/plc4go/protocols/opcua/readwrite/model/ViewDescription.go +++ b/plc4go/protocols/opcua/readwrite/model/ViewDescription.go @@ -235,14 +235,14 @@ func (m *_ViewDescription) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (timestamp) timestamp := int64(m.GetTimestamp()) - _timestampErr := writeBuffer.WriteInt64("timestamp", 64, (timestamp)) + _timestampErr := writeBuffer.WriteInt64("timestamp", 64, int64((timestamp))) if _timestampErr != nil { return errors.Wrap(_timestampErr, "Error serializing 'timestamp' field") } // Simple Field (viewVersion) viewVersion := uint32(m.GetViewVersion()) - _viewVersionErr := writeBuffer.WriteUint32("viewVersion", 32, (viewVersion)) + _viewVersionErr := writeBuffer.WriteUint32("viewVersion", 32, uint32((viewVersion))) if _viewVersionErr != nil { return errors.Wrap(_viewVersionErr, "Error serializing 'viewVersion' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/WriteRequest.go b/plc4go/protocols/opcua/readwrite/model/WriteRequest.go index 7b734226cb6..05fcd8b64ef 100644 --- a/plc4go/protocols/opcua/readwrite/model/WriteRequest.go +++ b/plc4go/protocols/opcua/readwrite/model/WriteRequest.go @@ -262,7 +262,7 @@ func (m *_WriteRequest) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (noOfNodesToWrite) noOfNodesToWrite := int32(m.GetNoOfNodesToWrite()) - _noOfNodesToWriteErr := writeBuffer.WriteInt32("noOfNodesToWrite", 32, (noOfNodesToWrite)) + _noOfNodesToWriteErr := writeBuffer.WriteInt32("noOfNodesToWrite", 32, int32((noOfNodesToWrite))) if _noOfNodesToWriteErr != nil { return errors.Wrap(_noOfNodesToWriteErr, "Error serializing 'noOfNodesToWrite' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/WriteResponse.go b/plc4go/protocols/opcua/readwrite/model/WriteResponse.go index f8dbed5687f..783eef71c07 100644 --- a/plc4go/protocols/opcua/readwrite/model/WriteResponse.go +++ b/plc4go/protocols/opcua/readwrite/model/WriteResponse.go @@ -327,7 +327,7 @@ func (m *_WriteResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (noOfResults) noOfResults := int32(m.GetNoOfResults()) - _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, (noOfResults)) + _noOfResultsErr := writeBuffer.WriteInt32("noOfResults", 32, int32((noOfResults))) if _noOfResultsErr != nil { return errors.Wrap(_noOfResultsErr, "Error serializing 'noOfResults' field") } @@ -351,7 +351,7 @@ func (m *_WriteResponse) SerializeWithWriteBuffer(ctx context.Context, writeBuff // Simple Field (noOfDiagnosticInfos) noOfDiagnosticInfos := int32(m.GetNoOfDiagnosticInfos()) - _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, (noOfDiagnosticInfos)) + _noOfDiagnosticInfosErr := writeBuffer.WriteInt32("noOfDiagnosticInfos", 32, int32((noOfDiagnosticInfos))) if _noOfDiagnosticInfosErr != nil { return errors.Wrap(_noOfDiagnosticInfosErr, "Error serializing 'noOfDiagnosticInfos' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/WriteValue.go b/plc4go/protocols/opcua/readwrite/model/WriteValue.go index 811b9b5f8b7..378b80be017 100644 --- a/plc4go/protocols/opcua/readwrite/model/WriteValue.go +++ b/plc4go/protocols/opcua/readwrite/model/WriteValue.go @@ -266,7 +266,7 @@ func (m *_WriteValue) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (attributeId) attributeId := uint32(m.GetAttributeId()) - _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, (attributeId)) + _attributeIdErr := writeBuffer.WriteUint32("attributeId", 32, uint32((attributeId))) if _attributeIdErr != nil { return errors.Wrap(_attributeIdErr, "Error serializing 'attributeId' field") } diff --git a/plc4go/protocols/opcua/readwrite/model/XmlElement.go b/plc4go/protocols/opcua/readwrite/model/XmlElement.go index 86228106242..6e0e1775a62 100644 --- a/plc4go/protocols/opcua/readwrite/model/XmlElement.go +++ b/plc4go/protocols/opcua/readwrite/model/XmlElement.go @@ -188,7 +188,7 @@ func (m *_XmlElement) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (length) length := int32(m.GetLength()) - _lengthErr := writeBuffer.WriteInt32("length", 32, (length)) + _lengthErr := writeBuffer.WriteInt32("length", 32, int32((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } diff --git a/plc4go/protocols/s7/readwrite/model/Alarm8MessageQueryType.go b/plc4go/protocols/s7/readwrite/model/Alarm8MessageQueryType.go index db70c1ecaa2..6e1682b6ff1 100644 --- a/plc4go/protocols/s7/readwrite/model/Alarm8MessageQueryType.go +++ b/plc4go/protocols/s7/readwrite/model/Alarm8MessageQueryType.go @@ -277,14 +277,14 @@ func (m *_Alarm8MessageQueryType) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (functionId) functionId := uint8(m.GetFunctionId()) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, (functionId)) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8((functionId))) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Simple Field (numberOfObjects) numberOfObjects := uint8(m.GetNumberOfObjects()) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } @@ -315,7 +315,7 @@ func (m *_Alarm8MessageQueryType) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (byteCount) byteCount := uint16(m.GetByteCount()) - _byteCountErr := writeBuffer.WriteUint16("byteCount", 16, (byteCount)) + _byteCountErr := writeBuffer.WriteUint16("byteCount", 16, uint16((byteCount))) if _byteCountErr != nil { return errors.Wrap(_byteCountErr, "Error serializing 'byteCount' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckObjectPushType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckObjectPushType.go index ce59e0515b2..dc3a2ef73f0 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckObjectPushType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckObjectPushType.go @@ -283,14 +283,14 @@ func (m *_AlarmMessageAckObjectPushType) SerializeWithWriteBuffer(ctx context.Co } // Const Field (variableSpec) - _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, 0x12) + _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, uint8(0x12)) if _variableSpecErr != nil { return errors.Wrap(_variableSpecErr, "Error serializing 'variableSpec' field") } // Simple Field (lengthSpec) lengthSpec := uint8(m.GetLengthSpec()) - _lengthSpecErr := writeBuffer.WriteUint8("lengthSpec", 8, (lengthSpec)) + _lengthSpecErr := writeBuffer.WriteUint8("lengthSpec", 8, uint8((lengthSpec))) if _lengthSpecErr != nil { return errors.Wrap(_lengthSpecErr, "Error serializing 'lengthSpec' field") } @@ -309,14 +309,14 @@ func (m *_AlarmMessageAckObjectPushType) SerializeWithWriteBuffer(ctx context.Co // Simple Field (numberOfValues) numberOfValues := uint8(m.GetNumberOfValues()) - _numberOfValuesErr := writeBuffer.WriteUint8("numberOfValues", 8, (numberOfValues)) + _numberOfValuesErr := writeBuffer.WriteUint8("numberOfValues", 8, uint8((numberOfValues))) if _numberOfValuesErr != nil { return errors.Wrap(_numberOfValuesErr, "Error serializing 'numberOfValues' field") } // Simple Field (eventId) eventId := uint32(m.GetEventId()) - _eventIdErr := writeBuffer.WriteUint32("eventId", 32, (eventId)) + _eventIdErr := writeBuffer.WriteUint32("eventId", 32, uint32((eventId))) if _eventIdErr != nil { return errors.Wrap(_eventIdErr, "Error serializing 'eventId' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckPushType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckPushType.go index a224e10b6e7..d4e58c96f6a 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckPushType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckPushType.go @@ -247,14 +247,14 @@ func (m *_AlarmMessageAckPushType) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (functionId) functionId := uint8(m.GetFunctionId()) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, (functionId)) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8((functionId))) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Simple Field (numberOfObjects) numberOfObjects := uint8(m.GetNumberOfObjects()) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckResponseType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckResponseType.go index b3d240fcb19..18ca5658a9e 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckResponseType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckResponseType.go @@ -206,14 +206,14 @@ func (m *_AlarmMessageAckResponseType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (functionId) functionId := uint8(m.GetFunctionId()) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, (functionId)) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8((functionId))) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Simple Field (numberOfObjects) numberOfObjects := uint8(m.GetNumberOfObjects()) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } @@ -224,7 +224,7 @@ func (m *_AlarmMessageAckResponseType) SerializeWithWriteBuffer(ctx context.Cont } for _curItem, _element := range m.GetMessageObjects() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'messageObjects' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckType.go index 03b28e08814..4c8518f7462 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageAckType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageAckType.go @@ -211,14 +211,14 @@ func (m *_AlarmMessageAckType) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (functionId) functionId := uint8(m.GetFunctionId()) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, (functionId)) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8((functionId))) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Simple Field (numberOfObjects) numberOfObjects := uint8(m.GetNumberOfObjects()) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectAckType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectAckType.go index 6547054c33f..b2ebdc35211 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectAckType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectAckType.go @@ -282,13 +282,13 @@ func (m *_AlarmMessageObjectAckType) SerializeWithWriteBuffer(ctx context.Contex } // Const Field (variableSpec) - _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, 0x12) + _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, uint8(0x12)) if _variableSpecErr != nil { return errors.Wrap(_variableSpecErr, "Error serializing 'variableSpec' field") } // Const Field (length) - _lengthErr := writeBuffer.WriteUint8("length", 8, 0x08) + _lengthErr := writeBuffer.WriteUint8("length", 8, uint8(0x08)) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } @@ -307,14 +307,14 @@ func (m *_AlarmMessageObjectAckType) SerializeWithWriteBuffer(ctx context.Contex // Simple Field (numberOfValues) numberOfValues := uint8(m.GetNumberOfValues()) - _numberOfValuesErr := writeBuffer.WriteUint8("numberOfValues", 8, (numberOfValues)) + _numberOfValuesErr := writeBuffer.WriteUint8("numberOfValues", 8, uint8((numberOfValues))) if _numberOfValuesErr != nil { return errors.Wrap(_numberOfValuesErr, "Error serializing 'numberOfValues' field") } // Simple Field (eventId) eventId := uint32(m.GetEventId()) - _eventIdErr := writeBuffer.WriteUint32("eventId", 32, (eventId)) + _eventIdErr := writeBuffer.WriteUint32("eventId", 32, uint32((eventId))) if _eventIdErr != nil { return errors.Wrap(_eventIdErr, "Error serializing 'eventId' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectPushType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectPushType.go index e2adebdf07c..968d3c19121 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectPushType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectPushType.go @@ -376,14 +376,14 @@ func (m *_AlarmMessageObjectPushType) SerializeWithWriteBuffer(ctx context.Conte } // Const Field (variableSpec) - _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, 0x12) + _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, uint8(0x12)) if _variableSpecErr != nil { return errors.Wrap(_variableSpecErr, "Error serializing 'variableSpec' field") } // Simple Field (lengthSpec) lengthSpec := uint8(m.GetLengthSpec()) - _lengthSpecErr := writeBuffer.WriteUint8("lengthSpec", 8, (lengthSpec)) + _lengthSpecErr := writeBuffer.WriteUint8("lengthSpec", 8, uint8((lengthSpec))) if _lengthSpecErr != nil { return errors.Wrap(_lengthSpecErr, "Error serializing 'lengthSpec' field") } @@ -402,14 +402,14 @@ func (m *_AlarmMessageObjectPushType) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (numberOfValues) numberOfValues := uint8(m.GetNumberOfValues()) - _numberOfValuesErr := writeBuffer.WriteUint8("numberOfValues", 8, (numberOfValues)) + _numberOfValuesErr := writeBuffer.WriteUint8("numberOfValues", 8, uint8((numberOfValues))) if _numberOfValuesErr != nil { return errors.Wrap(_numberOfValuesErr, "Error serializing 'numberOfValues' field") } // Simple Field (eventId) eventId := uint32(m.GetEventId()) - _eventIdErr := writeBuffer.WriteUint32("eventId", 32, (eventId)) + _eventIdErr := writeBuffer.WriteUint32("eventId", 32, uint32((eventId))) if _eventIdErr != nil { return errors.Wrap(_eventIdErr, "Error serializing 'eventId' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectQueryType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectQueryType.go index e60cf28ea74..719d0cfaacd 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectQueryType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageObjectQueryType.go @@ -367,7 +367,7 @@ func (m *_AlarmMessageObjectQueryType) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (lengthDataset) lengthDataset := uint8(m.GetLengthDataset()) - _lengthDatasetErr := writeBuffer.WriteUint8("lengthDataset", 8, (lengthDataset)) + _lengthDatasetErr := writeBuffer.WriteUint8("lengthDataset", 8, uint8((lengthDataset))) if _lengthDatasetErr != nil { return errors.Wrap(_lengthDatasetErr, "Error serializing 'lengthDataset' field") } @@ -382,14 +382,14 @@ func (m *_AlarmMessageObjectQueryType) SerializeWithWriteBuffer(ctx context.Cont }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } } // Const Field (variableSpec) - _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, 0x12) + _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, uint8(0x12)) if _variableSpecErr != nil { return errors.Wrap(_variableSpecErr, "Error serializing 'variableSpec' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessagePushType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessagePushType.go index 73447625d0e..613f7430991 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessagePushType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessagePushType.go @@ -247,14 +247,14 @@ func (m *_AlarmMessagePushType) SerializeWithWriteBuffer(ctx context.Context, wr // Simple Field (functionId) functionId := uint8(m.GetFunctionId()) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, (functionId)) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8((functionId))) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Simple Field (numberOfObjects) numberOfObjects := uint8(m.GetNumberOfObjects()) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmMessageQueryType.go b/plc4go/protocols/s7/readwrite/model/AlarmMessageQueryType.go index 93159b650d0..aea59259605 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmMessageQueryType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmMessageQueryType.go @@ -287,14 +287,14 @@ func (m *_AlarmMessageQueryType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (functionId) functionId := uint8(m.GetFunctionId()) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, (functionId)) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8((functionId))) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Simple Field (numberOfObjects) numberOfObjects := uint8(m.GetNumberOfObjects()) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } @@ -324,7 +324,7 @@ func (m *_AlarmMessageQueryType) SerializeWithWriteBuffer(ctx context.Context, w } // Const Field (DataLength) - _DataLengthErr := writeBuffer.WriteUint16("DataLength", 16, 0xFFFF) + _DataLengthErr := writeBuffer.WriteUint16("DataLength", 16, uint16(0xFFFF)) if _DataLengthErr != nil { return errors.Wrap(_DataLengthErr, "Error serializing 'DataLength' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AlarmStateType.go b/plc4go/protocols/s7/readwrite/model/AlarmStateType.go index 4aa0b20278a..21a7193b41b 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmStateType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmStateType.go @@ -156,7 +156,7 @@ func (e AlarmStateType) Serialize() ([]byte, error) { func (e AlarmStateType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AlarmStateType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AlarmStateType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/AlarmType.go b/plc4go/protocols/s7/readwrite/model/AlarmType.go index eaa64ed1176..b611ec1b0a1 100644 --- a/plc4go/protocols/s7/readwrite/model/AlarmType.go +++ b/plc4go/protocols/s7/readwrite/model/AlarmType.go @@ -138,7 +138,7 @@ func (e AlarmType) Serialize() ([]byte, error) { func (e AlarmType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("AlarmType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("AlarmType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/AssociatedQueryValueType.go b/plc4go/protocols/s7/readwrite/model/AssociatedQueryValueType.go index a5b74a695a2..53aa143b77b 100644 --- a/plc4go/protocols/s7/readwrite/model/AssociatedQueryValueType.go +++ b/plc4go/protocols/s7/readwrite/model/AssociatedQueryValueType.go @@ -260,7 +260,7 @@ func (m *_AssociatedQueryValueType) SerializeWithWriteBuffer(ctx context.Context // Simple Field (valueLength) valueLength := uint16(m.GetValueLength()) - _valueLengthErr := writeBuffer.WriteUint16("valueLength", 16, (valueLength)) + _valueLengthErr := writeBuffer.WriteUint16("valueLength", 16, uint16((valueLength))) if _valueLengthErr != nil { return errors.Wrap(_valueLengthErr, "Error serializing 'valueLength' field") } @@ -271,7 +271,7 @@ func (m *_AssociatedQueryValueType) SerializeWithWriteBuffer(ctx context.Context } for _curItem, _element := range m.GetData() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/s7/readwrite/model/AssociatedValueType.go b/plc4go/protocols/s7/readwrite/model/AssociatedValueType.go index 9bb03d24a27..946a9635c3a 100644 --- a/plc4go/protocols/s7/readwrite/model/AssociatedValueType.go +++ b/plc4go/protocols/s7/readwrite/model/AssociatedValueType.go @@ -273,7 +273,7 @@ func (m *_AssociatedValueType) SerializeWithWriteBuffer(ctx context.Context, wri } for _curItem, _element := range m.GetData() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'data' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacket.go b/plc4go/protocols/s7/readwrite/model/COTPPacket.go index e4f127f0b15..0a457d0075d 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPPacket.go +++ b/plc4go/protocols/s7/readwrite/model/COTPPacket.go @@ -271,14 +271,14 @@ func (pm *_COTPPacket) SerializeParent(ctx context.Context, writeBuffer utils.Wr // Implicit Field (headerLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) headerLength := uint8(uint8(uint8(m.GetLengthInBytes(ctx))) - uint8((uint8((utils.InlineIf((bool((m.GetPayload()) != (nil))), func() any { return uint8((m.GetPayload()).GetLengthInBytes(ctx)) }, func() any { return uint8(uint8(0)) }).(uint8))) + uint8(uint8(1))))) - _headerLengthErr := writeBuffer.WriteUint8("headerLength", 8, (headerLength)) + _headerLengthErr := writeBuffer.WriteUint8("headerLength", 8, uint8((headerLength))) if _headerLengthErr != nil { return errors.Wrap(_headerLengthErr, "Error serializing 'headerLength' field") } // Discriminator Field (tpduCode) (Used as input to a switch field) tpduCode := uint8(child.GetTpduCode()) - _tpduCodeErr := writeBuffer.WriteUint8("tpduCode", 8, (tpduCode)) + _tpduCodeErr := writeBuffer.WriteUint8("tpduCode", 8, uint8((tpduCode))) if _tpduCodeErr != nil { return errors.Wrap(_tpduCodeErr, "Error serializing 'tpduCode' field") diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionRequest.go b/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionRequest.go index f3711dd432a..055e238a61e 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionRequest.go +++ b/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionRequest.go @@ -228,14 +228,14 @@ func (m *_COTPPacketConnectionRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (destinationReference) destinationReference := uint16(m.GetDestinationReference()) - _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, (destinationReference)) + _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, uint16((destinationReference))) if _destinationReferenceErr != nil { return errors.Wrap(_destinationReferenceErr, "Error serializing 'destinationReference' field") } // Simple Field (sourceReference) sourceReference := uint16(m.GetSourceReference()) - _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, (sourceReference)) + _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, uint16((sourceReference))) if _sourceReferenceErr != nil { return errors.Wrap(_sourceReferenceErr, "Error serializing 'sourceReference' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionResponse.go b/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionResponse.go index 4b7583691fb..6ca7949a6c2 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionResponse.go +++ b/plc4go/protocols/s7/readwrite/model/COTPPacketConnectionResponse.go @@ -228,14 +228,14 @@ func (m *_COTPPacketConnectionResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (destinationReference) destinationReference := uint16(m.GetDestinationReference()) - _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, (destinationReference)) + _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, uint16((destinationReference))) if _destinationReferenceErr != nil { return errors.Wrap(_destinationReferenceErr, "Error serializing 'destinationReference' field") } // Simple Field (sourceReference) sourceReference := uint16(m.GetSourceReference()) - _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, (sourceReference)) + _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, uint16((sourceReference))) if _sourceReferenceErr != nil { return errors.Wrap(_sourceReferenceErr, "Error serializing 'sourceReference' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacketData.go b/plc4go/protocols/s7/readwrite/model/COTPPacketData.go index 0a80b65ec92..d7ab0420aed 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPPacketData.go +++ b/plc4go/protocols/s7/readwrite/model/COTPPacketData.go @@ -210,7 +210,7 @@ func (m *_COTPPacketData) SerializeWithWriteBuffer(ctx context.Context, writeBuf // Simple Field (tpduRef) tpduRef := uint8(m.GetTpduRef()) - _tpduRefErr := writeBuffer.WriteUint8("tpduRef", 7, (tpduRef)) + _tpduRefErr := writeBuffer.WriteUint8("tpduRef", 7, uint8((tpduRef))) if _tpduRefErr != nil { return errors.Wrap(_tpduRefErr, "Error serializing 'tpduRef' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectRequest.go b/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectRequest.go index 334cd4f9fb0..cf3262a8cad 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectRequest.go +++ b/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectRequest.go @@ -228,14 +228,14 @@ func (m *_COTPPacketDisconnectRequest) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (destinationReference) destinationReference := uint16(m.GetDestinationReference()) - _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, (destinationReference)) + _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, uint16((destinationReference))) if _destinationReferenceErr != nil { return errors.Wrap(_destinationReferenceErr, "Error serializing 'destinationReference' field") } // Simple Field (sourceReference) sourceReference := uint16(m.GetSourceReference()) - _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, (sourceReference)) + _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, uint16((sourceReference))) if _sourceReferenceErr != nil { return errors.Wrap(_sourceReferenceErr, "Error serializing 'sourceReference' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectResponse.go b/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectResponse.go index 05b8724ebee..37173921209 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectResponse.go +++ b/plc4go/protocols/s7/readwrite/model/COTPPacketDisconnectResponse.go @@ -203,14 +203,14 @@ func (m *_COTPPacketDisconnectResponse) SerializeWithWriteBuffer(ctx context.Con // Simple Field (destinationReference) destinationReference := uint16(m.GetDestinationReference()) - _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, (destinationReference)) + _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, uint16((destinationReference))) if _destinationReferenceErr != nil { return errors.Wrap(_destinationReferenceErr, "Error serializing 'destinationReference' field") } // Simple Field (sourceReference) sourceReference := uint16(m.GetSourceReference()) - _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, (sourceReference)) + _sourceReferenceErr := writeBuffer.WriteUint16("sourceReference", 16, uint16((sourceReference))) if _sourceReferenceErr != nil { return errors.Wrap(_sourceReferenceErr, "Error serializing 'sourceReference' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacketTpduError.go b/plc4go/protocols/s7/readwrite/model/COTPPacketTpduError.go index ce1adf8380b..ce18ffe0e3c 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPPacketTpduError.go +++ b/plc4go/protocols/s7/readwrite/model/COTPPacketTpduError.go @@ -203,14 +203,14 @@ func (m *_COTPPacketTpduError) SerializeWithWriteBuffer(ctx context.Context, wri // Simple Field (destinationReference) destinationReference := uint16(m.GetDestinationReference()) - _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, (destinationReference)) + _destinationReferenceErr := writeBuffer.WriteUint16("destinationReference", 16, uint16((destinationReference))) if _destinationReferenceErr != nil { return errors.Wrap(_destinationReferenceErr, "Error serializing 'destinationReference' field") } // Simple Field (rejectCause) rejectCause := uint8(m.GetRejectCause()) - _rejectCauseErr := writeBuffer.WriteUint8("rejectCause", 8, (rejectCause)) + _rejectCauseErr := writeBuffer.WriteUint8("rejectCause", 8, uint8((rejectCause))) if _rejectCauseErr != nil { return errors.Wrap(_rejectCauseErr, "Error serializing 'rejectCause' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPParameter.go b/plc4go/protocols/s7/readwrite/model/COTPParameter.go index cb1264085b5..49682dade8f 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPParameter.go +++ b/plc4go/protocols/s7/readwrite/model/COTPParameter.go @@ -187,7 +187,7 @@ func (pm *_COTPParameter) SerializeParent(ctx context.Context, writeBuffer utils // Discriminator Field (parameterType) (Used as input to a switch field) parameterType := uint8(child.GetParameterType()) - _parameterTypeErr := writeBuffer.WriteUint8("parameterType", 8, (parameterType)) + _parameterTypeErr := writeBuffer.WriteUint8("parameterType", 8, uint8((parameterType))) if _parameterTypeErr != nil { return errors.Wrap(_parameterTypeErr, "Error serializing 'parameterType' field") @@ -195,7 +195,7 @@ func (pm *_COTPParameter) SerializeParent(ctx context.Context, writeBuffer utils // Implicit Field (parameterLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) parameterLength := uint8(uint8(uint8(m.GetLengthInBytes(ctx))) - uint8(uint8(2))) - _parameterLengthErr := writeBuffer.WriteUint8("parameterLength", 8, (parameterLength)) + _parameterLengthErr := writeBuffer.WriteUint8("parameterLength", 8, uint8((parameterLength))) if _parameterLengthErr != nil { return errors.Wrap(_parameterLengthErr, "Error serializing 'parameterLength' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPParameterCalledTsap.go b/plc4go/protocols/s7/readwrite/model/COTPParameterCalledTsap.go index ac9ca16d5b3..814f9a9b243 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPParameterCalledTsap.go +++ b/plc4go/protocols/s7/readwrite/model/COTPParameterCalledTsap.go @@ -181,7 +181,7 @@ func (m *_COTPParameterCalledTsap) SerializeWithWriteBuffer(ctx context.Context, // Simple Field (tsapId) tsapId := uint16(m.GetTsapId()) - _tsapIdErr := writeBuffer.WriteUint16("tsapId", 16, (tsapId)) + _tsapIdErr := writeBuffer.WriteUint16("tsapId", 16, uint16((tsapId))) if _tsapIdErr != nil { return errors.Wrap(_tsapIdErr, "Error serializing 'tsapId' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPParameterCallingTsap.go b/plc4go/protocols/s7/readwrite/model/COTPParameterCallingTsap.go index 76b47b758ce..7d1650977fa 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPParameterCallingTsap.go +++ b/plc4go/protocols/s7/readwrite/model/COTPParameterCallingTsap.go @@ -181,7 +181,7 @@ func (m *_COTPParameterCallingTsap) SerializeWithWriteBuffer(ctx context.Context // Simple Field (tsapId) tsapId := uint16(m.GetTsapId()) - _tsapIdErr := writeBuffer.WriteUint16("tsapId", 16, (tsapId)) + _tsapIdErr := writeBuffer.WriteUint16("tsapId", 16, uint16((tsapId))) if _tsapIdErr != nil { return errors.Wrap(_tsapIdErr, "Error serializing 'tsapId' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPParameterChecksum.go b/plc4go/protocols/s7/readwrite/model/COTPParameterChecksum.go index e22102eb269..7a31bbc93a0 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPParameterChecksum.go +++ b/plc4go/protocols/s7/readwrite/model/COTPParameterChecksum.go @@ -181,7 +181,7 @@ func (m *_COTPParameterChecksum) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (crc) crc := uint8(m.GetCrc()) - _crcErr := writeBuffer.WriteUint8("crc", 8, (crc)) + _crcErr := writeBuffer.WriteUint8("crc", 8, uint8((crc))) if _crcErr != nil { return errors.Wrap(_crcErr, "Error serializing 'crc' field") } diff --git a/plc4go/protocols/s7/readwrite/model/COTPProtocolClass.go b/plc4go/protocols/s7/readwrite/model/COTPProtocolClass.go index 2b4eac97840..2da26a25022 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPProtocolClass.go +++ b/plc4go/protocols/s7/readwrite/model/COTPProtocolClass.go @@ -150,7 +150,7 @@ func (e COTPProtocolClass) Serialize() ([]byte, error) { func (e COTPProtocolClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("COTPProtocolClass", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("COTPProtocolClass", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/COTPTpduSize.go b/plc4go/protocols/s7/readwrite/model/COTPTpduSize.go index dd3a9f37118..c5836d7129d 100644 --- a/plc4go/protocols/s7/readwrite/model/COTPTpduSize.go +++ b/plc4go/protocols/s7/readwrite/model/COTPTpduSize.go @@ -208,7 +208,7 @@ func (e COTPTpduSize) Serialize() ([]byte, error) { func (e COTPTpduSize) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("COTPTpduSize", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("COTPTpduSize", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/CpuSubscribeEvents.go b/plc4go/protocols/s7/readwrite/model/CpuSubscribeEvents.go index 1c3bb876ee4..a6d6e59d9ad 100644 --- a/plc4go/protocols/s7/readwrite/model/CpuSubscribeEvents.go +++ b/plc4go/protocols/s7/readwrite/model/CpuSubscribeEvents.go @@ -144,7 +144,7 @@ func (e CpuSubscribeEvents) Serialize() ([]byte, error) { func (e CpuSubscribeEvents) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("CpuSubscribeEvents", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("CpuSubscribeEvents", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/CycServiceItemAnyType.go b/plc4go/protocols/s7/readwrite/model/CycServiceItemAnyType.go index 2edaf6d1249..8589004fa4f 100644 --- a/plc4go/protocols/s7/readwrite/model/CycServiceItemAnyType.go +++ b/plc4go/protocols/s7/readwrite/model/CycServiceItemAnyType.go @@ -271,7 +271,7 @@ func (m *_CycServiceItemAnyType) SerializeWithWriteBuffer(ctx context.Context, w return errors.Wrap(pushErr, "Error pushing for transportSize") } // Enum field (transportSize) - _transportSizeErr := writeBuffer.WriteUint8("TransportSize", 8, m.TransportSize.Code(), utils.WithAdditionalStringRepresentation(m.GetTransportSize().PLC4XEnumName())) + _transportSizeErr := writeBuffer.WriteUint8("TransportSize", 8, uint8(m.TransportSize.Code()), utils.WithAdditionalStringRepresentation(m.GetTransportSize().PLC4XEnumName())) if _transportSizeErr != nil { return errors.Wrap(_transportSizeErr, "Error serializing 'transportSize' field") } @@ -281,14 +281,14 @@ func (m *_CycServiceItemAnyType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (length) length := uint16(m.GetLength()) - _lengthErr := writeBuffer.WriteUint16("length", 16, (length)) + _lengthErr := writeBuffer.WriteUint16("length", 16, uint16((length))) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } // Simple Field (dbNumber) dbNumber := uint16(m.GetDbNumber()) - _dbNumberErr := writeBuffer.WriteUint16("dbNumber", 16, (dbNumber)) + _dbNumberErr := writeBuffer.WriteUint16("dbNumber", 16, uint16((dbNumber))) if _dbNumberErr != nil { return errors.Wrap(_dbNumberErr, "Error serializing 'dbNumber' field") } @@ -307,7 +307,7 @@ func (m *_CycServiceItemAnyType) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (address) address := uint32(m.GetAddress()) - _addressErr := writeBuffer.WriteUint32("address", 24, (address)) + _addressErr := writeBuffer.WriteUint32("address", 24, uint32((address))) if _addressErr != nil { return errors.Wrap(_addressErr, "Error serializing 'address' field") } diff --git a/plc4go/protocols/s7/readwrite/model/CycServiceItemDbReadType.go b/plc4go/protocols/s7/readwrite/model/CycServiceItemDbReadType.go index f43b7e930a9..615590bb15c 100644 --- a/plc4go/protocols/s7/readwrite/model/CycServiceItemDbReadType.go +++ b/plc4go/protocols/s7/readwrite/model/CycServiceItemDbReadType.go @@ -224,7 +224,7 @@ func (m *_CycServiceItemDbReadType) SerializeWithWriteBuffer(ctx context.Context // Simple Field (numberOfAreas) numberOfAreas := uint8(m.GetNumberOfAreas()) - _numberOfAreasErr := writeBuffer.WriteUint8("numberOfAreas", 8, (numberOfAreas)) + _numberOfAreasErr := writeBuffer.WriteUint8("numberOfAreas", 8, uint8((numberOfAreas))) if _numberOfAreasErr != nil { return errors.Wrap(_numberOfAreasErr, "Error serializing 'numberOfAreas' field") } diff --git a/plc4go/protocols/s7/readwrite/model/CycServiceItemType.go b/plc4go/protocols/s7/readwrite/model/CycServiceItemType.go index 21f3104efba..e8d3cd95ce3 100644 --- a/plc4go/protocols/s7/readwrite/model/CycServiceItemType.go +++ b/plc4go/protocols/s7/readwrite/model/CycServiceItemType.go @@ -229,21 +229,21 @@ func (pm *_CycServiceItemType) SerializeParent(ctx context.Context, writeBuffer } // Const Field (functionId) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, 0x12) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8(0x12)) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Simple Field (byteLength) byteLength := uint8(m.GetByteLength()) - _byteLengthErr := writeBuffer.WriteUint8("byteLength", 8, (byteLength)) + _byteLengthErr := writeBuffer.WriteUint8("byteLength", 8, uint8((byteLength))) if _byteLengthErr != nil { return errors.Wrap(_byteLengthErr, "Error serializing 'byteLength' field") } // Simple Field (syntaxId) syntaxId := uint8(m.GetSyntaxId()) - _syntaxIdErr := writeBuffer.WriteUint8("syntaxId", 8, (syntaxId)) + _syntaxIdErr := writeBuffer.WriteUint8("syntaxId", 8, uint8((syntaxId))) if _syntaxIdErr != nil { return errors.Wrap(_syntaxIdErr, "Error serializing 'syntaxId' field") } diff --git a/plc4go/protocols/s7/readwrite/model/DataItem.go b/plc4go/protocols/s7/readwrite/model/DataItem.go index 1b1d4ba7cfd..89d76dade78 100644 --- a/plc4go/protocols/s7/readwrite/model/DataItem.go +++ b/plc4go/protocols/s7/readwrite/model/DataItem.go @@ -198,12 +198,12 @@ func DataItemParseWithBuffer(ctx context.Context, readBuffer utils.ReadBuffer, d return values.NewPlcSTRING(value), nil case dataProtocolId == "IEC61131_TIME": // TIME // Simple Field (milliseconds) - milliseconds, _millisecondsErr := readBuffer.ReadUint32("milliseconds", 32) + milliseconds, _millisecondsErr := readBuffer.ReadInt32("milliseconds", 32) if _millisecondsErr != nil { return nil, errors.Wrap(_millisecondsErr, "Error parsing 'milliseconds' field") } readBuffer.CloseContext("DataItem") - return values.NewPlcTIMEFromMilliseconds(milliseconds), nil + return values.NewPlcTIMEFromMilliseconds(int64(milliseconds)), nil case dataProtocolId == "IEC61131_LTIME": // LTIME // Simple Field (nanoseconds) nanoseconds, _nanosecondsErr := readBuffer.ReadUint64("nanoseconds", 64) @@ -314,7 +314,7 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri switch { case dataProtocolId == "IEC61131_BOOL": // BOOL // Reserved Field (Just skip the bytes) - if _err := writeBuffer.WriteUint8("reserved", 7, uint8(0x00)); _err != nil { + if _err := writeBuffer.WriteUint8("reserved", 7, uint8(uint8(0x00))); _err != nil { return errors.Wrap(_err, "Error serializing reserved field") } @@ -324,62 +324,62 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } case dataProtocolId == "IEC61131_BYTE": // BYTE // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_WORD": // WORD // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_DWORD": // DWORD // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_LWORD": // LWORD // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_SINT": // SINT // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_USINT": // USINT // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_INT": // INT // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_UINT": // UINT // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_DINT": // DINT // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_UDINT": // UDINT // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_LINT": // LINT // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_ULINT": // ULINT // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataProtocolId == "IEC61131_REAL": // REAL @@ -416,67 +416,67 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } case dataProtocolId == "IEC61131_TIME": // TIME // Simple Field (milliseconds) - if _err := writeBuffer.WriteUint32("milliseconds", 32, value.(values.PlcTIME).GetMilliseconds()); _err != nil { + if _err := writeBuffer.WriteInt32("milliseconds", 32, int32(value.(values.PlcTIME).GetMilliseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'milliseconds' field") } case dataProtocolId == "IEC61131_LTIME": // LTIME // Simple Field (nanoseconds) - if _err := writeBuffer.WriteUint64("nanoseconds", 64, value.(values.PlcLTIME).GetNanoseconds()); _err != nil { + if _err := writeBuffer.WriteUint64("nanoseconds", 64, uint64(value.(values.PlcLTIME).GetNanoseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanoseconds' field") } case dataProtocolId == "IEC61131_DATE": // DATE // Simple Field (daysSinceSiemensEpoch) - if _err := writeBuffer.WriteUint16("daysSinceSiemensEpoch", 16, value.(values.PlcDATE).GetDaysSinceSiemensEpoch()); _err != nil { + if _err := writeBuffer.WriteUint16("daysSinceSiemensEpoch", 16, uint16(value.(values.PlcDATE).GetDaysSinceSiemensEpoch())); _err != nil { return errors.Wrap(_err, "Error serializing 'daysSinceSiemensEpoch' field") } case dataProtocolId == "IEC61131_TIME_OF_DAY": // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) - if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight()); _err != nil { + if _err := writeBuffer.WriteUint32("millisecondsSinceMidnight", 32, uint32(value.(values.PlcTIME_OF_DAY).GetMillisecondsSinceMidnight())); _err != nil { return errors.Wrap(_err, "Error serializing 'millisecondsSinceMidnight' field") } case dataProtocolId == "IEC61131_LTIME_OF_DAY": // LTIME_OF_DAY // Simple Field (nanosecondsSinceMidnight) - if _err := writeBuffer.WriteUint64("nanosecondsSinceMidnight", 64, value.(values.PlcLTIME_OF_DAY).GetNanosecondsSinceMidnight()); _err != nil { + if _err := writeBuffer.WriteUint64("nanosecondsSinceMidnight", 64, uint64(value.(values.PlcLTIME_OF_DAY).GetNanosecondsSinceMidnight())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanosecondsSinceMidnight' field") } case dataProtocolId == "IEC61131_DATE_AND_TIME": // DATE_AND_TIME // Simple Field (year) - if _err := writeBuffer.WriteUint16("year", 16, value.(values.PlcDATE_AND_TIME).GetYear()); _err != nil { + if _err := writeBuffer.WriteUint16("year", 16, uint16(value.(values.PlcDATE_AND_TIME).GetYear())); _err != nil { return errors.Wrap(_err, "Error serializing 'year' field") } // Simple Field (month) - if _err := writeBuffer.WriteUint8("month", 8, value.(values.PlcDATE_AND_TIME).GetMonth()); _err != nil { + if _err := writeBuffer.WriteUint8("month", 8, uint8(value.(values.PlcDATE_AND_TIME).GetMonth())); _err != nil { return errors.Wrap(_err, "Error serializing 'month' field") } // Simple Field (day) - if _err := writeBuffer.WriteUint8("day", 8, value.(values.PlcDATE_AND_TIME).GetDay()); _err != nil { + if _err := writeBuffer.WriteUint8("day", 8, uint8(value.(values.PlcDATE_AND_TIME).GetDay())); _err != nil { return errors.Wrap(_err, "Error serializing 'day' field") } // Simple Field (dayOfWeek) - if _err := writeBuffer.WriteUint8("dayOfWeek", 8, value.(values.PlcDATE_AND_TIME).GetDayOfWeek()); _err != nil { + if _err := writeBuffer.WriteUint8("dayOfWeek", 8, uint8(value.(values.PlcDATE_AND_TIME).GetDayOfWeek())); _err != nil { return errors.Wrap(_err, "Error serializing 'dayOfWeek' field") } // Simple Field (hour) - if _err := writeBuffer.WriteUint8("hour", 8, value.(values.PlcDATE_AND_TIME).GetHour()); _err != nil { + if _err := writeBuffer.WriteUint8("hour", 8, uint8(value.(values.PlcDATE_AND_TIME).GetHour())); _err != nil { return errors.Wrap(_err, "Error serializing 'hour' field") } // Simple Field (minutes) - if _err := writeBuffer.WriteUint8("minutes", 8, value.(values.PlcDATE_AND_TIME).GetMinutes()); _err != nil { + if _err := writeBuffer.WriteUint8("minutes", 8, uint8(value.(values.PlcDATE_AND_TIME).GetMinutes())); _err != nil { return errors.Wrap(_err, "Error serializing 'minutes' field") } // Simple Field (seconds) - if _err := writeBuffer.WriteUint8("seconds", 8, value.(values.PlcDATE_AND_TIME).GetSeconds()); _err != nil { + if _err := writeBuffer.WriteUint8("seconds", 8, uint8(value.(values.PlcDATE_AND_TIME).GetSeconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'seconds' field") } // Simple Field (nanoseconds) - if _err := writeBuffer.WriteUint32("nanoseconds", 32, value.(values.PlcDATE_AND_TIME).GetNanoseconds()); _err != nil { + if _err := writeBuffer.WriteUint32("nanoseconds", 32, uint32(value.(values.PlcDATE_AND_TIME).GetNanoseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanoseconds' field") } default: diff --git a/plc4go/protocols/s7/readwrite/model/DataTransportErrorCode.go b/plc4go/protocols/s7/readwrite/model/DataTransportErrorCode.go index 143758347a0..ecf67f58d2c 100644 --- a/plc4go/protocols/s7/readwrite/model/DataTransportErrorCode.go +++ b/plc4go/protocols/s7/readwrite/model/DataTransportErrorCode.go @@ -156,7 +156,7 @@ func (e DataTransportErrorCode) Serialize() ([]byte, error) { func (e DataTransportErrorCode) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("DataTransportErrorCode", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("DataTransportErrorCode", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/DataTransportSize.go b/plc4go/protocols/s7/readwrite/model/DataTransportSize.go index d50c7636140..d8cd8322b34 100644 --- a/plc4go/protocols/s7/readwrite/model/DataTransportSize.go +++ b/plc4go/protocols/s7/readwrite/model/DataTransportSize.go @@ -208,7 +208,7 @@ func (e DataTransportSize) Serialize() ([]byte, error) { func (e DataTransportSize) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("DataTransportSize", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("DataTransportSize", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/DateAndTime.go b/plc4go/protocols/s7/readwrite/model/DateAndTime.go index 2b0b9ede2ce..f8b579ae395 100644 --- a/plc4go/protocols/s7/readwrite/model/DateAndTime.go +++ b/plc4go/protocols/s7/readwrite/model/DateAndTime.go @@ -337,7 +337,7 @@ func (m *_DateAndTime) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Simple Field (dow) dow := uint8(m.GetDow()) - _dowErr := writeBuffer.WriteUint8("dow", 4, (dow)) + _dowErr := writeBuffer.WriteUint8("dow", 4, uint8((dow))) if _dowErr != nil { return errors.Wrap(_dowErr, "Error serializing 'dow' field") } diff --git a/plc4go/protocols/s7/readwrite/model/DeviceGroup.go b/plc4go/protocols/s7/readwrite/model/DeviceGroup.go index 8b489718d92..d9f76f7996d 100644 --- a/plc4go/protocols/s7/readwrite/model/DeviceGroup.go +++ b/plc4go/protocols/s7/readwrite/model/DeviceGroup.go @@ -138,7 +138,7 @@ func (e DeviceGroup) Serialize() ([]byte, error) { func (e DeviceGroup) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("DeviceGroup", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("DeviceGroup", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/EventType.go b/plc4go/protocols/s7/readwrite/model/EventType.go index 66739daca42..d175a8a112a 100644 --- a/plc4go/protocols/s7/readwrite/model/EventType.go +++ b/plc4go/protocols/s7/readwrite/model/EventType.go @@ -150,7 +150,7 @@ func (e EventType) Serialize() ([]byte, error) { func (e EventType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("EventType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("EventType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/MemoryArea.go b/plc4go/protocols/s7/readwrite/model/MemoryArea.go index a06e02b4e88..45dca34c2c6 100644 --- a/plc4go/protocols/s7/readwrite/model/MemoryArea.go +++ b/plc4go/protocols/s7/readwrite/model/MemoryArea.go @@ -228,7 +228,7 @@ func (e MemoryArea) Serialize() ([]byte, error) { func (e MemoryArea) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("MemoryArea", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("MemoryArea", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/ModeTransitionType.go b/plc4go/protocols/s7/readwrite/model/ModeTransitionType.go index 3317e117d55..afc63c88e3a 100644 --- a/plc4go/protocols/s7/readwrite/model/ModeTransitionType.go +++ b/plc4go/protocols/s7/readwrite/model/ModeTransitionType.go @@ -174,7 +174,7 @@ func (e ModeTransitionType) Serialize() ([]byte, error) { func (e ModeTransitionType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("ModeTransitionType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("ModeTransitionType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/QueryType.go b/plc4go/protocols/s7/readwrite/model/QueryType.go index 9c1272af17d..734cbaaa42c 100644 --- a/plc4go/protocols/s7/readwrite/model/QueryType.go +++ b/plc4go/protocols/s7/readwrite/model/QueryType.go @@ -144,7 +144,7 @@ func (e QueryType) Serialize() ([]byte, error) { func (e QueryType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("QueryType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("QueryType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/S7Address.go b/plc4go/protocols/s7/readwrite/model/S7Address.go index 6606e107dd3..eefdc5bbd2a 100644 --- a/plc4go/protocols/s7/readwrite/model/S7Address.go +++ b/plc4go/protocols/s7/readwrite/model/S7Address.go @@ -166,7 +166,7 @@ func (pm *_S7Address) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Discriminator Field (addressType) (Used as input to a switch field) addressType := uint8(child.GetAddressType()) - _addressTypeErr := writeBuffer.WriteUint8("addressType", 8, (addressType)) + _addressTypeErr := writeBuffer.WriteUint8("addressType", 8, uint8((addressType))) if _addressTypeErr != nil { return errors.Wrap(_addressTypeErr, "Error serializing 'addressType' field") diff --git a/plc4go/protocols/s7/readwrite/model/S7AddressAny.go b/plc4go/protocols/s7/readwrite/model/S7AddressAny.go index 5ee9c71e5f7..69ad46d2e0f 100644 --- a/plc4go/protocols/s7/readwrite/model/S7AddressAny.go +++ b/plc4go/protocols/s7/readwrite/model/S7AddressAny.go @@ -314,7 +314,7 @@ func (m *_S7AddressAny) SerializeWithWriteBuffer(ctx context.Context, writeBuffe return errors.Wrap(pushErr, "Error pushing for transportSize") } // Enum field (transportSize) - _transportSizeErr := writeBuffer.WriteUint8("TransportSize", 8, m.TransportSize.Code(), utils.WithAdditionalStringRepresentation(m.GetTransportSize().PLC4XEnumName())) + _transportSizeErr := writeBuffer.WriteUint8("TransportSize", 8, uint8(m.TransportSize.Code()), utils.WithAdditionalStringRepresentation(m.GetTransportSize().PLC4XEnumName())) if _transportSizeErr != nil { return errors.Wrap(_transportSizeErr, "Error serializing 'transportSize' field") } @@ -324,14 +324,14 @@ func (m *_S7AddressAny) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (numberOfElements) numberOfElements := uint16(m.GetNumberOfElements()) - _numberOfElementsErr := writeBuffer.WriteUint16("numberOfElements", 16, (numberOfElements)) + _numberOfElementsErr := writeBuffer.WriteUint16("numberOfElements", 16, uint16((numberOfElements))) if _numberOfElementsErr != nil { return errors.Wrap(_numberOfElementsErr, "Error serializing 'numberOfElements' field") } // Simple Field (dbNumber) dbNumber := uint16(m.GetDbNumber()) - _dbNumberErr := writeBuffer.WriteUint16("dbNumber", 16, (dbNumber)) + _dbNumberErr := writeBuffer.WriteUint16("dbNumber", 16, uint16((dbNumber))) if _dbNumberErr != nil { return errors.Wrap(_dbNumberErr, "Error serializing 'dbNumber' field") } @@ -358,7 +358,7 @@ func (m *_S7AddressAny) SerializeWithWriteBuffer(ctx context.Context, writeBuffe }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 5, reserved) + _err := writeBuffer.WriteUint8("reserved", 5, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -366,14 +366,14 @@ func (m *_S7AddressAny) SerializeWithWriteBuffer(ctx context.Context, writeBuffe // Simple Field (byteAddress) byteAddress := uint16(m.GetByteAddress()) - _byteAddressErr := writeBuffer.WriteUint16("byteAddress", 16, (byteAddress)) + _byteAddressErr := writeBuffer.WriteUint16("byteAddress", 16, uint16((byteAddress))) if _byteAddressErr != nil { return errors.Wrap(_byteAddressErr, "Error serializing 'byteAddress' field") } // Simple Field (bitAddress) bitAddress := uint8(m.GetBitAddress()) - _bitAddressErr := writeBuffer.WriteUint8("bitAddress", 3, (bitAddress)) + _bitAddressErr := writeBuffer.WriteUint8("bitAddress", 3, uint8((bitAddress))) if _bitAddressErr != nil { return errors.Wrap(_bitAddressErr, "Error serializing 'bitAddress' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7DataAlarmMessage.go b/plc4go/protocols/s7/readwrite/model/S7DataAlarmMessage.go index b327e7b6494..e35ab075d71 100644 --- a/plc4go/protocols/s7/readwrite/model/S7DataAlarmMessage.go +++ b/plc4go/protocols/s7/readwrite/model/S7DataAlarmMessage.go @@ -205,13 +205,13 @@ func (pm *_S7DataAlarmMessage) SerializeParent(ctx context.Context, writeBuffer } // Const Field (functionId) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, 0x00) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8(0x00)) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Const Field (numberMessageObj) - _numberMessageObjErr := writeBuffer.WriteUint8("numberMessageObj", 8, 0x01) + _numberMessageObjErr := writeBuffer.WriteUint8("numberMessageObj", 8, uint8(0x01)) if _numberMessageObjErr != nil { return errors.Wrap(_numberMessageObjErr, "Error serializing 'numberMessageObj' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7Message.go b/plc4go/protocols/s7/readwrite/model/S7Message.go index 4498abcea37..376eced9877 100644 --- a/plc4go/protocols/s7/readwrite/model/S7Message.go +++ b/plc4go/protocols/s7/readwrite/model/S7Message.go @@ -338,14 +338,14 @@ func (pm *_S7Message) SerializeParent(ctx context.Context, writeBuffer utils.Wri } // Const Field (protocolId) - _protocolIdErr := writeBuffer.WriteUint8("protocolId", 8, 0x32) + _protocolIdErr := writeBuffer.WriteUint8("protocolId", 8, uint8(0x32)) if _protocolIdErr != nil { return errors.Wrap(_protocolIdErr, "Error serializing 'protocolId' field") } // Discriminator Field (messageType) (Used as input to a switch field) messageType := uint8(child.GetMessageType()) - _messageTypeErr := writeBuffer.WriteUint8("messageType", 8, (messageType)) + _messageTypeErr := writeBuffer.WriteUint8("messageType", 8, uint8((messageType))) if _messageTypeErr != nil { return errors.Wrap(_messageTypeErr, "Error serializing 'messageType' field") @@ -361,7 +361,7 @@ func (pm *_S7Message) SerializeParent(ctx context.Context, writeBuffer utils.Wri }).Msg("Overriding reserved field with unexpected value.") reserved = *pm.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -369,21 +369,21 @@ func (pm *_S7Message) SerializeParent(ctx context.Context, writeBuffer utils.Wri // Simple Field (tpduReference) tpduReference := uint16(m.GetTpduReference()) - _tpduReferenceErr := writeBuffer.WriteUint16("tpduReference", 16, (tpduReference)) + _tpduReferenceErr := writeBuffer.WriteUint16("tpduReference", 16, uint16((tpduReference))) if _tpduReferenceErr != nil { return errors.Wrap(_tpduReferenceErr, "Error serializing 'tpduReference' field") } // Implicit Field (parameterLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) parameterLength := uint16(utils.InlineIf(bool((m.GetParameter()) != (nil)), func() any { return uint16((m.GetParameter()).GetLengthInBytes(ctx)) }, func() any { return uint16(uint16(0)) }).(uint16)) - _parameterLengthErr := writeBuffer.WriteUint16("parameterLength", 16, (parameterLength)) + _parameterLengthErr := writeBuffer.WriteUint16("parameterLength", 16, uint16((parameterLength))) if _parameterLengthErr != nil { return errors.Wrap(_parameterLengthErr, "Error serializing 'parameterLength' field") } // Implicit Field (payloadLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) payloadLength := uint16(utils.InlineIf(bool((m.GetPayload()) != (nil)), func() any { return uint16((m.GetPayload()).GetLengthInBytes(ctx)) }, func() any { return uint16(uint16(0)) }).(uint16)) - _payloadLengthErr := writeBuffer.WriteUint16("payloadLength", 16, (payloadLength)) + _payloadLengthErr := writeBuffer.WriteUint16("payloadLength", 16, uint16((payloadLength))) if _payloadLengthErr != nil { return errors.Wrap(_payloadLengthErr, "Error serializing 'payloadLength' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7MessageObjectRequest.go b/plc4go/protocols/s7/readwrite/model/S7MessageObjectRequest.go index 7d58c24e81b..93faa61575a 100644 --- a/plc4go/protocols/s7/readwrite/model/S7MessageObjectRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7MessageObjectRequest.go @@ -324,13 +324,13 @@ func (m *_S7MessageObjectRequest) SerializeWithWriteBuffer(ctx context.Context, } // Const Field (variableSpec) - _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, 0x12) + _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, uint8(0x12)) if _variableSpecErr != nil { return errors.Wrap(_variableSpecErr, "Error serializing 'variableSpec' field") } // Const Field (length) - _lengthErr := writeBuffer.WriteUint8("length", 8, 0x08) + _lengthErr := writeBuffer.WriteUint8("length", 8, uint8(0x08)) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } @@ -357,7 +357,7 @@ func (m *_S7MessageObjectRequest) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -385,7 +385,7 @@ func (m *_S7MessageObjectRequest) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7MessageObjectResponse.go b/plc4go/protocols/s7/readwrite/model/S7MessageObjectResponse.go index 06f7c827064..6bffb00466d 100644 --- a/plc4go/protocols/s7/readwrite/model/S7MessageObjectResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7MessageObjectResponse.go @@ -265,7 +265,7 @@ func (m *_S7MessageObjectResponse) SerializeWithWriteBuffer(ctx context.Context, }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7MessageResponse.go b/plc4go/protocols/s7/readwrite/model/S7MessageResponse.go index 30e29744ba4..cec279ccf57 100644 --- a/plc4go/protocols/s7/readwrite/model/S7MessageResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7MessageResponse.go @@ -202,14 +202,14 @@ func (m *_S7MessageResponse) SerializeWithWriteBuffer(ctx context.Context, write // Simple Field (errorClass) errorClass := uint8(m.GetErrorClass()) - _errorClassErr := writeBuffer.WriteUint8("errorClass", 8, (errorClass)) + _errorClassErr := writeBuffer.WriteUint8("errorClass", 8, uint8((errorClass))) if _errorClassErr != nil { return errors.Wrap(_errorClassErr, "Error serializing 'errorClass' field") } // Simple Field (errorCode) errorCode := uint8(m.GetErrorCode()) - _errorCodeErr := writeBuffer.WriteUint8("errorCode", 8, (errorCode)) + _errorCodeErr := writeBuffer.WriteUint8("errorCode", 8, uint8((errorCode))) if _errorCodeErr != nil { return errors.Wrap(_errorCodeErr, "Error serializing 'errorCode' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7MessageResponseData.go b/plc4go/protocols/s7/readwrite/model/S7MessageResponseData.go index ba8a89e9f61..f925de05dc5 100644 --- a/plc4go/protocols/s7/readwrite/model/S7MessageResponseData.go +++ b/plc4go/protocols/s7/readwrite/model/S7MessageResponseData.go @@ -202,14 +202,14 @@ func (m *_S7MessageResponseData) SerializeWithWriteBuffer(ctx context.Context, w // Simple Field (errorClass) errorClass := uint8(m.GetErrorClass()) - _errorClassErr := writeBuffer.WriteUint8("errorClass", 8, (errorClass)) + _errorClassErr := writeBuffer.WriteUint8("errorClass", 8, uint8((errorClass))) if _errorClassErr != nil { return errors.Wrap(_errorClassErr, "Error serializing 'errorClass' field") } // Simple Field (errorCode) errorCode := uint8(m.GetErrorCode()) - _errorCodeErr := writeBuffer.WriteUint8("errorCode", 8, (errorCode)) + _errorCodeErr := writeBuffer.WriteUint8("errorCode", 8, uint8((errorCode))) if _errorCodeErr != nil { return errors.Wrap(_errorCodeErr, "Error serializing 'errorCode' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7Parameter.go b/plc4go/protocols/s7/readwrite/model/S7Parameter.go index cb0a67039b4..545f4f1c1b6 100644 --- a/plc4go/protocols/s7/readwrite/model/S7Parameter.go +++ b/plc4go/protocols/s7/readwrite/model/S7Parameter.go @@ -181,7 +181,7 @@ func (pm *_S7Parameter) SerializeParent(ctx context.Context, writeBuffer utils.W // Discriminator Field (parameterType) (Used as input to a switch field) parameterType := uint8(child.GetParameterType()) - _parameterTypeErr := writeBuffer.WriteUint8("parameterType", 8, (parameterType)) + _parameterTypeErr := writeBuffer.WriteUint8("parameterType", 8, uint8((parameterType))) if _parameterTypeErr != nil { return errors.Wrap(_parameterTypeErr, "Error serializing 'parameterType' field") diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterModeTransition.go b/plc4go/protocols/s7/readwrite/model/S7ParameterModeTransition.go index d68c1babb12..3e48ef61e70 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterModeTransition.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterModeTransition.go @@ -300,7 +300,7 @@ func (m *_S7ParameterModeTransition) SerializeWithWriteBuffer(ctx context.Contex }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint16("reserved", 16, reserved) + _err := writeBuffer.WriteUint16("reserved", 16, uint16(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -308,42 +308,42 @@ func (m *_S7ParameterModeTransition) SerializeWithWriteBuffer(ctx context.Contex // Implicit Field (itemLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) itemLength := uint8(uint8(uint8(m.GetLengthInBytes(ctx))) - uint8(uint8(2))) - _itemLengthErr := writeBuffer.WriteUint8("itemLength", 8, (itemLength)) + _itemLengthErr := writeBuffer.WriteUint8("itemLength", 8, uint8((itemLength))) if _itemLengthErr != nil { return errors.Wrap(_itemLengthErr, "Error serializing 'itemLength' field") } // Simple Field (method) method := uint8(m.GetMethod()) - _methodErr := writeBuffer.WriteUint8("method", 8, (method)) + _methodErr := writeBuffer.WriteUint8("method", 8, uint8((method))) if _methodErr != nil { return errors.Wrap(_methodErr, "Error serializing 'method' field") } // Simple Field (cpuFunctionType) cpuFunctionType := uint8(m.GetCpuFunctionType()) - _cpuFunctionTypeErr := writeBuffer.WriteUint8("cpuFunctionType", 4, (cpuFunctionType)) + _cpuFunctionTypeErr := writeBuffer.WriteUint8("cpuFunctionType", 4, uint8((cpuFunctionType))) if _cpuFunctionTypeErr != nil { return errors.Wrap(_cpuFunctionTypeErr, "Error serializing 'cpuFunctionType' field") } // Simple Field (cpuFunctionGroup) cpuFunctionGroup := uint8(m.GetCpuFunctionGroup()) - _cpuFunctionGroupErr := writeBuffer.WriteUint8("cpuFunctionGroup", 4, (cpuFunctionGroup)) + _cpuFunctionGroupErr := writeBuffer.WriteUint8("cpuFunctionGroup", 4, uint8((cpuFunctionGroup))) if _cpuFunctionGroupErr != nil { return errors.Wrap(_cpuFunctionGroupErr, "Error serializing 'cpuFunctionGroup' field") } // Simple Field (currentMode) currentMode := uint8(m.GetCurrentMode()) - _currentModeErr := writeBuffer.WriteUint8("currentMode", 8, (currentMode)) + _currentModeErr := writeBuffer.WriteUint8("currentMode", 8, uint8((currentMode))) if _currentModeErr != nil { return errors.Wrap(_currentModeErr, "Error serializing 'currentMode' field") } // Simple Field (sequenceNumber) sequenceNumber := uint8(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, uint8((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarRequest.go b/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarRequest.go index 3becf027fa4..a3fdedb5591 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarRequest.go @@ -220,7 +220,7 @@ func (m *_S7ParameterReadVarRequest) SerializeWithWriteBuffer(ctx context.Contex // Implicit Field (numItems) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numItems := uint8(uint8(len(m.GetItems()))) - _numItemsErr := writeBuffer.WriteUint8("numItems", 8, (numItems)) + _numItemsErr := writeBuffer.WriteUint8("numItems", 8, uint8((numItems))) if _numItemsErr != nil { return errors.Wrap(_numItemsErr, "Error serializing 'numItems' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarResponse.go b/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarResponse.go index 8112ffd6327..65ed59d8620 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterReadVarResponse.go @@ -183,7 +183,7 @@ func (m *_S7ParameterReadVarResponse) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (numItems) numItems := uint8(m.GetNumItems()) - _numItemsErr := writeBuffer.WriteUint8("numItems", 8, (numItems)) + _numItemsErr := writeBuffer.WriteUint8("numItems", 8, uint8((numItems))) if _numItemsErr != nil { return errors.Wrap(_numItemsErr, "Error serializing 'numItems' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterSetupCommunication.go b/plc4go/protocols/s7/readwrite/model/S7ParameterSetupCommunication.go index 82e9d731290..b08582027c8 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterSetupCommunication.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterSetupCommunication.go @@ -252,7 +252,7 @@ func (m *_S7ParameterSetupCommunication) SerializeWithWriteBuffer(ctx context.Co }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -260,21 +260,21 @@ func (m *_S7ParameterSetupCommunication) SerializeWithWriteBuffer(ctx context.Co // Simple Field (maxAmqCaller) maxAmqCaller := uint16(m.GetMaxAmqCaller()) - _maxAmqCallerErr := writeBuffer.WriteUint16("maxAmqCaller", 16, (maxAmqCaller)) + _maxAmqCallerErr := writeBuffer.WriteUint16("maxAmqCaller", 16, uint16((maxAmqCaller))) if _maxAmqCallerErr != nil { return errors.Wrap(_maxAmqCallerErr, "Error serializing 'maxAmqCaller' field") } // Simple Field (maxAmqCallee) maxAmqCallee := uint16(m.GetMaxAmqCallee()) - _maxAmqCalleeErr := writeBuffer.WriteUint16("maxAmqCallee", 16, (maxAmqCallee)) + _maxAmqCalleeErr := writeBuffer.WriteUint16("maxAmqCallee", 16, uint16((maxAmqCallee))) if _maxAmqCalleeErr != nil { return errors.Wrap(_maxAmqCalleeErr, "Error serializing 'maxAmqCallee' field") } // Simple Field (pduLength) pduLength := uint16(m.GetPduLength()) - _pduLengthErr := writeBuffer.WriteUint16("pduLength", 16, (pduLength)) + _pduLengthErr := writeBuffer.WriteUint16("pduLength", 16, uint16((pduLength))) if _pduLengthErr != nil { return errors.Wrap(_pduLengthErr, "Error serializing 'pduLength' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterUserData.go b/plc4go/protocols/s7/readwrite/model/S7ParameterUserData.go index 0fe44247c1b..fce47e84ae1 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterUserData.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterUserData.go @@ -220,7 +220,7 @@ func (m *_S7ParameterUserData) SerializeWithWriteBuffer(ctx context.Context, wri // Implicit Field (numItems) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numItems := uint8(uint8(len(m.GetItems()))) - _numItemsErr := writeBuffer.WriteUint8("numItems", 8, (numItems)) + _numItemsErr := writeBuffer.WriteUint8("numItems", 8, uint8((numItems))) if _numItemsErr != nil { return errors.Wrap(_numItemsErr, "Error serializing 'numItems' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItem.go b/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItem.go index eb9cd813088..f9faa94ae96 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItem.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItem.go @@ -166,7 +166,7 @@ func (pm *_S7ParameterUserDataItem) SerializeParent(ctx context.Context, writeBu // Discriminator Field (itemType) (Used as input to a switch field) itemType := uint8(child.GetItemType()) - _itemTypeErr := writeBuffer.WriteUint8("itemType", 8, (itemType)) + _itemTypeErr := writeBuffer.WriteUint8("itemType", 8, uint8((itemType))) if _itemTypeErr != nil { return errors.Wrap(_itemTypeErr, "Error serializing 'itemType' field") diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItemCPUFunctions.go b/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItemCPUFunctions.go index afbad6c250e..651f3ade9b5 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItemCPUFunctions.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterUserDataItemCPUFunctions.go @@ -337,42 +337,42 @@ func (m *_S7ParameterUserDataItemCPUFunctions) SerializeWithWriteBuffer(ctx cont // Implicit Field (itemLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) itemLength := uint8(uint8(uint8(m.GetLengthInBytes(ctx))) - uint8(uint8(2))) - _itemLengthErr := writeBuffer.WriteUint8("itemLength", 8, (itemLength)) + _itemLengthErr := writeBuffer.WriteUint8("itemLength", 8, uint8((itemLength))) if _itemLengthErr != nil { return errors.Wrap(_itemLengthErr, "Error serializing 'itemLength' field") } // Simple Field (method) method := uint8(m.GetMethod()) - _methodErr := writeBuffer.WriteUint8("method", 8, (method)) + _methodErr := writeBuffer.WriteUint8("method", 8, uint8((method))) if _methodErr != nil { return errors.Wrap(_methodErr, "Error serializing 'method' field") } // Simple Field (cpuFunctionType) cpuFunctionType := uint8(m.GetCpuFunctionType()) - _cpuFunctionTypeErr := writeBuffer.WriteUint8("cpuFunctionType", 4, (cpuFunctionType)) + _cpuFunctionTypeErr := writeBuffer.WriteUint8("cpuFunctionType", 4, uint8((cpuFunctionType))) if _cpuFunctionTypeErr != nil { return errors.Wrap(_cpuFunctionTypeErr, "Error serializing 'cpuFunctionType' field") } // Simple Field (cpuFunctionGroup) cpuFunctionGroup := uint8(m.GetCpuFunctionGroup()) - _cpuFunctionGroupErr := writeBuffer.WriteUint8("cpuFunctionGroup", 4, (cpuFunctionGroup)) + _cpuFunctionGroupErr := writeBuffer.WriteUint8("cpuFunctionGroup", 4, uint8((cpuFunctionGroup))) if _cpuFunctionGroupErr != nil { return errors.Wrap(_cpuFunctionGroupErr, "Error serializing 'cpuFunctionGroup' field") } // Simple Field (cpuSubfunction) cpuSubfunction := uint8(m.GetCpuSubfunction()) - _cpuSubfunctionErr := writeBuffer.WriteUint8("cpuSubfunction", 8, (cpuSubfunction)) + _cpuSubfunctionErr := writeBuffer.WriteUint8("cpuSubfunction", 8, uint8((cpuSubfunction))) if _cpuSubfunctionErr != nil { return errors.Wrap(_cpuSubfunctionErr, "Error serializing 'cpuSubfunction' field") } // Simple Field (sequenceNumber) sequenceNumber := uint8(m.GetSequenceNumber()) - _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, (sequenceNumber)) + _sequenceNumberErr := writeBuffer.WriteUint8("sequenceNumber", 8, uint8((sequenceNumber))) if _sequenceNumberErr != nil { return errors.Wrap(_sequenceNumberErr, "Error serializing 'sequenceNumber' field") } @@ -381,7 +381,7 @@ func (m *_S7ParameterUserDataItemCPUFunctions) SerializeWithWriteBuffer(ctx cont var dataUnitReferenceNumber *uint8 = nil if m.GetDataUnitReferenceNumber() != nil { dataUnitReferenceNumber = m.GetDataUnitReferenceNumber() - _dataUnitReferenceNumberErr := writeBuffer.WriteUint8("dataUnitReferenceNumber", 8, *(dataUnitReferenceNumber)) + _dataUnitReferenceNumberErr := writeBuffer.WriteUint8("dataUnitReferenceNumber", 8, uint8(*(dataUnitReferenceNumber))) if _dataUnitReferenceNumberErr != nil { return errors.Wrap(_dataUnitReferenceNumberErr, "Error serializing 'dataUnitReferenceNumber' field") } @@ -391,7 +391,7 @@ func (m *_S7ParameterUserDataItemCPUFunctions) SerializeWithWriteBuffer(ctx cont var lastDataUnit *uint8 = nil if m.GetLastDataUnit() != nil { lastDataUnit = m.GetLastDataUnit() - _lastDataUnitErr := writeBuffer.WriteUint8("lastDataUnit", 8, *(lastDataUnit)) + _lastDataUnitErr := writeBuffer.WriteUint8("lastDataUnit", 8, uint8(*(lastDataUnit))) if _lastDataUnitErr != nil { return errors.Wrap(_lastDataUnitErr, "Error serializing 'lastDataUnit' field") } @@ -401,7 +401,7 @@ func (m *_S7ParameterUserDataItemCPUFunctions) SerializeWithWriteBuffer(ctx cont var errorCode *uint16 = nil if m.GetErrorCode() != nil { errorCode = m.GetErrorCode() - _errorCodeErr := writeBuffer.WriteUint16("errorCode", 16, *(errorCode)) + _errorCodeErr := writeBuffer.WriteUint16("errorCode", 16, uint16(*(errorCode))) if _errorCodeErr != nil { return errors.Wrap(_errorCodeErr, "Error serializing 'errorCode' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarRequest.go b/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarRequest.go index 2551bba4e4a..a26920cc541 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarRequest.go @@ -220,7 +220,7 @@ func (m *_S7ParameterWriteVarRequest) SerializeWithWriteBuffer(ctx context.Conte // Implicit Field (numItems) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numItems := uint8(uint8(len(m.GetItems()))) - _numItemsErr := writeBuffer.WriteUint8("numItems", 8, (numItems)) + _numItemsErr := writeBuffer.WriteUint8("numItems", 8, uint8((numItems))) if _numItemsErr != nil { return errors.Wrap(_numItemsErr, "Error serializing 'numItems' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarResponse.go b/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarResponse.go index 4420708917c..35382186bbf 100644 --- a/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7ParameterWriteVarResponse.go @@ -183,7 +183,7 @@ func (m *_S7ParameterWriteVarResponse) SerializeWithWriteBuffer(ctx context.Cont // Simple Field (numItems) numItems := uint8(m.GetNumItems()) - _numItemsErr := writeBuffer.WriteUint8("numItems", 8, (numItems)) + _numItemsErr := writeBuffer.WriteUint8("numItems", 8, uint8((numItems))) if _numItemsErr != nil { return errors.Wrap(_numItemsErr, "Error serializing 'numItems' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadDiagnosticMessage.go b/plc4go/protocols/s7/readwrite/model/S7PayloadDiagnosticMessage.go index 13154ebae8e..783f99f39df 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadDiagnosticMessage.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadDiagnosticMessage.go @@ -311,42 +311,42 @@ func (m *_S7PayloadDiagnosticMessage) SerializeWithWriteBuffer(ctx context.Conte // Simple Field (EventId) EventId := uint16(m.GetEventId()) - _EventIdErr := writeBuffer.WriteUint16("EventId", 16, (EventId)) + _EventIdErr := writeBuffer.WriteUint16("EventId", 16, uint16((EventId))) if _EventIdErr != nil { return errors.Wrap(_EventIdErr, "Error serializing 'EventId' field") } // Simple Field (PriorityClass) PriorityClass := uint8(m.GetPriorityClass()) - _PriorityClassErr := writeBuffer.WriteUint8("PriorityClass", 8, (PriorityClass)) + _PriorityClassErr := writeBuffer.WriteUint8("PriorityClass", 8, uint8((PriorityClass))) if _PriorityClassErr != nil { return errors.Wrap(_PriorityClassErr, "Error serializing 'PriorityClass' field") } // Simple Field (ObNumber) ObNumber := uint8(m.GetObNumber()) - _ObNumberErr := writeBuffer.WriteUint8("ObNumber", 8, (ObNumber)) + _ObNumberErr := writeBuffer.WriteUint8("ObNumber", 8, uint8((ObNumber))) if _ObNumberErr != nil { return errors.Wrap(_ObNumberErr, "Error serializing 'ObNumber' field") } // Simple Field (DatId) DatId := uint16(m.GetDatId()) - _DatIdErr := writeBuffer.WriteUint16("DatId", 16, (DatId)) + _DatIdErr := writeBuffer.WriteUint16("DatId", 16, uint16((DatId))) if _DatIdErr != nil { return errors.Wrap(_DatIdErr, "Error serializing 'DatId' field") } // Simple Field (Info1) Info1 := uint16(m.GetInfo1()) - _Info1Err := writeBuffer.WriteUint16("Info1", 16, (Info1)) + _Info1Err := writeBuffer.WriteUint16("Info1", 16, uint16((Info1))) if _Info1Err != nil { return errors.Wrap(_Info1Err, "Error serializing 'Info1' field") } // Simple Field (Info2) Info2 := uint32(m.GetInfo2()) - _Info2Err := writeBuffer.WriteUint32("Info2", 32, (Info2)) + _Info2Err := writeBuffer.WriteUint32("Info2", 32, uint32((Info2))) if _Info2Err != nil { return errors.Wrap(_Info2Err, "Error serializing 'Info2' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItem.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItem.go index a4b2d0bca87..e91d86431d1 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItem.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItem.go @@ -328,7 +328,7 @@ func (pm *_S7PayloadUserDataItem) SerializeParent(ctx context.Context, writeBuff // Simple Field (dataLength) dataLength := uint16(m.GetDataLength()) - _dataLengthErr := writeBuffer.WriteUint16("dataLength", 16, (dataLength)) + _dataLengthErr := writeBuffer.WriteUint16("dataLength", 16, uint16((dataLength))) if _dataLengthErr != nil { return errors.Wrap(_dataLengthErr, "Error serializing 'dataLength' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkFResponse.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkFResponse.go index b6f300b88cc..77655796000 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkFResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkFResponse.go @@ -235,14 +235,14 @@ func (m *_S7PayloadUserDataItemClkFResponse) SerializeWithWriteBuffer(ctx contex // Simple Field (Reserved) Reserved := uint8(m.GetReserved()) - _ReservedErr := writeBuffer.WriteUint8("Reserved", 8, (Reserved)) + _ReservedErr := writeBuffer.WriteUint8("Reserved", 8, uint8((Reserved))) if _ReservedErr != nil { return errors.Wrap(_ReservedErr, "Error serializing 'Reserved' field") } // Simple Field (Year1) Year1 := uint8(m.GetYear1()) - _Year1Err := writeBuffer.WriteUint8("Year1", 8, (Year1)) + _Year1Err := writeBuffer.WriteUint8("Year1", 8, uint8((Year1))) if _Year1Err != nil { return errors.Wrap(_Year1Err, "Error serializing 'Year1' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkResponse.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkResponse.go index 0910085d8dc..1f6e57b95a3 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkResponse.go @@ -235,14 +235,14 @@ func (m *_S7PayloadUserDataItemClkResponse) SerializeWithWriteBuffer(ctx context // Simple Field (Reserved) Reserved := uint8(m.GetReserved()) - _ReservedErr := writeBuffer.WriteUint8("Reserved", 8, (Reserved)) + _ReservedErr := writeBuffer.WriteUint8("Reserved", 8, uint8((Reserved))) if _ReservedErr != nil { return errors.Wrap(_ReservedErr, "Error serializing 'Reserved' field") } // Simple Field (Year1) Year1 := uint8(m.GetYear1()) - _Year1Err := writeBuffer.WriteUint8("Year1", 8, (Year1)) + _Year1Err := writeBuffer.WriteUint8("Year1", 8, uint8((Year1))) if _Year1Err != nil { return errors.Wrap(_Year1Err, "Error serializing 'Year1' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkSetRequest.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkSetRequest.go index b280a0f43cd..74cc05224d2 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkSetRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemClkSetRequest.go @@ -250,7 +250,7 @@ func (m *_S7PayloadUserDataItemClkSetRequest) SerializeWithWriteBuffer(ctx conte }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -266,7 +266,7 @@ func (m *_S7PayloadUserDataItemClkSetRequest) SerializeWithWriteBuffer(ctx conte }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.go index 26275996018..501bb4e93d2 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.go @@ -255,14 +255,14 @@ func (m *_S7PayloadUserDataItemCpuFunctionAlarmAckRequest) SerializeWithWriteBuf } // Const Field (functionId) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, 0x09) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8(0x09)) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Implicit Field (numberOfObjects) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numberOfObjects := uint8(uint8(len(m.GetMessageObjects()))) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.go index 30164eebf0b..a1917a43dc1 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.go @@ -242,14 +242,14 @@ func (m *_S7PayloadUserDataItemCpuFunctionAlarmAckResponse) SerializeWithWriteBu // Simple Field (functionId) functionId := uint8(m.GetFunctionId()) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, (functionId)) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8((functionId))) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Implicit Field (numberOfObjects) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) numberOfObjects := uint8(uint8(len(m.GetMessageObjects()))) - _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, (numberOfObjects)) + _numberOfObjectsErr := writeBuffer.WriteUint8("numberOfObjects", 8, uint8((numberOfObjects))) if _numberOfObjectsErr != nil { return errors.Wrap(_numberOfObjectsErr, "Error serializing 'numberOfObjects' field") } @@ -260,7 +260,7 @@ func (m *_S7PayloadUserDataItemCpuFunctionAlarmAckResponse) SerializeWithWriteBu } for _curItem, _element := range m.GetMessageObjects() { _ = _curItem - _elementErr := writeBuffer.WriteUint8("", 8, _element) + _elementErr := writeBuffer.WriteUint8("", 8, uint8(_element)) if _elementErr != nil { return errors.Wrap(_elementErr, "Error serializing 'messageObjects' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.go index 59237c6f466..bf26ba4aab4 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.go @@ -370,25 +370,25 @@ func (m *_S7PayloadUserDataItemCpuFunctionAlarmQueryRequest) SerializeWithWriteB } // Const Field (functionId) - _functionIdErr := writeBuffer.WriteUint8("functionId", 8, 0x00) + _functionIdErr := writeBuffer.WriteUint8("functionId", 8, uint8(0x00)) if _functionIdErr != nil { return errors.Wrap(_functionIdErr, "Error serializing 'functionId' field") } // Const Field (numberMessageObj) - _numberMessageObjErr := writeBuffer.WriteUint8("numberMessageObj", 8, 0x01) + _numberMessageObjErr := writeBuffer.WriteUint8("numberMessageObj", 8, uint8(0x01)) if _numberMessageObjErr != nil { return errors.Wrap(_numberMessageObjErr, "Error serializing 'numberMessageObj' field") } // Const Field (variableSpec) - _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, 0x12) + _variableSpecErr := writeBuffer.WriteUint8("variableSpec", 8, uint8(0x12)) if _variableSpecErr != nil { return errors.Wrap(_variableSpecErr, "Error serializing 'variableSpec' field") } // Const Field (length) - _lengthErr := writeBuffer.WriteUint8("length", 8, 0x08) + _lengthErr := writeBuffer.WriteUint8("length", 8, uint8(0x08)) if _lengthErr != nil { return errors.Wrap(_lengthErr, "Error serializing 'length' field") } @@ -415,7 +415,7 @@ func (m *_S7PayloadUserDataItemCpuFunctionAlarmQueryRequest) SerializeWithWriteB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -443,7 +443,7 @@ func (m *_S7PayloadUserDataItemCpuFunctionAlarmQueryRequest) SerializeWithWriteB }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField1 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.go index b2707334c06..0769ba45aba 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.go @@ -273,14 +273,14 @@ func (m *_S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse) Serializ // Simple Field (result) result := uint8(m.GetResult()) - _resultErr := writeBuffer.WriteUint8("result", 8, (result)) + _resultErr := writeBuffer.WriteUint8("result", 8, uint8((result))) if _resultErr != nil { return errors.Wrap(_resultErr, "Error serializing 'result' field") } // Simple Field (reserved01) reserved01 := uint8(m.GetReserved01()) - _reserved01Err := writeBuffer.WriteUint8("reserved01", 8, (reserved01)) + _reserved01Err := writeBuffer.WriteUint8("reserved01", 8, uint8((reserved01))) if _reserved01Err != nil { return errors.Wrap(_reserved01Err, "Error serializing 'reserved01' field") } @@ -299,14 +299,14 @@ func (m *_S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse) Serializ // Simple Field (reserved02) reserved02 := uint8(m.GetReserved02()) - _reserved02Err := writeBuffer.WriteUint8("reserved02", 8, (reserved02)) + _reserved02Err := writeBuffer.WriteUint8("reserved02", 8, uint8((reserved02))) if _reserved02Err != nil { return errors.Wrap(_reserved02Err, "Error serializing 'reserved02' field") } // Simple Field (reserved03) reserved03 := uint8(m.GetReserved03()) - _reserved03Err := writeBuffer.WriteUint8("reserved03", 8, (reserved03)) + _reserved03Err := writeBuffer.WriteUint8("reserved03", 8, uint8((reserved03))) if _reserved03Err != nil { return errors.Wrap(_reserved03Err, "Error serializing 'reserved03' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.go index 79d2a32fdf0..d98ac5d1648 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.go @@ -287,7 +287,7 @@ func (m *_S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest) SerializeWithW // Simple Field (Subscription) Subscription := uint8(m.GetSubscription()) - _SubscriptionErr := writeBuffer.WriteUint8("Subscription", 8, (Subscription)) + _SubscriptionErr := writeBuffer.WriteUint8("Subscription", 8, uint8((Subscription))) if _SubscriptionErr != nil { return errors.Wrap(_SubscriptionErr, "Error serializing 'Subscription' field") } @@ -302,7 +302,7 @@ func (m *_S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest) SerializeWithW }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -335,7 +335,7 @@ func (m *_S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest) SerializeWithW var Reserve *uint8 = nil if m.GetReserve() != nil { Reserve = m.GetReserve() - _ReserveErr := writeBuffer.WriteUint8("Reserve", 8, *(Reserve)) + _ReserveErr := writeBuffer.WriteUint8("Reserve", 8, uint8(*(Reserve))) if _ReserveErr != nil { return errors.Wrap(_ReserveErr, "Error serializing 'Reserve' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.go index c6fcbe94d41..ea6938c1b7b 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.go @@ -210,14 +210,14 @@ func (m *_S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse) SerializeW // Simple Field (result) result := uint8(m.GetResult()) - _resultErr := writeBuffer.WriteUint8("result", 8, (result)) + _resultErr := writeBuffer.WriteUint8("result", 8, uint8((result))) if _resultErr != nil { return errors.Wrap(_resultErr, "Error serializing 'result' field") } // Simple Field (reserved01) reserved01 := uint8(m.GetReserved01()) - _reserved01Err := writeBuffer.WriteUint8("reserved01", 8, (reserved01)) + _reserved01Err := writeBuffer.WriteUint8("reserved01", 8, uint8((reserved01))) if _reserved01Err != nil { return errors.Wrap(_reserved01Err, "Error serializing 'reserved01' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionReadSzlRequest.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionReadSzlRequest.go index 916e1ff853f..bf917bf270d 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionReadSzlRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCpuFunctionReadSzlRequest.go @@ -228,7 +228,7 @@ func (m *_S7PayloadUserDataItemCpuFunctionReadSzlRequest) SerializeWithWriteBuff // Simple Field (szlIndex) szlIndex := uint16(m.GetSzlIndex()) - _szlIndexErr := writeBuffer.WriteUint16("szlIndex", 16, (szlIndex)) + _szlIndexErr := writeBuffer.WriteUint16("szlIndex", 16, uint16((szlIndex))) if _szlIndexErr != nil { return errors.Wrap(_szlIndexErr, "Error serializing 'szlIndex' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.go index 5e03e0ca7b1..1d9e981b379 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.go @@ -237,7 +237,7 @@ func (m *_S7PayloadUserDataItemCyclicServicesChangeDrivenPush) SerializeWithWrit // Simple Field (itemsCount) itemsCount := uint16(m.GetItemsCount()) - _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, (itemsCount)) + _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, uint16((itemsCount))) if _itemsCountErr != nil { return errors.Wrap(_itemsCountErr, "Error serializing 'itemsCount' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.go index 967cf95b827..b44e0d73c2e 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.go @@ -237,7 +237,7 @@ func (m *_S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse) Seri // Simple Field (itemsCount) itemsCount := uint16(m.GetItemsCount()) - _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, (itemsCount)) + _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, uint16((itemsCount))) if _itemsCountErr != nil { return errors.Wrap(_itemsCountErr, "Error serializing 'itemsCount' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesPush.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesPush.go index 42aaef2876f..1ecc24d9fed 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesPush.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesPush.go @@ -237,7 +237,7 @@ func (m *_S7PayloadUserDataItemCyclicServicesPush) SerializeWithWriteBuffer(ctx // Simple Field (itemsCount) itemsCount := uint16(m.GetItemsCount()) - _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, (itemsCount)) + _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, uint16((itemsCount))) if _itemsCountErr != nil { return errors.Wrap(_itemsCountErr, "Error serializing 'itemsCount' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeRequest.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeRequest.go index e886ce6af3d..838e9eab347 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeRequest.go @@ -281,7 +281,7 @@ func (m *_S7PayloadUserDataItemCyclicServicesSubscribeRequest) SerializeWithWrit // Simple Field (itemsCount) itemsCount := uint16(m.GetItemsCount()) - _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, (itemsCount)) + _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, uint16((itemsCount))) if _itemsCountErr != nil { return errors.Wrap(_itemsCountErr, "Error serializing 'itemsCount' field") } @@ -300,7 +300,7 @@ func (m *_S7PayloadUserDataItemCyclicServicesSubscribeRequest) SerializeWithWrit // Simple Field (timeFactor) timeFactor := uint8(m.GetTimeFactor()) - _timeFactorErr := writeBuffer.WriteUint8("timeFactor", 8, (timeFactor)) + _timeFactorErr := writeBuffer.WriteUint8("timeFactor", 8, uint8((timeFactor))) if _timeFactorErr != nil { return errors.Wrap(_timeFactorErr, "Error serializing 'timeFactor' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeResponse.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeResponse.go index 4eb7d21c6a5..4ce358aa7cd 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeResponse.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesSubscribeResponse.go @@ -237,7 +237,7 @@ func (m *_S7PayloadUserDataItemCyclicServicesSubscribeResponse) SerializeWithWri // Simple Field (itemsCount) itemsCount := uint16(m.GetItemsCount()) - _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, (itemsCount)) + _itemsCountErr := writeBuffer.WriteUint16("itemsCount", 16, uint16((itemsCount))) if _itemsCountErr != nil { return errors.Wrap(_itemsCountErr, "Error serializing 'itemsCount' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.go b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.go index ce197c62ac4..dd30e6c759d 100644 --- a/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.go +++ b/plc4go/protocols/s7/readwrite/model/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.go @@ -210,14 +210,14 @@ func (m *_S7PayloadUserDataItemCyclicServicesUnsubscribeRequest) SerializeWithWr // Simple Field (function) function := uint8(m.GetFunction()) - _functionErr := writeBuffer.WriteUint8("function", 8, (function)) + _functionErr := writeBuffer.WriteUint8("function", 8, uint8((function))) if _functionErr != nil { return errors.Wrap(_functionErr, "Error serializing 'function' field") } // Simple Field (jobId) jobId := uint8(m.GetJobId()) - _jobIdErr := writeBuffer.WriteUint8("jobId", 8, (jobId)) + _jobIdErr := writeBuffer.WriteUint8("jobId", 8, uint8((jobId))) if _jobIdErr != nil { return errors.Wrap(_jobIdErr, "Error serializing 'jobId' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7VarPayloadDataItem.go b/plc4go/protocols/s7/readwrite/model/S7VarPayloadDataItem.go index f5bd9f0f86c..d611b4e2f11 100644 --- a/plc4go/protocols/s7/readwrite/model/S7VarPayloadDataItem.go +++ b/plc4go/protocols/s7/readwrite/model/S7VarPayloadDataItem.go @@ -258,7 +258,7 @@ func (m *_S7VarPayloadDataItem) SerializeWithWriteBuffer(ctx context.Context, wr dataLength := uint16(uint16(uint16(len(m.GetData()))) * uint16((utils.InlineIf((bool((m.GetTransportSize()) == (DataTransportSize_BIT))), func() any { return uint16(uint16(1)) }, func() any { return uint16((utils.InlineIf(m.GetTransportSize().SizeInBits(), func() any { return uint16(uint16(8)) }, func() any { return uint16(uint16(1)) }).(uint16))) }).(uint16)))) - _dataLengthErr := writeBuffer.WriteUint16("dataLength", 16, (dataLength)) + _dataLengthErr := writeBuffer.WriteUint16("dataLength", 16, uint16((dataLength))) if _dataLengthErr != nil { return errors.Wrap(_dataLengthErr, "Error serializing 'dataLength' field") } @@ -277,7 +277,7 @@ func (m *_S7VarPayloadDataItem) SerializeWithWriteBuffer(ctx context.Context, wr _timesPadding := uint8(utils.InlineIf((!(utils.GetLastItemFromContext(ctx))), func() any { return int32((int32(int32(len(m.GetData()))) % int32(int32(2)))) }, func() any { return int32(int32(0)) }).(int32)) for ; _timesPadding > 0; _timesPadding-- { _paddingValue := uint8(0x00) - _paddingErr := writeBuffer.WriteUint8("", 8, (_paddingValue)) + _paddingErr := writeBuffer.WriteUint8("", 8, uint8((_paddingValue))) if _paddingErr != nil { return errors.Wrap(_paddingErr, "Error serializing 'padding' field") } diff --git a/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItem.go b/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItem.go index 08d7bcae2f2..db4164fe7d4 100644 --- a/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItem.go +++ b/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItem.go @@ -166,7 +166,7 @@ func (pm *_S7VarRequestParameterItem) SerializeParent(ctx context.Context, write // Discriminator Field (itemType) (Used as input to a switch field) itemType := uint8(child.GetItemType()) - _itemTypeErr := writeBuffer.WriteUint8("itemType", 8, (itemType)) + _itemTypeErr := writeBuffer.WriteUint8("itemType", 8, uint8((itemType))) if _itemTypeErr != nil { return errors.Wrap(_itemTypeErr, "Error serializing 'itemType' field") diff --git a/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItemAddress.go b/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItemAddress.go index afb80067edd..2410f121ac7 100644 --- a/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItemAddress.go +++ b/plc4go/protocols/s7/readwrite/model/S7VarRequestParameterItemAddress.go @@ -195,7 +195,7 @@ func (m *_S7VarRequestParameterItemAddress) SerializeWithWriteBuffer(ctx context // Implicit Field (itemLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) itemLength := uint8(m.GetAddress().GetLengthInBytes(ctx)) - _itemLengthErr := writeBuffer.WriteUint8("itemLength", 8, (itemLength)) + _itemLengthErr := writeBuffer.WriteUint8("itemLength", 8, uint8((itemLength))) if _itemLengthErr != nil { return errors.Wrap(_itemLengthErr, "Error serializing 'itemLength' field") } diff --git a/plc4go/protocols/s7/readwrite/model/SubItem.go b/plc4go/protocols/s7/readwrite/model/SubItem.go index 4c798f84125..9f6e9532f36 100644 --- a/plc4go/protocols/s7/readwrite/model/SubItem.go +++ b/plc4go/protocols/s7/readwrite/model/SubItem.go @@ -184,21 +184,21 @@ func (m *_SubItem) SerializeWithWriteBuffer(ctx context.Context, writeBuffer uti // Simple Field (bytesToRead) bytesToRead := uint8(m.GetBytesToRead()) - _bytesToReadErr := writeBuffer.WriteUint8("bytesToRead", 8, (bytesToRead)) + _bytesToReadErr := writeBuffer.WriteUint8("bytesToRead", 8, uint8((bytesToRead))) if _bytesToReadErr != nil { return errors.Wrap(_bytesToReadErr, "Error serializing 'bytesToRead' field") } // Simple Field (dbNumber) dbNumber := uint16(m.GetDbNumber()) - _dbNumberErr := writeBuffer.WriteUint16("dbNumber", 16, (dbNumber)) + _dbNumberErr := writeBuffer.WriteUint16("dbNumber", 16, uint16((dbNumber))) if _dbNumberErr != nil { return errors.Wrap(_dbNumberErr, "Error serializing 'dbNumber' field") } // Simple Field (startAddress) startAddress := uint16(m.GetStartAddress()) - _startAddressErr := writeBuffer.WriteUint16("startAddress", 16, (startAddress)) + _startAddressErr := writeBuffer.WriteUint16("startAddress", 16, uint16((startAddress))) if _startAddressErr != nil { return errors.Wrap(_startAddressErr, "Error serializing 'startAddress' field") } diff --git a/plc4go/protocols/s7/readwrite/model/SyntaxIdType.go b/plc4go/protocols/s7/readwrite/model/SyntaxIdType.go index b56c297b1c6..34c84c199ac 100644 --- a/plc4go/protocols/s7/readwrite/model/SyntaxIdType.go +++ b/plc4go/protocols/s7/readwrite/model/SyntaxIdType.go @@ -198,7 +198,7 @@ func (e SyntaxIdType) Serialize() ([]byte, error) { func (e SyntaxIdType) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SyntaxIdType", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SyntaxIdType", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/SzlDataTreeItem.go b/plc4go/protocols/s7/readwrite/model/SzlDataTreeItem.go index 5a8a074a0a3..96a01fe1f28 100644 --- a/plc4go/protocols/s7/readwrite/model/SzlDataTreeItem.go +++ b/plc4go/protocols/s7/readwrite/model/SzlDataTreeItem.go @@ -221,7 +221,7 @@ func (m *_SzlDataTreeItem) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (itemIndex) itemIndex := uint16(m.GetItemIndex()) - _itemIndexErr := writeBuffer.WriteUint16("itemIndex", 16, (itemIndex)) + _itemIndexErr := writeBuffer.WriteUint16("itemIndex", 16, uint16((itemIndex))) if _itemIndexErr != nil { return errors.Wrap(_itemIndexErr, "Error serializing 'itemIndex' field") } @@ -234,21 +234,21 @@ func (m *_SzlDataTreeItem) SerializeWithWriteBuffer(ctx context.Context, writeBu // Simple Field (moduleTypeId) moduleTypeId := uint16(m.GetModuleTypeId()) - _moduleTypeIdErr := writeBuffer.WriteUint16("moduleTypeId", 16, (moduleTypeId)) + _moduleTypeIdErr := writeBuffer.WriteUint16("moduleTypeId", 16, uint16((moduleTypeId))) if _moduleTypeIdErr != nil { return errors.Wrap(_moduleTypeIdErr, "Error serializing 'moduleTypeId' field") } // Simple Field (ausbg) ausbg := uint16(m.GetAusbg()) - _ausbgErr := writeBuffer.WriteUint16("ausbg", 16, (ausbg)) + _ausbgErr := writeBuffer.WriteUint16("ausbg", 16, uint16((ausbg))) if _ausbgErr != nil { return errors.Wrap(_ausbgErr, "Error serializing 'ausbg' field") } // Simple Field (ausbe) ausbe := uint16(m.GetAusbe()) - _ausbeErr := writeBuffer.WriteUint16("ausbe", 16, (ausbe)) + _ausbeErr := writeBuffer.WriteUint16("ausbe", 16, uint16((ausbe))) if _ausbeErr != nil { return errors.Wrap(_ausbeErr, "Error serializing 'ausbe' field") } diff --git a/plc4go/protocols/s7/readwrite/model/SzlId.go b/plc4go/protocols/s7/readwrite/model/SzlId.go index fc3f1024aa5..ddfb55a0ddc 100644 --- a/plc4go/protocols/s7/readwrite/model/SzlId.go +++ b/plc4go/protocols/s7/readwrite/model/SzlId.go @@ -208,7 +208,7 @@ func (m *_SzlId) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils // Simple Field (sublistExtract) sublistExtract := uint8(m.GetSublistExtract()) - _sublistExtractErr := writeBuffer.WriteUint8("sublistExtract", 4, (sublistExtract)) + _sublistExtractErr := writeBuffer.WriteUint8("sublistExtract", 4, uint8((sublistExtract))) if _sublistExtractErr != nil { return errors.Wrap(_sublistExtractErr, "Error serializing 'sublistExtract' field") } diff --git a/plc4go/protocols/s7/readwrite/model/SzlModuleTypeClass.go b/plc4go/protocols/s7/readwrite/model/SzlModuleTypeClass.go index 07096f0139e..0623c352dfe 100644 --- a/plc4go/protocols/s7/readwrite/model/SzlModuleTypeClass.go +++ b/plc4go/protocols/s7/readwrite/model/SzlModuleTypeClass.go @@ -144,7 +144,7 @@ func (e SzlModuleTypeClass) Serialize() ([]byte, error) { func (e SzlModuleTypeClass) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SzlModuleTypeClass", 4, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SzlModuleTypeClass", 4, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/SzlSublist.go b/plc4go/protocols/s7/readwrite/model/SzlSublist.go index 47b834d751f..d1500188af1 100644 --- a/plc4go/protocols/s7/readwrite/model/SzlSublist.go +++ b/plc4go/protocols/s7/readwrite/model/SzlSublist.go @@ -276,7 +276,7 @@ func (e SzlSublist) Serialize() ([]byte, error) { func (e SzlSublist) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SzlSublist", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SzlSublist", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/TPKTPacket.go b/plc4go/protocols/s7/readwrite/model/TPKTPacket.go index b1adbc0b598..1c3fbb7323c 100644 --- a/plc4go/protocols/s7/readwrite/model/TPKTPacket.go +++ b/plc4go/protocols/s7/readwrite/model/TPKTPacket.go @@ -215,7 +215,7 @@ func (m *_TPKTPacket) SerializeWithWriteBuffer(ctx context.Context, writeBuffer } // Const Field (protocolId) - _protocolIdErr := writeBuffer.WriteUint8("protocolId", 8, 0x03) + _protocolIdErr := writeBuffer.WriteUint8("protocolId", 8, uint8(0x03)) if _protocolIdErr != nil { return errors.Wrap(_protocolIdErr, "Error serializing 'protocolId' field") } @@ -230,7 +230,7 @@ func (m *_TPKTPacket) SerializeWithWriteBuffer(ctx context.Context, writeBuffer }).Msg("Overriding reserved field with unexpected value.") reserved = *m.reservedField0 } - _err := writeBuffer.WriteUint8("reserved", 8, reserved) + _err := writeBuffer.WriteUint8("reserved", 8, uint8(reserved)) if _err != nil { return errors.Wrap(_err, "Error serializing 'reserved' field") } @@ -238,7 +238,7 @@ func (m *_TPKTPacket) SerializeWithWriteBuffer(ctx context.Context, writeBuffer // Implicit Field (len) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content) len := uint16(uint16(m.GetPayload().GetLengthInBytes(ctx)) + uint16(uint16(4))) - _lenErr := writeBuffer.WriteUint16("len", 16, (len)) + _lenErr := writeBuffer.WriteUint16("len", 16, uint16((len))) if _lenErr != nil { return errors.Wrap(_lenErr, "Error serializing 'len' field") } diff --git a/plc4go/protocols/s7/readwrite/model/TimeBase.go b/plc4go/protocols/s7/readwrite/model/TimeBase.go index 142c8eb0311..a340011c3b8 100644 --- a/plc4go/protocols/s7/readwrite/model/TimeBase.go +++ b/plc4go/protocols/s7/readwrite/model/TimeBase.go @@ -138,7 +138,7 @@ func (e TimeBase) Serialize() ([]byte, error) { func (e TimeBase) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TimeBase", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TimeBase", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/s7/readwrite/model/TransportSize.go b/plc4go/protocols/s7/readwrite/model/TransportSize.go index e3d65199f8b..f277353ee5b 100644 --- a/plc4go/protocols/s7/readwrite/model/TransportSize.go +++ b/plc4go/protocols/s7/readwrite/model/TransportSize.go @@ -1628,7 +1628,7 @@ func (e TransportSize) Serialize() ([]byte, error) { func (e TransportSize) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("TransportSize", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("TransportSize", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/protocols/simulated/readwrite/model/DataItem.go b/plc4go/protocols/simulated/readwrite/model/DataItem.go index 80678c62c7a..855ea7d2267 100644 --- a/plc4go/protocols/simulated/readwrite/model/DataItem.go +++ b/plc4go/protocols/simulated/readwrite/model/DataItem.go @@ -436,156 +436,156 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } case dataType == "BYTE" && numberOfValues == uint16(1): // BYTE // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "BYTE": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint8("", 8, value.GetIndex(i).GetUint8()) + _itemErr := writeBuffer.WriteUint8("", 8, uint8(value.GetIndex(i).GetUint8())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "WORD" && numberOfValues == uint16(1): // WORD // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "WORD": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint16("", 16, value.GetIndex(i).GetUint16()) + _itemErr := writeBuffer.WriteUint16("", 16, uint16(value.GetIndex(i).GetUint16())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "DWORD" && numberOfValues == uint16(1): // DWORD // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "DWORD": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint32("", 32, value.GetIndex(i).GetUint32()) + _itemErr := writeBuffer.WriteUint32("", 32, uint32(value.GetIndex(i).GetUint32())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "LWORD" && numberOfValues == uint16(1): // LWORD // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "LWORD": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint64("", 64, value.GetIndex(i).GetUint64()) + _itemErr := writeBuffer.WriteUint64("", 64, uint64(value.GetIndex(i).GetUint64())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "SINT" && numberOfValues == uint16(1): // SINT // Simple Field (value) - if _err := writeBuffer.WriteInt8("value", 8, value.GetInt8()); _err != nil { + if _err := writeBuffer.WriteInt8("value", 8, int8(value.GetInt8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "SINT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt8("", 8, value.GetIndex(i).GetInt8()) + _itemErr := writeBuffer.WriteInt8("", 8, int8(value.GetIndex(i).GetInt8())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "INT" && numberOfValues == uint16(1): // INT // Simple Field (value) - if _err := writeBuffer.WriteInt16("value", 16, value.GetInt16()); _err != nil { + if _err := writeBuffer.WriteInt16("value", 16, int16(value.GetInt16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "INT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt16("", 16, value.GetIndex(i).GetInt16()) + _itemErr := writeBuffer.WriteInt16("", 16, int16(value.GetIndex(i).GetInt16())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "DINT" && numberOfValues == uint16(1): // DINT // Simple Field (value) - if _err := writeBuffer.WriteInt32("value", 32, value.GetInt32()); _err != nil { + if _err := writeBuffer.WriteInt32("value", 32, int32(value.GetInt32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "DINT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt32("", 32, value.GetIndex(i).GetInt32()) + _itemErr := writeBuffer.WriteInt32("", 32, int32(value.GetIndex(i).GetInt32())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "LINT" && numberOfValues == uint16(1): // LINT // Simple Field (value) - if _err := writeBuffer.WriteInt64("value", 64, value.GetInt64()); _err != nil { + if _err := writeBuffer.WriteInt64("value", 64, int64(value.GetInt64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "LINT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteInt64("", 64, value.GetIndex(i).GetInt64()) + _itemErr := writeBuffer.WriteInt64("", 64, int64(value.GetIndex(i).GetInt64())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "USINT" && numberOfValues == uint16(1): // USINT // Simple Field (value) - if _err := writeBuffer.WriteUint8("value", 8, value.GetUint8()); _err != nil { + if _err := writeBuffer.WriteUint8("value", 8, uint8(value.GetUint8())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "USINT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint8("", 8, value.GetIndex(i).GetUint8()) + _itemErr := writeBuffer.WriteUint8("", 8, uint8(value.GetIndex(i).GetUint8())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "UINT" && numberOfValues == uint16(1): // UINT // Simple Field (value) - if _err := writeBuffer.WriteUint16("value", 16, value.GetUint16()); _err != nil { + if _err := writeBuffer.WriteUint16("value", 16, uint16(value.GetUint16())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "UINT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint16("", 16, value.GetIndex(i).GetUint16()) + _itemErr := writeBuffer.WriteUint16("", 16, uint16(value.GetIndex(i).GetUint16())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "UDINT" && numberOfValues == uint16(1): // UDINT // Simple Field (value) - if _err := writeBuffer.WriteUint32("value", 32, value.GetUint32()); _err != nil { + if _err := writeBuffer.WriteUint32("value", 32, uint32(value.GetUint32())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "UDINT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint32("", 32, value.GetIndex(i).GetUint32()) + _itemErr := writeBuffer.WriteUint32("", 32, uint32(value.GetIndex(i).GetUint32())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } } case dataType == "ULINT" && numberOfValues == uint16(1): // ULINT // Simple Field (value) - if _err := writeBuffer.WriteUint64("value", 64, value.GetUint64()); _err != nil { + if _err := writeBuffer.WriteUint64("value", 64, uint64(value.GetUint64())); _err != nil { return errors.Wrap(_err, "Error serializing 'value' field") } case dataType == "ULINT": // List // Array Field (value) for i := uint32(0); i < uint32(m.NumberOfValues); i++ { - _itemErr := writeBuffer.WriteUint64("", 64, value.GetIndex(i).GetUint64()) + _itemErr := writeBuffer.WriteUint64("", 64, uint64(value.GetIndex(i).GetUint64())) if _itemErr != nil { return errors.Wrap(_itemErr, "Error serializing 'value' field") } diff --git a/plc4go/protocols/simulated/readwrite/model/Dummy.go b/plc4go/protocols/simulated/readwrite/model/Dummy.go index a8f64e1f5ae..7a3b8be5ecc 100644 --- a/plc4go/protocols/simulated/readwrite/model/Dummy.go +++ b/plc4go/protocols/simulated/readwrite/model/Dummy.go @@ -149,7 +149,7 @@ func (m *_Dummy) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils // Simple Field (dummy) dummy := uint16(m.GetDummy()) - _dummyErr := writeBuffer.WriteUint16("dummy", 16, (dummy)) + _dummyErr := writeBuffer.WriteUint16("dummy", 16, uint16((dummy))) if _dummyErr != nil { return errors.Wrap(_dummyErr, "Error serializing 'dummy' field") } diff --git a/plc4go/protocols/simulated/readwrite/model/SimulatedDataTypeSizes.go b/plc4go/protocols/simulated/readwrite/model/SimulatedDataTypeSizes.go index ac1addd6126..87c5da1425c 100644 --- a/plc4go/protocols/simulated/readwrite/model/SimulatedDataTypeSizes.go +++ b/plc4go/protocols/simulated/readwrite/model/SimulatedDataTypeSizes.go @@ -408,7 +408,7 @@ func (e SimulatedDataTypeSizes) Serialize() ([]byte, error) { func (e SimulatedDataTypeSizes) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error { log := zerolog.Ctx(ctx) _ = log - return writeBuffer.WriteUint8("SimulatedDataTypeSizes", 8, uint8(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) + return writeBuffer.WriteUint8("SimulatedDataTypeSizes", 8, uint8(uint8(e)), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName())) } // PLC4XEnumName returns the name that is used in code to identify this enum diff --git a/plc4go/spi/values/PlcTIME.go b/plc4go/spi/values/PlcTIME.go index 6ae2756c5ce..fabf14e8c4e 100644 --- a/plc4go/spi/values/PlcTIME.go +++ b/plc4go/spi/values/PlcTIME.go @@ -40,7 +40,7 @@ func NewPlcTIME(value time.Duration) PlcTIME { } } -func NewPlcTIMEFromMilliseconds(milliseconds uint32) PlcTIME { +func NewPlcTIMEFromMilliseconds(milliseconds int64) PlcTIME { return NewPlcTIME(time.Duration(milliseconds) * time.Millisecond) } @@ -53,8 +53,8 @@ func (m PlcTIME) GetRaw() []byte { return theBytes } -func (m PlcTIME) GetMilliseconds() uint32 { - return uint32(m.value.Milliseconds()) +func (m PlcTIME) GetMilliseconds() int64 { + return m.value.Milliseconds() } func (m PlcTIME) IsDuration() bool { diff --git a/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java b/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java index 9b3ef672cf4..2c30a51b67f 100644 --- a/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java +++ b/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java @@ -1667,6 +1667,9 @@ public enum BACnetVendorId { RYOBI_LIMITED((int) 1451, (int) 1451, (String) "Ryobi Limited"), EKKO_SENSE_LTD((int) 1452, (int) 1452, (String) "EkkoSense Ltd"), CLIMA_COOL((int) 1453, (int) 1453, (String) "ClimaCool"), + GRID_CONNECT_INC((int) 1454, (int) 1454, (String) "Grid Connect Inc."), + ZIEGLER_INSTRUMENTATIONUK_LTD((int) 1455, (int) 1455, (String) "Ziegler Instrumentation UK Ltd"), + CONTROL_TECLLC((int) 1456, (int) 1456, (String) "ControlTec, LLC"), UNKNOWN_VENDOR((int) 0xFFFF, (int) 0xFFFF, (String) "Unknown"); private static final Map map; diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java index 051dedaa117..8cbcc67d768 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -180,8 +180,7 @@ public static PlcValue staticParse( } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME // Simple Field (milliseconds) - Long milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readLong("", 32); + Integer milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32); return PlcTIME.ofMilliseconds(milliseconds); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME @@ -365,10 +364,9 @@ public static void staticSerialize( writeBuffer, _value, stringLength, "UTF-16"); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME // Simple Field (milliseconds) - long milliseconds = (long) _value.getLong(); + int milliseconds = (int) _value.getInt(); /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeLong( - "", 32, ((Number) (milliseconds)).longValue()); + /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (milliseconds)).intValue()); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME // Simple Field (nanoseconds) BigInteger nanoseconds = (BigInteger) _value.getBigInteger(); diff --git a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs index ffb0c312d72..cef84d68cb6 100644 --- a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs +++ b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs @@ -675,8 +675,11 @@ public enum KnxManufacturer M_ATOUCH = 648, M_PANASONIC_LIFE_SOLUTIONS_INDIA_PVT__LTD = 649, M_WALLYONS = 650, - M_ABB___RESERVED = 651, - M_BUSCH_JAEGER_ELEKTRO___RESERVED = 652, + M_ZIMMEX = 651, + M_RHOMBUS_EUROPE = 652, + M_TURING_THINK = 653, + M_ABB___RESERVED = 654, + M_BUSCH_JAEGER_ELEKTRO___RESERVED = 655, } public static class KnxManufacturerInfo @@ -2528,10 +2531,19 @@ public static class KnxManufacturerInfo case KnxManufacturer.M_WALLYONS: { /* '650' */ return 708; } - case KnxManufacturer.M_ABB___RESERVED: { /* '651' */ + case KnxManufacturer.M_ZIMMEX: { /* '651' */ + return 709; + } + case KnxManufacturer.M_RHOMBUS_EUROPE: { /* '652' */ + return 710; + } + case KnxManufacturer.M_TURING_THINK: { /* '653' */ + return 711; + } + case KnxManufacturer.M_ABB___RESERVED: { /* '654' */ return 43954; } - case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '652' */ + case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '655' */ return 43959; } case KnxManufacturer.M_RTS_AUTOMATION: { /* '66' */ @@ -4497,10 +4509,19 @@ public static string Name(this KnxManufacturer value) case KnxManufacturer.M_WALLYONS: { /* '650' */ return "WallYons"; } - case KnxManufacturer.M_ABB___RESERVED: { /* '651' */ + case KnxManufacturer.M_ZIMMEX: { /* '651' */ + return "Zimmex"; + } + case KnxManufacturer.M_RHOMBUS_EUROPE: { /* '652' */ + return "Rhombus Europe"; + } + case KnxManufacturer.M_TURING_THINK: { /* '653' */ + return "Turing-Think"; + } + case KnxManufacturer.M_ABB___RESERVED: { /* '654' */ return "ABB - reserved"; } - case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '652' */ + case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '655' */ return "Busch-Jaeger Elektro - reserved"; } case KnxManufacturer.M_RTS_AUTOMATION: { /* '66' */ diff --git a/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec b/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec index 931ea40961e..60c5013226b 100644 --- a/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec +++ b/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec @@ -1466,6 +1466,9 @@ ['1451' RYOBI_LIMITED ['1451', '"Ryobi Limited"']] ['1452' EKKO_SENSE_LTD ['1452', '"EkkoSense Ltd"']] ['1453' CLIMA_COOL ['1453', '"ClimaCool"']] + ['1454' GRID_CONNECT_INC ['1454', '"Grid Connect Inc."']] + ['1455' ZIEGLER_INSTRUMENTATIONUK_LTD ['1455', '"Ziegler Instrumentation UK Ltd"']] + ['1456' CONTROL_TECLLC ['1456', '"ControlTec, LLC"']] ['0xFFFF' UNKNOWN_VENDOR ['0xFFFF', '"Unknown"']] ] From 90500e9aa15a6541e50a03a5e28b7d9e86e1d5af Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Sun, 3 Dec 2023 08:59:35 -0400 Subject: [PATCH 14/21] Arreglando el manejo de los tipos TIME. modificacion del PlcTIME y s7.mspec. --- plc4j/drivers/s7/pom.xml | 4 +- .../s7/readwrite/Alarm8MessageQueryType.java | 252 ------- .../AlarmMessageAckObjectPushType.java | 253 ------- .../s7/readwrite/AlarmMessageAckPushType.java | 192 ----- .../AlarmMessageAckResponseType.java | 164 ----- .../s7/readwrite/AlarmMessageAckType.java | 170 ----- .../readwrite/AlarmMessageObjectAckType.java | 246 ------- .../readwrite/AlarmMessageObjectPushType.java | 329 --------- .../AlarmMessageObjectQueryType.java | 310 -------- .../s7/readwrite/AlarmMessagePushType.java | 192 ----- .../s7/readwrite/AlarmMessageQueryType.java | 252 ------- .../java/s7/readwrite/AlarmStateType.java | 59 -- .../plc4x/java/s7/readwrite/AlarmType.java | 56 -- .../readwrite/AssociatedQueryValueType.java | 204 ------ .../s7/readwrite/AssociatedValueType.java | 220 ------ .../plc4x/java/s7/readwrite/COTPPacket.java | 238 ------ .../COTPPacketConnectionRequest.java | 200 ------ .../COTPPacketConnectionResponse.java | 200 ------ .../java/s7/readwrite/COTPPacketData.java | 159 ---- .../COTPPacketDisconnectRequest.java | 200 ------ .../COTPPacketDisconnectResponse.java | 167 ----- .../s7/readwrite/COTPPacketTpduError.java | 165 ----- .../java/s7/readwrite/COTPParameter.java | 182 ----- .../s7/readwrite/COTPParameterCalledTsap.java | 141 ---- .../readwrite/COTPParameterCallingTsap.java | 141 ---- .../s7/readwrite/COTPParameterChecksum.java | 141 ---- ...ameterDisconnectAdditionalInformation.java | 145 ---- .../s7/readwrite/COTPParameterTpduSize.java | 151 ---- .../java/s7/readwrite/COTPProtocolClass.java | 58 -- .../plc4x/java/s7/readwrite/COTPTpduSize.java | 87 --- .../java/s7/readwrite/CpuSubscribeEvents.java | 57 -- .../s7/readwrite/CycServiceItemAnyType.java | 244 ------- .../readwrite/CycServiceItemDbReadType.java | 169 ----- .../java/s7/readwrite/CycServiceItemType.java | 189 ----- .../plc4x/java/s7/readwrite/DataItem.java | 531 -------------- .../s7/readwrite/DataTransportErrorCode.java | 59 -- .../java/s7/readwrite/DataTransportSize.java | 87 --- .../plc4x/java/s7/readwrite/DateAndTime.java | 313 -------- .../plc4x/java/s7/readwrite/DeviceGroup.java | 56 -- .../plc4x/java/s7/readwrite/EventType.java | 58 -- .../plc4x/java/s7/readwrite/MemoryArea.java | 89 --- .../java/s7/readwrite/ModeTransitionType.java | 62 -- .../plc4x/java/s7/readwrite/QueryType.java | 57 -- .../plc4x/java/s7/readwrite/S7Address.java | 146 ---- .../plc4x/java/s7/readwrite/S7AddressAny.java | 276 ------- .../java/s7/readwrite/S7DataAlarmMessage.java | 192 ----- .../plc4x/java/s7/readwrite/S7Message.java | 262 ------- .../s7/readwrite/S7MessageObjectRequest.java | 256 ------- .../s7/readwrite/S7MessageObjectResponse.java | 196 ----- .../java/s7/readwrite/S7MessageRequest.java | 120 ---- .../java/s7/readwrite/S7MessageResponse.java | 164 ----- .../s7/readwrite/S7MessageResponseData.java | 165 ----- .../java/s7/readwrite/S7MessageUserData.java | 121 ---- .../plc4x/java/s7/readwrite/S7Parameter.java | 187 ----- .../readwrite/S7ParameterModeTransition.java | 252 ------- .../readwrite/S7ParameterReadVarRequest.java | 165 ----- .../readwrite/S7ParameterReadVarResponse.java | 145 ---- .../S7ParameterSetupCommunication.java | 191 ----- .../s7/readwrite/S7ParameterUserData.java | 164 ----- .../s7/readwrite/S7ParameterUserDataItem.java | 148 ---- .../S7ParameterUserDataItemCPUFunctions.java | 337 --------- .../readwrite/S7ParameterWriteVarRequest.java | 165 ----- .../S7ParameterWriteVarResponse.java | 145 ---- .../plc4x/java/s7/readwrite/S7Payload.java | 179 ----- .../java/s7/readwrite/S7PayloadAlarm8.java | 160 ----- .../s7/readwrite/S7PayloadAlarmAckInd.java | 160 ----- .../java/s7/readwrite/S7PayloadAlarmS.java | 160 ----- .../java/s7/readwrite/S7PayloadAlarmSC.java | 160 ----- .../java/s7/readwrite/S7PayloadAlarmSQ.java | 160 ----- .../readwrite/S7PayloadDiagnosticMessage.java | 295 -------- .../java/s7/readwrite/S7PayloadNotify.java | 160 ----- .../java/s7/readwrite/S7PayloadNotify8.java | 160 ----- .../readwrite/S7PayloadReadVarResponse.java | 154 ---- .../java/s7/readwrite/S7PayloadUserData.java | 172 ----- .../s7/readwrite/S7PayloadUserDataItem.java | 483 ------------- .../S7PayloadUserDataItemClkFRequest.java | 134 ---- .../S7PayloadUserDataItemClkFResponse.java | 203 ------ .../S7PayloadUserDataItemClkRequest.java | 134 ---- .../S7PayloadUserDataItemClkResponse.java | 203 ------ .../S7PayloadUserDataItemClkSetRequest.java | 177 ----- .../S7PayloadUserDataItemClkSetResponse.java | 134 ---- ...aItemCpuFunctionAlarmAckErrorResponse.java | 138 ---- ...serDataItemCpuFunctionAlarmAckRequest.java | 201 ------ ...erDataItemCpuFunctionAlarmAckResponse.java | 195 ----- ...loadUserDataItemCpuFunctionAlarmQuery.java | 317 -------- ...rDataItemCpuFunctionAlarmQueryRequest.java | 316 -------- ...DataItemCpuFunctionAlarmQueryResponse.java | 166 ----- ...serDataItemCpuFunctionMsgSubscription.java | 252 ------- ...uFunctionMsgSubscriptionAlarmResponse.java | 258 ------- ...ItemCpuFunctionMsgSubscriptionRequest.java | 250 ------- ...temCpuFunctionMsgSubscriptionResponse.java | 138 ---- ...CpuFunctionMsgSubscriptionSysResponse.java | 182 ----- ...taItemCpuFunctionReadSzlNoDataRequest.java | 138 ---- ...UserDataItemCpuFunctionReadSzlRequest.java | 183 ----- ...serDataItemCpuFunctionReadSzlResponse.java | 166 ----- ...ataItemCyclicServicesChangeDrivenPush.java | 192 ----- ...ServicesChangeDrivenSubscribeResponse.java | 193 ----- ...erDataItemCyclicServicesErrorResponse.java | 138 ---- ...PayloadUserDataItemCyclicServicesPush.java | 190 ----- ...ataItemCyclicServicesSubscribeRequest.java | 239 ------ ...taItemCyclicServicesSubscribeResponse.java | 192 ----- ...aItemCyclicServicesUnsubscribeRequest.java | 181 ----- ...ItemCyclicServicesUnsubscribeResponse.java | 138 ---- .../readwrite/S7PayloadWriteVarRequest.java | 154 ---- .../readwrite/S7PayloadWriteVarResponse.java | 154 ---- .../s7/readwrite/S7VarPayloadDataItem.java | 220 ------ .../s7/readwrite/S7VarPayloadStatusItem.java | 139 ---- .../readwrite/S7VarRequestParameterItem.java | 148 ---- .../S7VarRequestParameterItemAddress.java | 155 ---- .../apache/plc4x/java/s7/readwrite/State.java | 248 ------- .../plc4x/java/s7/readwrite/SubItem.java | 157 ---- .../plc4x/java/s7/readwrite/SyntaxIdType.java | 66 -- .../java/s7/readwrite/SzlDataTreeItem.java | 190 ----- .../apache/plc4x/java/s7/readwrite/SzlId.java | 179 ----- .../java/s7/readwrite/SzlModuleTypeClass.java | 57 -- .../plc4x/java/s7/readwrite/SzlSublist.java | 79 -- .../plc4x/java/s7/readwrite/TPKTPacket.java | 193 ----- .../plc4x/java/s7/readwrite/TimeBase.java | 56 -- .../java/s7/readwrite/TransportSize.java | 680 ------------------ .../plc4j/s7event/PlcReadDataS7400H.java | 1 + .../apache/plc4x/java/spi/values/PlcTIME.java | 10 +- 121 files changed, 9 insertions(+), 21674 deletions(-) delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQuery.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscription.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java delete mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java diff --git a/plc4j/drivers/s7/pom.xml b/plc4j/drivers/s7/pom.xml index 6ff47e7645c..4cf409d0136 100644 --- a/plc4j/drivers/s7/pom.xml +++ b/plc4j/drivers/s7/pom.xml @@ -36,11 +36,11 @@ - + org.apache.karaf.tooling karaf-maven-plugin - + generate-feature-xml compile diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java deleted file mode 100644 index 31e7dab0922..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class Alarm8MessageQueryType implements Message { - - // Properties. - protected final short functionId; - protected final short numberOfObjects; - protected final DataTransportErrorCode returnCode; - protected final DataTransportSize transportSize; - protected final int byteCount; - protected final List messageObjects; - - public Alarm8MessageQueryType( - short functionId, - short numberOfObjects, - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int byteCount, - List messageObjects) { - super(); - this.functionId = functionId; - this.numberOfObjects = numberOfObjects; - this.returnCode = returnCode; - this.transportSize = transportSize; - this.byteCount = byteCount; - this.messageObjects = messageObjects; - } - - public short getFunctionId() { - return functionId; - } - - public short getNumberOfObjects() { - return numberOfObjects; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public DataTransportSize getTransportSize() { - return transportSize; - } - - public int getByteCount() { - return byteCount; - } - - public List getMessageObjects() { - return messageObjects; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("Alarm8MessageQueryType"); - - // Simple Field (functionId) - writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (numberOfObjects) - writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (transportSize) - writeSimpleEnumField( - "transportSize", - "DataTransportSize", - transportSize, - new DataWriterEnumDefault<>( - DataTransportSize::getValue, - DataTransportSize::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (byteCount) - writeSimpleField("byteCount", byteCount, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (messageObjects) - writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); - - writeBuffer.popContext("Alarm8MessageQueryType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - Alarm8MessageQueryType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (functionId) - lengthInBits += 8; - - // Simple field (numberOfObjects) - lengthInBits += 8; - - // Simple field (returnCode) - lengthInBits += 8; - - // Simple field (transportSize) - lengthInBits += 8; - - // Simple field (byteCount) - lengthInBits += 16; - - // Array field - if (messageObjects != null) { - int i = 0; - for (AlarmMessageObjectQueryType element : messageObjects) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static Alarm8MessageQueryType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static Alarm8MessageQueryType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("Alarm8MessageQueryType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); - - short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - DataTransportSize transportSize = - readEnumField( - "transportSize", - "DataTransportSize", - new DataReaderEnumDefault<>( - DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - int byteCount = readSimpleField("byteCount", readUnsignedInt(readBuffer, 16)); - - List messageObjects = - readCountArrayField( - "messageObjects", - new DataReaderComplexDefault<>( - () -> AlarmMessageObjectQueryType.staticParse(readBuffer), readBuffer), - (byteCount) / (12)); - - readBuffer.closeContext("Alarm8MessageQueryType"); - // Create the instance - Alarm8MessageQueryType _alarm8MessageQueryType; - _alarm8MessageQueryType = - new Alarm8MessageQueryType( - functionId, numberOfObjects, returnCode, transportSize, byteCount, messageObjects); - return _alarm8MessageQueryType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof Alarm8MessageQueryType)) { - return false; - } - Alarm8MessageQueryType that = (Alarm8MessageQueryType) o; - return (getFunctionId() == that.getFunctionId()) - && (getNumberOfObjects() == that.getNumberOfObjects()) - && (getReturnCode() == that.getReturnCode()) - && (getTransportSize() == that.getTransportSize()) - && (getByteCount() == that.getByteCount()) - && (getMessageObjects() == that.getMessageObjects()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getFunctionId(), - getNumberOfObjects(), - getReturnCode(), - getTransportSize(), - getByteCount(), - getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java deleted file mode 100644 index 342589eba6d..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageAckObjectPushType implements Message { - - // Constant values. - public static final Short VARIABLESPEC = 0x12; - - // Properties. - protected final short lengthSpec; - protected final SyntaxIdType syntaxId; - protected final short numberOfValues; - protected final long eventId; - protected final State ackStateGoing; - protected final State ackStateComing; - - public AlarmMessageAckObjectPushType( - short lengthSpec, - SyntaxIdType syntaxId, - short numberOfValues, - long eventId, - State ackStateGoing, - State ackStateComing) { - super(); - this.lengthSpec = lengthSpec; - this.syntaxId = syntaxId; - this.numberOfValues = numberOfValues; - this.eventId = eventId; - this.ackStateGoing = ackStateGoing; - this.ackStateComing = ackStateComing; - } - - public short getLengthSpec() { - return lengthSpec; - } - - public SyntaxIdType getSyntaxId() { - return syntaxId; - } - - public short getNumberOfValues() { - return numberOfValues; - } - - public long getEventId() { - return eventId; - } - - public State getAckStateGoing() { - return ackStateGoing; - } - - public State getAckStateComing() { - return ackStateComing; - } - - public short getVariableSpec() { - return VARIABLESPEC; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageAckObjectPushType"); - - // Const Field (variableSpec) - writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (lengthSpec) - writeSimpleField("lengthSpec", lengthSpec, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (syntaxId) - writeSimpleEnumField( - "syntaxId", - "SyntaxIdType", - syntaxId, - new DataWriterEnumDefault<>( - SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (numberOfValues) - writeSimpleField("numberOfValues", numberOfValues, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (eventId) - writeSimpleField("eventId", eventId, writeUnsignedLong(writeBuffer, 32)); - - // Simple Field (ackStateGoing) - writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (ackStateComing) - writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("AlarmMessageAckObjectPushType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageAckObjectPushType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (variableSpec) - lengthInBits += 8; - - // Simple field (lengthSpec) - lengthInBits += 8; - - // Simple field (syntaxId) - lengthInBits += 8; - - // Simple field (numberOfValues) - lengthInBits += 8; - - // Simple field (eventId) - lengthInBits += 32; - - // Simple field (ackStateGoing) - lengthInBits += ackStateGoing.getLengthInBits(); - - // Simple field (ackStateComing) - lengthInBits += ackStateComing.getLengthInBits(); - - return lengthInBits; - } - - public static AlarmMessageAckObjectPushType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageAckObjectPushType staticParse(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("AlarmMessageAckObjectPushType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short variableSpec = - readConstField( - "variableSpec", - readUnsignedShort(readBuffer, 8), - AlarmMessageAckObjectPushType.VARIABLESPEC); - - short lengthSpec = readSimpleField("lengthSpec", readUnsignedShort(readBuffer, 8)); - - SyntaxIdType syntaxId = - readEnumField( - "syntaxId", - "SyntaxIdType", - new DataReaderEnumDefault<>( - SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); - - short numberOfValues = readSimpleField("numberOfValues", readUnsignedShort(readBuffer, 8)); - - long eventId = readSimpleField("eventId", readUnsignedLong(readBuffer, 32)); - - State ackStateGoing = - readSimpleField( - "ackStateGoing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - State ackStateComing = - readSimpleField( - "ackStateComing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("AlarmMessageAckObjectPushType"); - // Create the instance - AlarmMessageAckObjectPushType _alarmMessageAckObjectPushType; - _alarmMessageAckObjectPushType = - new AlarmMessageAckObjectPushType( - lengthSpec, syntaxId, numberOfValues, eventId, ackStateGoing, ackStateComing); - return _alarmMessageAckObjectPushType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageAckObjectPushType)) { - return false; - } - AlarmMessageAckObjectPushType that = (AlarmMessageAckObjectPushType) o; - return (getLengthSpec() == that.getLengthSpec()) - && (getSyntaxId() == that.getSyntaxId()) - && (getNumberOfValues() == that.getNumberOfValues()) - && (getEventId() == that.getEventId()) - && (getAckStateGoing() == that.getAckStateGoing()) - && (getAckStateComing() == that.getAckStateComing()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getLengthSpec(), - getSyntaxId(), - getNumberOfValues(), - getEventId(), - getAckStateGoing(), - getAckStateComing()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java deleted file mode 100644 index 48491b961ad..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageAckPushType implements Message { - - // Properties. - protected final DateAndTime TimeStamp; - protected final short functionId; - protected final short numberOfObjects; - protected final List messageObjects; - - public AlarmMessageAckPushType( - DateAndTime TimeStamp, - short functionId, - short numberOfObjects, - List messageObjects) { - super(); - this.TimeStamp = TimeStamp; - this.functionId = functionId; - this.numberOfObjects = numberOfObjects; - this.messageObjects = messageObjects; - } - - public DateAndTime getTimeStamp() { - return TimeStamp; - } - - public short getFunctionId() { - return functionId; - } - - public short getNumberOfObjects() { - return numberOfObjects; - } - - public List getMessageObjects() { - return messageObjects; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageAckPushType"); - - // Simple Field (TimeStamp) - writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (functionId) - writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (numberOfObjects) - writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (messageObjects) - writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); - - writeBuffer.popContext("AlarmMessageAckPushType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageAckPushType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (TimeStamp) - lengthInBits += TimeStamp.getLengthInBits(); - - // Simple field (functionId) - lengthInBits += 8; - - // Simple field (numberOfObjects) - lengthInBits += 8; - - // Array field - if (messageObjects != null) { - int i = 0; - for (AlarmMessageAckObjectPushType element : messageObjects) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static AlarmMessageAckPushType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageAckPushType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("AlarmMessageAckPushType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DateAndTime TimeStamp = - readSimpleField( - "TimeStamp", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); - - short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - List messageObjects = - readCountArrayField( - "messageObjects", - new DataReaderComplexDefault<>( - () -> AlarmMessageAckObjectPushType.staticParse(readBuffer), readBuffer), - numberOfObjects); - - readBuffer.closeContext("AlarmMessageAckPushType"); - // Create the instance - AlarmMessageAckPushType _alarmMessageAckPushType; - _alarmMessageAckPushType = - new AlarmMessageAckPushType(TimeStamp, functionId, numberOfObjects, messageObjects); - return _alarmMessageAckPushType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageAckPushType)) { - return false; - } - AlarmMessageAckPushType that = (AlarmMessageAckPushType) o; - return (getTimeStamp() == that.getTimeStamp()) - && (getFunctionId() == that.getFunctionId()) - && (getNumberOfObjects() == that.getNumberOfObjects()) - && (getMessageObjects() == that.getMessageObjects()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTimeStamp(), getFunctionId(), getNumberOfObjects(), getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java deleted file mode 100644 index e588b6ca414..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageAckResponseType implements Message { - - // Properties. - protected final short functionId; - protected final short numberOfObjects; - protected final List messageObjects; - - public AlarmMessageAckResponseType( - short functionId, short numberOfObjects, List messageObjects) { - super(); - this.functionId = functionId; - this.numberOfObjects = numberOfObjects; - this.messageObjects = messageObjects; - } - - public short getFunctionId() { - return functionId; - } - - public short getNumberOfObjects() { - return numberOfObjects; - } - - public List getMessageObjects() { - return messageObjects; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageAckResponseType"); - - // Simple Field (functionId) - writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (numberOfObjects) - writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (messageObjects) - writeSimpleTypeArrayField("messageObjects", messageObjects, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("AlarmMessageAckResponseType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageAckResponseType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (functionId) - lengthInBits += 8; - - // Simple field (numberOfObjects) - lengthInBits += 8; - - // Array field - if (messageObjects != null) { - lengthInBits += 8 * messageObjects.size(); - } - - return lengthInBits; - } - - public static AlarmMessageAckResponseType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageAckResponseType staticParse(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("AlarmMessageAckResponseType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); - - short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - List messageObjects = - readCountArrayField("messageObjects", readUnsignedShort(readBuffer, 8), numberOfObjects); - - readBuffer.closeContext("AlarmMessageAckResponseType"); - // Create the instance - AlarmMessageAckResponseType _alarmMessageAckResponseType; - _alarmMessageAckResponseType = - new AlarmMessageAckResponseType(functionId, numberOfObjects, messageObjects); - return _alarmMessageAckResponseType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageAckResponseType)) { - return false; - } - AlarmMessageAckResponseType that = (AlarmMessageAckResponseType) o; - return (getFunctionId() == that.getFunctionId()) - && (getNumberOfObjects() == that.getNumberOfObjects()) - && (getMessageObjects() == that.getMessageObjects()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getFunctionId(), getNumberOfObjects(), getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java deleted file mode 100644 index bea2571d061..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageAckType implements Message { - - // Properties. - protected final short functionId; - protected final short numberOfObjects; - protected final List messageObjects; - - public AlarmMessageAckType( - short functionId, short numberOfObjects, List messageObjects) { - super(); - this.functionId = functionId; - this.numberOfObjects = numberOfObjects; - this.messageObjects = messageObjects; - } - - public short getFunctionId() { - return functionId; - } - - public short getNumberOfObjects() { - return numberOfObjects; - } - - public List getMessageObjects() { - return messageObjects; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageAckType"); - - // Simple Field (functionId) - writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (numberOfObjects) - writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (messageObjects) - writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); - - writeBuffer.popContext("AlarmMessageAckType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageAckType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (functionId) - lengthInBits += 8; - - // Simple field (numberOfObjects) - lengthInBits += 8; - - // Array field - if (messageObjects != null) { - int i = 0; - for (AlarmMessageObjectAckType element : messageObjects) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static AlarmMessageAckType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageAckType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("AlarmMessageAckType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); - - short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - List messageObjects = - readCountArrayField( - "messageObjects", - new DataReaderComplexDefault<>( - () -> AlarmMessageObjectAckType.staticParse(readBuffer), readBuffer), - numberOfObjects); - - readBuffer.closeContext("AlarmMessageAckType"); - // Create the instance - AlarmMessageAckType _alarmMessageAckType; - _alarmMessageAckType = new AlarmMessageAckType(functionId, numberOfObjects, messageObjects); - return _alarmMessageAckType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageAckType)) { - return false; - } - AlarmMessageAckType that = (AlarmMessageAckType) o; - return (getFunctionId() == that.getFunctionId()) - && (getNumberOfObjects() == that.getNumberOfObjects()) - && (getMessageObjects() == that.getMessageObjects()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getFunctionId(), getNumberOfObjects(), getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java deleted file mode 100644 index fc3ff163982..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java +++ /dev/null @@ -1,246 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageObjectAckType implements Message { - - // Constant values. - public static final Short VARIABLESPEC = 0x12; - public static final Short LENGTH = 0x08; - - // Properties. - protected final SyntaxIdType syntaxId; - protected final short numberOfValues; - protected final long eventId; - protected final State ackStateGoing; - protected final State ackStateComing; - - public AlarmMessageObjectAckType( - SyntaxIdType syntaxId, - short numberOfValues, - long eventId, - State ackStateGoing, - State ackStateComing) { - super(); - this.syntaxId = syntaxId; - this.numberOfValues = numberOfValues; - this.eventId = eventId; - this.ackStateGoing = ackStateGoing; - this.ackStateComing = ackStateComing; - } - - public SyntaxIdType getSyntaxId() { - return syntaxId; - } - - public short getNumberOfValues() { - return numberOfValues; - } - - public long getEventId() { - return eventId; - } - - public State getAckStateGoing() { - return ackStateGoing; - } - - public State getAckStateComing() { - return ackStateComing; - } - - public short getVariableSpec() { - return VARIABLESPEC; - } - - public short getLength() { - return LENGTH; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageObjectAckType"); - - // Const Field (variableSpec) - writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (length) - writeConstField("length", LENGTH, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (syntaxId) - writeSimpleEnumField( - "syntaxId", - "SyntaxIdType", - syntaxId, - new DataWriterEnumDefault<>( - SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (numberOfValues) - writeSimpleField("numberOfValues", numberOfValues, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (eventId) - writeSimpleField("eventId", eventId, writeUnsignedLong(writeBuffer, 32)); - - // Simple Field (ackStateGoing) - writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (ackStateComing) - writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("AlarmMessageObjectAckType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageObjectAckType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (variableSpec) - lengthInBits += 8; - - // Const Field (length) - lengthInBits += 8; - - // Simple field (syntaxId) - lengthInBits += 8; - - // Simple field (numberOfValues) - lengthInBits += 8; - - // Simple field (eventId) - lengthInBits += 32; - - // Simple field (ackStateGoing) - lengthInBits += ackStateGoing.getLengthInBits(); - - // Simple field (ackStateComing) - lengthInBits += ackStateComing.getLengthInBits(); - - return lengthInBits; - } - - public static AlarmMessageObjectAckType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageObjectAckType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("AlarmMessageObjectAckType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short variableSpec = - readConstField( - "variableSpec", - readUnsignedShort(readBuffer, 8), - AlarmMessageObjectAckType.VARIABLESPEC); - - short length = - readConstField( - "length", readUnsignedShort(readBuffer, 8), AlarmMessageObjectAckType.LENGTH); - - SyntaxIdType syntaxId = - readEnumField( - "syntaxId", - "SyntaxIdType", - new DataReaderEnumDefault<>( - SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); - - short numberOfValues = readSimpleField("numberOfValues", readUnsignedShort(readBuffer, 8)); - - long eventId = readSimpleField("eventId", readUnsignedLong(readBuffer, 32)); - - State ackStateGoing = - readSimpleField( - "ackStateGoing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - State ackStateComing = - readSimpleField( - "ackStateComing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("AlarmMessageObjectAckType"); - // Create the instance - AlarmMessageObjectAckType _alarmMessageObjectAckType; - _alarmMessageObjectAckType = - new AlarmMessageObjectAckType( - syntaxId, numberOfValues, eventId, ackStateGoing, ackStateComing); - return _alarmMessageObjectAckType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageObjectAckType)) { - return false; - } - AlarmMessageObjectAckType that = (AlarmMessageObjectAckType) o; - return (getSyntaxId() == that.getSyntaxId()) - && (getNumberOfValues() == that.getNumberOfValues()) - && (getEventId() == that.getEventId()) - && (getAckStateGoing() == that.getAckStateGoing()) - && (getAckStateComing() == that.getAckStateComing()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getSyntaxId(), getNumberOfValues(), getEventId(), getAckStateGoing(), getAckStateComing()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java deleted file mode 100644 index 42777096da9..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java +++ /dev/null @@ -1,329 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageObjectPushType implements Message { - - // Constant values. - public static final Short VARIABLESPEC = 0x12; - - // Properties. - protected final short lengthSpec; - protected final SyntaxIdType syntaxId; - protected final short numberOfValues; - protected final long eventId; - protected final State eventState; - protected final State localState; - protected final State ackStateGoing; - protected final State ackStateComing; - protected final List AssociatedValues; - - public AlarmMessageObjectPushType( - short lengthSpec, - SyntaxIdType syntaxId, - short numberOfValues, - long eventId, - State eventState, - State localState, - State ackStateGoing, - State ackStateComing, - List AssociatedValues) { - super(); - this.lengthSpec = lengthSpec; - this.syntaxId = syntaxId; - this.numberOfValues = numberOfValues; - this.eventId = eventId; - this.eventState = eventState; - this.localState = localState; - this.ackStateGoing = ackStateGoing; - this.ackStateComing = ackStateComing; - this.AssociatedValues = AssociatedValues; - } - - public short getLengthSpec() { - return lengthSpec; - } - - public SyntaxIdType getSyntaxId() { - return syntaxId; - } - - public short getNumberOfValues() { - return numberOfValues; - } - - public long getEventId() { - return eventId; - } - - public State getEventState() { - return eventState; - } - - public State getLocalState() { - return localState; - } - - public State getAckStateGoing() { - return ackStateGoing; - } - - public State getAckStateComing() { - return ackStateComing; - } - - public List getAssociatedValues() { - return AssociatedValues; - } - - public short getVariableSpec() { - return VARIABLESPEC; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageObjectPushType"); - - // Const Field (variableSpec) - writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (lengthSpec) - writeSimpleField("lengthSpec", lengthSpec, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (syntaxId) - writeSimpleEnumField( - "syntaxId", - "SyntaxIdType", - syntaxId, - new DataWriterEnumDefault<>( - SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (numberOfValues) - writeSimpleField("numberOfValues", numberOfValues, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (eventId) - writeSimpleField("eventId", eventId, writeUnsignedLong(writeBuffer, 32)); - - // Simple Field (eventState) - writeSimpleField("eventState", eventState, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (localState) - writeSimpleField("localState", localState, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (ackStateGoing) - writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (ackStateComing) - writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); - - // Array Field (AssociatedValues) - writeComplexTypeArrayField("AssociatedValues", AssociatedValues, writeBuffer); - - writeBuffer.popContext("AlarmMessageObjectPushType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageObjectPushType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (variableSpec) - lengthInBits += 8; - - // Simple field (lengthSpec) - lengthInBits += 8; - - // Simple field (syntaxId) - lengthInBits += 8; - - // Simple field (numberOfValues) - lengthInBits += 8; - - // Simple field (eventId) - lengthInBits += 32; - - // Simple field (eventState) - lengthInBits += eventState.getLengthInBits(); - - // Simple field (localState) - lengthInBits += localState.getLengthInBits(); - - // Simple field (ackStateGoing) - lengthInBits += ackStateGoing.getLengthInBits(); - - // Simple field (ackStateComing) - lengthInBits += ackStateComing.getLengthInBits(); - - // Array field - if (AssociatedValues != null) { - int i = 0; - for (AssociatedValueType element : AssociatedValues) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= AssociatedValues.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static AlarmMessageObjectPushType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageObjectPushType staticParse(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("AlarmMessageObjectPushType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short variableSpec = - readConstField( - "variableSpec", - readUnsignedShort(readBuffer, 8), - AlarmMessageObjectPushType.VARIABLESPEC); - - short lengthSpec = readSimpleField("lengthSpec", readUnsignedShort(readBuffer, 8)); - - SyntaxIdType syntaxId = - readEnumField( - "syntaxId", - "SyntaxIdType", - new DataReaderEnumDefault<>( - SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); - - short numberOfValues = readSimpleField("numberOfValues", readUnsignedShort(readBuffer, 8)); - - long eventId = readSimpleField("eventId", readUnsignedLong(readBuffer, 32)); - - State eventState = - readSimpleField( - "eventState", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - State localState = - readSimpleField( - "localState", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - State ackStateGoing = - readSimpleField( - "ackStateGoing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - State ackStateComing = - readSimpleField( - "ackStateComing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - List AssociatedValues = - readCountArrayField( - "AssociatedValues", - new DataReaderComplexDefault<>( - () -> AssociatedValueType.staticParse(readBuffer), readBuffer), - numberOfValues); - - readBuffer.closeContext("AlarmMessageObjectPushType"); - // Create the instance - AlarmMessageObjectPushType _alarmMessageObjectPushType; - _alarmMessageObjectPushType = - new AlarmMessageObjectPushType( - lengthSpec, - syntaxId, - numberOfValues, - eventId, - eventState, - localState, - ackStateGoing, - ackStateComing, - AssociatedValues); - return _alarmMessageObjectPushType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageObjectPushType)) { - return false; - } - AlarmMessageObjectPushType that = (AlarmMessageObjectPushType) o; - return (getLengthSpec() == that.getLengthSpec()) - && (getSyntaxId() == that.getSyntaxId()) - && (getNumberOfValues() == that.getNumberOfValues()) - && (getEventId() == that.getEventId()) - && (getEventState() == that.getEventState()) - && (getLocalState() == that.getLocalState()) - && (getAckStateGoing() == that.getAckStateGoing()) - && (getAckStateComing() == that.getAckStateComing()) - && (getAssociatedValues() == that.getAssociatedValues()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getLengthSpec(), - getSyntaxId(), - getNumberOfValues(), - getEventId(), - getEventState(), - getLocalState(), - getAckStateGoing(), - getAckStateComing(), - getAssociatedValues()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java deleted file mode 100644 index 7d931070da7..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java +++ /dev/null @@ -1,310 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageObjectQueryType implements Message { - - // Constant values. - public static final Short VARIABLESPEC = 0x12; - - // Properties. - protected final short lengthDataset; - protected final State eventState; - protected final State ackStateGoing; - protected final State ackStateComing; - protected final DateAndTime timeComing; - protected final AssociatedValueType valueComing; - protected final DateAndTime timeGoing; - protected final AssociatedValueType valueGoing; - - public AlarmMessageObjectQueryType( - short lengthDataset, - State eventState, - State ackStateGoing, - State ackStateComing, - DateAndTime timeComing, - AssociatedValueType valueComing, - DateAndTime timeGoing, - AssociatedValueType valueGoing) { - super(); - this.lengthDataset = lengthDataset; - this.eventState = eventState; - this.ackStateGoing = ackStateGoing; - this.ackStateComing = ackStateComing; - this.timeComing = timeComing; - this.valueComing = valueComing; - this.timeGoing = timeGoing; - this.valueGoing = valueGoing; - } - - public short getLengthDataset() { - return lengthDataset; - } - - public State getEventState() { - return eventState; - } - - public State getAckStateGoing() { - return ackStateGoing; - } - - public State getAckStateComing() { - return ackStateComing; - } - - public DateAndTime getTimeComing() { - return timeComing; - } - - public AssociatedValueType getValueComing() { - return valueComing; - } - - public DateAndTime getTimeGoing() { - return timeGoing; - } - - public AssociatedValueType getValueGoing() { - return valueGoing; - } - - public short getVariableSpec() { - return VARIABLESPEC; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageObjectQueryType"); - - // Simple Field (lengthDataset) - writeSimpleField("lengthDataset", lengthDataset, writeUnsignedShort(writeBuffer, 8)); - - // Reserved Field (reserved) - writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16)); - - // Const Field (variableSpec) - writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (eventState) - writeSimpleField("eventState", eventState, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (ackStateGoing) - writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (ackStateComing) - writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (timeComing) - writeSimpleField("timeComing", timeComing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (valueComing) - writeSimpleField("valueComing", valueComing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (timeGoing) - writeSimpleField("timeGoing", timeGoing, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (valueGoing) - writeSimpleField("valueGoing", valueGoing, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("AlarmMessageObjectQueryType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageObjectQueryType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (lengthDataset) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 16; - - // Const Field (variableSpec) - lengthInBits += 8; - - // Simple field (eventState) - lengthInBits += eventState.getLengthInBits(); - - // Simple field (ackStateGoing) - lengthInBits += ackStateGoing.getLengthInBits(); - - // Simple field (ackStateComing) - lengthInBits += ackStateComing.getLengthInBits(); - - // Simple field (timeComing) - lengthInBits += timeComing.getLengthInBits(); - - // Simple field (valueComing) - lengthInBits += valueComing.getLengthInBits(); - - // Simple field (timeGoing) - lengthInBits += timeGoing.getLengthInBits(); - - // Simple field (valueGoing) - lengthInBits += valueGoing.getLengthInBits(); - - return lengthInBits; - } - - public static AlarmMessageObjectQueryType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageObjectQueryType staticParse(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("AlarmMessageObjectQueryType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short lengthDataset = readSimpleField("lengthDataset", readUnsignedShort(readBuffer, 8)); - - Integer reservedField0 = - readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000); - - short variableSpec = - readConstField( - "variableSpec", - readUnsignedShort(readBuffer, 8), - AlarmMessageObjectQueryType.VARIABLESPEC); - - State eventState = - readSimpleField( - "eventState", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - State ackStateGoing = - readSimpleField( - "ackStateGoing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - State ackStateComing = - readSimpleField( - "ackStateComing", - new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); - - DateAndTime timeComing = - readSimpleField( - "timeComing", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - AssociatedValueType valueComing = - readSimpleField( - "valueComing", - new DataReaderComplexDefault<>( - () -> AssociatedValueType.staticParse(readBuffer), readBuffer)); - - DateAndTime timeGoing = - readSimpleField( - "timeGoing", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - AssociatedValueType valueGoing = - readSimpleField( - "valueGoing", - new DataReaderComplexDefault<>( - () -> AssociatedValueType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("AlarmMessageObjectQueryType"); - // Create the instance - AlarmMessageObjectQueryType _alarmMessageObjectQueryType; - _alarmMessageObjectQueryType = - new AlarmMessageObjectQueryType( - lengthDataset, - eventState, - ackStateGoing, - ackStateComing, - timeComing, - valueComing, - timeGoing, - valueGoing); - return _alarmMessageObjectQueryType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageObjectQueryType)) { - return false; - } - AlarmMessageObjectQueryType that = (AlarmMessageObjectQueryType) o; - return (getLengthDataset() == that.getLengthDataset()) - && (getEventState() == that.getEventState()) - && (getAckStateGoing() == that.getAckStateGoing()) - && (getAckStateComing() == that.getAckStateComing()) - && (getTimeComing() == that.getTimeComing()) - && (getValueComing() == that.getValueComing()) - && (getTimeGoing() == that.getTimeGoing()) - && (getValueGoing() == that.getValueGoing()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getLengthDataset(), - getEventState(), - getAckStateGoing(), - getAckStateComing(), - getTimeComing(), - getValueComing(), - getTimeGoing(), - getValueGoing()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java deleted file mode 100644 index a6b578a1e97..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessagePushType implements Message { - - // Properties. - protected final DateAndTime TimeStamp; - protected final short functionId; - protected final short numberOfObjects; - protected final List messageObjects; - - public AlarmMessagePushType( - DateAndTime TimeStamp, - short functionId, - short numberOfObjects, - List messageObjects) { - super(); - this.TimeStamp = TimeStamp; - this.functionId = functionId; - this.numberOfObjects = numberOfObjects; - this.messageObjects = messageObjects; - } - - public DateAndTime getTimeStamp() { - return TimeStamp; - } - - public short getFunctionId() { - return functionId; - } - - public short getNumberOfObjects() { - return numberOfObjects; - } - - public List getMessageObjects() { - return messageObjects; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessagePushType"); - - // Simple Field (TimeStamp) - writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (functionId) - writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (numberOfObjects) - writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (messageObjects) - writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); - - writeBuffer.popContext("AlarmMessagePushType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessagePushType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (TimeStamp) - lengthInBits += TimeStamp.getLengthInBits(); - - // Simple field (functionId) - lengthInBits += 8; - - // Simple field (numberOfObjects) - lengthInBits += 8; - - // Array field - if (messageObjects != null) { - int i = 0; - for (AlarmMessageObjectPushType element : messageObjects) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static AlarmMessagePushType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessagePushType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("AlarmMessagePushType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DateAndTime TimeStamp = - readSimpleField( - "TimeStamp", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); - - short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - List messageObjects = - readCountArrayField( - "messageObjects", - new DataReaderComplexDefault<>( - () -> AlarmMessageObjectPushType.staticParse(readBuffer), readBuffer), - numberOfObjects); - - readBuffer.closeContext("AlarmMessagePushType"); - // Create the instance - AlarmMessagePushType _alarmMessagePushType; - _alarmMessagePushType = - new AlarmMessagePushType(TimeStamp, functionId, numberOfObjects, messageObjects); - return _alarmMessagePushType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessagePushType)) { - return false; - } - AlarmMessagePushType that = (AlarmMessagePushType) o; - return (getTimeStamp() == that.getTimeStamp()) - && (getFunctionId() == that.getFunctionId()) - && (getNumberOfObjects() == that.getNumberOfObjects()) - && (getMessageObjects() == that.getMessageObjects()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTimeStamp(), getFunctionId(), getNumberOfObjects(), getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java deleted file mode 100644 index 53eddc50a4d..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AlarmMessageQueryType implements Message { - - // Constant values. - public static final Integer DATALENGTH = 0xFFFF; - - // Properties. - protected final short functionId; - protected final short numberOfObjects; - protected final DataTransportErrorCode returnCode; - protected final DataTransportSize transportSize; - protected final List messageObjects; - - public AlarmMessageQueryType( - short functionId, - short numberOfObjects, - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - List messageObjects) { - super(); - this.functionId = functionId; - this.numberOfObjects = numberOfObjects; - this.returnCode = returnCode; - this.transportSize = transportSize; - this.messageObjects = messageObjects; - } - - public short getFunctionId() { - return functionId; - } - - public short getNumberOfObjects() { - return numberOfObjects; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public DataTransportSize getTransportSize() { - return transportSize; - } - - public List getMessageObjects() { - return messageObjects; - } - - public int getDataLength() { - return DATALENGTH; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AlarmMessageQueryType"); - - // Simple Field (functionId) - writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (numberOfObjects) - writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (transportSize) - writeSimpleEnumField( - "transportSize", - "DataTransportSize", - transportSize, - new DataWriterEnumDefault<>( - DataTransportSize::getValue, - DataTransportSize::name, - writeUnsignedShort(writeBuffer, 8))); - - // Const Field (DataLength) - writeConstField("DataLength", DATALENGTH, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (messageObjects) - writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); - - writeBuffer.popContext("AlarmMessageQueryType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AlarmMessageQueryType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (functionId) - lengthInBits += 8; - - // Simple field (numberOfObjects) - lengthInBits += 8; - - // Simple field (returnCode) - lengthInBits += 8; - - // Simple field (transportSize) - lengthInBits += 8; - - // Const Field (DataLength) - lengthInBits += 16; - - // Array field - if (messageObjects != null) { - int i = 0; - for (AlarmMessageObjectQueryType element : messageObjects) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static AlarmMessageQueryType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AlarmMessageQueryType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("AlarmMessageQueryType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); - - short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - DataTransportSize transportSize = - readEnumField( - "transportSize", - "DataTransportSize", - new DataReaderEnumDefault<>( - DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - int DataLength = - readConstField( - "DataLength", readUnsignedInt(readBuffer, 16), AlarmMessageQueryType.DATALENGTH); - - List messageObjects = - readCountArrayField( - "messageObjects", - new DataReaderComplexDefault<>( - () -> AlarmMessageObjectQueryType.staticParse(readBuffer), readBuffer), - numberOfObjects); - - readBuffer.closeContext("AlarmMessageQueryType"); - // Create the instance - AlarmMessageQueryType _alarmMessageQueryType; - _alarmMessageQueryType = - new AlarmMessageQueryType( - functionId, numberOfObjects, returnCode, transportSize, messageObjects); - return _alarmMessageQueryType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AlarmMessageQueryType)) { - return false; - } - AlarmMessageQueryType that = (AlarmMessageQueryType) o; - return (getFunctionId() == that.getFunctionId()) - && (getNumberOfObjects() == that.getNumberOfObjects()) - && (getReturnCode() == that.getReturnCode()) - && (getTransportSize() == that.getTransportSize()) - && (getMessageObjects() == that.getMessageObjects()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getFunctionId(), - getNumberOfObjects(), - getReturnCode(), - getTransportSize(), - getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java deleted file mode 100644 index 5a038892956..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum AlarmStateType { - SCAN_ABORT((short) 0x00), - SCAN_INITIATE((short) 0x01), - ALARM_ABORT((short) 0x04), - ALARM_INITIATE((short) 0x05), - ALARM_S_ABORT((short) 0x08), - ALARM_S_INITIATE((short) 0x09); - private static final Map map; - - static { - map = new HashMap<>(); - for (AlarmStateType value : AlarmStateType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - AlarmStateType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static AlarmStateType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java deleted file mode 100644 index 3693907d2a4..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum AlarmType { - SCAN((short) 0x01), - ALARM_8((short) 0x02), - ALARM_S((short) 0x04); - private static final Map map; - - static { - map = new HashMap<>(); - for (AlarmType value : AlarmType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - AlarmType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static AlarmType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java deleted file mode 100644 index 9f7a355161d..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AssociatedQueryValueType implements Message { - - // Properties. - protected final DataTransportErrorCode returnCode; - protected final DataTransportSize transportSize; - protected final int valueLength; - protected final List data; - - public AssociatedQueryValueType( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int valueLength, - List data) { - super(); - this.returnCode = returnCode; - this.transportSize = transportSize; - this.valueLength = valueLength; - this.data = data; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public DataTransportSize getTransportSize() { - return transportSize; - } - - public int getValueLength() { - return valueLength; - } - - public List getData() { - return data; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AssociatedQueryValueType"); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (transportSize) - writeSimpleEnumField( - "transportSize", - "DataTransportSize", - transportSize, - new DataWriterEnumDefault<>( - DataTransportSize::getValue, - DataTransportSize::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (valueLength) - writeSimpleField("valueLength", valueLength, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (data) - writeSimpleTypeArrayField("data", data, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("AssociatedQueryValueType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AssociatedQueryValueType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (returnCode) - lengthInBits += 8; - - // Simple field (transportSize) - lengthInBits += 8; - - // Simple field (valueLength) - lengthInBits += 16; - - // Array field - if (data != null) { - lengthInBits += 8 * data.size(); - } - - return lengthInBits; - } - - public static AssociatedQueryValueType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AssociatedQueryValueType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("AssociatedQueryValueType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - DataTransportSize transportSize = - readEnumField( - "transportSize", - "DataTransportSize", - new DataReaderEnumDefault<>( - DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - int valueLength = readSimpleField("valueLength", readUnsignedInt(readBuffer, 16)); - - List data = readCountArrayField("data", readUnsignedShort(readBuffer, 8), valueLength); - - readBuffer.closeContext("AssociatedQueryValueType"); - // Create the instance - AssociatedQueryValueType _associatedQueryValueType; - _associatedQueryValueType = - new AssociatedQueryValueType(returnCode, transportSize, valueLength, data); - return _associatedQueryValueType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AssociatedQueryValueType)) { - return false; - } - AssociatedQueryValueType that = (AssociatedQueryValueType) o; - return (getReturnCode() == that.getReturnCode()) - && (getTransportSize() == that.getTransportSize()) - && (getValueLength() == that.getValueLength()) - && (getData() == that.getData()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getReturnCode(), getTransportSize(), getValueLength(), getData()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java deleted file mode 100644 index d3807cd3865..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class AssociatedValueType implements Message { - - // Properties. - protected final DataTransportErrorCode returnCode; - protected final DataTransportSize transportSize; - protected final int valueLength; - protected final List data; - - public AssociatedValueType( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int valueLength, - List data) { - super(); - this.returnCode = returnCode; - this.transportSize = transportSize; - this.valueLength = valueLength; - this.data = data; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public DataTransportSize getTransportSize() { - return transportSize; - } - - public int getValueLength() { - return valueLength; - } - - public List getData() { - return data; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("AssociatedValueType"); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (transportSize) - writeSimpleEnumField( - "transportSize", - "DataTransportSize", - transportSize, - new DataWriterEnumDefault<>( - DataTransportSize::getValue, - DataTransportSize::name, - writeUnsignedShort(writeBuffer, 8))); - - // Manual Field (valueLength) - writeManualField( - "valueLength", - () -> - org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.LeftShift3( - writeBuffer, valueLength), - writeBuffer); - - // Array Field (data) - writeSimpleTypeArrayField("data", data, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("AssociatedValueType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - AssociatedValueType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (returnCode) - lengthInBits += 8; - - // Simple field (transportSize) - lengthInBits += 8; - - // Manual Field (valueLength) - lengthInBits += 2; - - // Array field - if (data != null) { - lengthInBits += 8 * data.size(); - } - - return lengthInBits; - } - - public static AssociatedValueType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static AssociatedValueType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("AssociatedValueType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - DataTransportSize transportSize = - readEnumField( - "transportSize", - "DataTransportSize", - new DataReaderEnumDefault<>( - DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - int valueLength = - readManualField( - "valueLength", - readBuffer, - () -> - (int) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.RightShift3( - readBuffer, transportSize))); - - List data = - readCountArrayField( - "data", - readUnsignedShort(readBuffer, 8), - org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.EventItemLength( - readBuffer, valueLength)); - - readBuffer.closeContext("AssociatedValueType"); - // Create the instance - AssociatedValueType _associatedValueType; - _associatedValueType = new AssociatedValueType(returnCode, transportSize, valueLength, data); - return _associatedValueType; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof AssociatedValueType)) { - return false; - } - AssociatedValueType that = (AssociatedValueType) o; - return (getReturnCode() == that.getReturnCode()) - && (getTransportSize() == that.getTransportSize()) - && (getValueLength() == that.getValueLength()) - && (getData() == that.getData()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getReturnCode(), getTransportSize(), getValueLength(), getData()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java deleted file mode 100644 index 6d4f3cd49ba..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java +++ /dev/null @@ -1,238 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class COTPPacket implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getTpduCode(); - - // Properties. - protected final List parameters; - protected final S7Message payload; - - public COTPPacket(List parameters, S7Message payload) { - super(); - this.parameters = parameters; - this.payload = payload; - } - - public List getParameters() { - return parameters; - } - - public S7Message getPayload() { - return payload; - } - - protected abstract void serializeCOTPPacketChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - int startPos = positionAware.getPos(); - writeBuffer.pushContext("COTPPacket"); - - // Implicit Field (headerLength) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - short headerLength = - (short) - ((getLengthInBytes()) - - ((((((((getPayload()) != (null))) ? getPayload().getLengthInBytes() : 0))) - + (1)))); - writeImplicitField("headerLength", headerLength, writeUnsignedShort(writeBuffer, 8)); - - // Discriminator Field (tpduCode) (Used as input to a switch field) - writeDiscriminatorField("tpduCode", getTpduCode(), writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeCOTPPacketChild(writeBuffer); - - // Array Field (parameters) - writeComplexTypeArrayField("parameters", parameters, writeBuffer); - - // Optional Field (payload) (Can be skipped, if the value is null) - writeOptionalField("payload", payload, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("COTPPacket"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - COTPPacket _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (headerLength) - lengthInBits += 8; - - // Discriminator Field (tpduCode) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - // Array field - if (parameters != null) { - for (Message element : parameters) { - lengthInBits += element.getLengthInBits(); - } - } - - // Optional Field (payload) - if (payload != null) { - lengthInBits += payload.getLengthInBits(); - } - - return lengthInBits; - } - - public static COTPPacket staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - if ((args == null) || (args.length != 1)) { - throw new PlcRuntimeException( - "Wrong number of arguments, expected 1, but got " + args.length); - } - Integer cotpLen; - if (args[0] instanceof Integer) { - cotpLen = (Integer) args[0]; - } else if (args[0] instanceof String) { - cotpLen = Integer.valueOf((String) args[0]); - } else { - throw new PlcRuntimeException( - "Argument 0 expected to be of type Integer or a string which is parseable but was " - + args[0].getClass().getName()); - } - return staticParse(readBuffer, cotpLen); - } - - public static COTPPacket staticParse(ReadBuffer readBuffer, Integer cotpLen) - throws ParseException { - readBuffer.pullContext("COTPPacket"); - PositionAware positionAware = readBuffer; - int startPos = positionAware.getPos(); - int curPos; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short headerLength = readImplicitField("headerLength", readUnsignedShort(readBuffer, 8)); - - short tpduCode = readDiscriminatorField("tpduCode", readUnsignedShort(readBuffer, 8)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - COTPPacketBuilder builder = null; - if (EvaluationHelper.equals(tpduCode, (short) 0xF0)) { - builder = COTPPacketData.staticParseCOTPPacketBuilder(readBuffer, cotpLen); - } else if (EvaluationHelper.equals(tpduCode, (short) 0xE0)) { - builder = COTPPacketConnectionRequest.staticParseCOTPPacketBuilder(readBuffer, cotpLen); - } else if (EvaluationHelper.equals(tpduCode, (short) 0xD0)) { - builder = COTPPacketConnectionResponse.staticParseCOTPPacketBuilder(readBuffer, cotpLen); - } else if (EvaluationHelper.equals(tpduCode, (short) 0x80)) { - builder = COTPPacketDisconnectRequest.staticParseCOTPPacketBuilder(readBuffer, cotpLen); - } else if (EvaluationHelper.equals(tpduCode, (short) 0xC0)) { - builder = COTPPacketDisconnectResponse.staticParseCOTPPacketBuilder(readBuffer, cotpLen); - } else if (EvaluationHelper.equals(tpduCode, (short) 0x70)) { - builder = COTPPacketTpduError.staticParseCOTPPacketBuilder(readBuffer, cotpLen); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "tpduCode=" - + tpduCode - + "]"); - } - - List parameters = - readLengthArrayField( - "parameters", - new DataReaderComplexDefault<>( - () -> - COTPParameter.staticParse( - readBuffer, - (short) ((((headerLength) + (1))) - ((positionAware.getPos() - startPos)))), - readBuffer), - (((headerLength) + (1))) - ((positionAware.getPos() - startPos))); - - S7Message payload = - readOptionalField( - "payload", - new DataReaderComplexDefault<>(() -> S7Message.staticParse(readBuffer), readBuffer), - ((positionAware.getPos() - startPos)) < (cotpLen)); - - readBuffer.closeContext("COTPPacket"); - // Create the instance - COTPPacket _cOTPPacket = builder.build(parameters, payload); - return _cOTPPacket; - } - - public interface COTPPacketBuilder { - COTPPacket build(List parameters, S7Message payload); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPPacket)) { - return false; - } - COTPPacket that = (COTPPacket) o; - return (getParameters() == that.getParameters()) && (getPayload() == that.getPayload()) && true; - } - - @Override - public int hashCode() { - return Objects.hash(getParameters(), getPayload()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java deleted file mode 100644 index f5c7bb10507..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPPacketConnectionRequest extends COTPPacket implements Message { - - // Accessors for discriminator values. - public Short getTpduCode() { - return (short) 0xE0; - } - - // Properties. - protected final int destinationReference; - protected final int sourceReference; - protected final COTPProtocolClass protocolClass; - - public COTPPacketConnectionRequest( - List parameters, - S7Message payload, - int destinationReference, - int sourceReference, - COTPProtocolClass protocolClass) { - super(parameters, payload); - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - this.protocolClass = protocolClass; - } - - public int getDestinationReference() { - return destinationReference; - } - - public int getSourceReference() { - return sourceReference; - } - - public COTPProtocolClass getProtocolClass() { - return protocolClass; - } - - @Override - protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPPacketConnectionRequest"); - - // Simple Field (destinationReference) - writeSimpleField( - "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (sourceReference) - writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (protocolClass) - writeSimpleEnumField( - "protocolClass", - "COTPProtocolClass", - protocolClass, - new DataWriterEnumDefault<>( - COTPProtocolClass::getValue, - COTPProtocolClass::name, - writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("COTPPacketConnectionRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPPacketConnectionRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (destinationReference) - lengthInBits += 16; - - // Simple field (sourceReference) - lengthInBits += 16; - - // Simple field (protocolClass) - lengthInBits += 8; - - return lengthInBits; - } - - public static COTPPacketBuilder staticParseCOTPPacketBuilder( - ReadBuffer readBuffer, Integer cotpLen) throws ParseException { - readBuffer.pullContext("COTPPacketConnectionRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int destinationReference = - readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); - - int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); - - COTPProtocolClass protocolClass = - readEnumField( - "protocolClass", - "COTPProtocolClass", - new DataReaderEnumDefault<>( - COTPProtocolClass::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("COTPPacketConnectionRequest"); - // Create the instance - return new COTPPacketConnectionRequestBuilderImpl( - destinationReference, sourceReference, protocolClass); - } - - public static class COTPPacketConnectionRequestBuilderImpl - implements COTPPacket.COTPPacketBuilder { - private final int destinationReference; - private final int sourceReference; - private final COTPProtocolClass protocolClass; - - public COTPPacketConnectionRequestBuilderImpl( - int destinationReference, int sourceReference, COTPProtocolClass protocolClass) { - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - this.protocolClass = protocolClass; - } - - public COTPPacketConnectionRequest build(List parameters, S7Message payload) { - COTPPacketConnectionRequest cOTPPacketConnectionRequest = - new COTPPacketConnectionRequest( - parameters, payload, destinationReference, sourceReference, protocolClass); - return cOTPPacketConnectionRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPPacketConnectionRequest)) { - return false; - } - COTPPacketConnectionRequest that = (COTPPacketConnectionRequest) o; - return (getDestinationReference() == that.getDestinationReference()) - && (getSourceReference() == that.getSourceReference()) - && (getProtocolClass() == that.getProtocolClass()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), getDestinationReference(), getSourceReference(), getProtocolClass()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java deleted file mode 100644 index 1d64fa5fa2e..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPPacketConnectionResponse extends COTPPacket implements Message { - - // Accessors for discriminator values. - public Short getTpduCode() { - return (short) 0xD0; - } - - // Properties. - protected final int destinationReference; - protected final int sourceReference; - protected final COTPProtocolClass protocolClass; - - public COTPPacketConnectionResponse( - List parameters, - S7Message payload, - int destinationReference, - int sourceReference, - COTPProtocolClass protocolClass) { - super(parameters, payload); - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - this.protocolClass = protocolClass; - } - - public int getDestinationReference() { - return destinationReference; - } - - public int getSourceReference() { - return sourceReference; - } - - public COTPProtocolClass getProtocolClass() { - return protocolClass; - } - - @Override - protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPPacketConnectionResponse"); - - // Simple Field (destinationReference) - writeSimpleField( - "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (sourceReference) - writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (protocolClass) - writeSimpleEnumField( - "protocolClass", - "COTPProtocolClass", - protocolClass, - new DataWriterEnumDefault<>( - COTPProtocolClass::getValue, - COTPProtocolClass::name, - writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("COTPPacketConnectionResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPPacketConnectionResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (destinationReference) - lengthInBits += 16; - - // Simple field (sourceReference) - lengthInBits += 16; - - // Simple field (protocolClass) - lengthInBits += 8; - - return lengthInBits; - } - - public static COTPPacketBuilder staticParseCOTPPacketBuilder( - ReadBuffer readBuffer, Integer cotpLen) throws ParseException { - readBuffer.pullContext("COTPPacketConnectionResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int destinationReference = - readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); - - int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); - - COTPProtocolClass protocolClass = - readEnumField( - "protocolClass", - "COTPProtocolClass", - new DataReaderEnumDefault<>( - COTPProtocolClass::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("COTPPacketConnectionResponse"); - // Create the instance - return new COTPPacketConnectionResponseBuilderImpl( - destinationReference, sourceReference, protocolClass); - } - - public static class COTPPacketConnectionResponseBuilderImpl - implements COTPPacket.COTPPacketBuilder { - private final int destinationReference; - private final int sourceReference; - private final COTPProtocolClass protocolClass; - - public COTPPacketConnectionResponseBuilderImpl( - int destinationReference, int sourceReference, COTPProtocolClass protocolClass) { - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - this.protocolClass = protocolClass; - } - - public COTPPacketConnectionResponse build(List parameters, S7Message payload) { - COTPPacketConnectionResponse cOTPPacketConnectionResponse = - new COTPPacketConnectionResponse( - parameters, payload, destinationReference, sourceReference, protocolClass); - return cOTPPacketConnectionResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPPacketConnectionResponse)) { - return false; - } - COTPPacketConnectionResponse that = (COTPPacketConnectionResponse) o; - return (getDestinationReference() == that.getDestinationReference()) - && (getSourceReference() == that.getSourceReference()) - && (getProtocolClass() == that.getProtocolClass()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), getDestinationReference(), getSourceReference(), getProtocolClass()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java deleted file mode 100644 index 233483c1a72..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPPacketData extends COTPPacket implements Message { - - // Accessors for discriminator values. - public Short getTpduCode() { - return (short) 0xF0; - } - - // Properties. - protected final boolean eot; - protected final byte tpduRef; - - public COTPPacketData( - List parameters, S7Message payload, boolean eot, byte tpduRef) { - super(parameters, payload); - this.eot = eot; - this.tpduRef = tpduRef; - } - - public boolean getEot() { - return eot; - } - - public byte getTpduRef() { - return tpduRef; - } - - @Override - protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPPacketData"); - - // Simple Field (eot) - writeSimpleField("eot", eot, writeBoolean(writeBuffer)); - - // Simple Field (tpduRef) - writeSimpleField("tpduRef", tpduRef, writeUnsignedByte(writeBuffer, 7)); - - writeBuffer.popContext("COTPPacketData"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPPacketData _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (eot) - lengthInBits += 1; - - // Simple field (tpduRef) - lengthInBits += 7; - - return lengthInBits; - } - - public static COTPPacketBuilder staticParseCOTPPacketBuilder( - ReadBuffer readBuffer, Integer cotpLen) throws ParseException { - readBuffer.pullContext("COTPPacketData"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - boolean eot = readSimpleField("eot", readBoolean(readBuffer)); - - byte tpduRef = readSimpleField("tpduRef", readUnsignedByte(readBuffer, 7)); - - readBuffer.closeContext("COTPPacketData"); - // Create the instance - return new COTPPacketDataBuilderImpl(eot, tpduRef); - } - - public static class COTPPacketDataBuilderImpl implements COTPPacket.COTPPacketBuilder { - private final boolean eot; - private final byte tpduRef; - - public COTPPacketDataBuilderImpl(boolean eot, byte tpduRef) { - this.eot = eot; - this.tpduRef = tpduRef; - } - - public COTPPacketData build(List parameters, S7Message payload) { - COTPPacketData cOTPPacketData = new COTPPacketData(parameters, payload, eot, tpduRef); - return cOTPPacketData; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPPacketData)) { - return false; - } - COTPPacketData that = (COTPPacketData) o; - return (getEot() == that.getEot()) - && (getTpduRef() == that.getTpduRef()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getEot(), getTpduRef()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java deleted file mode 100644 index 8c1ef73f6fd..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPPacketDisconnectRequest extends COTPPacket implements Message { - - // Accessors for discriminator values. - public Short getTpduCode() { - return (short) 0x80; - } - - // Properties. - protected final int destinationReference; - protected final int sourceReference; - protected final COTPProtocolClass protocolClass; - - public COTPPacketDisconnectRequest( - List parameters, - S7Message payload, - int destinationReference, - int sourceReference, - COTPProtocolClass protocolClass) { - super(parameters, payload); - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - this.protocolClass = protocolClass; - } - - public int getDestinationReference() { - return destinationReference; - } - - public int getSourceReference() { - return sourceReference; - } - - public COTPProtocolClass getProtocolClass() { - return protocolClass; - } - - @Override - protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPPacketDisconnectRequest"); - - // Simple Field (destinationReference) - writeSimpleField( - "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (sourceReference) - writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (protocolClass) - writeSimpleEnumField( - "protocolClass", - "COTPProtocolClass", - protocolClass, - new DataWriterEnumDefault<>( - COTPProtocolClass::getValue, - COTPProtocolClass::name, - writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("COTPPacketDisconnectRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPPacketDisconnectRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (destinationReference) - lengthInBits += 16; - - // Simple field (sourceReference) - lengthInBits += 16; - - // Simple field (protocolClass) - lengthInBits += 8; - - return lengthInBits; - } - - public static COTPPacketBuilder staticParseCOTPPacketBuilder( - ReadBuffer readBuffer, Integer cotpLen) throws ParseException { - readBuffer.pullContext("COTPPacketDisconnectRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int destinationReference = - readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); - - int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); - - COTPProtocolClass protocolClass = - readEnumField( - "protocolClass", - "COTPProtocolClass", - new DataReaderEnumDefault<>( - COTPProtocolClass::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("COTPPacketDisconnectRequest"); - // Create the instance - return new COTPPacketDisconnectRequestBuilderImpl( - destinationReference, sourceReference, protocolClass); - } - - public static class COTPPacketDisconnectRequestBuilderImpl - implements COTPPacket.COTPPacketBuilder { - private final int destinationReference; - private final int sourceReference; - private final COTPProtocolClass protocolClass; - - public COTPPacketDisconnectRequestBuilderImpl( - int destinationReference, int sourceReference, COTPProtocolClass protocolClass) { - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - this.protocolClass = protocolClass; - } - - public COTPPacketDisconnectRequest build(List parameters, S7Message payload) { - COTPPacketDisconnectRequest cOTPPacketDisconnectRequest = - new COTPPacketDisconnectRequest( - parameters, payload, destinationReference, sourceReference, protocolClass); - return cOTPPacketDisconnectRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPPacketDisconnectRequest)) { - return false; - } - COTPPacketDisconnectRequest that = (COTPPacketDisconnectRequest) o; - return (getDestinationReference() == that.getDestinationReference()) - && (getSourceReference() == that.getSourceReference()) - && (getProtocolClass() == that.getProtocolClass()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), getDestinationReference(), getSourceReference(), getProtocolClass()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java deleted file mode 100644 index 90bae295940..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPPacketDisconnectResponse extends COTPPacket implements Message { - - // Accessors for discriminator values. - public Short getTpduCode() { - return (short) 0xC0; - } - - // Properties. - protected final int destinationReference; - protected final int sourceReference; - - public COTPPacketDisconnectResponse( - List parameters, - S7Message payload, - int destinationReference, - int sourceReference) { - super(parameters, payload); - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - } - - public int getDestinationReference() { - return destinationReference; - } - - public int getSourceReference() { - return sourceReference; - } - - @Override - protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPPacketDisconnectResponse"); - - // Simple Field (destinationReference) - writeSimpleField( - "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (sourceReference) - writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("COTPPacketDisconnectResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPPacketDisconnectResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (destinationReference) - lengthInBits += 16; - - // Simple field (sourceReference) - lengthInBits += 16; - - return lengthInBits; - } - - public static COTPPacketBuilder staticParseCOTPPacketBuilder( - ReadBuffer readBuffer, Integer cotpLen) throws ParseException { - readBuffer.pullContext("COTPPacketDisconnectResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int destinationReference = - readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); - - int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); - - readBuffer.closeContext("COTPPacketDisconnectResponse"); - // Create the instance - return new COTPPacketDisconnectResponseBuilderImpl(destinationReference, sourceReference); - } - - public static class COTPPacketDisconnectResponseBuilderImpl - implements COTPPacket.COTPPacketBuilder { - private final int destinationReference; - private final int sourceReference; - - public COTPPacketDisconnectResponseBuilderImpl(int destinationReference, int sourceReference) { - this.destinationReference = destinationReference; - this.sourceReference = sourceReference; - } - - public COTPPacketDisconnectResponse build(List parameters, S7Message payload) { - COTPPacketDisconnectResponse cOTPPacketDisconnectResponse = - new COTPPacketDisconnectResponse( - parameters, payload, destinationReference, sourceReference); - return cOTPPacketDisconnectResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPPacketDisconnectResponse)) { - return false; - } - COTPPacketDisconnectResponse that = (COTPPacketDisconnectResponse) o; - return (getDestinationReference() == that.getDestinationReference()) - && (getSourceReference() == that.getSourceReference()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getDestinationReference(), getSourceReference()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java deleted file mode 100644 index bb6c4ed3aa2..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPPacketTpduError extends COTPPacket implements Message { - - // Accessors for discriminator values. - public Short getTpduCode() { - return (short) 0x70; - } - - // Properties. - protected final int destinationReference; - protected final short rejectCause; - - public COTPPacketTpduError( - List parameters, - S7Message payload, - int destinationReference, - short rejectCause) { - super(parameters, payload); - this.destinationReference = destinationReference; - this.rejectCause = rejectCause; - } - - public int getDestinationReference() { - return destinationReference; - } - - public short getRejectCause() { - return rejectCause; - } - - @Override - protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPPacketTpduError"); - - // Simple Field (destinationReference) - writeSimpleField( - "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (rejectCause) - writeSimpleField("rejectCause", rejectCause, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("COTPPacketTpduError"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPPacketTpduError _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (destinationReference) - lengthInBits += 16; - - // Simple field (rejectCause) - lengthInBits += 8; - - return lengthInBits; - } - - public static COTPPacketBuilder staticParseCOTPPacketBuilder( - ReadBuffer readBuffer, Integer cotpLen) throws ParseException { - readBuffer.pullContext("COTPPacketTpduError"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int destinationReference = - readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); - - short rejectCause = readSimpleField("rejectCause", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("COTPPacketTpduError"); - // Create the instance - return new COTPPacketTpduErrorBuilderImpl(destinationReference, rejectCause); - } - - public static class COTPPacketTpduErrorBuilderImpl implements COTPPacket.COTPPacketBuilder { - private final int destinationReference; - private final short rejectCause; - - public COTPPacketTpduErrorBuilderImpl(int destinationReference, short rejectCause) { - this.destinationReference = destinationReference; - this.rejectCause = rejectCause; - } - - public COTPPacketTpduError build(List parameters, S7Message payload) { - COTPPacketTpduError cOTPPacketTpduError = - new COTPPacketTpduError(parameters, payload, destinationReference, rejectCause); - return cOTPPacketTpduError; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPPacketTpduError)) { - return false; - } - COTPPacketTpduError that = (COTPPacketTpduError) o; - return (getDestinationReference() == that.getDestinationReference()) - && (getRejectCause() == that.getRejectCause()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getDestinationReference(), getRejectCause()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java deleted file mode 100644 index d056c5f92fc..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class COTPParameter implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getParameterType(); - - public COTPParameter() { - super(); - } - - protected abstract void serializeCOTPParameterChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPParameter"); - - // Discriminator Field (parameterType) (Used as input to a switch field) - writeDiscriminatorField( - "parameterType", getParameterType(), writeUnsignedShort(writeBuffer, 8)); - - // Implicit Field (parameterLength) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - short parameterLength = (short) ((getLengthInBytes()) - (2)); - writeImplicitField("parameterLength", parameterLength, writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeCOTPParameterChild(writeBuffer); - - writeBuffer.popContext("COTPParameter"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - COTPParameter _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Discriminator Field (parameterType) - lengthInBits += 8; - - // Implicit Field (parameterLength) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static COTPParameter staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - if ((args == null) || (args.length != 1)) { - throw new PlcRuntimeException( - "Wrong number of arguments, expected 1, but got " + args.length); - } - Short rest; - if (args[0] instanceof Short) { - rest = (Short) args[0]; - } else if (args[0] instanceof String) { - rest = Short.valueOf((String) args[0]); - } else { - throw new PlcRuntimeException( - "Argument 0 expected to be of type Short or a string which is parseable but was " - + args[0].getClass().getName()); - } - return staticParse(readBuffer, rest); - } - - public static COTPParameter staticParse(ReadBuffer readBuffer, Short rest) throws ParseException { - readBuffer.pullContext("COTPParameter"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short parameterType = readDiscriminatorField("parameterType", readUnsignedShort(readBuffer, 8)); - - short parameterLength = readImplicitField("parameterLength", readUnsignedShort(readBuffer, 8)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - COTPParameterBuilder builder = null; - if (EvaluationHelper.equals(parameterType, (short) 0xC0)) { - builder = COTPParameterTpduSize.staticParseCOTPParameterBuilder(readBuffer, rest); - } else if (EvaluationHelper.equals(parameterType, (short) 0xC1)) { - builder = COTPParameterCallingTsap.staticParseCOTPParameterBuilder(readBuffer, rest); - } else if (EvaluationHelper.equals(parameterType, (short) 0xC2)) { - builder = COTPParameterCalledTsap.staticParseCOTPParameterBuilder(readBuffer, rest); - } else if (EvaluationHelper.equals(parameterType, (short) 0xC3)) { - builder = COTPParameterChecksum.staticParseCOTPParameterBuilder(readBuffer, rest); - } else if (EvaluationHelper.equals(parameterType, (short) 0xE0)) { - builder = - COTPParameterDisconnectAdditionalInformation.staticParseCOTPParameterBuilder( - readBuffer, rest); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "parameterType=" - + parameterType - + "]"); - } - - readBuffer.closeContext("COTPParameter"); - // Create the instance - COTPParameter _cOTPParameter = builder.build(); - return _cOTPParameter; - } - - public interface COTPParameterBuilder { - COTPParameter build(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPParameter)) { - return false; - } - COTPParameter that = (COTPParameter) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java deleted file mode 100644 index 154495f6808..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPParameterCalledTsap extends COTPParameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0xC2; - } - - // Properties. - protected final int tsapId; - - public COTPParameterCalledTsap(int tsapId) { - super(); - this.tsapId = tsapId; - } - - public int getTsapId() { - return tsapId; - } - - @Override - protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPParameterCalledTsap"); - - // Simple Field (tsapId) - writeSimpleField("tsapId", tsapId, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("COTPParameterCalledTsap"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPParameterCalledTsap _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (tsapId) - lengthInBits += 16; - - return lengthInBits; - } - - public static COTPParameterBuilder staticParseCOTPParameterBuilder( - ReadBuffer readBuffer, Short rest) throws ParseException { - readBuffer.pullContext("COTPParameterCalledTsap"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int tsapId = readSimpleField("tsapId", readUnsignedInt(readBuffer, 16)); - - readBuffer.closeContext("COTPParameterCalledTsap"); - // Create the instance - return new COTPParameterCalledTsapBuilderImpl(tsapId); - } - - public static class COTPParameterCalledTsapBuilderImpl - implements COTPParameter.COTPParameterBuilder { - private final int tsapId; - - public COTPParameterCalledTsapBuilderImpl(int tsapId) { - this.tsapId = tsapId; - } - - public COTPParameterCalledTsap build() { - COTPParameterCalledTsap cOTPParameterCalledTsap = new COTPParameterCalledTsap(tsapId); - return cOTPParameterCalledTsap; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPParameterCalledTsap)) { - return false; - } - COTPParameterCalledTsap that = (COTPParameterCalledTsap) o; - return (getTsapId() == that.getTsapId()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getTsapId()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java deleted file mode 100644 index b61845ae97a..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPParameterCallingTsap extends COTPParameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0xC1; - } - - // Properties. - protected final int tsapId; - - public COTPParameterCallingTsap(int tsapId) { - super(); - this.tsapId = tsapId; - } - - public int getTsapId() { - return tsapId; - } - - @Override - protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPParameterCallingTsap"); - - // Simple Field (tsapId) - writeSimpleField("tsapId", tsapId, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("COTPParameterCallingTsap"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPParameterCallingTsap _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (tsapId) - lengthInBits += 16; - - return lengthInBits; - } - - public static COTPParameterBuilder staticParseCOTPParameterBuilder( - ReadBuffer readBuffer, Short rest) throws ParseException { - readBuffer.pullContext("COTPParameterCallingTsap"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int tsapId = readSimpleField("tsapId", readUnsignedInt(readBuffer, 16)); - - readBuffer.closeContext("COTPParameterCallingTsap"); - // Create the instance - return new COTPParameterCallingTsapBuilderImpl(tsapId); - } - - public static class COTPParameterCallingTsapBuilderImpl - implements COTPParameter.COTPParameterBuilder { - private final int tsapId; - - public COTPParameterCallingTsapBuilderImpl(int tsapId) { - this.tsapId = tsapId; - } - - public COTPParameterCallingTsap build() { - COTPParameterCallingTsap cOTPParameterCallingTsap = new COTPParameterCallingTsap(tsapId); - return cOTPParameterCallingTsap; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPParameterCallingTsap)) { - return false; - } - COTPParameterCallingTsap that = (COTPParameterCallingTsap) o; - return (getTsapId() == that.getTsapId()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getTsapId()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java deleted file mode 100644 index bfa89f0ff1e..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java +++ /dev/null @@ -1,141 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPParameterChecksum extends COTPParameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0xC3; - } - - // Properties. - protected final short crc; - - public COTPParameterChecksum(short crc) { - super(); - this.crc = crc; - } - - public short getCrc() { - return crc; - } - - @Override - protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPParameterChecksum"); - - // Simple Field (crc) - writeSimpleField("crc", crc, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("COTPParameterChecksum"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPParameterChecksum _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (crc) - lengthInBits += 8; - - return lengthInBits; - } - - public static COTPParameterBuilder staticParseCOTPParameterBuilder( - ReadBuffer readBuffer, Short rest) throws ParseException { - readBuffer.pullContext("COTPParameterChecksum"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short crc = readSimpleField("crc", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("COTPParameterChecksum"); - // Create the instance - return new COTPParameterChecksumBuilderImpl(crc); - } - - public static class COTPParameterChecksumBuilderImpl - implements COTPParameter.COTPParameterBuilder { - private final short crc; - - public COTPParameterChecksumBuilderImpl(short crc) { - this.crc = crc; - } - - public COTPParameterChecksum build() { - COTPParameterChecksum cOTPParameterChecksum = new COTPParameterChecksum(crc); - return cOTPParameterChecksum; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPParameterChecksum)) { - return false; - } - COTPParameterChecksum that = (COTPParameterChecksum) o; - return (getCrc() == that.getCrc()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getCrc()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java deleted file mode 100644 index 9846b0517fe..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPParameterDisconnectAdditionalInformation extends COTPParameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0xE0; - } - - // Properties. - protected final byte[] data; - - public COTPParameterDisconnectAdditionalInformation(byte[] data) { - super(); - this.data = data; - } - - public byte[] getData() { - return data; - } - - @Override - protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPParameterDisconnectAdditionalInformation"); - - // Array Field (data) - writeByteArrayField("data", data, writeByteArray(writeBuffer, 8)); - - writeBuffer.popContext("COTPParameterDisconnectAdditionalInformation"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPParameterDisconnectAdditionalInformation _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Array field - if (data != null) { - lengthInBits += 8 * data.length; - } - - return lengthInBits; - } - - public static COTPParameterBuilder staticParseCOTPParameterBuilder( - ReadBuffer readBuffer, Short rest) throws ParseException { - readBuffer.pullContext("COTPParameterDisconnectAdditionalInformation"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - byte[] data = readBuffer.readByteArray("data", Math.toIntExact(rest)); - - readBuffer.closeContext("COTPParameterDisconnectAdditionalInformation"); - // Create the instance - return new COTPParameterDisconnectAdditionalInformationBuilderImpl(data); - } - - public static class COTPParameterDisconnectAdditionalInformationBuilderImpl - implements COTPParameter.COTPParameterBuilder { - private final byte[] data; - - public COTPParameterDisconnectAdditionalInformationBuilderImpl(byte[] data) { - this.data = data; - } - - public COTPParameterDisconnectAdditionalInformation build() { - COTPParameterDisconnectAdditionalInformation cOTPParameterDisconnectAdditionalInformation = - new COTPParameterDisconnectAdditionalInformation(data); - return cOTPParameterDisconnectAdditionalInformation; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPParameterDisconnectAdditionalInformation)) { - return false; - } - COTPParameterDisconnectAdditionalInformation that = - (COTPParameterDisconnectAdditionalInformation) o; - return (getData() == that.getData()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getData()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java deleted file mode 100644 index be740620a83..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java +++ /dev/null @@ -1,151 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class COTPParameterTpduSize extends COTPParameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0xC0; - } - - // Properties. - protected final COTPTpduSize tpduSize; - - public COTPParameterTpduSize(COTPTpduSize tpduSize) { - super(); - this.tpduSize = tpduSize; - } - - public COTPTpduSize getTpduSize() { - return tpduSize; - } - - @Override - protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("COTPParameterTpduSize"); - - // Simple Field (tpduSize) - writeSimpleEnumField( - "tpduSize", - "COTPTpduSize", - tpduSize, - new DataWriterEnumDefault<>( - COTPTpduSize::getValue, COTPTpduSize::name, writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("COTPParameterTpduSize"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - COTPParameterTpduSize _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (tpduSize) - lengthInBits += 8; - - return lengthInBits; - } - - public static COTPParameterBuilder staticParseCOTPParameterBuilder( - ReadBuffer readBuffer, Short rest) throws ParseException { - readBuffer.pullContext("COTPParameterTpduSize"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - COTPTpduSize tpduSize = - readEnumField( - "tpduSize", - "COTPTpduSize", - new DataReaderEnumDefault<>( - COTPTpduSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("COTPParameterTpduSize"); - // Create the instance - return new COTPParameterTpduSizeBuilderImpl(tpduSize); - } - - public static class COTPParameterTpduSizeBuilderImpl - implements COTPParameter.COTPParameterBuilder { - private final COTPTpduSize tpduSize; - - public COTPParameterTpduSizeBuilderImpl(COTPTpduSize tpduSize) { - this.tpduSize = tpduSize; - } - - public COTPParameterTpduSize build() { - COTPParameterTpduSize cOTPParameterTpduSize = new COTPParameterTpduSize(tpduSize); - return cOTPParameterTpduSize; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof COTPParameterTpduSize)) { - return false; - } - COTPParameterTpduSize that = (COTPParameterTpduSize) o; - return (getTpduSize() == that.getTpduSize()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getTpduSize()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java deleted file mode 100644 index 01715721bc9..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum COTPProtocolClass { - CLASS_0((short) 0x00), - CLASS_1((short) 0x10), - CLASS_2((short) 0x20), - CLASS_3((short) 0x30), - CLASS_4((short) 0x40); - private static final Map map; - - static { - map = new HashMap<>(); - for (COTPProtocolClass value : COTPProtocolClass.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - COTPProtocolClass(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static COTPProtocolClass enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java deleted file mode 100644 index 9f7df7129aa..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum COTPTpduSize { - SIZE_128((short) 0x07, (int) 128), - SIZE_256((short) 0x08, (int) 256), - SIZE_512((short) 0x09, (int) 512), - SIZE_1024((short) 0x0a, (int) 1024), - SIZE_2048((short) 0x0b, (int) 2048), - SIZE_4096((short) 0x0c, (int) 4096), - SIZE_8192((short) 0x0d, (int) 8192); - private static final Map map; - - static { - map = new HashMap<>(); - for (COTPTpduSize value : COTPTpduSize.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - private final int sizeInBytes; - - COTPTpduSize(short value, int sizeInBytes) { - this.value = value; - this.sizeInBytes = sizeInBytes; - } - - public short getValue() { - return value; - } - - public int getSizeInBytes() { - return sizeInBytes; - } - - public static COTPTpduSize firstEnumForFieldSizeInBytes(int fieldValue) { - for (COTPTpduSize _val : COTPTpduSize.values()) { - if (_val.getSizeInBytes() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSizeInBytes(int fieldValue) { - List _values = new ArrayList<>(); - for (COTPTpduSize _val : COTPTpduSize.values()) { - if (_val.getSizeInBytes() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public static COTPTpduSize enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java deleted file mode 100644 index 10be0b999da..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum CpuSubscribeEvents { - CPU((short) 0x01), - IM((short) 0x02), - FM((short) 0x04), - CP((short) 0x80); - private static final Map map; - - static { - map = new HashMap<>(); - for (CpuSubscribeEvents value : CpuSubscribeEvents.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - CpuSubscribeEvents(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static CpuSubscribeEvents enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java deleted file mode 100644 index c15002a449e..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java +++ /dev/null @@ -1,244 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class CycServiceItemAnyType extends CycServiceItemType implements Message { - - // Accessors for discriminator values. - - // Properties. - protected final TransportSize transportSize; - protected final int length; - protected final int dbNumber; - protected final MemoryArea memoryArea; - protected final int address; - - public CycServiceItemAnyType( - short byteLength, - short syntaxId, - TransportSize transportSize, - int length, - int dbNumber, - MemoryArea memoryArea, - int address) { - super(byteLength, syntaxId); - this.transportSize = transportSize; - this.length = length; - this.dbNumber = dbNumber; - this.memoryArea = memoryArea; - this.address = address; - } - - public TransportSize getTransportSize() { - return transportSize; - } - - public int getLength() { - return length; - } - - public int getDbNumber() { - return dbNumber; - } - - public MemoryArea getMemoryArea() { - return memoryArea; - } - - public int getAddress() { - return address; - } - - @Override - protected void serializeCycServiceItemTypeChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("CycServiceItemAnyType"); - - // Enum field (transportSize) - writeEnumField( - "transportSize", - "TransportSize", - transportSize, - new DataWriterEnumDefault<>( - TransportSize::getCode, TransportSize::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (length) - writeSimpleField("length", length, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (dbNumber) - writeSimpleField("dbNumber", dbNumber, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (memoryArea) - writeSimpleEnumField( - "memoryArea", - "MemoryArea", - memoryArea, - new DataWriterEnumDefault<>( - MemoryArea::getValue, MemoryArea::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (address) - writeSimpleField("address", address, writeUnsignedInt(writeBuffer, 24)); - - writeBuffer.popContext("CycServiceItemAnyType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - CycServiceItemAnyType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Enum Field (transportSize) - lengthInBits += 8; - - // Simple field (length) - lengthInBits += 16; - - // Simple field (dbNumber) - lengthInBits += 16; - - // Simple field (memoryArea) - lengthInBits += 8; - - // Simple field (address) - lengthInBits += 24; - - return lengthInBits; - } - - public static CycServiceItemTypeBuilder staticParseCycServiceItemTypeBuilder( - ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("CycServiceItemAnyType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - TransportSize transportSize = - readEnumField( - "transportSize", - "TransportSize", - readEnum(TransportSize::firstEnumForFieldCode, readUnsignedShort(readBuffer, 8))); - - int length = readSimpleField("length", readUnsignedInt(readBuffer, 16)); - - int dbNumber = readSimpleField("dbNumber", readUnsignedInt(readBuffer, 16)); - - MemoryArea memoryArea = - readEnumField( - "memoryArea", - "MemoryArea", - new DataReaderEnumDefault<>( - MemoryArea::enumForValue, readUnsignedShort(readBuffer, 8))); - - int address = readSimpleField("address", readUnsignedInt(readBuffer, 24)); - - readBuffer.closeContext("CycServiceItemAnyType"); - // Create the instance - return new CycServiceItemAnyTypeBuilderImpl( - transportSize, length, dbNumber, memoryArea, address); - } - - public static class CycServiceItemAnyTypeBuilderImpl - implements CycServiceItemType.CycServiceItemTypeBuilder { - private final TransportSize transportSize; - private final int length; - private final int dbNumber; - private final MemoryArea memoryArea; - private final int address; - - public CycServiceItemAnyTypeBuilderImpl( - TransportSize transportSize, int length, int dbNumber, MemoryArea memoryArea, int address) { - this.transportSize = transportSize; - this.length = length; - this.dbNumber = dbNumber; - this.memoryArea = memoryArea; - this.address = address; - } - - public CycServiceItemAnyType build(short byteLength, short syntaxId) { - CycServiceItemAnyType cycServiceItemAnyType = - new CycServiceItemAnyType( - byteLength, syntaxId, transportSize, length, dbNumber, memoryArea, address); - return cycServiceItemAnyType; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof CycServiceItemAnyType)) { - return false; - } - CycServiceItemAnyType that = (CycServiceItemAnyType) o; - return (getTransportSize() == that.getTransportSize()) - && (getLength() == that.getLength()) - && (getDbNumber() == that.getDbNumber()) - && (getMemoryArea() == that.getMemoryArea()) - && (getAddress() == that.getAddress()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), - getTransportSize(), - getLength(), - getDbNumber(), - getMemoryArea(), - getAddress()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java deleted file mode 100644 index 73363758ddd..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class CycServiceItemDbReadType extends CycServiceItemType implements Message { - - // Accessors for discriminator values. - - // Properties. - protected final short numberOfAreas; - protected final List items; - - public CycServiceItemDbReadType( - short byteLength, short syntaxId, short numberOfAreas, List items) { - super(byteLength, syntaxId); - this.numberOfAreas = numberOfAreas; - this.items = items; - } - - public short getNumberOfAreas() { - return numberOfAreas; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeCycServiceItemTypeChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("CycServiceItemDbReadType"); - - // Simple Field (numberOfAreas) - writeSimpleField("numberOfAreas", numberOfAreas, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("CycServiceItemDbReadType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - CycServiceItemDbReadType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (numberOfAreas) - lengthInBits += 8; - - // Array field - if (items != null) { - int i = 0; - for (SubItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static CycServiceItemTypeBuilder staticParseCycServiceItemTypeBuilder( - ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("CycServiceItemDbReadType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short numberOfAreas = readSimpleField("numberOfAreas", readUnsignedShort(readBuffer, 8)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>(() -> SubItem.staticParse(readBuffer), readBuffer), - numberOfAreas); - - readBuffer.closeContext("CycServiceItemDbReadType"); - // Create the instance - return new CycServiceItemDbReadTypeBuilderImpl(numberOfAreas, items); - } - - public static class CycServiceItemDbReadTypeBuilderImpl - implements CycServiceItemType.CycServiceItemTypeBuilder { - private final short numberOfAreas; - private final List items; - - public CycServiceItemDbReadTypeBuilderImpl(short numberOfAreas, List items) { - this.numberOfAreas = numberOfAreas; - this.items = items; - } - - public CycServiceItemDbReadType build(short byteLength, short syntaxId) { - CycServiceItemDbReadType cycServiceItemDbReadType = - new CycServiceItemDbReadType(byteLength, syntaxId, numberOfAreas, items); - return cycServiceItemDbReadType; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof CycServiceItemDbReadType)) { - return false; - } - CycServiceItemDbReadType that = (CycServiceItemDbReadType) o; - return (getNumberOfAreas() == that.getNumberOfAreas()) - && (getItems() == that.getItems()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getNumberOfAreas(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java deleted file mode 100644 index 9dca1f7e3ed..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class CycServiceItemType implements Message { - - // Abstract accessors for discriminator values. - - // Constant values. - public static final Short FUNCTIONID = 0x12; - - // Properties. - protected final short byteLength; - protected final short syntaxId; - - public CycServiceItemType(short byteLength, short syntaxId) { - super(); - this.byteLength = byteLength; - this.syntaxId = syntaxId; - } - - public short getByteLength() { - return byteLength; - } - - public short getSyntaxId() { - return syntaxId; - } - - public short getFunctionId() { - return FUNCTIONID; - } - - protected abstract void serializeCycServiceItemTypeChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("CycServiceItemType"); - - // Const Field (functionId) - writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (byteLength) - writeSimpleField("byteLength", byteLength, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (syntaxId) - writeSimpleField("syntaxId", syntaxId, writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeCycServiceItemTypeChild(writeBuffer); - - writeBuffer.popContext("CycServiceItemType"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - CycServiceItemType _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (functionId) - lengthInBits += 8; - - // Simple field (byteLength) - lengthInBits += 8; - - // Simple field (syntaxId) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static CycServiceItemType staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static CycServiceItemType staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("CycServiceItemType"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = - readConstField( - "functionId", readUnsignedShort(readBuffer, 8), CycServiceItemType.FUNCTIONID); - - short byteLength = readSimpleField("byteLength", readUnsignedShort(readBuffer, 8)); - - short syntaxId = readSimpleField("syntaxId", readUnsignedShort(readBuffer, 8)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - CycServiceItemTypeBuilder builder = null; - if (EvaluationHelper.equals(syntaxId, (short) 0x10)) { - builder = CycServiceItemAnyType.staticParseCycServiceItemTypeBuilder(readBuffer); - } else if (EvaluationHelper.equals(syntaxId, (short) 0xb0)) { - builder = CycServiceItemDbReadType.staticParseCycServiceItemTypeBuilder(readBuffer); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "syntaxId=" - + syntaxId - + "]"); - } - - readBuffer.closeContext("CycServiceItemType"); - // Create the instance - CycServiceItemType _cycServiceItemType = builder.build(byteLength, syntaxId); - return _cycServiceItemType; - } - - public interface CycServiceItemTypeBuilder { - CycServiceItemType build(short byteLength, short syntaxId); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof CycServiceItemType)) { - return false; - } - CycServiceItemType that = (CycServiceItemType) o; - return (getByteLength() == that.getByteLength()) - && (getSyntaxId() == that.getSyntaxId()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getByteLength(), getSyntaxId()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java deleted file mode 100644 index 8cbcc67d768..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ /dev/null @@ -1,531 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.math.BigInteger; -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.WithOption; -import org.apache.plc4x.java.spi.generation.ByteOrder; -import org.apache.plc4x.java.spi.generation.EvaluationHelper; -import org.apache.plc4x.java.spi.generation.ParseException; -import org.apache.plc4x.java.spi.generation.ReadBuffer; -import org.apache.plc4x.java.spi.generation.SerializationException; -import org.apache.plc4x.java.spi.generation.WriteBuffer; -import org.apache.plc4x.java.spi.values.*; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -// Code generated by code-generation. DO NOT EDIT. - -public class DataItem { - - private static final Logger LOGGER = LoggerFactory.getLogger(DataItem.class); - - public static PlcValue staticParse( - ReadBuffer readBuffer, String dataProtocolId, Integer stringLength) throws ParseException { - if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BOOL")) { // BOOL - - // Reserved Field (Compartmentalized so the "reserved" variable can't leak) - { - byte reserved = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedByte("", 7); - if (reserved != (byte) 0x00) { - LOGGER.info( - "Expected constant value " + 0x00 + " but got " + reserved + " for reserved field."); - } - } - - // Simple Field (value) - Boolean value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readBit(""); - - return new PlcBOOL(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BYTE")) { // BYTE - - // Simple Field (value) - Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - return new PlcBYTE(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WORD")) { // WORD - - // Simple Field (value) - Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); - - return new PlcWORD(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DWORD")) { // DWORD - - // Simple Field (value) - Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32); - - return new PlcDWORD(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LWORD")) { // LWORD - - // Simple Field (value) - BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return new PlcLWORD(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_SINT")) { // SINT - - // Simple Field (value) - Byte value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readSignedByte("", 8); - - return new PlcSINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_USINT")) { // USINT - - // Simple Field (value) - Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - return new PlcUSINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_INT")) { // INT - - // Simple Field (value) - Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readShort("", 16); - - return new PlcINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UINT")) { // UINT - - // Simple Field (value) - Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); - - return new PlcUINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DINT")) { // DINT - - // Simple Field (value) - Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32); - - return new PlcDINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UDINT")) { // UDINT - - // Simple Field (value) - Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32); - - return new PlcUDINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LINT")) { // LINT - - // Simple Field (value) - Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readLong("", 64); - - return new PlcLINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_ULINT")) { // ULINT - - // Simple Field (value) - BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return new PlcULINT(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_REAL")) { // REAL - - // Simple Field (value) - Float value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readFloat("", 32); - - return new PlcREAL(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LREAL")) { // LREAL - - // Simple Field (value) - Double value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readDouble("", 64); - - return new PlcLREAL(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_CHAR")) { // CHAR - - // Simple Field (value) - String value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readString("", 8, WithOption.WithEncoding("UTF-8")); - - return new PlcCHAR(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WCHAR")) { // CHAR - - // Simple Field (value) - String value = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readString("", 16, WithOption.WithEncoding("UTF-16")); - - return new PlcCHAR(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_STRING")) { // STRING - - // Manual Field (value) - String value = - (String) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseS7String( - readBuffer, stringLength, "UTF-8")); - - return new PlcSTRING(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WSTRING")) { // STRING - - // Manual Field (value) - String value = - (String) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseS7String( - readBuffer, stringLength, "UTF-16")); - - return new PlcSTRING(value); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME - - // Simple Field (milliseconds) - Integer milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32); - - return PlcTIME.ofMilliseconds(milliseconds); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME - - // Simple Field (nanoseconds) - BigInteger nanoseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return PlcLTIME.ofNanoseconds(nanoseconds); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - - // Simple Field (daysSinceSiemensEpoch) - Integer daysSinceSiemensEpoch = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedInt("", 16); - - return PlcDATE.ofDaysSinceSiemensEpoch(daysSinceSiemensEpoch); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY - - // Simple Field (millisecondsSinceMidnight) - Long millisecondsSinceMidnight = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedLong("", 32); - - return PlcTIME_OF_DAY.ofMillisecondsSinceMidnight(millisecondsSinceMidnight); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME_OF_DAY")) { // LTIME_OF_DAY - - // Simple Field (nanosecondsSinceMidnight) - BigInteger nanosecondsSinceMidnight = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedBigInteger("", 64); - - return PlcLTIME_OF_DAY.ofNanosecondsSinceMidnight(nanosecondsSinceMidnight); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE_AND_TIME")) { // DATE_AND_TIME - - // Simple Field (year) - Integer year = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); - - // Simple Field (month) - Short month = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - // Simple Field (day) - Short day = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - // Simple Field (dayOfWeek) - Short dayOfWeek = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedShort("", 8); - - // Simple Field (hour) - Short hour = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - // Simple Field (minutes) - Short minutes = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - // Simple Field (seconds) - Short seconds = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); - - // Simple Field (nanoseconds) - Long nanoseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedLong("", 32); - - return PlcDATE_AND_TIME.ofSegments( - year.intValue(), - (month == 0) ? 1 : month.intValue(), - (day == 0) ? 1 : day.intValue(), - hour.intValue(), - minutes.intValue(), - seconds.intValue(), - nanoseconds.intValue()); - } - return null; - } - - public static void staticSerialize( - WriteBuffer writeBuffer, PlcValue _value, String dataProtocolId, Integer stringLength) - throws SerializationException { - staticSerialize(writeBuffer, _value, dataProtocolId, stringLength, ByteOrder.BIG_ENDIAN); - } - - public static void staticSerialize( - WriteBuffer writeBuffer, - PlcValue _value, - String dataProtocolId, - Integer stringLength, - ByteOrder byteOrder) - throws SerializationException { - if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BOOL")) { // BOOL - // Reserved Field - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedByte("", 7, ((Number) (byte) 0x00).byteValue()); - // Simple Field (value) - boolean value = (boolean) _value.getBoolean(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeBit("", (boolean) (value)); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BYTE")) { // BYTE - // Simple Field (value) - short value = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WORD")) { // WORD - // Simple Field (value) - int value = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DWORD")) { // DWORD - // Simple Field (value) - long value = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LWORD")) { // LWORD - // Simple Field (value) - BigInteger value = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value)); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_SINT")) { // SINT - // Simple Field (value) - byte value = (byte) _value.getByte(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeSignedByte("", 8, ((Number) (value)).byteValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_USINT")) { // USINT - // Simple Field (value) - short value = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_INT")) { // INT - // Simple Field (value) - short value = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeShort("", 16, ((Number) (value)).shortValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UINT")) { // UINT - // Simple Field (value) - int value = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DINT")) { // DINT - // Simple Field (value) - int value = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (value)).intValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UDINT")) { // UDINT - // Simple Field (value) - long value = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LINT")) { // LINT - // Simple Field (value) - long value = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeLong("", 64, ((Number) (value)).longValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_ULINT")) { // ULINT - // Simple Field (value) - BigInteger value = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value)); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_REAL")) { // REAL - // Simple Field (value) - float value = (float) _value.getFloat(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeFloat("", 32, (value)); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LREAL")) { // LREAL - // Simple Field (value) - double value = (double) _value.getDouble(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeDouble("", 64, (value)); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_CHAR")) { // CHAR - // Simple Field (value) - String value = (String) _value.getString(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeString( - "", 8, (String) (value), WithOption.WithEncoding("UTF-8")); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WCHAR")) { // CHAR - // Simple Field (value) - String value = (String) _value.getString(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeString( - "", 16, (String) (value), WithOption.WithEncoding("UTF-16")); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_STRING")) { // STRING - // Manual Field (value) - org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeS7String( - writeBuffer, _value, stringLength, "UTF-8"); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WSTRING")) { // STRING - // Manual Field (value) - org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeS7String( - writeBuffer, _value, stringLength, "UTF-16"); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME - // Simple Field (milliseconds) - int milliseconds = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (milliseconds)).intValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME - // Simple Field (nanoseconds) - BigInteger nanoseconds = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (nanoseconds)); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Simple Field (daysSinceSiemensEpoch) - int daysSinceSiemensEpoch = (int) ((PlcDATE) _value).getDaysSinceSiemensEpoch(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedInt( - "", 16, ((Number) (daysSinceSiemensEpoch)).intValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY - // Simple Field (millisecondsSinceMidnight) - long millisecondsSinceMidnight = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( - "", 32, ((Number) (millisecondsSinceMidnight)).longValue()); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME_OF_DAY")) { // LTIME_OF_DAY - // Simple Field (nanosecondsSinceMidnight) - BigInteger nanosecondsSinceMidnight = (BigInteger) _value.getBigInteger(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger( - "", 64, (BigInteger) (nanosecondsSinceMidnight)); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE_AND_TIME")) { // DATE_AND_TIME - // Simple Field (year) - int year = (int) _value.getInt(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (year)).intValue()); - // Simple Field (month) - short month = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (month)).shortValue()); - // Simple Field (day) - short day = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (day)).shortValue()); - // Simple Field (dayOfWeek) - short dayOfWeek = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort( - "", 8, ((Number) (dayOfWeek)).shortValue()); - // Simple Field (hour) - short hour = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (hour)).shortValue()); - // Simple Field (minutes) - short minutes = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (minutes)).shortValue()); - // Simple Field (seconds) - short seconds = (short) _value.getShort(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (seconds)).shortValue()); - // Simple Field (nanoseconds) - long nanoseconds = (long) _value.getLong(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( - "", 32, ((Number) (nanoseconds)).longValue()); - } - } - - public static int getLengthInBytes(PlcValue _value, String dataProtocolId, Integer stringLength) { - return (int) Math.ceil((float) getLengthInBits(_value, dataProtocolId, stringLength) / 8.0); - } - - public static int getLengthInBits(PlcValue _value, String dataProtocolId, Integer stringLength) { - int sizeInBits = 0; - if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BOOL")) { // BOOL - // Reserved Field - sizeInBits += 7; - // Simple Field (value) - sizeInBits += 1; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BYTE")) { // BYTE - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WORD")) { // WORD - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DWORD")) { // DWORD - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LWORD")) { // LWORD - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_SINT")) { // SINT - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_USINT")) { // USINT - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_INT")) { // INT - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UINT")) { // UINT - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DINT")) { // DINT - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UDINT")) { // UDINT - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LINT")) { // LINT - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_ULINT")) { // ULINT - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_REAL")) { // REAL - // Simple Field (value) - sizeInBits += 32; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LREAL")) { // LREAL - // Simple Field (value) - sizeInBits += 64; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_CHAR")) { // CHAR - // Simple Field (value) - sizeInBits += 8; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WCHAR")) { // CHAR - // Simple Field (value) - sizeInBits += 16; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_STRING")) { // STRING - // Manual Field (value) - sizeInBits += (((stringLength) * (8))) + (16); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WSTRING")) { // STRING - // Manual Field (value) - sizeInBits += (((stringLength) * (16))) + (32); - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME - // Simple Field (milliseconds) - sizeInBits += 32; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME - // Simple Field (nanoseconds) - sizeInBits += 64; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Simple Field (daysSinceSiemensEpoch) - sizeInBits += 16; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY - // Simple Field (millisecondsSinceMidnight) - sizeInBits += 32; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME_OF_DAY")) { // LTIME_OF_DAY - // Simple Field (nanosecondsSinceMidnight) - sizeInBits += 64; - } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE_AND_TIME")) { // DATE_AND_TIME - // Simple Field (year) - sizeInBits += 16; - // Simple Field (month) - sizeInBits += 8; - // Simple Field (day) - sizeInBits += 8; - // Simple Field (dayOfWeek) - sizeInBits += 8; - // Simple Field (hour) - sizeInBits += 8; - // Simple Field (minutes) - sizeInBits += 8; - // Simple Field (seconds) - sizeInBits += 8; - // Simple Field (nanoseconds) - sizeInBits += 32; - } - return sizeInBits; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java deleted file mode 100644 index 72da9d71528..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum DataTransportErrorCode { - RESERVED((short) 0x00), - OK((short) 0xFF), - ACCESS_DENIED((short) 0x03), - INVALID_ADDRESS((short) 0x05), - DATA_TYPE_NOT_SUPPORTED((short) 0x06), - NOT_FOUND((short) 0x0A); - private static final Map map; - - static { - map = new HashMap<>(); - for (DataTransportErrorCode value : DataTransportErrorCode.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - DataTransportErrorCode(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static DataTransportErrorCode enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java deleted file mode 100644 index bc667c57c38..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum DataTransportSize { - NULL((short) 0x00, (boolean) false), - BIT((short) 0x03, (boolean) true), - BYTE_WORD_DWORD((short) 0x04, (boolean) true), - INTEGER((short) 0x05, (boolean) true), - DINTEGER((short) 0x06, (boolean) false), - REAL((short) 0x07, (boolean) false), - OCTET_STRING((short) 0x09, (boolean) false); - private static final Map map; - - static { - map = new HashMap<>(); - for (DataTransportSize value : DataTransportSize.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - private final boolean sizeInBits; - - DataTransportSize(short value, boolean sizeInBits) { - this.value = value; - this.sizeInBits = sizeInBits; - } - - public short getValue() { - return value; - } - - public boolean getSizeInBits() { - return sizeInBits; - } - - public static DataTransportSize firstEnumForFieldSizeInBits(boolean fieldValue) { - for (DataTransportSize _val : DataTransportSize.values()) { - if (_val.getSizeInBits() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSizeInBits(boolean fieldValue) { - List _values = new ArrayList<>(); - for (DataTransportSize _val : DataTransportSize.values()) { - if (_val.getSizeInBits() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public static DataTransportSize enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java deleted file mode 100644 index 6b52808638f..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java +++ /dev/null @@ -1,313 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class DateAndTime implements Message { - - // Properties. - protected final short year; - protected final short month; - protected final short day; - protected final short hour; - protected final short minutes; - protected final short seconds; - protected final short msec; - protected final byte dow; - - public DateAndTime( - short year, - short month, - short day, - short hour, - short minutes, - short seconds, - short msec, - byte dow) { - super(); - this.year = year; - this.month = month; - this.day = day; - this.hour = hour; - this.minutes = minutes; - this.seconds = seconds; - this.msec = msec; - this.dow = dow; - } - - public short getYear() { - return year; - } - - public short getMonth() { - return month; - } - - public short getDay() { - return day; - } - - public short getHour() { - return hour; - } - - public short getMinutes() { - return minutes; - } - - public short getSeconds() { - return seconds; - } - - public short getMsec() { - return msec; - } - - public byte getDow() { - return dow; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("DateAndTime"); - - // Manual Field (year) - writeManualField( - "year", - () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, year), - writeBuffer); - - // Manual Field (month) - writeManualField( - "month", - () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, month), - writeBuffer); - - // Manual Field (day) - writeManualField( - "day", - () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, day), - writeBuffer); - - // Manual Field (hour) - writeManualField( - "hour", - () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, hour), - writeBuffer); - - // Manual Field (minutes) - writeManualField( - "minutes", - () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, minutes), - writeBuffer); - - // Manual Field (seconds) - writeManualField( - "seconds", - () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, seconds), - writeBuffer); - - // Manual Field (msec) - writeManualField( - "msec", - () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.IntToS7msec(writeBuffer, msec), - writeBuffer); - - // Simple Field (dow) - writeSimpleField("dow", dow, writeUnsignedByte(writeBuffer, 4)); - - writeBuffer.popContext("DateAndTime"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - DateAndTime _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Manual Field (year) - lengthInBits += 8; - - // Manual Field (month) - lengthInBits += 8; - - // Manual Field (day) - lengthInBits += 8; - - // Manual Field (hour) - lengthInBits += 8; - - // Manual Field (minutes) - lengthInBits += 8; - - // Manual Field (seconds) - lengthInBits += 8; - - // Manual Field (msec) - lengthInBits += 12; - - // Simple field (dow) - lengthInBits += 4; - - return lengthInBits; - } - - public static DateAndTime staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static DateAndTime staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("DateAndTime"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short year = - readManualField( - "year", - readBuffer, - () -> - (short) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); - - short month = - readManualField( - "month", - readBuffer, - () -> - (short) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); - - short day = - readManualField( - "day", - readBuffer, - () -> - (short) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); - - short hour = - readManualField( - "hour", - readBuffer, - () -> - (short) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); - - short minutes = - readManualField( - "minutes", - readBuffer, - () -> - (short) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); - - short seconds = - readManualField( - "seconds", - readBuffer, - () -> - (short) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); - - short msec = - readManualField( - "msec", - readBuffer, - () -> - (short) - (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.S7msecToInt( - readBuffer))); - - byte dow = readSimpleField("dow", readUnsignedByte(readBuffer, 4)); - - readBuffer.closeContext("DateAndTime"); - // Create the instance - DateAndTime _dateAndTime; - _dateAndTime = new DateAndTime(year, month, day, hour, minutes, seconds, msec, dow); - return _dateAndTime; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof DateAndTime)) { - return false; - } - DateAndTime that = (DateAndTime) o; - return (getYear() == that.getYear()) - && (getMonth() == that.getMonth()) - && (getDay() == that.getDay()) - && (getHour() == that.getHour()) - && (getMinutes() == that.getMinutes()) - && (getSeconds() == that.getSeconds()) - && (getMsec() == that.getMsec()) - && (getDow() == that.getDow()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getYear(), - getMonth(), - getDay(), - getHour(), - getMinutes(), - getSeconds(), - getMsec(), - getDow()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java deleted file mode 100644 index 6386830857b..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum DeviceGroup { - PG_OR_PC((short) 0x01), - OS((short) 0x02), - OTHERS((short) 0x03); - private static final Map map; - - static { - map = new HashMap<>(); - for (DeviceGroup value : DeviceGroup.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - DeviceGroup(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static DeviceGroup enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java deleted file mode 100644 index b80be908777..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum EventType { - MODE((short) 0x01), - SYS((short) 0x02), - USR((short) 0x04), - ALM((short) 0x80), - CYC((short) 0x69); - private static final Map map; - - static { - map = new HashMap<>(); - for (EventType value : EventType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - EventType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static EventType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java deleted file mode 100644 index 16146f7ab20..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum MemoryArea { - COUNTERS((short) 0x1C, (String) "C"), - TIMERS((short) 0x1D, (String) "T"), - DIRECT_PERIPHERAL_ACCESS((short) 0x80, (String) "D"), - INPUTS((short) 0x81, (String) "I"), - OUTPUTS((short) 0x82, (String) "Q"), - FLAGS_MARKERS((short) 0x83, (String) "M"), - DATA_BLOCKS((short) 0x84, (String) "DB"), - INSTANCE_DATA_BLOCKS((short) 0x85, (String) "DBI"), - LOCAL_DATA((short) 0x86, (String) "LD"); - private static final Map map; - - static { - map = new HashMap<>(); - for (MemoryArea value : MemoryArea.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - private final String shortName; - - MemoryArea(short value, String shortName) { - this.value = value; - this.shortName = shortName; - } - - public short getValue() { - return value; - } - - public String getShortName() { - return shortName; - } - - public static MemoryArea firstEnumForFieldShortName(String fieldValue) { - for (MemoryArea _val : MemoryArea.values()) { - if (_val.getShortName().equals(fieldValue)) { - return _val; - } - } - return null; - } - - public static List enumsForFieldShortName(String fieldValue) { - List _values = new ArrayList<>(); - for (MemoryArea _val : MemoryArea.values()) { - if (_val.getShortName().equals(fieldValue)) { - _values.add(_val); - } - } - return _values; - } - - public static MemoryArea enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java deleted file mode 100644 index affc7ccb3eb..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum ModeTransitionType { - STOP((short) 0x00), - WARM_RESTART((short) 0x01), - RUN((short) 0x02), - HOT_RESTART((short) 0x03), - HOLD((short) 0x04), - COLD_RESTART((short) 0x06), - RUN_R((short) 0x09), - LINK_UP((short) 0x11), - UPDATE((short) 0x12); - private static final Map map; - - static { - map = new HashMap<>(); - for (ModeTransitionType value : ModeTransitionType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - ModeTransitionType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static ModeTransitionType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java deleted file mode 100644 index 6a0986380cb..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum QueryType { - BYALARMTYPE((short) 0x01), - ALARM_8((short) 0x02), - ALARM_S((short) 0x04), - ALARM_8P((short) 0x09); - private static final Map map; - - static { - map = new HashMap<>(); - for (QueryType value : QueryType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - QueryType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static QueryType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java deleted file mode 100644 index 3fdb19bcae3..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7Address implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getAddressType(); - - public S7Address() { - super(); - } - - protected abstract void serializeS7AddressChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7Address"); - - // Discriminator Field (addressType) (Used as input to a switch field) - writeDiscriminatorField("addressType", getAddressType(), writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeS7AddressChild(writeBuffer); - - writeBuffer.popContext("S7Address"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7Address _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Discriminator Field (addressType) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static S7Address staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static S7Address staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7Address"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short addressType = readDiscriminatorField("addressType", readUnsignedShort(readBuffer, 8)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7AddressBuilder builder = null; - if (EvaluationHelper.equals(addressType, (short) 0x10)) { - builder = S7AddressAny.staticParseS7AddressBuilder(readBuffer); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "addressType=" - + addressType - + "]"); - } - - readBuffer.closeContext("S7Address"); - // Create the instance - S7Address _s7Address = builder.build(); - return _s7Address; - } - - public interface S7AddressBuilder { - S7Address build(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7Address)) { - return false; - } - S7Address that = (S7Address) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java deleted file mode 100644 index d990a8d900d..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7AddressAny extends S7Address implements Message { - - // Accessors for discriminator values. - public Short getAddressType() { - return (short) 0x10; - } - - // Properties. - protected final TransportSize transportSize; - protected final int numberOfElements; - protected final int dbNumber; - protected final MemoryArea area; - protected final int byteAddress; - protected final byte bitAddress; - - public S7AddressAny( - TransportSize transportSize, - int numberOfElements, - int dbNumber, - MemoryArea area, - int byteAddress, - byte bitAddress) { - super(); - this.transportSize = transportSize; - this.numberOfElements = numberOfElements; - this.dbNumber = dbNumber; - this.area = area; - this.byteAddress = byteAddress; - this.bitAddress = bitAddress; - } - - public TransportSize getTransportSize() { - return transportSize; - } - - public int getNumberOfElements() { - return numberOfElements; - } - - public int getDbNumber() { - return dbNumber; - } - - public MemoryArea getArea() { - return area; - } - - public int getByteAddress() { - return byteAddress; - } - - public byte getBitAddress() { - return bitAddress; - } - - @Override - protected void serializeS7AddressChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7AddressAny"); - - // Enum field (transportSize) - writeEnumField( - "transportSize", - "TransportSize", - transportSize, - new DataWriterEnumDefault<>( - TransportSize::getCode, TransportSize::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (numberOfElements) - writeSimpleField("numberOfElements", numberOfElements, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (dbNumber) - writeSimpleField("dbNumber", dbNumber, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (area) - writeSimpleEnumField( - "area", - "MemoryArea", - area, - new DataWriterEnumDefault<>( - MemoryArea::getValue, MemoryArea::name, writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (byte) 0x00, writeUnsignedByte(writeBuffer, 5)); - - // Simple Field (byteAddress) - writeSimpleField("byteAddress", byteAddress, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (bitAddress) - writeSimpleField("bitAddress", bitAddress, writeUnsignedByte(writeBuffer, 3)); - - writeBuffer.popContext("S7AddressAny"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7AddressAny _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Enum Field (transportSize) - lengthInBits += 8; - - // Simple field (numberOfElements) - lengthInBits += 16; - - // Simple field (dbNumber) - lengthInBits += 16; - - // Simple field (area) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 5; - - // Simple field (byteAddress) - lengthInBits += 16; - - // Simple field (bitAddress) - lengthInBits += 3; - - return lengthInBits; - } - - public static S7AddressBuilder staticParseS7AddressBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("S7AddressAny"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - TransportSize transportSize = - readEnumField( - "transportSize", - "TransportSize", - readEnum(TransportSize::firstEnumForFieldCode, readUnsignedShort(readBuffer, 8))); - - int numberOfElements = readSimpleField("numberOfElements", readUnsignedInt(readBuffer, 16)); - - int dbNumber = readSimpleField("dbNumber", readUnsignedInt(readBuffer, 16)); - - MemoryArea area = - readEnumField( - "area", - "MemoryArea", - new DataReaderEnumDefault<>( - MemoryArea::enumForValue, readUnsignedShort(readBuffer, 8))); - - Byte reservedField0 = - readReservedField("reserved", readUnsignedByte(readBuffer, 5), (byte) 0x00); - - int byteAddress = readSimpleField("byteAddress", readUnsignedInt(readBuffer, 16)); - - byte bitAddress = readSimpleField("bitAddress", readUnsignedByte(readBuffer, 3)); - - readBuffer.closeContext("S7AddressAny"); - // Create the instance - return new S7AddressAnyBuilderImpl( - transportSize, numberOfElements, dbNumber, area, byteAddress, bitAddress); - } - - public static class S7AddressAnyBuilderImpl implements S7Address.S7AddressBuilder { - private final TransportSize transportSize; - private final int numberOfElements; - private final int dbNumber; - private final MemoryArea area; - private final int byteAddress; - private final byte bitAddress; - - public S7AddressAnyBuilderImpl( - TransportSize transportSize, - int numberOfElements, - int dbNumber, - MemoryArea area, - int byteAddress, - byte bitAddress) { - this.transportSize = transportSize; - this.numberOfElements = numberOfElements; - this.dbNumber = dbNumber; - this.area = area; - this.byteAddress = byteAddress; - this.bitAddress = bitAddress; - } - - public S7AddressAny build() { - S7AddressAny s7AddressAny = - new S7AddressAny( - transportSize, numberOfElements, dbNumber, area, byteAddress, bitAddress); - return s7AddressAny; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7AddressAny)) { - return false; - } - S7AddressAny that = (S7AddressAny) o; - return (getTransportSize() == that.getTransportSize()) - && (getNumberOfElements() == that.getNumberOfElements()) - && (getDbNumber() == that.getDbNumber()) - && (getArea() == that.getArea()) - && (getByteAddress() == that.getByteAddress()) - && (getBitAddress() == that.getBitAddress()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), - getTransportSize(), - getNumberOfElements(), - getDbNumber(), - getArea(), - getByteAddress(), - getBitAddress()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java deleted file mode 100644 index 92e453cc402..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7DataAlarmMessage implements Message { - - // Abstract accessors for discriminator values. - public abstract Byte getCpuFunctionType(); - - // Constant values. - public static final Short FUNCTIONID = 0x00; - public static final Short NUMBERMESSAGEOBJ = 0x01; - - public S7DataAlarmMessage() { - super(); - } - - public short getFunctionId() { - return FUNCTIONID; - } - - public short getNumberMessageObj() { - return NUMBERMESSAGEOBJ; - } - - protected abstract void serializeS7DataAlarmMessageChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7DataAlarmMessage"); - - // Const Field (functionId) - writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (numberMessageObj) - writeConstField("numberMessageObj", NUMBERMESSAGEOBJ, writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeS7DataAlarmMessageChild(writeBuffer); - - writeBuffer.popContext("S7DataAlarmMessage"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7DataAlarmMessage _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (functionId) - lengthInBits += 8; - - // Const Field (numberMessageObj) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static S7DataAlarmMessage staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - if ((args == null) || (args.length != 1)) { - throw new PlcRuntimeException( - "Wrong number of arguments, expected 1, but got " + args.length); - } - Byte cpuFunctionType; - if (args[0] instanceof Byte) { - cpuFunctionType = (Byte) args[0]; - } else if (args[0] instanceof String) { - cpuFunctionType = Byte.valueOf((String) args[0]); - } else { - throw new PlcRuntimeException( - "Argument 0 expected to be of type Byte or a string which is parseable but was " - + args[0].getClass().getName()); - } - return staticParse(readBuffer, cpuFunctionType); - } - - public static S7DataAlarmMessage staticParse(ReadBuffer readBuffer, Byte cpuFunctionType) - throws ParseException { - readBuffer.pullContext("S7DataAlarmMessage"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = - readConstField( - "functionId", readUnsignedShort(readBuffer, 8), S7DataAlarmMessage.FUNCTIONID); - - short numberMessageObj = - readConstField( - "numberMessageObj", - readUnsignedShort(readBuffer, 8), - S7DataAlarmMessage.NUMBERMESSAGEOBJ); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7DataAlarmMessageBuilder builder = null; - if (EvaluationHelper.equals(cpuFunctionType, (byte) 0x04)) { - builder = - S7MessageObjectRequest.staticParseS7DataAlarmMessageBuilder(readBuffer, cpuFunctionType); - } else if (EvaluationHelper.equals(cpuFunctionType, (byte) 0x08)) { - builder = - S7MessageObjectResponse.staticParseS7DataAlarmMessageBuilder(readBuffer, cpuFunctionType); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "cpuFunctionType=" - + cpuFunctionType - + "]"); - } - - readBuffer.closeContext("S7DataAlarmMessage"); - // Create the instance - S7DataAlarmMessage _s7DataAlarmMessage = builder.build(); - return _s7DataAlarmMessage; - } - - public interface S7DataAlarmMessageBuilder { - S7DataAlarmMessage build(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7DataAlarmMessage)) { - return false; - } - S7DataAlarmMessage that = (S7DataAlarmMessage) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java deleted file mode 100644 index 19cf023dbf2..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java +++ /dev/null @@ -1,262 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7Message implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getMessageType(); - - // Constant values. - public static final Short PROTOCOLID = 0x32; - - // Properties. - protected final int tpduReference; - protected final S7Parameter parameter; - protected final S7Payload payload; - - public S7Message(int tpduReference, S7Parameter parameter, S7Payload payload) { - super(); - this.tpduReference = tpduReference; - this.parameter = parameter; - this.payload = payload; - } - - public int getTpduReference() { - return tpduReference; - } - - public S7Parameter getParameter() { - return parameter; - } - - public S7Payload getPayload() { - return payload; - } - - public short getProtocolId() { - return PROTOCOLID; - } - - protected abstract void serializeS7MessageChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7Message"); - - // Const Field (protocolId) - writeConstField("protocolId", PROTOCOLID, writeUnsignedShort(writeBuffer, 8)); - - // Discriminator Field (messageType) (Used as input to a switch field) - writeDiscriminatorField("messageType", getMessageType(), writeUnsignedShort(writeBuffer, 8)); - - // Reserved Field (reserved) - writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (tpduReference) - writeSimpleField("tpduReference", tpduReference, writeUnsignedInt(writeBuffer, 16)); - - // Implicit Field (parameterLength) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - int parameterLength = - (int) ((((getParameter()) != (null)) ? getParameter().getLengthInBytes() : 0)); - writeImplicitField("parameterLength", parameterLength, writeUnsignedInt(writeBuffer, 16)); - - // Implicit Field (payloadLength) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - int payloadLength = (int) ((((getPayload()) != (null)) ? getPayload().getLengthInBytes() : 0)); - writeImplicitField("payloadLength", payloadLength, writeUnsignedInt(writeBuffer, 16)); - - // Switch field (Serialize the sub-type) - serializeS7MessageChild(writeBuffer); - - // Optional Field (parameter) (Can be skipped, if the value is null) - writeOptionalField("parameter", parameter, new DataWriterComplexDefault<>(writeBuffer)); - - // Optional Field (payload) (Can be skipped, if the value is null) - writeOptionalField("payload", payload, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7Message"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7Message _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (protocolId) - lengthInBits += 8; - - // Discriminator Field (messageType) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 16; - - // Simple field (tpduReference) - lengthInBits += 16; - - // Implicit Field (parameterLength) - lengthInBits += 16; - - // Implicit Field (payloadLength) - lengthInBits += 16; - - // Length of sub-type elements will be added by sub-type... - - // Optional Field (parameter) - if (parameter != null) { - lengthInBits += parameter.getLengthInBits(); - } - - // Optional Field (payload) - if (payload != null) { - lengthInBits += payload.getLengthInBits(); - } - - return lengthInBits; - } - - public static S7Message staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static S7Message staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7Message"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short protocolId = - readConstField("protocolId", readUnsignedShort(readBuffer, 8), S7Message.PROTOCOLID); - - short messageType = readDiscriminatorField("messageType", readUnsignedShort(readBuffer, 8)); - - Integer reservedField0 = - readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000); - - int tpduReference = readSimpleField("tpduReference", readUnsignedInt(readBuffer, 16)); - - int parameterLength = readImplicitField("parameterLength", readUnsignedInt(readBuffer, 16)); - - int payloadLength = readImplicitField("payloadLength", readUnsignedInt(readBuffer, 16)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7MessageBuilder builder = null; - if (EvaluationHelper.equals(messageType, (short) 0x01)) { - builder = S7MessageRequest.staticParseS7MessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(messageType, (short) 0x02)) { - builder = S7MessageResponse.staticParseS7MessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(messageType, (short) 0x03)) { - builder = S7MessageResponseData.staticParseS7MessageBuilder(readBuffer); - } else if (EvaluationHelper.equals(messageType, (short) 0x07)) { - builder = S7MessageUserData.staticParseS7MessageBuilder(readBuffer); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "messageType=" - + messageType - + "]"); - } - - S7Parameter parameter = - readOptionalField( - "parameter", - new DataReaderComplexDefault<>( - () -> S7Parameter.staticParse(readBuffer, (short) (messageType)), readBuffer), - (parameterLength) > (0)); - - S7Payload payload = - readOptionalField( - "payload", - new DataReaderComplexDefault<>( - () -> - S7Payload.staticParse( - readBuffer, (short) (messageType), (S7Parameter) (parameter)), - readBuffer), - (payloadLength) > (0)); - - readBuffer.closeContext("S7Message"); - // Create the instance - S7Message _s7Message = builder.build(tpduReference, parameter, payload); - return _s7Message; - } - - public interface S7MessageBuilder { - S7Message build(int tpduReference, S7Parameter parameter, S7Payload payload); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7Message)) { - return false; - } - S7Message that = (S7Message) o; - return (getTpduReference() == that.getTpduReference()) - && (getParameter() == that.getParameter()) - && (getPayload() == that.getPayload()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTpduReference(), getParameter(), getPayload()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java deleted file mode 100644 index fcdf0b49c24..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java +++ /dev/null @@ -1,256 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7MessageObjectRequest extends S7DataAlarmMessage implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - // Constant values. - public static final Short VARIABLESPEC = 0x12; - public static final Short LENGTH = 0x08; - - // Properties. - protected final SyntaxIdType syntaxId; - protected final QueryType queryType; - protected final AlarmType alarmType; - - public S7MessageObjectRequest(SyntaxIdType syntaxId, QueryType queryType, AlarmType alarmType) { - super(); - this.syntaxId = syntaxId; - this.queryType = queryType; - this.alarmType = alarmType; - } - - public SyntaxIdType getSyntaxId() { - return syntaxId; - } - - public QueryType getQueryType() { - return queryType; - } - - public AlarmType getAlarmType() { - return alarmType; - } - - public short getVariableSpec() { - return VARIABLESPEC; - } - - public short getLength() { - return LENGTH; - } - - @Override - protected void serializeS7DataAlarmMessageChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7MessageObjectRequest"); - - // Const Field (variableSpec) - writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (length) - writeConstField("length", LENGTH, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (syntaxId) - writeSimpleEnumField( - "syntaxId", - "SyntaxIdType", - syntaxId, - new DataWriterEnumDefault<>( - SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (queryType) - writeSimpleEnumField( - "queryType", - "QueryType", - queryType, - new DataWriterEnumDefault<>( - QueryType::getValue, QueryType::name, writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x34, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (alarmType) - writeSimpleEnumField( - "alarmType", - "AlarmType", - alarmType, - new DataWriterEnumDefault<>( - AlarmType::getValue, AlarmType::name, writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("S7MessageObjectRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7MessageObjectRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (variableSpec) - lengthInBits += 8; - - // Const Field (length) - lengthInBits += 8; - - // Simple field (syntaxId) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (queryType) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (alarmType) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7DataAlarmMessageBuilder staticParseS7DataAlarmMessageBuilder( - ReadBuffer readBuffer, Byte cpuFunctionType) throws ParseException { - readBuffer.pullContext("S7MessageObjectRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short variableSpec = - readConstField( - "variableSpec", readUnsignedShort(readBuffer, 8), S7MessageObjectRequest.VARIABLESPEC); - - short length = - readConstField("length", readUnsignedShort(readBuffer, 8), S7MessageObjectRequest.LENGTH); - - SyntaxIdType syntaxId = - readEnumField( - "syntaxId", - "SyntaxIdType", - new DataReaderEnumDefault<>( - SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - QueryType queryType = - readEnumField( - "queryType", - "QueryType", - new DataReaderEnumDefault<>(QueryType::enumForValue, readUnsignedShort(readBuffer, 8))); - - Short reservedField1 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x34); - - AlarmType alarmType = - readEnumField( - "alarmType", - "AlarmType", - new DataReaderEnumDefault<>(AlarmType::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("S7MessageObjectRequest"); - // Create the instance - return new S7MessageObjectRequestBuilderImpl(syntaxId, queryType, alarmType); - } - - public static class S7MessageObjectRequestBuilderImpl - implements S7DataAlarmMessage.S7DataAlarmMessageBuilder { - private final SyntaxIdType syntaxId; - private final QueryType queryType; - private final AlarmType alarmType; - - public S7MessageObjectRequestBuilderImpl( - SyntaxIdType syntaxId, QueryType queryType, AlarmType alarmType) { - this.syntaxId = syntaxId; - this.queryType = queryType; - this.alarmType = alarmType; - } - - public S7MessageObjectRequest build() { - S7MessageObjectRequest s7MessageObjectRequest = - new S7MessageObjectRequest(syntaxId, queryType, alarmType); - return s7MessageObjectRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7MessageObjectRequest)) { - return false; - } - S7MessageObjectRequest that = (S7MessageObjectRequest) o; - return (getSyntaxId() == that.getSyntaxId()) - && (getQueryType() == that.getQueryType()) - && (getAlarmType() == that.getAlarmType()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getSyntaxId(), getQueryType(), getAlarmType()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java deleted file mode 100644 index 812a27a0bcf..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java +++ /dev/null @@ -1,196 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7MessageObjectResponse extends S7DataAlarmMessage implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - // Properties. - protected final DataTransportErrorCode returnCode; - protected final DataTransportSize transportSize; - - public S7MessageObjectResponse( - DataTransportErrorCode returnCode, DataTransportSize transportSize) { - super(); - this.returnCode = returnCode; - this.transportSize = transportSize; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public DataTransportSize getTransportSize() { - return transportSize; - } - - @Override - protected void serializeS7DataAlarmMessageChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7MessageObjectResponse"); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (transportSize) - writeSimpleEnumField( - "transportSize", - "DataTransportSize", - transportSize, - new DataWriterEnumDefault<>( - DataTransportSize::getValue, - DataTransportSize::name, - writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7MessageObjectResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7MessageObjectResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (returnCode) - lengthInBits += 8; - - // Simple field (transportSize) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7DataAlarmMessageBuilder staticParseS7DataAlarmMessageBuilder( - ReadBuffer readBuffer, Byte cpuFunctionType) throws ParseException { - readBuffer.pullContext("S7MessageObjectResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - DataTransportSize transportSize = - readEnumField( - "transportSize", - "DataTransportSize", - new DataReaderEnumDefault<>( - DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - readBuffer.closeContext("S7MessageObjectResponse"); - // Create the instance - return new S7MessageObjectResponseBuilderImpl(returnCode, transportSize); - } - - public static class S7MessageObjectResponseBuilderImpl - implements S7DataAlarmMessage.S7DataAlarmMessageBuilder { - private final DataTransportErrorCode returnCode; - private final DataTransportSize transportSize; - - public S7MessageObjectResponseBuilderImpl( - DataTransportErrorCode returnCode, DataTransportSize transportSize) { - this.returnCode = returnCode; - this.transportSize = transportSize; - } - - public S7MessageObjectResponse build() { - S7MessageObjectResponse s7MessageObjectResponse = - new S7MessageObjectResponse(returnCode, transportSize); - return s7MessageObjectResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7MessageObjectResponse)) { - return false; - } - S7MessageObjectResponse that = (S7MessageObjectResponse) o; - return (getReturnCode() == that.getReturnCode()) - && (getTransportSize() == that.getTransportSize()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getReturnCode(), getTransportSize()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java deleted file mode 100644 index d7f55537d40..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7MessageRequest extends S7Message implements Message { - - // Accessors for discriminator values. - public Short getMessageType() { - return (short) 0x01; - } - - public S7MessageRequest(int tpduReference, S7Parameter parameter, S7Payload payload) { - super(tpduReference, parameter, payload); - } - - @Override - protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7MessageRequest"); - - writeBuffer.popContext("S7MessageRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7MessageRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("S7MessageRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7MessageRequest"); - // Create the instance - return new S7MessageRequestBuilderImpl(); - } - - public static class S7MessageRequestBuilderImpl implements S7Message.S7MessageBuilder { - - public S7MessageRequestBuilderImpl() {} - - public S7MessageRequest build(int tpduReference, S7Parameter parameter, S7Payload payload) { - S7MessageRequest s7MessageRequest = new S7MessageRequest(tpduReference, parameter, payload); - return s7MessageRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7MessageRequest)) { - return false; - } - S7MessageRequest that = (S7MessageRequest) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java deleted file mode 100644 index c32725f02a8..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7MessageResponse extends S7Message implements Message { - - // Accessors for discriminator values. - public Short getMessageType() { - return (short) 0x02; - } - - // Properties. - protected final short errorClass; - protected final short errorCode; - - public S7MessageResponse( - int tpduReference, - S7Parameter parameter, - S7Payload payload, - short errorClass, - short errorCode) { - super(tpduReference, parameter, payload); - this.errorClass = errorClass; - this.errorCode = errorCode; - } - - public short getErrorClass() { - return errorClass; - } - - public short getErrorCode() { - return errorCode; - } - - @Override - protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7MessageResponse"); - - // Simple Field (errorClass) - writeSimpleField("errorClass", errorClass, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (errorCode) - writeSimpleField("errorCode", errorCode, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7MessageResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7MessageResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (errorClass) - lengthInBits += 8; - - // Simple field (errorCode) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("S7MessageResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short errorClass = readSimpleField("errorClass", readUnsignedShort(readBuffer, 8)); - - short errorCode = readSimpleField("errorCode", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7MessageResponse"); - // Create the instance - return new S7MessageResponseBuilderImpl(errorClass, errorCode); - } - - public static class S7MessageResponseBuilderImpl implements S7Message.S7MessageBuilder { - private final short errorClass; - private final short errorCode; - - public S7MessageResponseBuilderImpl(short errorClass, short errorCode) { - this.errorClass = errorClass; - this.errorCode = errorCode; - } - - public S7MessageResponse build(int tpduReference, S7Parameter parameter, S7Payload payload) { - S7MessageResponse s7MessageResponse = - new S7MessageResponse(tpduReference, parameter, payload, errorClass, errorCode); - return s7MessageResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7MessageResponse)) { - return false; - } - S7MessageResponse that = (S7MessageResponse) o; - return (getErrorClass() == that.getErrorClass()) - && (getErrorCode() == that.getErrorCode()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getErrorClass(), getErrorCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java deleted file mode 100644 index a4e957df96a..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7MessageResponseData extends S7Message implements Message { - - // Accessors for discriminator values. - public Short getMessageType() { - return (short) 0x03; - } - - // Properties. - protected final short errorClass; - protected final short errorCode; - - public S7MessageResponseData( - int tpduReference, - S7Parameter parameter, - S7Payload payload, - short errorClass, - short errorCode) { - super(tpduReference, parameter, payload); - this.errorClass = errorClass; - this.errorCode = errorCode; - } - - public short getErrorClass() { - return errorClass; - } - - public short getErrorCode() { - return errorCode; - } - - @Override - protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7MessageResponseData"); - - // Simple Field (errorClass) - writeSimpleField("errorClass", errorClass, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (errorCode) - writeSimpleField("errorCode", errorCode, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7MessageResponseData"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7MessageResponseData _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (errorClass) - lengthInBits += 8; - - // Simple field (errorCode) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("S7MessageResponseData"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short errorClass = readSimpleField("errorClass", readUnsignedShort(readBuffer, 8)); - - short errorCode = readSimpleField("errorCode", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7MessageResponseData"); - // Create the instance - return new S7MessageResponseDataBuilderImpl(errorClass, errorCode); - } - - public static class S7MessageResponseDataBuilderImpl implements S7Message.S7MessageBuilder { - private final short errorClass; - private final short errorCode; - - public S7MessageResponseDataBuilderImpl(short errorClass, short errorCode) { - this.errorClass = errorClass; - this.errorCode = errorCode; - } - - public S7MessageResponseData build( - int tpduReference, S7Parameter parameter, S7Payload payload) { - S7MessageResponseData s7MessageResponseData = - new S7MessageResponseData(tpduReference, parameter, payload, errorClass, errorCode); - return s7MessageResponseData; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7MessageResponseData)) { - return false; - } - S7MessageResponseData that = (S7MessageResponseData) o; - return (getErrorClass() == that.getErrorClass()) - && (getErrorCode() == that.getErrorCode()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getErrorClass(), getErrorCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java deleted file mode 100644 index 93c380103cd..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7MessageUserData extends S7Message implements Message { - - // Accessors for discriminator values. - public Short getMessageType() { - return (short) 0x07; - } - - public S7MessageUserData(int tpduReference, S7Parameter parameter, S7Payload payload) { - super(tpduReference, parameter, payload); - } - - @Override - protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7MessageUserData"); - - writeBuffer.popContext("S7MessageUserData"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7MessageUserData _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) - throws ParseException { - readBuffer.pullContext("S7MessageUserData"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7MessageUserData"); - // Create the instance - return new S7MessageUserDataBuilderImpl(); - } - - public static class S7MessageUserDataBuilderImpl implements S7Message.S7MessageBuilder { - - public S7MessageUserDataBuilderImpl() {} - - public S7MessageUserData build(int tpduReference, S7Parameter parameter, S7Payload payload) { - S7MessageUserData s7MessageUserData = - new S7MessageUserData(tpduReference, parameter, payload); - return s7MessageUserData; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7MessageUserData)) { - return false; - } - S7MessageUserData that = (S7MessageUserData) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java deleted file mode 100644 index d02b9522305..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java +++ /dev/null @@ -1,187 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7Parameter implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getMessageType(); - - public abstract Short getParameterType(); - - public S7Parameter() { - super(); - } - - protected abstract void serializeS7ParameterChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7Parameter"); - - // Discriminator Field (parameterType) (Used as input to a switch field) - writeDiscriminatorField( - "parameterType", getParameterType(), writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeS7ParameterChild(writeBuffer); - - writeBuffer.popContext("S7Parameter"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7Parameter _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Discriminator Field (parameterType) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static S7Parameter staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - if ((args == null) || (args.length != 1)) { - throw new PlcRuntimeException( - "Wrong number of arguments, expected 1, but got " + args.length); - } - Short messageType; - if (args[0] instanceof Short) { - messageType = (Short) args[0]; - } else if (args[0] instanceof String) { - messageType = Short.valueOf((String) args[0]); - } else { - throw new PlcRuntimeException( - "Argument 0 expected to be of type Short or a string which is parseable but was " - + args[0].getClass().getName()); - } - return staticParse(readBuffer, messageType); - } - - public static S7Parameter staticParse(ReadBuffer readBuffer, Short messageType) - throws ParseException { - readBuffer.pullContext("S7Parameter"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short parameterType = readDiscriminatorField("parameterType", readUnsignedShort(readBuffer, 8)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7ParameterBuilder builder = null; - if (EvaluationHelper.equals(parameterType, (short) 0xF0)) { - builder = - S7ParameterSetupCommunication.staticParseS7ParameterBuilder(readBuffer, messageType); - } else if (EvaluationHelper.equals(parameterType, (short) 0x04) - && EvaluationHelper.equals(messageType, (short) 0x01)) { - builder = S7ParameterReadVarRequest.staticParseS7ParameterBuilder(readBuffer, messageType); - } else if (EvaluationHelper.equals(parameterType, (short) 0x04) - && EvaluationHelper.equals(messageType, (short) 0x03)) { - builder = S7ParameterReadVarResponse.staticParseS7ParameterBuilder(readBuffer, messageType); - } else if (EvaluationHelper.equals(parameterType, (short) 0x05) - && EvaluationHelper.equals(messageType, (short) 0x01)) { - builder = S7ParameterWriteVarRequest.staticParseS7ParameterBuilder(readBuffer, messageType); - } else if (EvaluationHelper.equals(parameterType, (short) 0x05) - && EvaluationHelper.equals(messageType, (short) 0x03)) { - builder = S7ParameterWriteVarResponse.staticParseS7ParameterBuilder(readBuffer, messageType); - } else if (EvaluationHelper.equals(parameterType, (short) 0x00) - && EvaluationHelper.equals(messageType, (short) 0x07)) { - builder = S7ParameterUserData.staticParseS7ParameterBuilder(readBuffer, messageType); - } else if (EvaluationHelper.equals(parameterType, (short) 0x01) - && EvaluationHelper.equals(messageType, (short) 0x07)) { - builder = S7ParameterModeTransition.staticParseS7ParameterBuilder(readBuffer, messageType); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "parameterType=" - + parameterType - + " " - + "messageType=" - + messageType - + "]"); - } - - readBuffer.closeContext("S7Parameter"); - // Create the instance - S7Parameter _s7Parameter = builder.build(); - return _s7Parameter; - } - - public interface S7ParameterBuilder { - S7Parameter build(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7Parameter)) { - return false; - } - S7Parameter that = (S7Parameter) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java deleted file mode 100644 index 8858e89a028..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterModeTransition extends S7Parameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0x01; - } - - public Short getMessageType() { - return (short) 0x07; - } - - // Properties. - protected final short method; - protected final byte cpuFunctionType; - protected final byte cpuFunctionGroup; - protected final short currentMode; - protected final short sequenceNumber; - - public S7ParameterModeTransition( - short method, - byte cpuFunctionType, - byte cpuFunctionGroup, - short currentMode, - short sequenceNumber) { - super(); - this.method = method; - this.cpuFunctionType = cpuFunctionType; - this.cpuFunctionGroup = cpuFunctionGroup; - this.currentMode = currentMode; - this.sequenceNumber = sequenceNumber; - } - - public short getMethod() { - return method; - } - - public byte getCpuFunctionType() { - return cpuFunctionType; - } - - public byte getCpuFunctionGroup() { - return cpuFunctionGroup; - } - - public short getCurrentMode() { - return currentMode; - } - - public short getSequenceNumber() { - return sequenceNumber; - } - - @Override - protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterModeTransition"); - - // Reserved Field (reserved) - writeReservedField("reserved", (int) 0x0010, writeUnsignedInt(writeBuffer, 16)); - - // Implicit Field (itemLength) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short itemLength = (short) ((getLengthInBytes()) - (2)); - writeImplicitField("itemLength", itemLength, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (method) - writeSimpleField("method", method, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (cpuFunctionType) - writeSimpleField("cpuFunctionType", cpuFunctionType, writeUnsignedByte(writeBuffer, 4)); - - // Simple Field (cpuFunctionGroup) - writeSimpleField("cpuFunctionGroup", cpuFunctionGroup, writeUnsignedByte(writeBuffer, 4)); - - // Simple Field (currentMode) - writeSimpleField("currentMode", currentMode, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (sequenceNumber) - writeSimpleField("sequenceNumber", sequenceNumber, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7ParameterModeTransition"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterModeTransition _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Reserved Field (reserved) - lengthInBits += 16; - - // Implicit Field (itemLength) - lengthInBits += 8; - - // Simple field (method) - lengthInBits += 8; - - // Simple field (cpuFunctionType) - lengthInBits += 4; - - // Simple field (cpuFunctionGroup) - lengthInBits += 4; - - // Simple field (currentMode) - lengthInBits += 8; - - // Simple field (sequenceNumber) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7ParameterBuilder staticParseS7ParameterBuilder( - ReadBuffer readBuffer, Short messageType) throws ParseException { - readBuffer.pullContext("S7ParameterModeTransition"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - Integer reservedField0 = - readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0010); - - short itemLength = readImplicitField("itemLength", readUnsignedShort(readBuffer, 8)); - - short method = readSimpleField("method", readUnsignedShort(readBuffer, 8)); - - byte cpuFunctionType = readSimpleField("cpuFunctionType", readUnsignedByte(readBuffer, 4)); - - byte cpuFunctionGroup = readSimpleField("cpuFunctionGroup", readUnsignedByte(readBuffer, 4)); - - short currentMode = readSimpleField("currentMode", readUnsignedShort(readBuffer, 8)); - - short sequenceNumber = readSimpleField("sequenceNumber", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7ParameterModeTransition"); - // Create the instance - return new S7ParameterModeTransitionBuilderImpl( - method, cpuFunctionType, cpuFunctionGroup, currentMode, sequenceNumber); - } - - public static class S7ParameterModeTransitionBuilderImpl - implements S7Parameter.S7ParameterBuilder { - private final short method; - private final byte cpuFunctionType; - private final byte cpuFunctionGroup; - private final short currentMode; - private final short sequenceNumber; - - public S7ParameterModeTransitionBuilderImpl( - short method, - byte cpuFunctionType, - byte cpuFunctionGroup, - short currentMode, - short sequenceNumber) { - this.method = method; - this.cpuFunctionType = cpuFunctionType; - this.cpuFunctionGroup = cpuFunctionGroup; - this.currentMode = currentMode; - this.sequenceNumber = sequenceNumber; - } - - public S7ParameterModeTransition build() { - S7ParameterModeTransition s7ParameterModeTransition = - new S7ParameterModeTransition( - method, cpuFunctionType, cpuFunctionGroup, currentMode, sequenceNumber); - return s7ParameterModeTransition; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterModeTransition)) { - return false; - } - S7ParameterModeTransition that = (S7ParameterModeTransition) o; - return (getMethod() == that.getMethod()) - && (getCpuFunctionType() == that.getCpuFunctionType()) - && (getCpuFunctionGroup() == that.getCpuFunctionGroup()) - && (getCurrentMode() == that.getCurrentMode()) - && (getSequenceNumber() == that.getSequenceNumber()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), - getMethod(), - getCpuFunctionType(), - getCpuFunctionGroup(), - getCurrentMode(), - getSequenceNumber()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java deleted file mode 100644 index 1cd784f0ee9..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterReadVarRequest extends S7Parameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0x04; - } - - public Short getMessageType() { - return (short) 0x01; - } - - // Properties. - protected final List items; - - public S7ParameterReadVarRequest(List items) { - super(); - this.items = items; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterReadVarRequest"); - - // Implicit Field (numItems) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short numItems = (short) (COUNT(getItems())); - writeImplicitField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7ParameterReadVarRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterReadVarRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (numItems) - lengthInBits += 8; - - // Array field - if (items != null) { - int i = 0; - for (S7VarRequestParameterItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7ParameterBuilder staticParseS7ParameterBuilder( - ReadBuffer readBuffer, Short messageType) throws ParseException { - readBuffer.pullContext("S7ParameterReadVarRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short numItems = readImplicitField("numItems", readUnsignedShort(readBuffer, 8)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> S7VarRequestParameterItem.staticParse(readBuffer), readBuffer), - numItems); - - readBuffer.closeContext("S7ParameterReadVarRequest"); - // Create the instance - return new S7ParameterReadVarRequestBuilderImpl(items); - } - - public static class S7ParameterReadVarRequestBuilderImpl - implements S7Parameter.S7ParameterBuilder { - private final List items; - - public S7ParameterReadVarRequestBuilderImpl(List items) { - this.items = items; - } - - public S7ParameterReadVarRequest build() { - S7ParameterReadVarRequest s7ParameterReadVarRequest = new S7ParameterReadVarRequest(items); - return s7ParameterReadVarRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterReadVarRequest)) { - return false; - } - S7ParameterReadVarRequest that = (S7ParameterReadVarRequest) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java deleted file mode 100644 index c79fc96629b..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterReadVarResponse extends S7Parameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0x04; - } - - public Short getMessageType() { - return (short) 0x03; - } - - // Properties. - protected final short numItems; - - public S7ParameterReadVarResponse(short numItems) { - super(); - this.numItems = numItems; - } - - public short getNumItems() { - return numItems; - } - - @Override - protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterReadVarResponse"); - - // Simple Field (numItems) - writeSimpleField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7ParameterReadVarResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterReadVarResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (numItems) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7ParameterBuilder staticParseS7ParameterBuilder( - ReadBuffer readBuffer, Short messageType) throws ParseException { - readBuffer.pullContext("S7ParameterReadVarResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short numItems = readSimpleField("numItems", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7ParameterReadVarResponse"); - // Create the instance - return new S7ParameterReadVarResponseBuilderImpl(numItems); - } - - public static class S7ParameterReadVarResponseBuilderImpl - implements S7Parameter.S7ParameterBuilder { - private final short numItems; - - public S7ParameterReadVarResponseBuilderImpl(short numItems) { - this.numItems = numItems; - } - - public S7ParameterReadVarResponse build() { - S7ParameterReadVarResponse s7ParameterReadVarResponse = - new S7ParameterReadVarResponse(numItems); - return s7ParameterReadVarResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterReadVarResponse)) { - return false; - } - S7ParameterReadVarResponse that = (S7ParameterReadVarResponse) o; - return (getNumItems() == that.getNumItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getNumItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java deleted file mode 100644 index c9d4cf0974e..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterSetupCommunication extends S7Parameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0xF0; - } - - public Short getMessageType() { - return 0; - } - - // Properties. - protected final int maxAmqCaller; - protected final int maxAmqCallee; - protected final int pduLength; - - public S7ParameterSetupCommunication(int maxAmqCaller, int maxAmqCallee, int pduLength) { - super(); - this.maxAmqCaller = maxAmqCaller; - this.maxAmqCallee = maxAmqCallee; - this.pduLength = pduLength; - } - - public int getMaxAmqCaller() { - return maxAmqCaller; - } - - public int getMaxAmqCallee() { - return maxAmqCallee; - } - - public int getPduLength() { - return pduLength; - } - - @Override - protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterSetupCommunication"); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (maxAmqCaller) - writeSimpleField("maxAmqCaller", maxAmqCaller, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (maxAmqCallee) - writeSimpleField("maxAmqCallee", maxAmqCallee, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (pduLength) - writeSimpleField("pduLength", pduLength, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("S7ParameterSetupCommunication"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterSetupCommunication _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (maxAmqCaller) - lengthInBits += 16; - - // Simple field (maxAmqCallee) - lengthInBits += 16; - - // Simple field (pduLength) - lengthInBits += 16; - - return lengthInBits; - } - - public static S7ParameterBuilder staticParseS7ParameterBuilder( - ReadBuffer readBuffer, Short messageType) throws ParseException { - readBuffer.pullContext("S7ParameterSetupCommunication"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - int maxAmqCaller = readSimpleField("maxAmqCaller", readUnsignedInt(readBuffer, 16)); - - int maxAmqCallee = readSimpleField("maxAmqCallee", readUnsignedInt(readBuffer, 16)); - - int pduLength = readSimpleField("pduLength", readUnsignedInt(readBuffer, 16)); - - readBuffer.closeContext("S7ParameterSetupCommunication"); - // Create the instance - return new S7ParameterSetupCommunicationBuilderImpl(maxAmqCaller, maxAmqCallee, pduLength); - } - - public static class S7ParameterSetupCommunicationBuilderImpl - implements S7Parameter.S7ParameterBuilder { - private final int maxAmqCaller; - private final int maxAmqCallee; - private final int pduLength; - - public S7ParameterSetupCommunicationBuilderImpl( - int maxAmqCaller, int maxAmqCallee, int pduLength) { - this.maxAmqCaller = maxAmqCaller; - this.maxAmqCallee = maxAmqCallee; - this.pduLength = pduLength; - } - - public S7ParameterSetupCommunication build() { - S7ParameterSetupCommunication s7ParameterSetupCommunication = - new S7ParameterSetupCommunication(maxAmqCaller, maxAmqCallee, pduLength); - return s7ParameterSetupCommunication; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterSetupCommunication)) { - return false; - } - S7ParameterSetupCommunication that = (S7ParameterSetupCommunication) o; - return (getMaxAmqCaller() == that.getMaxAmqCaller()) - && (getMaxAmqCallee() == that.getMaxAmqCallee()) - && (getPduLength() == that.getPduLength()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getMaxAmqCaller(), getMaxAmqCallee(), getPduLength()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java deleted file mode 100644 index a0013a3181f..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterUserData extends S7Parameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0x00; - } - - public Short getMessageType() { - return (short) 0x07; - } - - // Properties. - protected final List items; - - public S7ParameterUserData(List items) { - super(); - this.items = items; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterUserData"); - - // Implicit Field (numItems) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short numItems = (short) (COUNT(getItems())); - writeImplicitField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7ParameterUserData"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterUserData _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (numItems) - lengthInBits += 8; - - // Array field - if (items != null) { - int i = 0; - for (S7ParameterUserDataItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7ParameterBuilder staticParseS7ParameterBuilder( - ReadBuffer readBuffer, Short messageType) throws ParseException { - readBuffer.pullContext("S7ParameterUserData"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short numItems = readImplicitField("numItems", readUnsignedShort(readBuffer, 8)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> S7ParameterUserDataItem.staticParse(readBuffer), readBuffer), - numItems); - - readBuffer.closeContext("S7ParameterUserData"); - // Create the instance - return new S7ParameterUserDataBuilderImpl(items); - } - - public static class S7ParameterUserDataBuilderImpl implements S7Parameter.S7ParameterBuilder { - private final List items; - - public S7ParameterUserDataBuilderImpl(List items) { - this.items = items; - } - - public S7ParameterUserData build() { - S7ParameterUserData s7ParameterUserData = new S7ParameterUserData(items); - return s7ParameterUserData; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterUserData)) { - return false; - } - S7ParameterUserData that = (S7ParameterUserData) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java deleted file mode 100644 index b041ad34770..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7ParameterUserDataItem implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getItemType(); - - public S7ParameterUserDataItem() { - super(); - } - - protected abstract void serializeS7ParameterUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterUserDataItem"); - - // Discriminator Field (itemType) (Used as input to a switch field) - writeDiscriminatorField("itemType", getItemType(), writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeS7ParameterUserDataItemChild(writeBuffer); - - writeBuffer.popContext("S7ParameterUserDataItem"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7ParameterUserDataItem _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Discriminator Field (itemType) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static S7ParameterUserDataItem staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static S7ParameterUserDataItem staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7ParameterUserDataItem"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short itemType = readDiscriminatorField("itemType", readUnsignedShort(readBuffer, 8)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7ParameterUserDataItemBuilder builder = null; - if (EvaluationHelper.equals(itemType, (short) 0x12)) { - builder = - S7ParameterUserDataItemCPUFunctions.staticParseS7ParameterUserDataItemBuilder(readBuffer); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "itemType=" - + itemType - + "]"); - } - - readBuffer.closeContext("S7ParameterUserDataItem"); - // Create the instance - S7ParameterUserDataItem _s7ParameterUserDataItem = builder.build(); - return _s7ParameterUserDataItem; - } - - public interface S7ParameterUserDataItemBuilder { - S7ParameterUserDataItem build(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterUserDataItem)) { - return false; - } - S7ParameterUserDataItem that = (S7ParameterUserDataItem) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java deleted file mode 100644 index 7f330b5b2b7..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterUserDataItemCPUFunctions extends S7ParameterUserDataItem - implements Message { - - // Accessors for discriminator values. - public Short getItemType() { - return (short) 0x12; - } - - // Properties. - protected final short method; - protected final byte cpuFunctionType; - protected final byte cpuFunctionGroup; - protected final short cpuSubfunction; - protected final short sequenceNumber; - protected final Short dataUnitReferenceNumber; - protected final Short lastDataUnit; - protected final Integer errorCode; - - public S7ParameterUserDataItemCPUFunctions( - short method, - byte cpuFunctionType, - byte cpuFunctionGroup, - short cpuSubfunction, - short sequenceNumber, - Short dataUnitReferenceNumber, - Short lastDataUnit, - Integer errorCode) { - super(); - this.method = method; - this.cpuFunctionType = cpuFunctionType; - this.cpuFunctionGroup = cpuFunctionGroup; - this.cpuSubfunction = cpuSubfunction; - this.sequenceNumber = sequenceNumber; - this.dataUnitReferenceNumber = dataUnitReferenceNumber; - this.lastDataUnit = lastDataUnit; - this.errorCode = errorCode; - } - - public short getMethod() { - return method; - } - - public byte getCpuFunctionType() { - return cpuFunctionType; - } - - public byte getCpuFunctionGroup() { - return cpuFunctionGroup; - } - - public short getCpuSubfunction() { - return cpuSubfunction; - } - - public short getSequenceNumber() { - return sequenceNumber; - } - - public Short getDataUnitReferenceNumber() { - return dataUnitReferenceNumber; - } - - public Short getLastDataUnit() { - return lastDataUnit; - } - - public Integer getErrorCode() { - return errorCode; - } - - @Override - protected void serializeS7ParameterUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterUserDataItemCPUFunctions"); - - // Implicit Field (itemLength) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short itemLength = (short) ((getLengthInBytes()) - (2)); - writeImplicitField("itemLength", itemLength, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (method) - writeSimpleField("method", method, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (cpuFunctionType) - writeSimpleField("cpuFunctionType", cpuFunctionType, writeUnsignedByte(writeBuffer, 4)); - - // Simple Field (cpuFunctionGroup) - writeSimpleField("cpuFunctionGroup", cpuFunctionGroup, writeUnsignedByte(writeBuffer, 4)); - - // Simple Field (cpuSubfunction) - writeSimpleField("cpuSubfunction", cpuSubfunction, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (sequenceNumber) - writeSimpleField("sequenceNumber", sequenceNumber, writeUnsignedShort(writeBuffer, 8)); - - // Optional Field (dataUnitReferenceNumber) (Can be skipped, if the value is null) - writeOptionalField( - "dataUnitReferenceNumber", dataUnitReferenceNumber, writeUnsignedShort(writeBuffer, 8)); - - // Optional Field (lastDataUnit) (Can be skipped, if the value is null) - writeOptionalField("lastDataUnit", lastDataUnit, writeUnsignedShort(writeBuffer, 8)); - - // Optional Field (errorCode) (Can be skipped, if the value is null) - writeOptionalField("errorCode", errorCode, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("S7ParameterUserDataItemCPUFunctions"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterUserDataItemCPUFunctions _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (itemLength) - lengthInBits += 8; - - // Simple field (method) - lengthInBits += 8; - - // Simple field (cpuFunctionType) - lengthInBits += 4; - - // Simple field (cpuFunctionGroup) - lengthInBits += 4; - - // Simple field (cpuSubfunction) - lengthInBits += 8; - - // Simple field (sequenceNumber) - lengthInBits += 8; - - // Optional Field (dataUnitReferenceNumber) - if (dataUnitReferenceNumber != null) { - lengthInBits += 8; - } - - // Optional Field (lastDataUnit) - if (lastDataUnit != null) { - lengthInBits += 8; - } - - // Optional Field (errorCode) - if (errorCode != null) { - lengthInBits += 16; - } - - return lengthInBits; - } - - public static S7ParameterUserDataItemBuilder staticParseS7ParameterUserDataItemBuilder( - ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7ParameterUserDataItemCPUFunctions"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short itemLength = readImplicitField("itemLength", readUnsignedShort(readBuffer, 8)); - - short method = readSimpleField("method", readUnsignedShort(readBuffer, 8)); - - byte cpuFunctionType = readSimpleField("cpuFunctionType", readUnsignedByte(readBuffer, 4)); - - byte cpuFunctionGroup = readSimpleField("cpuFunctionGroup", readUnsignedByte(readBuffer, 4)); - - short cpuSubfunction = readSimpleField("cpuSubfunction", readUnsignedShort(readBuffer, 8)); - - short sequenceNumber = readSimpleField("sequenceNumber", readUnsignedShort(readBuffer, 8)); - - Short dataUnitReferenceNumber = - readOptionalField( - "dataUnitReferenceNumber", - readUnsignedShort(readBuffer, 8), - (((cpuFunctionType) == (8))) - || (((((cpuFunctionType) == (0))) && (((cpuFunctionGroup) == (2)))))); - - Short lastDataUnit = - readOptionalField( - "lastDataUnit", - readUnsignedShort(readBuffer, 8), - (((cpuFunctionType) == (8))) - || (((((cpuFunctionType) == (0))) && (((cpuFunctionGroup) == (2)))))); - - Integer errorCode = - readOptionalField( - "errorCode", - readUnsignedInt(readBuffer, 16), - (((cpuFunctionType) == (8))) - || (((((cpuFunctionType) == (0))) && (((cpuFunctionGroup) == (2)))))); - - readBuffer.closeContext("S7ParameterUserDataItemCPUFunctions"); - // Create the instance - return new S7ParameterUserDataItemCPUFunctionsBuilderImpl( - method, - cpuFunctionType, - cpuFunctionGroup, - cpuSubfunction, - sequenceNumber, - dataUnitReferenceNumber, - lastDataUnit, - errorCode); - } - - public static class S7ParameterUserDataItemCPUFunctionsBuilderImpl - implements S7ParameterUserDataItem.S7ParameterUserDataItemBuilder { - private final short method; - private final byte cpuFunctionType; - private final byte cpuFunctionGroup; - private final short cpuSubfunction; - private final short sequenceNumber; - private final Short dataUnitReferenceNumber; - private final Short lastDataUnit; - private final Integer errorCode; - - public S7ParameterUserDataItemCPUFunctionsBuilderImpl( - short method, - byte cpuFunctionType, - byte cpuFunctionGroup, - short cpuSubfunction, - short sequenceNumber, - Short dataUnitReferenceNumber, - Short lastDataUnit, - Integer errorCode) { - this.method = method; - this.cpuFunctionType = cpuFunctionType; - this.cpuFunctionGroup = cpuFunctionGroup; - this.cpuSubfunction = cpuSubfunction; - this.sequenceNumber = sequenceNumber; - this.dataUnitReferenceNumber = dataUnitReferenceNumber; - this.lastDataUnit = lastDataUnit; - this.errorCode = errorCode; - } - - public S7ParameterUserDataItemCPUFunctions build() { - S7ParameterUserDataItemCPUFunctions s7ParameterUserDataItemCPUFunctions = - new S7ParameterUserDataItemCPUFunctions( - method, - cpuFunctionType, - cpuFunctionGroup, - cpuSubfunction, - sequenceNumber, - dataUnitReferenceNumber, - lastDataUnit, - errorCode); - return s7ParameterUserDataItemCPUFunctions; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterUserDataItemCPUFunctions)) { - return false; - } - S7ParameterUserDataItemCPUFunctions that = (S7ParameterUserDataItemCPUFunctions) o; - return (getMethod() == that.getMethod()) - && (getCpuFunctionType() == that.getCpuFunctionType()) - && (getCpuFunctionGroup() == that.getCpuFunctionGroup()) - && (getCpuSubfunction() == that.getCpuSubfunction()) - && (getSequenceNumber() == that.getSequenceNumber()) - && (getDataUnitReferenceNumber() == that.getDataUnitReferenceNumber()) - && (getLastDataUnit() == that.getLastDataUnit()) - && (getErrorCode() == that.getErrorCode()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), - getMethod(), - getCpuFunctionType(), - getCpuFunctionGroup(), - getCpuSubfunction(), - getSequenceNumber(), - getDataUnitReferenceNumber(), - getLastDataUnit(), - getErrorCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java deleted file mode 100644 index b70182a707d..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterWriteVarRequest extends S7Parameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0x05; - } - - public Short getMessageType() { - return (short) 0x01; - } - - // Properties. - protected final List items; - - public S7ParameterWriteVarRequest(List items) { - super(); - this.items = items; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterWriteVarRequest"); - - // Implicit Field (numItems) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short numItems = (short) (COUNT(getItems())); - writeImplicitField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7ParameterWriteVarRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterWriteVarRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (numItems) - lengthInBits += 8; - - // Array field - if (items != null) { - int i = 0; - for (S7VarRequestParameterItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7ParameterBuilder staticParseS7ParameterBuilder( - ReadBuffer readBuffer, Short messageType) throws ParseException { - readBuffer.pullContext("S7ParameterWriteVarRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short numItems = readImplicitField("numItems", readUnsignedShort(readBuffer, 8)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> S7VarRequestParameterItem.staticParse(readBuffer), readBuffer), - numItems); - - readBuffer.closeContext("S7ParameterWriteVarRequest"); - // Create the instance - return new S7ParameterWriteVarRequestBuilderImpl(items); - } - - public static class S7ParameterWriteVarRequestBuilderImpl - implements S7Parameter.S7ParameterBuilder { - private final List items; - - public S7ParameterWriteVarRequestBuilderImpl(List items) { - this.items = items; - } - - public S7ParameterWriteVarRequest build() { - S7ParameterWriteVarRequest s7ParameterWriteVarRequest = new S7ParameterWriteVarRequest(items); - return s7ParameterWriteVarRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterWriteVarRequest)) { - return false; - } - S7ParameterWriteVarRequest that = (S7ParameterWriteVarRequest) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java deleted file mode 100644 index 58fb3442e63..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7ParameterWriteVarResponse extends S7Parameter implements Message { - - // Accessors for discriminator values. - public Short getParameterType() { - return (short) 0x05; - } - - public Short getMessageType() { - return (short) 0x03; - } - - // Properties. - protected final short numItems; - - public S7ParameterWriteVarResponse(short numItems) { - super(); - this.numItems = numItems; - } - - public short getNumItems() { - return numItems; - } - - @Override - protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7ParameterWriteVarResponse"); - - // Simple Field (numItems) - writeSimpleField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7ParameterWriteVarResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7ParameterWriteVarResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (numItems) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7ParameterBuilder staticParseS7ParameterBuilder( - ReadBuffer readBuffer, Short messageType) throws ParseException { - readBuffer.pullContext("S7ParameterWriteVarResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short numItems = readSimpleField("numItems", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7ParameterWriteVarResponse"); - // Create the instance - return new S7ParameterWriteVarResponseBuilderImpl(numItems); - } - - public static class S7ParameterWriteVarResponseBuilderImpl - implements S7Parameter.S7ParameterBuilder { - private final short numItems; - - public S7ParameterWriteVarResponseBuilderImpl(short numItems) { - this.numItems = numItems; - } - - public S7ParameterWriteVarResponse build() { - S7ParameterWriteVarResponse s7ParameterWriteVarResponse = - new S7ParameterWriteVarResponse(numItems); - return s7ParameterWriteVarResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7ParameterWriteVarResponse)) { - return false; - } - S7ParameterWriteVarResponse that = (S7ParameterWriteVarResponse) o; - return (getNumItems() == that.getNumItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getNumItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java deleted file mode 100644 index 27068e8ebcc..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7Payload implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getMessageType(); - - public abstract Short getParameterParameterType(); - - public S7Payload() { - super(); - } - - protected abstract void serializeS7PayloadChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7Payload"); - - // Switch field (Serialize the sub-type) - serializeS7PayloadChild(writeBuffer); - - writeBuffer.popContext("S7Payload"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7Payload _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static S7Payload staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { - PositionAware positionAware = readBuffer; - if ((args == null) || (args.length != 2)) { - throw new PlcRuntimeException( - "Wrong number of arguments, expected 2, but got " + args.length); - } - Short messageType; - if (args[0] instanceof Short) { - messageType = (Short) args[0]; - } else if (args[0] instanceof String) { - messageType = Short.valueOf((String) args[0]); - } else { - throw new PlcRuntimeException( - "Argument 0 expected to be of type Short or a string which is parseable but was " - + args[0].getClass().getName()); - } - S7Parameter parameter; - if (args[1] instanceof S7Parameter) { - parameter = (S7Parameter) args[1]; - } else { - throw new PlcRuntimeException( - "Argument 1 expected to be of type S7Parameter or a string which is parseable but was " - + args[1].getClass().getName()); - } - return staticParse(readBuffer, messageType, parameter); - } - - public static S7Payload staticParse( - ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { - readBuffer.pullContext("S7Payload"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7PayloadBuilder builder = null; - if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x04) - && EvaluationHelper.equals(messageType, (short) 0x03)) { - builder = - S7PayloadReadVarResponse.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); - } else if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x05) - && EvaluationHelper.equals(messageType, (short) 0x01)) { - builder = - S7PayloadWriteVarRequest.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); - } else if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x05) - && EvaluationHelper.equals(messageType, (short) 0x03)) { - builder = - S7PayloadWriteVarResponse.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); - } else if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x00) - && EvaluationHelper.equals(messageType, (short) 0x07)) { - builder = S7PayloadUserData.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "parameterparameterType=" - + parameter.getParameterType() - + " " - + "messageType=" - + messageType - + "]"); - } - - readBuffer.closeContext("S7Payload"); - // Create the instance - S7Payload _s7Payload = builder.build(); - return _s7Payload; - } - - public interface S7PayloadBuilder { - S7Payload build(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7Payload)) { - return false; - } - S7Payload that = (S7Payload) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java deleted file mode 100644 index 8642ab90b7e..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadAlarm8 extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x05; - } - - // Properties. - protected final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarm8( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - AlarmMessagePushType alarmMessage) { - super(returnCode, transportSize, dataLength); - this.alarmMessage = alarmMessage; - } - - public AlarmMessagePushType getAlarmMessage() { - return alarmMessage; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadAlarm8"); - - // Simple Field (alarmMessage) - writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadAlarm8"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadAlarm8 _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (alarmMessage) - lengthInBits += alarmMessage.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadAlarm8"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - AlarmMessagePushType alarmMessage = - readSimpleField( - "alarmMessage", - new DataReaderComplexDefault<>( - () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadAlarm8"); - // Create the instance - return new S7PayloadAlarm8BuilderImpl(alarmMessage); - } - - public static class S7PayloadAlarm8BuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarm8BuilderImpl(AlarmMessagePushType alarmMessage) { - this.alarmMessage = alarmMessage; - } - - public S7PayloadAlarm8 build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadAlarm8 s7PayloadAlarm8 = - new S7PayloadAlarm8(returnCode, transportSize, dataLength, alarmMessage); - return s7PayloadAlarm8; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadAlarm8)) { - return false; - } - S7PayloadAlarm8 that = (S7PayloadAlarm8) o; - return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAlarmMessage()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java deleted file mode 100644 index 15880f9c2af..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadAlarmAckInd extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x0c; - } - - // Properties. - protected final AlarmMessageAckPushType alarmMessage; - - public S7PayloadAlarmAckInd( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - AlarmMessageAckPushType alarmMessage) { - super(returnCode, transportSize, dataLength); - this.alarmMessage = alarmMessage; - } - - public AlarmMessageAckPushType getAlarmMessage() { - return alarmMessage; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadAlarmAckInd"); - - // Simple Field (alarmMessage) - writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadAlarmAckInd"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadAlarmAckInd _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (alarmMessage) - lengthInBits += alarmMessage.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadAlarmAckInd"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - AlarmMessageAckPushType alarmMessage = - readSimpleField( - "alarmMessage", - new DataReaderComplexDefault<>( - () -> AlarmMessageAckPushType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadAlarmAckInd"); - // Create the instance - return new S7PayloadAlarmAckIndBuilderImpl(alarmMessage); - } - - public static class S7PayloadAlarmAckIndBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final AlarmMessageAckPushType alarmMessage; - - public S7PayloadAlarmAckIndBuilderImpl(AlarmMessageAckPushType alarmMessage) { - this.alarmMessage = alarmMessage; - } - - public S7PayloadAlarmAckInd build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadAlarmAckInd s7PayloadAlarmAckInd = - new S7PayloadAlarmAckInd(returnCode, transportSize, dataLength, alarmMessage); - return s7PayloadAlarmAckInd; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadAlarmAckInd)) { - return false; - } - S7PayloadAlarmAckInd that = (S7PayloadAlarmAckInd) o; - return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAlarmMessage()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java deleted file mode 100644 index 24a994f5fc1..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadAlarmS extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x12; - } - - // Properties. - protected final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarmS( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - AlarmMessagePushType alarmMessage) { - super(returnCode, transportSize, dataLength); - this.alarmMessage = alarmMessage; - } - - public AlarmMessagePushType getAlarmMessage() { - return alarmMessage; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadAlarmS"); - - // Simple Field (alarmMessage) - writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadAlarmS"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadAlarmS _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (alarmMessage) - lengthInBits += alarmMessage.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadAlarmS"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - AlarmMessagePushType alarmMessage = - readSimpleField( - "alarmMessage", - new DataReaderComplexDefault<>( - () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadAlarmS"); - // Create the instance - return new S7PayloadAlarmSBuilderImpl(alarmMessage); - } - - public static class S7PayloadAlarmSBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarmSBuilderImpl(AlarmMessagePushType alarmMessage) { - this.alarmMessage = alarmMessage; - } - - public S7PayloadAlarmS build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadAlarmS s7PayloadAlarmS = - new S7PayloadAlarmS(returnCode, transportSize, dataLength, alarmMessage); - return s7PayloadAlarmS; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadAlarmS)) { - return false; - } - S7PayloadAlarmS that = (S7PayloadAlarmS) o; - return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAlarmMessage()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java deleted file mode 100644 index e1ca33f3648..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadAlarmSC extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x13; - } - - // Properties. - protected final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarmSC( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - AlarmMessagePushType alarmMessage) { - super(returnCode, transportSize, dataLength); - this.alarmMessage = alarmMessage; - } - - public AlarmMessagePushType getAlarmMessage() { - return alarmMessage; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadAlarmSC"); - - // Simple Field (alarmMessage) - writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadAlarmSC"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadAlarmSC _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (alarmMessage) - lengthInBits += alarmMessage.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadAlarmSC"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - AlarmMessagePushType alarmMessage = - readSimpleField( - "alarmMessage", - new DataReaderComplexDefault<>( - () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadAlarmSC"); - // Create the instance - return new S7PayloadAlarmSCBuilderImpl(alarmMessage); - } - - public static class S7PayloadAlarmSCBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarmSCBuilderImpl(AlarmMessagePushType alarmMessage) { - this.alarmMessage = alarmMessage; - } - - public S7PayloadAlarmSC build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadAlarmSC s7PayloadAlarmSC = - new S7PayloadAlarmSC(returnCode, transportSize, dataLength, alarmMessage); - return s7PayloadAlarmSC; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadAlarmSC)) { - return false; - } - S7PayloadAlarmSC that = (S7PayloadAlarmSC) o; - return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAlarmMessage()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java deleted file mode 100644 index d944a03afc9..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadAlarmSQ extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x11; - } - - // Properties. - protected final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarmSQ( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - AlarmMessagePushType alarmMessage) { - super(returnCode, transportSize, dataLength); - this.alarmMessage = alarmMessage; - } - - public AlarmMessagePushType getAlarmMessage() { - return alarmMessage; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadAlarmSQ"); - - // Simple Field (alarmMessage) - writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadAlarmSQ"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadAlarmSQ _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (alarmMessage) - lengthInBits += alarmMessage.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadAlarmSQ"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - AlarmMessagePushType alarmMessage = - readSimpleField( - "alarmMessage", - new DataReaderComplexDefault<>( - () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadAlarmSQ"); - // Create the instance - return new S7PayloadAlarmSQBuilderImpl(alarmMessage); - } - - public static class S7PayloadAlarmSQBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final AlarmMessagePushType alarmMessage; - - public S7PayloadAlarmSQBuilderImpl(AlarmMessagePushType alarmMessage) { - this.alarmMessage = alarmMessage; - } - - public S7PayloadAlarmSQ build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadAlarmSQ s7PayloadAlarmSQ = - new S7PayloadAlarmSQ(returnCode, transportSize, dataLength, alarmMessage); - return s7PayloadAlarmSQ; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadAlarmSQ)) { - return false; - } - S7PayloadAlarmSQ that = (S7PayloadAlarmSQ) o; - return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAlarmMessage()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java deleted file mode 100644 index f22947b4779..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadDiagnosticMessage extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x03; - } - - // Properties. - protected final int EventId; - protected final short PriorityClass; - protected final short ObNumber; - protected final int DatId; - protected final int Info1; - protected final long Info2; - protected final DateAndTime TimeStamp; - - public S7PayloadDiagnosticMessage( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - int EventId, - short PriorityClass, - short ObNumber, - int DatId, - int Info1, - long Info2, - DateAndTime TimeStamp) { - super(returnCode, transportSize, dataLength); - this.EventId = EventId; - this.PriorityClass = PriorityClass; - this.ObNumber = ObNumber; - this.DatId = DatId; - this.Info1 = Info1; - this.Info2 = Info2; - this.TimeStamp = TimeStamp; - } - - public int getEventId() { - return EventId; - } - - public short getPriorityClass() { - return PriorityClass; - } - - public short getObNumber() { - return ObNumber; - } - - public int getDatId() { - return DatId; - } - - public int getInfo1() { - return Info1; - } - - public long getInfo2() { - return Info2; - } - - public DateAndTime getTimeStamp() { - return TimeStamp; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadDiagnosticMessage"); - - // Simple Field (EventId) - writeSimpleField("EventId", EventId, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (PriorityClass) - writeSimpleField("PriorityClass", PriorityClass, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (ObNumber) - writeSimpleField("ObNumber", ObNumber, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (DatId) - writeSimpleField("DatId", DatId, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (Info1) - writeSimpleField("Info1", Info1, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (Info2) - writeSimpleField("Info2", Info2, writeUnsignedLong(writeBuffer, 32)); - - // Simple Field (TimeStamp) - writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadDiagnosticMessage"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadDiagnosticMessage _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (EventId) - lengthInBits += 16; - - // Simple field (PriorityClass) - lengthInBits += 8; - - // Simple field (ObNumber) - lengthInBits += 8; - - // Simple field (DatId) - lengthInBits += 16; - - // Simple field (Info1) - lengthInBits += 16; - - // Simple field (Info2) - lengthInBits += 32; - - // Simple field (TimeStamp) - lengthInBits += TimeStamp.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadDiagnosticMessage"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int EventId = readSimpleField("EventId", readUnsignedInt(readBuffer, 16)); - - short PriorityClass = readSimpleField("PriorityClass", readUnsignedShort(readBuffer, 8)); - - short ObNumber = readSimpleField("ObNumber", readUnsignedShort(readBuffer, 8)); - - int DatId = readSimpleField("DatId", readUnsignedInt(readBuffer, 16)); - - int Info1 = readSimpleField("Info1", readUnsignedInt(readBuffer, 16)); - - long Info2 = readSimpleField("Info2", readUnsignedLong(readBuffer, 32)); - - DateAndTime TimeStamp = - readSimpleField( - "TimeStamp", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadDiagnosticMessage"); - // Create the instance - return new S7PayloadDiagnosticMessageBuilderImpl( - EventId, PriorityClass, ObNumber, DatId, Info1, Info2, TimeStamp); - } - - public static class S7PayloadDiagnosticMessageBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final int EventId; - private final short PriorityClass; - private final short ObNumber; - private final int DatId; - private final int Info1; - private final long Info2; - private final DateAndTime TimeStamp; - - public S7PayloadDiagnosticMessageBuilderImpl( - int EventId, - short PriorityClass, - short ObNumber, - int DatId, - int Info1, - long Info2, - DateAndTime TimeStamp) { - this.EventId = EventId; - this.PriorityClass = PriorityClass; - this.ObNumber = ObNumber; - this.DatId = DatId; - this.Info1 = Info1; - this.Info2 = Info2; - this.TimeStamp = TimeStamp; - } - - public S7PayloadDiagnosticMessage build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadDiagnosticMessage s7PayloadDiagnosticMessage = - new S7PayloadDiagnosticMessage( - returnCode, - transportSize, - dataLength, - EventId, - PriorityClass, - ObNumber, - DatId, - Info1, - Info2, - TimeStamp); - return s7PayloadDiagnosticMessage; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadDiagnosticMessage)) { - return false; - } - S7PayloadDiagnosticMessage that = (S7PayloadDiagnosticMessage) o; - return (getEventId() == that.getEventId()) - && (getPriorityClass() == that.getPriorityClass()) - && (getObNumber() == that.getObNumber()) - && (getDatId() == that.getDatId()) - && (getInfo1() == that.getInfo1()) - && (getInfo2() == that.getInfo2()) - && (getTimeStamp() == that.getTimeStamp()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), - getEventId(), - getPriorityClass(), - getObNumber(), - getDatId(), - getInfo1(), - getInfo2(), - getTimeStamp()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java deleted file mode 100644 index f6bf5231723..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadNotify extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x06; - } - - // Properties. - protected final AlarmMessagePushType alarmMessage; - - public S7PayloadNotify( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - AlarmMessagePushType alarmMessage) { - super(returnCode, transportSize, dataLength); - this.alarmMessage = alarmMessage; - } - - public AlarmMessagePushType getAlarmMessage() { - return alarmMessage; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadNotify"); - - // Simple Field (alarmMessage) - writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadNotify"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadNotify _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (alarmMessage) - lengthInBits += alarmMessage.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadNotify"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - AlarmMessagePushType alarmMessage = - readSimpleField( - "alarmMessage", - new DataReaderComplexDefault<>( - () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadNotify"); - // Create the instance - return new S7PayloadNotifyBuilderImpl(alarmMessage); - } - - public static class S7PayloadNotifyBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final AlarmMessagePushType alarmMessage; - - public S7PayloadNotifyBuilderImpl(AlarmMessagePushType alarmMessage) { - this.alarmMessage = alarmMessage; - } - - public S7PayloadNotify build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadNotify s7PayloadNotify = - new S7PayloadNotify(returnCode, transportSize, dataLength, alarmMessage); - return s7PayloadNotify; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadNotify)) { - return false; - } - S7PayloadNotify that = (S7PayloadNotify) o; - return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAlarmMessage()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java deleted file mode 100644 index 1c7542a478f..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadNotify8 extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x16; - } - - // Properties. - protected final AlarmMessagePushType alarmMessage; - - public S7PayloadNotify8( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - AlarmMessagePushType alarmMessage) { - super(returnCode, transportSize, dataLength); - this.alarmMessage = alarmMessage; - } - - public AlarmMessagePushType getAlarmMessage() { - return alarmMessage; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadNotify8"); - - // Simple Field (alarmMessage) - writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadNotify8"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadNotify8 _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (alarmMessage) - lengthInBits += alarmMessage.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadNotify8"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - AlarmMessagePushType alarmMessage = - readSimpleField( - "alarmMessage", - new DataReaderComplexDefault<>( - () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadNotify8"); - // Create the instance - return new S7PayloadNotify8BuilderImpl(alarmMessage); - } - - public static class S7PayloadNotify8BuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final AlarmMessagePushType alarmMessage; - - public S7PayloadNotify8BuilderImpl(AlarmMessagePushType alarmMessage) { - this.alarmMessage = alarmMessage; - } - - public S7PayloadNotify8 build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadNotify8 s7PayloadNotify8 = - new S7PayloadNotify8(returnCode, transportSize, dataLength, alarmMessage); - return s7PayloadNotify8; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadNotify8)) { - return false; - } - S7PayloadNotify8 that = (S7PayloadNotify8) o; - return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAlarmMessage()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java deleted file mode 100644 index 4520e992e16..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadReadVarResponse extends S7Payload implements Message { - - // Accessors for discriminator values. - public Short getParameterParameterType() { - return (short) 0x04; - } - - public Short getMessageType() { - return (short) 0x03; - } - - // Properties. - protected final List items; - - public S7PayloadReadVarResponse(List items) { - super(); - this.items = items; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadReadVarResponse"); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadReadVarResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadReadVarResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Array field - if (items != null) { - int i = 0; - for (S7VarPayloadDataItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadBuilder staticParseS7PayloadBuilder( - ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { - readBuffer.pullContext("S7PayloadReadVarResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> S7VarPayloadDataItem.staticParse(readBuffer), readBuffer), - CAST(parameter, S7ParameterReadVarResponse.class).getNumItems()); - - readBuffer.closeContext("S7PayloadReadVarResponse"); - // Create the instance - return new S7PayloadReadVarResponseBuilderImpl(items); - } - - public static class S7PayloadReadVarResponseBuilderImpl implements S7Payload.S7PayloadBuilder { - private final List items; - - public S7PayloadReadVarResponseBuilderImpl(List items) { - this.items = items; - } - - public S7PayloadReadVarResponse build() { - S7PayloadReadVarResponse s7PayloadReadVarResponse = new S7PayloadReadVarResponse(items); - return s7PayloadReadVarResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadReadVarResponse)) { - return false; - } - S7PayloadReadVarResponse that = (S7PayloadReadVarResponse) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java deleted file mode 100644 index 466513678c3..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserData extends S7Payload implements Message { - - // Accessors for discriminator values. - public Short getParameterParameterType() { - return (short) 0x00; - } - - public Short getMessageType() { - return (short) 0x07; - } - - // Properties. - protected final List items; - - public S7PayloadUserData(List items) { - super(); - this.items = items; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserData"); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadUserData"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserData _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Array field - if (items != null) { - int i = 0; - for (S7PayloadUserDataItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadBuilder staticParseS7PayloadBuilder( - ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { - readBuffer.pullContext("S7PayloadUserData"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> - S7PayloadUserDataItem.staticParse( - readBuffer, - (byte) - (CAST( - CAST(parameter, S7ParameterUserData.class).getItems().get(0), - S7ParameterUserDataItemCPUFunctions.class) - .getCpuFunctionGroup()), - (byte) - (CAST( - CAST(parameter, S7ParameterUserData.class).getItems().get(0), - S7ParameterUserDataItemCPUFunctions.class) - .getCpuFunctionType()), - (short) - (CAST( - CAST(parameter, S7ParameterUserData.class).getItems().get(0), - S7ParameterUserDataItemCPUFunctions.class) - .getCpuSubfunction())), - readBuffer), - COUNT(CAST(parameter, S7ParameterUserData.class).getItems())); - - readBuffer.closeContext("S7PayloadUserData"); - // Create the instance - return new S7PayloadUserDataBuilderImpl(items); - } - - public static class S7PayloadUserDataBuilderImpl implements S7Payload.S7PayloadBuilder { - private final List items; - - public S7PayloadUserDataBuilderImpl(List items) { - this.items = items; - } - - public S7PayloadUserData build() { - S7PayloadUserData s7PayloadUserData = new S7PayloadUserData(items); - return s7PayloadUserData; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserData)) { - return false; - } - S7PayloadUserData that = (S7PayloadUserData) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java deleted file mode 100644 index 16ef4c273d8..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7PayloadUserDataItem implements Message { - - // Abstract accessors for discriminator values. - public abstract Byte getCpuFunctionGroup(); - - public abstract Byte getCpuFunctionType(); - - public abstract Short getCpuSubfunction(); - - // Properties. - protected final DataTransportErrorCode returnCode; - protected final DataTransportSize transportSize; - protected final int dataLength; - - public S7PayloadUserDataItem( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(); - this.returnCode = returnCode; - this.transportSize = transportSize; - this.dataLength = dataLength; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public DataTransportSize getTransportSize() { - return transportSize; - } - - public int getDataLength() { - return dataLength; - } - - protected abstract void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItem"); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (transportSize) - writeSimpleEnumField( - "transportSize", - "DataTransportSize", - transportSize, - new DataWriterEnumDefault<>( - DataTransportSize::getValue, - DataTransportSize::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (dataLength) - writeSimpleField("dataLength", dataLength, writeUnsignedInt(writeBuffer, 16)); - - // Switch field (Serialize the sub-type) - serializeS7PayloadUserDataItemChild(writeBuffer); - - writeBuffer.popContext("S7PayloadUserDataItem"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7PayloadUserDataItem _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (returnCode) - lengthInBits += 8; - - // Simple field (transportSize) - lengthInBits += 8; - - // Simple field (dataLength) - lengthInBits += 16; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static S7PayloadUserDataItem staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - if ((args == null) || (args.length != 3)) { - throw new PlcRuntimeException( - "Wrong number of arguments, expected 3, but got " + args.length); - } - Byte cpuFunctionGroup; - if (args[0] instanceof Byte) { - cpuFunctionGroup = (Byte) args[0]; - } else if (args[0] instanceof String) { - cpuFunctionGroup = Byte.valueOf((String) args[0]); - } else { - throw new PlcRuntimeException( - "Argument 0 expected to be of type Byte or a string which is parseable but was " - + args[0].getClass().getName()); - } - Byte cpuFunctionType; - if (args[1] instanceof Byte) { - cpuFunctionType = (Byte) args[1]; - } else if (args[1] instanceof String) { - cpuFunctionType = Byte.valueOf((String) args[1]); - } else { - throw new PlcRuntimeException( - "Argument 1 expected to be of type Byte or a string which is parseable but was " - + args[1].getClass().getName()); - } - Short cpuSubfunction; - if (args[2] instanceof Short) { - cpuSubfunction = (Short) args[2]; - } else if (args[2] instanceof String) { - cpuSubfunction = Short.valueOf((String) args[2]); - } else { - throw new PlcRuntimeException( - "Argument 2 expected to be of type Short or a string which is parseable but was " - + args[2].getClass().getName()); - } - return staticParse(readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } - - public static S7PayloadUserDataItem staticParse( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItem"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - DataTransportSize transportSize = - readEnumField( - "transportSize", - "DataTransportSize", - new DataReaderEnumDefault<>( - DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - int dataLength = readSimpleField("dataLength", readUnsignedInt(readBuffer, 16)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7PayloadUserDataItemBuilder builder = null; - if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { - builder = - S7PayloadUserDataItemCyclicServicesPush.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x05)) { - builder = - S7PayloadUserDataItemCyclicServicesChangeDrivenPush - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { - builder = - S7PayloadUserDataItemCyclicServicesSubscribeRequest - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { - builder = - S7PayloadUserDataItemCyclicServicesUnsubscribeRequest - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { - builder = - S7PayloadUserDataItemCyclicServicesSubscribeResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { - builder = - S7PayloadUserDataItemCyclicServicesUnsubscribeResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x05) - && EvaluationHelper.equals(dataLength, (int) 0x00)) { - builder = - S7PayloadUserDataItemCyclicServicesErrorResponse.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x05)) { - builder = - S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x03)) { - builder = - S7PayloadDiagnosticMessage.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x05)) { - builder = - S7PayloadAlarm8.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x06)) { - builder = - S7PayloadNotify.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x0c)) { - builder = - S7PayloadAlarmAckInd.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x11)) { - builder = - S7PayloadAlarmSQ.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x12)) { - builder = - S7PayloadAlarmS.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x13)) { - builder = - S7PayloadAlarmSC.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x16)) { - builder = - S7PayloadNotify8.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01) - && EvaluationHelper.equals(dataLength, (int) 0x00)) { - builder = - S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { - builder = - S7PayloadUserDataItemCpuFunctionReadSzlRequest.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { - builder = - S7PayloadUserDataItemCpuFunctionReadSzlResponse.staticParseS7PayloadUserDataItemBuilder( - readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x02)) { - builder = - S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x02) - && EvaluationHelper.equals(dataLength, (int) 0x00)) { - builder = - S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x02) - && EvaluationHelper.equals(dataLength, (int) 0x02)) { - builder = - S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x02) - && EvaluationHelper.equals(dataLength, (int) 0x05)) { - builder = - S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x0b)) { - builder = - S7PayloadUserDataItemCpuFunctionAlarmAckRequest.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x0b) - && EvaluationHelper.equals(dataLength, (int) 0x00)) { - builder = - S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x0b)) { - builder = - S7PayloadUserDataItemCpuFunctionAlarmAckResponse.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x13)) { - builder = - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x13)) { - builder = - S7PayloadUserDataItemCpuFunctionAlarmQueryResponse - .staticParseS7PayloadUserDataItemBuilder( - readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { - builder = - S7PayloadUserDataItemClkRequest.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { - builder = - S7PayloadUserDataItemClkResponse.staticParseS7PayloadUserDataItemBuilder( - readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x03)) { - builder = - S7PayloadUserDataItemClkFRequest.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x03)) { - builder = - S7PayloadUserDataItemClkFResponse.staticParseS7PayloadUserDataItemBuilder( - readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { - builder = - S7PayloadUserDataItemClkSetRequest.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) - && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) - && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { - builder = - S7PayloadUserDataItemClkSetResponse.staticParseS7PayloadUserDataItemBuilder( - readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "cpuFunctionGroup=" - + cpuFunctionGroup - + " " - + "cpuFunctionType=" - + cpuFunctionType - + " " - + "cpuSubfunction=" - + cpuSubfunction - + " " - + "dataLength=" - + dataLength - + "]"); - } - - readBuffer.closeContext("S7PayloadUserDataItem"); - // Create the instance - S7PayloadUserDataItem _s7PayloadUserDataItem = - builder.build(returnCode, transportSize, dataLength); - return _s7PayloadUserDataItem; - } - - public interface S7PayloadUserDataItemBuilder { - S7PayloadUserDataItem build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItem)) { - return false; - } - S7PayloadUserDataItem that = (S7PayloadUserDataItem) o; - return (getReturnCode() == that.getReturnCode()) - && (getTransportSize() == that.getTransportSize()) - && (getDataLength() == that.getDataLength()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getReturnCode(), getTransportSize(), getDataLength()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java deleted file mode 100644 index 4c527a9242a..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemClkFRequest extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x07; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x03; - } - - public S7PayloadUserDataItemClkFRequest( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemClkFRequest"); - - writeBuffer.popContext("S7PayloadUserDataItemClkFRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemClkFRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemClkFRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemClkFRequest"); - // Create the instance - return new S7PayloadUserDataItemClkFRequestBuilderImpl(); - } - - public static class S7PayloadUserDataItemClkFRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemClkFRequestBuilderImpl() {} - - public S7PayloadUserDataItemClkFRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemClkFRequest s7PayloadUserDataItemClkFRequest = - new S7PayloadUserDataItemClkFRequest(returnCode, transportSize, dataLength); - return s7PayloadUserDataItemClkFRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemClkFRequest)) { - return false; - } - S7PayloadUserDataItemClkFRequest that = (S7PayloadUserDataItemClkFRequest) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java deleted file mode 100644 index 6f7d4540f79..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemClkFResponse extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x07; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x03; - } - - // Properties. - protected final short Reserved; - protected final short Year1; - protected final DateAndTime TimeStamp; - - public S7PayloadUserDataItemClkFResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short Reserved, - short Year1, - DateAndTime TimeStamp) { - super(returnCode, transportSize, dataLength); - this.Reserved = Reserved; - this.Year1 = Year1; - this.TimeStamp = TimeStamp; - } - - public short getReserved() { - return Reserved; - } - - public short getYear1() { - return Year1; - } - - public DateAndTime getTimeStamp() { - return TimeStamp; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemClkFResponse"); - - // Simple Field (Reserved) - writeSimpleField("Reserved", Reserved, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (Year1) - writeSimpleField("Year1", Year1, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (TimeStamp) - writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadUserDataItemClkFResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemClkFResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (Reserved) - lengthInBits += 8; - - // Simple field (Year1) - lengthInBits += 8; - - // Simple field (TimeStamp) - lengthInBits += TimeStamp.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, - Integer dataLength, - Byte cpuFunctionGroup, - Byte cpuFunctionType, - Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemClkFResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short Reserved = readSimpleField("Reserved", readUnsignedShort(readBuffer, 8)); - - short Year1 = readSimpleField("Year1", readUnsignedShort(readBuffer, 8)); - - DateAndTime TimeStamp = - readSimpleField( - "TimeStamp", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadUserDataItemClkFResponse"); - // Create the instance - return new S7PayloadUserDataItemClkFResponseBuilderImpl(Reserved, Year1, TimeStamp); - } - - public static class S7PayloadUserDataItemClkFResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short Reserved; - private final short Year1; - private final DateAndTime TimeStamp; - - public S7PayloadUserDataItemClkFResponseBuilderImpl( - short Reserved, short Year1, DateAndTime TimeStamp) { - this.Reserved = Reserved; - this.Year1 = Year1; - this.TimeStamp = TimeStamp; - } - - public S7PayloadUserDataItemClkFResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemClkFResponse s7PayloadUserDataItemClkFResponse = - new S7PayloadUserDataItemClkFResponse( - returnCode, transportSize, dataLength, Reserved, Year1, TimeStamp); - return s7PayloadUserDataItemClkFResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemClkFResponse)) { - return false; - } - S7PayloadUserDataItemClkFResponse that = (S7PayloadUserDataItemClkFResponse) o; - return (getReserved() == that.getReserved()) - && (getYear1() == that.getYear1()) - && (getTimeStamp() == that.getTimeStamp()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getReserved(), getYear1(), getTimeStamp()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java deleted file mode 100644 index 2ac4fc7b39f..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemClkRequest extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x07; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - public S7PayloadUserDataItemClkRequest( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemClkRequest"); - - writeBuffer.popContext("S7PayloadUserDataItemClkRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemClkRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemClkRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemClkRequest"); - // Create the instance - return new S7PayloadUserDataItemClkRequestBuilderImpl(); - } - - public static class S7PayloadUserDataItemClkRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemClkRequestBuilderImpl() {} - - public S7PayloadUserDataItemClkRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemClkRequest s7PayloadUserDataItemClkRequest = - new S7PayloadUserDataItemClkRequest(returnCode, transportSize, dataLength); - return s7PayloadUserDataItemClkRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemClkRequest)) { - return false; - } - S7PayloadUserDataItemClkRequest that = (S7PayloadUserDataItemClkRequest) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java deleted file mode 100644 index 3ebeb32ca99..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemClkResponse extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x07; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - // Properties. - protected final short Reserved; - protected final short Year1; - protected final DateAndTime TimeStamp; - - public S7PayloadUserDataItemClkResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short Reserved, - short Year1, - DateAndTime TimeStamp) { - super(returnCode, transportSize, dataLength); - this.Reserved = Reserved; - this.Year1 = Year1; - this.TimeStamp = TimeStamp; - } - - public short getReserved() { - return Reserved; - } - - public short getYear1() { - return Year1; - } - - public DateAndTime getTimeStamp() { - return TimeStamp; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemClkResponse"); - - // Simple Field (Reserved) - writeSimpleField("Reserved", Reserved, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (Year1) - writeSimpleField("Year1", Year1, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (TimeStamp) - writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadUserDataItemClkResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemClkResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (Reserved) - lengthInBits += 8; - - // Simple field (Year1) - lengthInBits += 8; - - // Simple field (TimeStamp) - lengthInBits += TimeStamp.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, - Integer dataLength, - Byte cpuFunctionGroup, - Byte cpuFunctionType, - Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemClkResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short Reserved = readSimpleField("Reserved", readUnsignedShort(readBuffer, 8)); - - short Year1 = readSimpleField("Year1", readUnsignedShort(readBuffer, 8)); - - DateAndTime TimeStamp = - readSimpleField( - "TimeStamp", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadUserDataItemClkResponse"); - // Create the instance - return new S7PayloadUserDataItemClkResponseBuilderImpl(Reserved, Year1, TimeStamp); - } - - public static class S7PayloadUserDataItemClkResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short Reserved; - private final short Year1; - private final DateAndTime TimeStamp; - - public S7PayloadUserDataItemClkResponseBuilderImpl( - short Reserved, short Year1, DateAndTime TimeStamp) { - this.Reserved = Reserved; - this.Year1 = Year1; - this.TimeStamp = TimeStamp; - } - - public S7PayloadUserDataItemClkResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemClkResponse s7PayloadUserDataItemClkResponse = - new S7PayloadUserDataItemClkResponse( - returnCode, transportSize, dataLength, Reserved, Year1, TimeStamp); - return s7PayloadUserDataItemClkResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemClkResponse)) { - return false; - } - S7PayloadUserDataItemClkResponse that = (S7PayloadUserDataItemClkResponse) o; - return (getReserved() == that.getReserved()) - && (getYear1() == that.getYear1()) - && (getTimeStamp() == that.getTimeStamp()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getReserved(), getYear1(), getTimeStamp()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java deleted file mode 100644 index 9de7ca3487d..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemClkSetRequest extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x07; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x04; - } - - // Properties. - protected final DateAndTime TimeStamp; - - public S7PayloadUserDataItemClkSetRequest( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - DateAndTime TimeStamp) { - super(returnCode, transportSize, dataLength); - this.TimeStamp = TimeStamp; - } - - public DateAndTime getTimeStamp() { - return TimeStamp; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemClkSetRequest"); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (TimeStamp) - writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7PayloadUserDataItemClkSetRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemClkSetRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Reserved Field (reserved) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (TimeStamp) - lengthInBits += TimeStamp.getLengthInBits(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemClkSetRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - Short reservedField1 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - DateAndTime TimeStamp = - readSimpleField( - "TimeStamp", - new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7PayloadUserDataItemClkSetRequest"); - // Create the instance - return new S7PayloadUserDataItemClkSetRequestBuilderImpl(TimeStamp); - } - - public static class S7PayloadUserDataItemClkSetRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final DateAndTime TimeStamp; - - public S7PayloadUserDataItemClkSetRequestBuilderImpl(DateAndTime TimeStamp) { - this.TimeStamp = TimeStamp; - } - - public S7PayloadUserDataItemClkSetRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemClkSetRequest s7PayloadUserDataItemClkSetRequest = - new S7PayloadUserDataItemClkSetRequest(returnCode, transportSize, dataLength, TimeStamp); - return s7PayloadUserDataItemClkSetRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemClkSetRequest)) { - return false; - } - S7PayloadUserDataItemClkSetRequest that = (S7PayloadUserDataItemClkSetRequest) o; - return (getTimeStamp() == that.getTimeStamp()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getTimeStamp()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java deleted file mode 100644 index ece52dd08ee..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemClkSetResponse extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x07; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x04; - } - - public S7PayloadUserDataItemClkSetResponse( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemClkSetResponse"); - - writeBuffer.popContext("S7PayloadUserDataItemClkSetResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemClkSetResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemClkSetResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemClkSetResponse"); - // Create the instance - return new S7PayloadUserDataItemClkSetResponseBuilderImpl(); - } - - public static class S7PayloadUserDataItemClkSetResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemClkSetResponseBuilderImpl() {} - - public S7PayloadUserDataItemClkSetResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemClkSetResponse s7PayloadUserDataItemClkSetResponse = - new S7PayloadUserDataItemClkSetResponse(returnCode, transportSize, dataLength); - return s7PayloadUserDataItemClkSetResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemClkSetResponse)) { - return false; - } - S7PayloadUserDataItemClkSetResponse that = (S7PayloadUserDataItemClkSetResponse) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java deleted file mode 100644 index 1d3d6828ff2..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x0b; - } - - public S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponseBuilderImpl(); - } - - public static class S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponseBuilderImpl() {} - - public S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse - s7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse = - new S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse( - returnCode, transportSize, dataLength); - return s7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse)) { - return false; - } - S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse that = - (S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java deleted file mode 100644 index c74ec909136..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionAlarmAckRequest extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x0b; - } - - // Constant values. - public static final Short FUNCTIONID = 0x09; - - // Properties. - protected final List messageObjects; - - public S7PayloadUserDataItemCpuFunctionAlarmAckRequest( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - List messageObjects) { - super(returnCode, transportSize, dataLength); - this.messageObjects = messageObjects; - } - - public List getMessageObjects() { - return messageObjects; - } - - public short getFunctionId() { - return FUNCTIONID; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); - - // Const Field (functionId) - writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); - - // Implicit Field (numberOfObjects) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - short numberOfObjects = (short) (COUNT(getMessageObjects())); - writeImplicitField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (messageObjects) - writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionAlarmAckRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (functionId) - lengthInBits += 8; - - // Implicit Field (numberOfObjects) - lengthInBits += 8; - - // Array field - if (messageObjects != null) { - int i = 0; - for (AlarmMessageObjectAckType element : messageObjects) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = - readConstField( - "functionId", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmAckRequest.FUNCTIONID); - - short numberOfObjects = readImplicitField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - List messageObjects = - readCountArrayField( - "messageObjects", - new DataReaderComplexDefault<>( - () -> AlarmMessageObjectAckType.staticParse(readBuffer), readBuffer), - numberOfObjects); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionAlarmAckRequestBuilderImpl(messageObjects); - } - - public static class S7PayloadUserDataItemCpuFunctionAlarmAckRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final List messageObjects; - - public S7PayloadUserDataItemCpuFunctionAlarmAckRequestBuilderImpl( - List messageObjects) { - this.messageObjects = messageObjects; - } - - public S7PayloadUserDataItemCpuFunctionAlarmAckRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionAlarmAckRequest - s7PayloadUserDataItemCpuFunctionAlarmAckRequest = - new S7PayloadUserDataItemCpuFunctionAlarmAckRequest( - returnCode, transportSize, dataLength, messageObjects); - return s7PayloadUserDataItemCpuFunctionAlarmAckRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmAckRequest)) { - return false; - } - S7PayloadUserDataItemCpuFunctionAlarmAckRequest that = - (S7PayloadUserDataItemCpuFunctionAlarmAckRequest) o; - return (getMessageObjects() == that.getMessageObjects()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java deleted file mode 100644 index 3be0eb08c87..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java +++ /dev/null @@ -1,195 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionAlarmAckResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x0b; - } - - // Properties. - protected final short functionId; - protected final List messageObjects; - - public S7PayloadUserDataItemCpuFunctionAlarmAckResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short functionId, - List messageObjects) { - super(returnCode, transportSize, dataLength); - this.functionId = functionId; - this.messageObjects = messageObjects; - } - - public short getFunctionId() { - return functionId; - } - - public List getMessageObjects() { - return messageObjects; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); - - // Simple Field (functionId) - writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); - - // Implicit Field (numberOfObjects) (Used for parsing, but its value is not stored as it's - // implicitly given by the objects content) - short numberOfObjects = (short) (COUNT(getMessageObjects())); - writeImplicitField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (messageObjects) - writeSimpleTypeArrayField("messageObjects", messageObjects, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionAlarmAckResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (functionId) - lengthInBits += 8; - - // Implicit Field (numberOfObjects) - lengthInBits += 8; - - // Array field - if (messageObjects != null) { - lengthInBits += 8 * messageObjects.size(); - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); - - short numberOfObjects = readImplicitField("numberOfObjects", readUnsignedShort(readBuffer, 8)); - - List messageObjects = - readCountArrayField("messageObjects", readUnsignedShort(readBuffer, 8), numberOfObjects); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionAlarmAckResponseBuilderImpl( - functionId, messageObjects); - } - - public static class S7PayloadUserDataItemCpuFunctionAlarmAckResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short functionId; - private final List messageObjects; - - public S7PayloadUserDataItemCpuFunctionAlarmAckResponseBuilderImpl( - short functionId, List messageObjects) { - this.functionId = functionId; - this.messageObjects = messageObjects; - } - - public S7PayloadUserDataItemCpuFunctionAlarmAckResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionAlarmAckResponse - s7PayloadUserDataItemCpuFunctionAlarmAckResponse = - new S7PayloadUserDataItemCpuFunctionAlarmAckResponse( - returnCode, transportSize, dataLength, functionId, messageObjects); - return s7PayloadUserDataItemCpuFunctionAlarmAckResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmAckResponse)) { - return false; - } - S7PayloadUserDataItemCpuFunctionAlarmAckResponse that = - (S7PayloadUserDataItemCpuFunctionAlarmAckResponse) o; - return (getFunctionId() == that.getFunctionId()) - && (getMessageObjects() == that.getMessageObjects()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getFunctionId(), getMessageObjects()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQuery.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQuery.java deleted file mode 100644 index 6db11a71d6e..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQuery.java +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionAlarmQuery extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x13; - } - - // Constant values. - public static final Short FUNCTIONID = 0x00; - public static final Short NUMBERMESSAGEOBJ = 0x01; - public static final Short VARIABLESPEC = 0x12; - public static final Short LENGTH = 0x08; - - // Properties. - protected final SyntaxIdType syntaxId; - protected final QueryType queryType; - protected final AlarmType alarmType; - - public S7PayloadUserDataItemCpuFunctionAlarmQuery( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - SyntaxIdType syntaxId, - QueryType queryType, - AlarmType alarmType) { - super(returnCode, transportSize, dataLength); - this.syntaxId = syntaxId; - this.queryType = queryType; - this.alarmType = alarmType; - } - - public SyntaxIdType getSyntaxId() { - return syntaxId; - } - - public QueryType getQueryType() { - return queryType; - } - - public AlarmType getAlarmType() { - return alarmType; - } - - public short getFunctionId() { - return FUNCTIONID; - } - - public short getNumberMessageObj() { - return NUMBERMESSAGEOBJ; - } - - public short getVariableSpec() { - return VARIABLESPEC; - } - - public short getLength() { - return LENGTH; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - int startPos = positionAware.getPos(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmQuery"); - - // Const Field (functionId) - writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (numberMessageObj) - writeConstField("numberMessageObj", NUMBERMESSAGEOBJ, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (variableSpec) - writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (length) - writeConstField("length", LENGTH, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (syntaxId) - writeSimpleEnumField( - "syntaxId", - "SyntaxIdType", - syntaxId, - new DataWriterEnumDefault<>( - SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (queryType) - writeSimpleEnumField( - "queryType", - "QueryType", - queryType, - new DataWriterEnumDefault<>( - QueryType::getValue, QueryType::name, writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x34, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (alarmType) - writeSimpleEnumField( - "alarmType", - "AlarmType", - alarmType, - new DataWriterEnumDefault<>( - AlarmType::getValue, AlarmType::name, writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmQuery"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionAlarmQuery _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (functionId) - lengthInBits += 8; - - // Const Field (numberMessageObj) - lengthInBits += 8; - - // Const Field (variableSpec) - lengthInBits += 8; - - // Const Field (length) - lengthInBits += 8; - - // Simple field (syntaxId) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (queryType) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (alarmType) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmQuery"); - PositionAware positionAware = readBuffer; - int startPos = positionAware.getPos(); - int curPos; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = - readConstField( - "functionId", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQuery.FUNCTIONID); - - short numberMessageObj = - readConstField( - "numberMessageObj", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQuery.NUMBERMESSAGEOBJ); - - short variableSpec = - readConstField( - "variableSpec", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQuery.VARIABLESPEC); - - short length = - readConstField( - "length", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQuery.LENGTH); - - SyntaxIdType syntaxId = - readEnumField( - "syntaxId", - "SyntaxIdType", - new DataReaderEnumDefault<>( - SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - QueryType queryType = - readEnumField( - "queryType", - "QueryType", - new DataReaderEnumDefault<>(QueryType::enumForValue, readUnsignedShort(readBuffer, 8))); - - Short reservedField1 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x34); - - AlarmType alarmType = - readEnumField( - "alarmType", - "AlarmType", - new DataReaderEnumDefault<>(AlarmType::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmQuery"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionAlarmQueryBuilderImpl( - syntaxId, queryType, alarmType); - } - - public static class S7PayloadUserDataItemCpuFunctionAlarmQueryBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final SyntaxIdType syntaxId; - private final QueryType queryType; - private final AlarmType alarmType; - - public S7PayloadUserDataItemCpuFunctionAlarmQueryBuilderImpl( - SyntaxIdType syntaxId, QueryType queryType, AlarmType alarmType) { - this.syntaxId = syntaxId; - this.queryType = queryType; - this.alarmType = alarmType; - } - - public S7PayloadUserDataItemCpuFunctionAlarmQuery build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionAlarmQuery s7PayloadUserDataItemCpuFunctionAlarmQuery = - new S7PayloadUserDataItemCpuFunctionAlarmQuery( - returnCode, transportSize, dataLength, syntaxId, queryType, alarmType); - return s7PayloadUserDataItemCpuFunctionAlarmQuery; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmQuery)) { - return false; - } - S7PayloadUserDataItemCpuFunctionAlarmQuery that = - (S7PayloadUserDataItemCpuFunctionAlarmQuery) o; - return (getSyntaxId() == that.getSyntaxId()) - && (getQueryType() == that.getQueryType()) - && (getAlarmType() == that.getAlarmType()) - && super.equals(that); - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getSyntaxId(), getQueryType(), getAlarmType()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java deleted file mode 100644 index 86ef1925c10..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionAlarmQueryRequest extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x13; - } - - // Constant values. - public static final Short FUNCTIONID = 0x00; - public static final Short NUMBERMESSAGEOBJ = 0x01; - public static final Short VARIABLESPEC = 0x12; - public static final Short LENGTH = 0x08; - - // Properties. - protected final SyntaxIdType syntaxId; - protected final QueryType queryType; - protected final AlarmType alarmType; - - public S7PayloadUserDataItemCpuFunctionAlarmQueryRequest( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - SyntaxIdType syntaxId, - QueryType queryType, - AlarmType alarmType) { - super(returnCode, transportSize, dataLength); - this.syntaxId = syntaxId; - this.queryType = queryType; - this.alarmType = alarmType; - } - - public SyntaxIdType getSyntaxId() { - return syntaxId; - } - - public QueryType getQueryType() { - return queryType; - } - - public AlarmType getAlarmType() { - return alarmType; - } - - public short getFunctionId() { - return FUNCTIONID; - } - - public short getNumberMessageObj() { - return NUMBERMESSAGEOBJ; - } - - public short getVariableSpec() { - return VARIABLESPEC; - } - - public short getLength() { - return LENGTH; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); - - // Const Field (functionId) - writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (numberMessageObj) - writeConstField("numberMessageObj", NUMBERMESSAGEOBJ, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (variableSpec) - writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); - - // Const Field (length) - writeConstField("length", LENGTH, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (syntaxId) - writeSimpleEnumField( - "syntaxId", - "SyntaxIdType", - syntaxId, - new DataWriterEnumDefault<>( - SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (queryType) - writeSimpleEnumField( - "queryType", - "QueryType", - queryType, - new DataWriterEnumDefault<>( - QueryType::getValue, QueryType::name, writeUnsignedShort(writeBuffer, 8))); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x34, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (alarmType) - writeSimpleEnumField( - "alarmType", - "AlarmType", - alarmType, - new DataWriterEnumDefault<>( - AlarmType::getValue, AlarmType::name, writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (functionId) - lengthInBits += 8; - - // Const Field (numberMessageObj) - lengthInBits += 8; - - // Const Field (variableSpec) - lengthInBits += 8; - - // Const Field (length) - lengthInBits += 8; - - // Simple field (syntaxId) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (queryType) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (alarmType) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short functionId = - readConstField( - "functionId", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.FUNCTIONID); - - short numberMessageObj = - readConstField( - "numberMessageObj", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.NUMBERMESSAGEOBJ); - - short variableSpec = - readConstField( - "variableSpec", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.VARIABLESPEC); - - short length = - readConstField( - "length", - readUnsignedShort(readBuffer, 8), - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.LENGTH); - - SyntaxIdType syntaxId = - readEnumField( - "syntaxId", - "SyntaxIdType", - new DataReaderEnumDefault<>( - SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - QueryType queryType = - readEnumField( - "queryType", - "QueryType", - new DataReaderEnumDefault<>(QueryType::enumForValue, readUnsignedShort(readBuffer, 8))); - - Short reservedField1 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x34); - - AlarmType alarmType = - readEnumField( - "alarmType", - "AlarmType", - new DataReaderEnumDefault<>(AlarmType::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionAlarmQueryRequestBuilderImpl( - syntaxId, queryType, alarmType); - } - - public static class S7PayloadUserDataItemCpuFunctionAlarmQueryRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final SyntaxIdType syntaxId; - private final QueryType queryType; - private final AlarmType alarmType; - - public S7PayloadUserDataItemCpuFunctionAlarmQueryRequestBuilderImpl( - SyntaxIdType syntaxId, QueryType queryType, AlarmType alarmType) { - this.syntaxId = syntaxId; - this.queryType = queryType; - this.alarmType = alarmType; - } - - public S7PayloadUserDataItemCpuFunctionAlarmQueryRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest - s7PayloadUserDataItemCpuFunctionAlarmQueryRequest = - new S7PayloadUserDataItemCpuFunctionAlarmQueryRequest( - returnCode, transportSize, dataLength, syntaxId, queryType, alarmType); - return s7PayloadUserDataItemCpuFunctionAlarmQueryRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmQueryRequest)) { - return false; - } - S7PayloadUserDataItemCpuFunctionAlarmQueryRequest that = - (S7PayloadUserDataItemCpuFunctionAlarmQueryRequest) o; - return (getSyntaxId() == that.getSyntaxId()) - && (getQueryType() == that.getQueryType()) - && (getAlarmType() == that.getAlarmType()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getSyntaxId(), getQueryType(), getAlarmType()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java deleted file mode 100644 index 8cf96d3469a..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionAlarmQueryResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x13; - } - - // Properties. - protected final byte[] items; - - public S7PayloadUserDataItemCpuFunctionAlarmQueryResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - byte[] items) { - super(returnCode, transportSize, dataLength); - this.items = items; - } - - public byte[] getItems() { - return items; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); - - // Array Field (items) - writeByteArrayField("items", items, writeByteArray(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionAlarmQueryResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Array field - if (items != null) { - lengthInBits += 8 * items.length; - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, - Integer dataLength, - Byte cpuFunctionGroup, - Byte cpuFunctionType, - Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - byte[] items = readBuffer.readByteArray("items", Math.toIntExact(dataLength)); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionAlarmQueryResponseBuilderImpl(items); - } - - public static class S7PayloadUserDataItemCpuFunctionAlarmQueryResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final byte[] items; - - public S7PayloadUserDataItemCpuFunctionAlarmQueryResponseBuilderImpl(byte[] items) { - this.items = items; - } - - public S7PayloadUserDataItemCpuFunctionAlarmQueryResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionAlarmQueryResponse - s7PayloadUserDataItemCpuFunctionAlarmQueryResponse = - new S7PayloadUserDataItemCpuFunctionAlarmQueryResponse( - returnCode, transportSize, dataLength, items); - return s7PayloadUserDataItemCpuFunctionAlarmQueryResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmQueryResponse)) { - return false; - } - S7PayloadUserDataItemCpuFunctionAlarmQueryResponse that = - (S7PayloadUserDataItemCpuFunctionAlarmQueryResponse) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscription.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscription.java deleted file mode 100644 index 9b3cbc7abc2..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscription.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionMsgSubscription extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x02; - } - - // Properties. - protected final short Subscription; - protected final String magicKey; - protected final AlarmStateType Alarmtype; - protected final Short Reserve; - - public S7PayloadUserDataItemCpuFunctionMsgSubscription( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short Subscription, - String magicKey, - AlarmStateType Alarmtype, - Short Reserve) { - super(returnCode, transportSize, dataLength); - this.Subscription = Subscription; - this.magicKey = magicKey; - this.Alarmtype = Alarmtype; - this.Reserve = Reserve; - } - - public short getSubscription() { - return Subscription; - } - - public String getMagicKey() { - return magicKey; - } - - public AlarmStateType getAlarmtype() { - return Alarmtype; - } - - public Short getReserve() { - return Reserve; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - int startPos = positionAware.getPos(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscription"); - - // Simple Field (Subscription) - writeSimpleField("Subscription", Subscription, writeUnsignedShort(writeBuffer, 8)); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (magicKey) - writeSimpleField("magicKey", magicKey, writeString(writeBuffer, 64)); - - // Optional Field (Alarmtype) (Can be skipped, if the value is null) - writeOptionalEnumField( - "Alarmtype", - "AlarmStateType", - Alarmtype, - new DataWriterEnumDefault<>( - AlarmStateType::getValue, AlarmStateType::name, writeUnsignedShort(writeBuffer, 8)), - (getSubscription()) >= (128)); - - // Optional Field (Reserve) (Can be skipped, if the value is null) - writeOptionalField("Reserve", Reserve, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscription"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionMsgSubscription _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (Subscription) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (magicKey) - lengthInBits += 64; - - // Optional Field (Alarmtype) - if (Alarmtype != null) { - lengthInBits += 8; - } - - // Optional Field (Reserve) - if (Reserve != null) { - lengthInBits += 8; - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscription"); - PositionAware positionAware = readBuffer; - int startPos = positionAware.getPos(); - int curPos; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short Subscription = readSimpleField("Subscription", readUnsignedShort(readBuffer, 8)); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - String magicKey = readSimpleField("magicKey", readString(readBuffer, 64)); - - AlarmStateType Alarmtype = - readOptionalField( - "Alarmtype", - new DataReaderEnumDefault<>( - AlarmStateType::enumForValue, readUnsignedShort(readBuffer, 8)), - (Subscription) >= (128)); - - Short Reserve = - readOptionalField("Reserve", readUnsignedShort(readBuffer, 8), (Subscription) >= (128)); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscription"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionBuilderImpl( - Subscription, magicKey, Alarmtype, Reserve); - } - - public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short Subscription; - private final String magicKey; - private final AlarmStateType Alarmtype; - private final Short Reserve; - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionBuilderImpl( - short Subscription, String magicKey, AlarmStateType Alarmtype, Short Reserve) { - this.Subscription = Subscription; - this.magicKey = magicKey; - this.Alarmtype = Alarmtype; - this.Reserve = Reserve; - } - - public S7PayloadUserDataItemCpuFunctionMsgSubscription build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionMsgSubscription - s7PayloadUserDataItemCpuFunctionMsgSubscription = - new S7PayloadUserDataItemCpuFunctionMsgSubscription( - returnCode, - transportSize, - dataLength, - Subscription, - magicKey, - Alarmtype, - Reserve); - return s7PayloadUserDataItemCpuFunctionMsgSubscription; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscription)) { - return false; - } - S7PayloadUserDataItemCpuFunctionMsgSubscription that = - (S7PayloadUserDataItemCpuFunctionMsgSubscription) o; - return (getSubscription() == that.getSubscription()) - && (getMagicKey() == that.getMagicKey()) - && (getAlarmtype() == that.getAlarmtype()) - && (getReserve() == that.getReserve()) - && super.equals(that); - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), getSubscription(), getMagicKey(), getAlarmtype(), getReserve()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java deleted file mode 100644 index 642c00f863e..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java +++ /dev/null @@ -1,258 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse - extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x02; - } - - // Properties. - protected final short result; - protected final short reserved01; - protected final AlarmType alarmType; - protected final short reserved02; - protected final short reserved03; - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short result, - short reserved01, - AlarmType alarmType, - short reserved02, - short reserved03) { - super(returnCode, transportSize, dataLength); - this.result = result; - this.reserved01 = reserved01; - this.alarmType = alarmType; - this.reserved02 = reserved02; - this.reserved03 = reserved03; - } - - public short getResult() { - return result; - } - - public short getReserved01() { - return reserved01; - } - - public AlarmType getAlarmType() { - return alarmType; - } - - public short getReserved02() { - return reserved02; - } - - public short getReserved03() { - return reserved03; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); - - // Simple Field (result) - writeSimpleField("result", result, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (reserved01) - writeSimpleField("reserved01", reserved01, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (alarmType) - writeSimpleEnumField( - "alarmType", - "AlarmType", - alarmType, - new DataWriterEnumDefault<>( - AlarmType::getValue, AlarmType::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (reserved02) - writeSimpleField("reserved02", reserved02, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (reserved03) - writeSimpleField("reserved03", reserved03, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (result) - lengthInBits += 8; - - // Simple field (reserved01) - lengthInBits += 8; - - // Simple field (alarmType) - lengthInBits += 8; - - // Simple field (reserved02) - lengthInBits += 8; - - // Simple field (reserved03) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short result = readSimpleField("result", readUnsignedShort(readBuffer, 8)); - - short reserved01 = readSimpleField("reserved01", readUnsignedShort(readBuffer, 8)); - - AlarmType alarmType = - readEnumField( - "alarmType", - "AlarmType", - new DataReaderEnumDefault<>(AlarmType::enumForValue, readUnsignedShort(readBuffer, 8))); - - short reserved02 = readSimpleField("reserved02", readUnsignedShort(readBuffer, 8)); - - short reserved03 = readSimpleField("reserved03", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponseBuilderImpl( - result, reserved01, alarmType, reserved02, reserved03); - } - - public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short result; - private final short reserved01; - private final AlarmType alarmType; - private final short reserved02; - private final short reserved03; - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponseBuilderImpl( - short result, short reserved01, AlarmType alarmType, short reserved02, short reserved03) { - this.result = result; - this.reserved01 = reserved01; - this.alarmType = alarmType; - this.reserved02 = reserved02; - this.reserved03 = reserved03; - } - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse - s7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse = - new S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse( - returnCode, - transportSize, - dataLength, - result, - reserved01, - alarmType, - reserved02, - reserved03); - return s7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse)) { - return false; - } - S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse that = - (S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse) o; - return (getResult() == that.getResult()) - && (getReserved01() == that.getReserved01()) - && (getAlarmType() == that.getAlarmType()) - && (getReserved02() == that.getReserved02()) - && (getReserved03() == that.getReserved03()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), - getResult(), - getReserved01(), - getAlarmType(), - getReserved02(), - getReserved03()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java deleted file mode 100644 index c75ceaf52e1..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java +++ /dev/null @@ -1,250 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x02; - } - - // Properties. - protected final short Subscription; - protected final String magicKey; - protected final AlarmStateType Alarmtype; - protected final Short Reserve; - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short Subscription, - String magicKey, - AlarmStateType Alarmtype, - Short Reserve) { - super(returnCode, transportSize, dataLength); - this.Subscription = Subscription; - this.magicKey = magicKey; - this.Alarmtype = Alarmtype; - this.Reserve = Reserve; - } - - public short getSubscription() { - return Subscription; - } - - public String getMagicKey() { - return magicKey; - } - - public AlarmStateType getAlarmtype() { - return Alarmtype; - } - - public Short getReserve() { - return Reserve; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); - - // Simple Field (Subscription) - writeSimpleField("Subscription", Subscription, writeUnsignedShort(writeBuffer, 8)); - - // Reserved Field (reserved) - writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (magicKey) - writeSimpleField("magicKey", magicKey, writeString(writeBuffer, 64)); - - // Optional Field (Alarmtype) (Can be skipped, if the value is null) - writeOptionalEnumField( - "Alarmtype", - "AlarmStateType", - Alarmtype, - new DataWriterEnumDefault<>( - AlarmStateType::getValue, AlarmStateType::name, writeUnsignedShort(writeBuffer, 8)), - (getSubscription()) >= (128)); - - // Optional Field (Reserve) (Can be skipped, if the value is null) - writeOptionalField("Reserve", Reserve, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (Subscription) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Simple field (magicKey) - lengthInBits += 64; - - // Optional Field (Alarmtype) - if (Alarmtype != null) { - lengthInBits += 8; - } - - // Optional Field (Reserve) - if (Reserve != null) { - lengthInBits += 8; - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short Subscription = readSimpleField("Subscription", readUnsignedShort(readBuffer, 8)); - - Short reservedField0 = - readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); - - String magicKey = readSimpleField("magicKey", readString(readBuffer, 64)); - - AlarmStateType Alarmtype = - readOptionalField( - "Alarmtype", - new DataReaderEnumDefault<>( - AlarmStateType::enumForValue, readUnsignedShort(readBuffer, 8)), - (Subscription) >= (128)); - - Short Reserve = - readOptionalField("Reserve", readUnsignedShort(readBuffer, 8), (Subscription) >= (128)); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequestBuilderImpl( - Subscription, magicKey, Alarmtype, Reserve); - } - - public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short Subscription; - private final String magicKey; - private final AlarmStateType Alarmtype; - private final Short Reserve; - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequestBuilderImpl( - short Subscription, String magicKey, AlarmStateType Alarmtype, Short Reserve) { - this.Subscription = Subscription; - this.magicKey = magicKey; - this.Alarmtype = Alarmtype; - this.Reserve = Reserve; - } - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest - s7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest = - new S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest( - returnCode, - transportSize, - dataLength, - Subscription, - magicKey, - Alarmtype, - Reserve); - return s7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest)) { - return false; - } - S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest that = - (S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest) o; - return (getSubscription() == that.getSubscription()) - && (getMagicKey() == that.getMagicKey()) - && (getAlarmtype() == that.getAlarmtype()) - && (getReserve() == that.getReserve()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), getSubscription(), getMagicKey(), getAlarmtype(), getReserve()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java deleted file mode 100644 index e63f6c495c0..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x02; - } - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponseBuilderImpl(); - } - - public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponseBuilderImpl() {} - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse - s7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse = - new S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse( - returnCode, transportSize, dataLength); - return s7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse)) { - return false; - } - S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse that = - (S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java deleted file mode 100644 index d8f5fac1d79..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse - extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x02; - } - - // Properties. - protected final short result; - protected final short reserved01; - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short result, - short reserved01) { - super(returnCode, transportSize, dataLength); - this.result = result; - this.reserved01 = reserved01; - } - - public short getResult() { - return result; - } - - public short getReserved01() { - return reserved01; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); - - // Simple Field (result) - writeSimpleField("result", result, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (reserved01) - writeSimpleField("reserved01", reserved01, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (result) - lengthInBits += 8; - - // Simple field (reserved01) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short result = readSimpleField("result", readUnsignedShort(readBuffer, 8)); - - short reserved01 = readSimpleField("reserved01", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponseBuilderImpl( - result, reserved01); - } - - public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short result; - private final short reserved01; - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponseBuilderImpl( - short result, short reserved01) { - this.result = result; - this.reserved01 = reserved01; - } - - public S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse - s7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse = - new S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse( - returnCode, transportSize, dataLength, result, reserved01); - return s7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse)) { - return false; - } - S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse that = - (S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse) o; - return (getResult() == that.getResult()) - && (getReserved01() == that.getReserved01()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getResult(), getReserved01()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java deleted file mode 100644 index 947c57fa9dc..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - public S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequestBuilderImpl(); - } - - public static class S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequestBuilderImpl() {} - - public S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest - s7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest = - new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( - returnCode, transportSize, dataLength); - return s7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest)) { - return false; - } - S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest that = - (S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java deleted file mode 100644 index 31c17cd57de..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionReadSzlRequest extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - // Properties. - protected final SzlId szlId; - protected final int szlIndex; - - public S7PayloadUserDataItemCpuFunctionReadSzlRequest( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - SzlId szlId, - int szlIndex) { - super(returnCode, transportSize, dataLength); - this.szlId = szlId; - this.szlIndex = szlIndex; - } - - public SzlId getSzlId() { - return szlId; - } - - public int getSzlIndex() { - return szlIndex; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); - - // Simple Field (szlId) - writeSimpleField("szlId", szlId, new DataWriterComplexDefault<>(writeBuffer)); - - // Simple Field (szlIndex) - writeSimpleField("szlIndex", szlIndex, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionReadSzlRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (szlId) - lengthInBits += szlId.getLengthInBits(); - - // Simple field (szlIndex) - lengthInBits += 16; - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - SzlId szlId = - readSimpleField( - "szlId", - new DataReaderComplexDefault<>(() -> SzlId.staticParse(readBuffer), readBuffer)); - - int szlIndex = readSimpleField("szlIndex", readUnsignedInt(readBuffer, 16)); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionReadSzlRequestBuilderImpl(szlId, szlIndex); - } - - public static class S7PayloadUserDataItemCpuFunctionReadSzlRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final SzlId szlId; - private final int szlIndex; - - public S7PayloadUserDataItemCpuFunctionReadSzlRequestBuilderImpl(SzlId szlId, int szlIndex) { - this.szlId = szlId; - this.szlIndex = szlIndex; - } - - public S7PayloadUserDataItemCpuFunctionReadSzlRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionReadSzlRequest - s7PayloadUserDataItemCpuFunctionReadSzlRequest = - new S7PayloadUserDataItemCpuFunctionReadSzlRequest( - returnCode, transportSize, dataLength, szlId, szlIndex); - return s7PayloadUserDataItemCpuFunctionReadSzlRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionReadSzlRequest)) { - return false; - } - S7PayloadUserDataItemCpuFunctionReadSzlRequest that = - (S7PayloadUserDataItemCpuFunctionReadSzlRequest) o; - return (getSzlId() == that.getSzlId()) - && (getSzlIndex() == that.getSzlIndex()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getSzlId(), getSzlIndex()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java deleted file mode 100644 index 59cd4a3653c..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java +++ /dev/null @@ -1,166 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCpuFunctionReadSzlResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x04; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - // Properties. - protected final byte[] items; - - public S7PayloadUserDataItemCpuFunctionReadSzlResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - byte[] items) { - super(returnCode, transportSize, dataLength); - this.items = items; - } - - public byte[] getItems() { - return items; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); - - // Array Field (items) - writeByteArrayField("items", items, writeByteArray(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCpuFunctionReadSzlResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Array field - if (items != null) { - lengthInBits += 8 * items.length; - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, - Integer dataLength, - Byte cpuFunctionGroup, - Byte cpuFunctionType, - Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - byte[] items = readBuffer.readByteArray("items", Math.toIntExact(dataLength)); - - readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); - // Create the instance - return new S7PayloadUserDataItemCpuFunctionReadSzlResponseBuilderImpl(items); - } - - public static class S7PayloadUserDataItemCpuFunctionReadSzlResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final byte[] items; - - public S7PayloadUserDataItemCpuFunctionReadSzlResponseBuilderImpl(byte[] items) { - this.items = items; - } - - public S7PayloadUserDataItemCpuFunctionReadSzlResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCpuFunctionReadSzlResponse - s7PayloadUserDataItemCpuFunctionReadSzlResponse = - new S7PayloadUserDataItemCpuFunctionReadSzlResponse( - returnCode, transportSize, dataLength, items); - return s7PayloadUserDataItemCpuFunctionReadSzlResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCpuFunctionReadSzlResponse)) { - return false; - } - S7PayloadUserDataItemCpuFunctionReadSzlResponse that = - (S7PayloadUserDataItemCpuFunctionReadSzlResponse) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java deleted file mode 100644 index c1ea18e262d..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesChangeDrivenPush extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x05; - } - - // Properties. - protected final int itemsCount; - protected final List items; - - public S7PayloadUserDataItemCyclicServicesChangeDrivenPush( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - int itemsCount, - List items) { - super(returnCode, transportSize, dataLength); - this.itemsCount = itemsCount; - this.items = items; - } - - public int getItemsCount() { - return itemsCount; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); - - // Simple Field (itemsCount) - writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesChangeDrivenPush _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (itemsCount) - lengthInBits += 16; - - // Array field - if (items != null) { - int i = 0; - for (AssociatedQueryValueType element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> AssociatedQueryValueType.staticParse(readBuffer), readBuffer), - itemsCount); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesChangeDrivenPushBuilderImpl(itemsCount, items); - } - - public static class S7PayloadUserDataItemCyclicServicesChangeDrivenPushBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final int itemsCount; - private final List items; - - public S7PayloadUserDataItemCyclicServicesChangeDrivenPushBuilderImpl( - int itemsCount, List items) { - this.itemsCount = itemsCount; - this.items = items; - } - - public S7PayloadUserDataItemCyclicServicesChangeDrivenPush build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesChangeDrivenPush - s7PayloadUserDataItemCyclicServicesChangeDrivenPush = - new S7PayloadUserDataItemCyclicServicesChangeDrivenPush( - returnCode, transportSize, dataLength, itemsCount, items); - return s7PayloadUserDataItemCyclicServicesChangeDrivenPush; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesChangeDrivenPush)) { - return false; - } - S7PayloadUserDataItemCyclicServicesChangeDrivenPush that = - (S7PayloadUserDataItemCyclicServicesChangeDrivenPush) o; - return (getItemsCount() == that.getItemsCount()) - && (getItems() == that.getItems()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItemsCount(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java deleted file mode 100644 index 38bc3d39110..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse - extends S7PayloadUserDataItem implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x05; - } - - // Properties. - protected final int itemsCount; - protected final List items; - - public S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - int itemsCount, - List items) { - super(returnCode, transportSize, dataLength); - this.itemsCount = itemsCount; - this.items = items; - } - - public int getItemsCount() { - return itemsCount; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); - - // Simple Field (itemsCount) - writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (itemsCount) - lengthInBits += 16; - - // Array field - if (items != null) { - int i = 0; - for (AssociatedQueryValueType element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> AssociatedQueryValueType.staticParse(readBuffer), readBuffer), - itemsCount); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponseBuilderImpl( - itemsCount, items); - } - - public static class S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final int itemsCount; - private final List items; - - public S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponseBuilderImpl( - int itemsCount, List items) { - this.itemsCount = itemsCount; - this.items = items; - } - - public S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse - s7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse = - new S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse( - returnCode, transportSize, dataLength, itemsCount, items); - return s7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse)) { - return false; - } - S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse that = - (S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse) o; - return (getItemsCount() == that.getItemsCount()) - && (getItems() == that.getItems()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItemsCount(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java deleted file mode 100644 index f9613dcb1ad..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesErrorResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x05; - } - - public S7PayloadUserDataItemCyclicServicesErrorResponse( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesErrorResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesErrorResponseBuilderImpl(); - } - - public static class S7PayloadUserDataItemCyclicServicesErrorResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemCyclicServicesErrorResponseBuilderImpl() {} - - public S7PayloadUserDataItemCyclicServicesErrorResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesErrorResponse - s7PayloadUserDataItemCyclicServicesErrorResponse = - new S7PayloadUserDataItemCyclicServicesErrorResponse( - returnCode, transportSize, dataLength); - return s7PayloadUserDataItemCyclicServicesErrorResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesErrorResponse)) { - return false; - } - S7PayloadUserDataItemCyclicServicesErrorResponse that = - (S7PayloadUserDataItemCyclicServicesErrorResponse) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java deleted file mode 100644 index c2341a414b8..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesPush extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x00; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - // Properties. - protected final int itemsCount; - protected final List items; - - public S7PayloadUserDataItemCyclicServicesPush( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - int itemsCount, - List items) { - super(returnCode, transportSize, dataLength); - this.itemsCount = itemsCount; - this.items = items; - } - - public int getItemsCount() { - return itemsCount; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesPush"); - - // Simple Field (itemsCount) - writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesPush"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesPush _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (itemsCount) - lengthInBits += 16; - - // Array field - if (items != null) { - int i = 0; - for (AssociatedValueType element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesPush"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> AssociatedValueType.staticParse(readBuffer), readBuffer), - itemsCount); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesPush"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesPushBuilderImpl(itemsCount, items); - } - - public static class S7PayloadUserDataItemCyclicServicesPushBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final int itemsCount; - private final List items; - - public S7PayloadUserDataItemCyclicServicesPushBuilderImpl( - int itemsCount, List items) { - this.itemsCount = itemsCount; - this.items = items; - } - - public S7PayloadUserDataItemCyclicServicesPush build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesPush s7PayloadUserDataItemCyclicServicesPush = - new S7PayloadUserDataItemCyclicServicesPush( - returnCode, transportSize, dataLength, itemsCount, items); - return s7PayloadUserDataItemCyclicServicesPush; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesPush)) { - return false; - } - S7PayloadUserDataItemCyclicServicesPush that = (S7PayloadUserDataItemCyclicServicesPush) o; - return (getItemsCount() == that.getItemsCount()) - && (getItems() == that.getItems()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItemsCount(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java deleted file mode 100644 index 7376db3a7cf..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java +++ /dev/null @@ -1,239 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesSubscribeRequest extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - // Properties. - protected final int itemsCount; - protected final TimeBase timeBase; - protected final short timeFactor; - protected final List item; - - public S7PayloadUserDataItemCyclicServicesSubscribeRequest( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - int itemsCount, - TimeBase timeBase, - short timeFactor, - List item) { - super(returnCode, transportSize, dataLength); - this.itemsCount = itemsCount; - this.timeBase = timeBase; - this.timeFactor = timeFactor; - this.item = item; - } - - public int getItemsCount() { - return itemsCount; - } - - public TimeBase getTimeBase() { - return timeBase; - } - - public short getTimeFactor() { - return timeFactor; - } - - public List getItem() { - return item; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); - - // Simple Field (itemsCount) - writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (timeBase) - writeSimpleEnumField( - "timeBase", - "TimeBase", - timeBase, - new DataWriterEnumDefault<>( - TimeBase::getValue, TimeBase::name, writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (timeFactor) - writeSimpleField("timeFactor", timeFactor, writeUnsignedShort(writeBuffer, 8)); - - // Array Field (item) - writeComplexTypeArrayField("item", item, writeBuffer); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesSubscribeRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (itemsCount) - lengthInBits += 16; - - // Simple field (timeBase) - lengthInBits += 8; - - // Simple field (timeFactor) - lengthInBits += 8; - - // Array field - if (item != null) { - int i = 0; - for (CycServiceItemType element : item) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= item.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); - - TimeBase timeBase = - readEnumField( - "timeBase", - "TimeBase", - new DataReaderEnumDefault<>(TimeBase::enumForValue, readUnsignedShort(readBuffer, 8))); - - short timeFactor = readSimpleField("timeFactor", readUnsignedShort(readBuffer, 8)); - - List item = - readCountArrayField( - "item", - new DataReaderComplexDefault<>( - () -> CycServiceItemType.staticParse(readBuffer), readBuffer), - itemsCount); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesSubscribeRequestBuilderImpl( - itemsCount, timeBase, timeFactor, item); - } - - public static class S7PayloadUserDataItemCyclicServicesSubscribeRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final int itemsCount; - private final TimeBase timeBase; - private final short timeFactor; - private final List item; - - public S7PayloadUserDataItemCyclicServicesSubscribeRequestBuilderImpl( - int itemsCount, TimeBase timeBase, short timeFactor, List item) { - this.itemsCount = itemsCount; - this.timeBase = timeBase; - this.timeFactor = timeFactor; - this.item = item; - } - - public S7PayloadUserDataItemCyclicServicesSubscribeRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesSubscribeRequest - s7PayloadUserDataItemCyclicServicesSubscribeRequest = - new S7PayloadUserDataItemCyclicServicesSubscribeRequest( - returnCode, transportSize, dataLength, itemsCount, timeBase, timeFactor, item); - return s7PayloadUserDataItemCyclicServicesSubscribeRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesSubscribeRequest)) { - return false; - } - S7PayloadUserDataItemCyclicServicesSubscribeRequest that = - (S7PayloadUserDataItemCyclicServicesSubscribeRequest) o; - return (getItemsCount() == that.getItemsCount()) - && (getTimeBase() == that.getTimeBase()) - && (getTimeFactor() == that.getTimeFactor()) - && (getItem() == that.getItem()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - super.hashCode(), getItemsCount(), getTimeBase(), getTimeFactor(), getItem()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java deleted file mode 100644 index fbef37afb23..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java +++ /dev/null @@ -1,192 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesSubscribeResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x01; - } - - // Properties. - protected final int itemsCount; - protected final List items; - - public S7PayloadUserDataItemCyclicServicesSubscribeResponse( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - int itemsCount, - List items) { - super(returnCode, transportSize, dataLength); - this.itemsCount = itemsCount; - this.items = items; - } - - public int getItemsCount() { - return itemsCount; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); - - // Simple Field (itemsCount) - writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesSubscribeResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (itemsCount) - lengthInBits += 16; - - // Array field - if (items != null) { - int i = 0; - for (AssociatedValueType element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> AssociatedValueType.staticParse(readBuffer), readBuffer), - itemsCount); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesSubscribeResponseBuilderImpl(itemsCount, items); - } - - public static class S7PayloadUserDataItemCyclicServicesSubscribeResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final int itemsCount; - private final List items; - - public S7PayloadUserDataItemCyclicServicesSubscribeResponseBuilderImpl( - int itemsCount, List items) { - this.itemsCount = itemsCount; - this.items = items; - } - - public S7PayloadUserDataItemCyclicServicesSubscribeResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesSubscribeResponse - s7PayloadUserDataItemCyclicServicesSubscribeResponse = - new S7PayloadUserDataItemCyclicServicesSubscribeResponse( - returnCode, transportSize, dataLength, itemsCount, items); - return s7PayloadUserDataItemCyclicServicesSubscribeResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesSubscribeResponse)) { - return false; - } - S7PayloadUserDataItemCyclicServicesSubscribeResponse that = - (S7PayloadUserDataItemCyclicServicesSubscribeResponse) o; - return (getItemsCount() == that.getItemsCount()) - && (getItems() == that.getItems()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItemsCount(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java deleted file mode 100644 index eadbcbbb3f7..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java +++ /dev/null @@ -1,181 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesUnsubscribeRequest extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x04; - } - - public Short getCpuSubfunction() { - return (short) 0x04; - } - - // Properties. - protected final short function; - protected final short jobId; - - public S7PayloadUserDataItemCyclicServicesUnsubscribeRequest( - DataTransportErrorCode returnCode, - DataTransportSize transportSize, - int dataLength, - short function, - short jobId) { - super(returnCode, transportSize, dataLength); - this.function = function; - this.jobId = jobId; - } - - public short getFunction() { - return function; - } - - public short getJobId() { - return jobId; - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); - - // Simple Field (function) - writeSimpleField("function", function, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (jobId) - writeSimpleField("jobId", jobId, writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesUnsubscribeRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (function) - lengthInBits += 8; - - // Simple field (jobId) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short function = readSimpleField("function", readUnsignedShort(readBuffer, 8)); - - short jobId = readSimpleField("jobId", readUnsignedShort(readBuffer, 8)); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesUnsubscribeRequestBuilderImpl(function, jobId); - } - - public static class S7PayloadUserDataItemCyclicServicesUnsubscribeRequestBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - private final short function; - private final short jobId; - - public S7PayloadUserDataItemCyclicServicesUnsubscribeRequestBuilderImpl( - short function, short jobId) { - this.function = function; - this.jobId = jobId; - } - - public S7PayloadUserDataItemCyclicServicesUnsubscribeRequest build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesUnsubscribeRequest - s7PayloadUserDataItemCyclicServicesUnsubscribeRequest = - new S7PayloadUserDataItemCyclicServicesUnsubscribeRequest( - returnCode, transportSize, dataLength, function, jobId); - return s7PayloadUserDataItemCyclicServicesUnsubscribeRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesUnsubscribeRequest)) { - return false; - } - S7PayloadUserDataItemCyclicServicesUnsubscribeRequest that = - (S7PayloadUserDataItemCyclicServicesUnsubscribeRequest) o; - return (getFunction() == that.getFunction()) - && (getJobId() == that.getJobId()) - && super.equals(that) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getFunction(), getJobId()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java deleted file mode 100644 index 9e3e74c323c..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadUserDataItemCyclicServicesUnsubscribeResponse extends S7PayloadUserDataItem - implements Message { - - // Accessors for discriminator values. - public Byte getCpuFunctionGroup() { - return (byte) 0x02; - } - - public Byte getCpuFunctionType() { - return (byte) 0x08; - } - - public Short getCpuSubfunction() { - return (short) 0x04; - } - - public S7PayloadUserDataItemCyclicServicesUnsubscribeResponse( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - super(returnCode, transportSize, dataLength); - } - - @Override - protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); - - writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadUserDataItemCyclicServicesUnsubscribeResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - return lengthInBits; - } - - public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( - ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) - throws ParseException { - readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); - // Create the instance - return new S7PayloadUserDataItemCyclicServicesUnsubscribeResponseBuilderImpl(); - } - - public static class S7PayloadUserDataItemCyclicServicesUnsubscribeResponseBuilderImpl - implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { - - public S7PayloadUserDataItemCyclicServicesUnsubscribeResponseBuilderImpl() {} - - public S7PayloadUserDataItemCyclicServicesUnsubscribeResponse build( - DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { - S7PayloadUserDataItemCyclicServicesUnsubscribeResponse - s7PayloadUserDataItemCyclicServicesUnsubscribeResponse = - new S7PayloadUserDataItemCyclicServicesUnsubscribeResponse( - returnCode, transportSize, dataLength); - return s7PayloadUserDataItemCyclicServicesUnsubscribeResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadUserDataItemCyclicServicesUnsubscribeResponse)) { - return false; - } - S7PayloadUserDataItemCyclicServicesUnsubscribeResponse that = - (S7PayloadUserDataItemCyclicServicesUnsubscribeResponse) o; - return super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java deleted file mode 100644 index 5c31abe5b18..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadWriteVarRequest extends S7Payload implements Message { - - // Accessors for discriminator values. - public Short getParameterParameterType() { - return (short) 0x05; - } - - public Short getMessageType() { - return (short) 0x01; - } - - // Properties. - protected final List items; - - public S7PayloadWriteVarRequest(List items) { - super(); - this.items = items; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadWriteVarRequest"); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadWriteVarRequest"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadWriteVarRequest _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Array field - if (items != null) { - int i = 0; - for (S7VarPayloadDataItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadBuilder staticParseS7PayloadBuilder( - ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { - readBuffer.pullContext("S7PayloadWriteVarRequest"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> S7VarPayloadDataItem.staticParse(readBuffer), readBuffer), - COUNT(CAST(parameter, S7ParameterWriteVarRequest.class).getItems())); - - readBuffer.closeContext("S7PayloadWriteVarRequest"); - // Create the instance - return new S7PayloadWriteVarRequestBuilderImpl(items); - } - - public static class S7PayloadWriteVarRequestBuilderImpl implements S7Payload.S7PayloadBuilder { - private final List items; - - public S7PayloadWriteVarRequestBuilderImpl(List items) { - this.items = items; - } - - public S7PayloadWriteVarRequest build() { - S7PayloadWriteVarRequest s7PayloadWriteVarRequest = new S7PayloadWriteVarRequest(items); - return s7PayloadWriteVarRequest; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadWriteVarRequest)) { - return false; - } - S7PayloadWriteVarRequest that = (S7PayloadWriteVarRequest) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java deleted file mode 100644 index fca9a9f20d6..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7PayloadWriteVarResponse extends S7Payload implements Message { - - // Accessors for discriminator values. - public Short getParameterParameterType() { - return (short) 0x05; - } - - public Short getMessageType() { - return (short) 0x03; - } - - // Properties. - protected final List items; - - public S7PayloadWriteVarResponse(List items) { - super(); - this.items = items; - } - - public List getItems() { - return items; - } - - @Override - protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7PayloadWriteVarResponse"); - - // Array Field (items) - writeComplexTypeArrayField("items", items, writeBuffer); - - writeBuffer.popContext("S7PayloadWriteVarResponse"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7PayloadWriteVarResponse _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Array field - if (items != null) { - int i = 0; - for (S7VarPayloadStatusItem element : items) { - ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); - lengthInBits += element.getLengthInBits(); - } - } - - return lengthInBits; - } - - public static S7PayloadBuilder staticParseS7PayloadBuilder( - ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { - readBuffer.pullContext("S7PayloadWriteVarResponse"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - List items = - readCountArrayField( - "items", - new DataReaderComplexDefault<>( - () -> S7VarPayloadStatusItem.staticParse(readBuffer), readBuffer), - CAST(parameter, S7ParameterWriteVarResponse.class).getNumItems()); - - readBuffer.closeContext("S7PayloadWriteVarResponse"); - // Create the instance - return new S7PayloadWriteVarResponseBuilderImpl(items); - } - - public static class S7PayloadWriteVarResponseBuilderImpl implements S7Payload.S7PayloadBuilder { - private final List items; - - public S7PayloadWriteVarResponseBuilderImpl(List items) { - this.items = items; - } - - public S7PayloadWriteVarResponse build() { - S7PayloadWriteVarResponse s7PayloadWriteVarResponse = new S7PayloadWriteVarResponse(items); - return s7PayloadWriteVarResponse; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7PayloadWriteVarResponse)) { - return false; - } - S7PayloadWriteVarResponse that = (S7PayloadWriteVarResponse) o; - return (getItems() == that.getItems()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getItems()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java deleted file mode 100644 index 813eb4234a5..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java +++ /dev/null @@ -1,220 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7VarPayloadDataItem implements Message { - - // Properties. - protected final DataTransportErrorCode returnCode; - protected final DataTransportSize transportSize; - protected final byte[] data; - - public S7VarPayloadDataItem( - DataTransportErrorCode returnCode, DataTransportSize transportSize, byte[] data) { - super(); - this.returnCode = returnCode; - this.transportSize = transportSize; - this.data = data; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public DataTransportSize getTransportSize() { - return transportSize; - } - - public byte[] getData() { - return data; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7VarPayloadDataItem"); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - // Simple Field (transportSize) - writeSimpleEnumField( - "transportSize", - "DataTransportSize", - transportSize, - new DataWriterEnumDefault<>( - DataTransportSize::getValue, - DataTransportSize::name, - writeUnsignedShort(writeBuffer, 8))); - - // Implicit Field (dataLength) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - int dataLength = - (int) - ((COUNT(getData())) - * ((((((getTransportSize()) == (DataTransportSize.BIT))) - ? 1 - : (((getTransportSize().getSizeInBits()) ? 8 : 1)))))); - writeImplicitField("dataLength", dataLength, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (data) - writeByteArrayField("data", data, writeByteArray(writeBuffer, 8)); - - // Padding Field (padding) - writePaddingField( - "padding", - (int) ((((!(_lastItem))) ? ((COUNT(data)) % (2)) : 0)), - (short) 0x00, - writeUnsignedShort(writeBuffer, 8)); - - writeBuffer.popContext("S7VarPayloadDataItem"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7VarPayloadDataItem _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (returnCode) - lengthInBits += 8; - - // Simple field (transportSize) - lengthInBits += 8; - - // Implicit Field (dataLength) - lengthInBits += 16; - - // Array field - if (data != null) { - lengthInBits += 8 * data.length; - } - - // Padding Field (padding) - int _timesPadding = (int) ((((!(_lastItem))) ? ((COUNT(data)) % (2)) : 0)); - while (_timesPadding-- > 0) { - lengthInBits += 8; - } - - return lengthInBits; - } - - public static S7VarPayloadDataItem staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static S7VarPayloadDataItem staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7VarPayloadDataItem"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - DataTransportSize transportSize = - readEnumField( - "transportSize", - "DataTransportSize", - new DataReaderEnumDefault<>( - DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); - - int dataLength = readImplicitField("dataLength", readUnsignedInt(readBuffer, 16)); - - byte[] data = - readBuffer.readByteArray( - "data", - Math.toIntExact( - ((transportSize.getSizeInBits()) ? CEIL((dataLength) / (8.0)) : dataLength))); - - readPaddingField( - readUnsignedShort(readBuffer, 8), (int) ((((!(_lastItem))) ? ((COUNT(data)) % (2)) : 0))); - - readBuffer.closeContext("S7VarPayloadDataItem"); - // Create the instance - S7VarPayloadDataItem _s7VarPayloadDataItem; - _s7VarPayloadDataItem = new S7VarPayloadDataItem(returnCode, transportSize, data); - return _s7VarPayloadDataItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7VarPayloadDataItem)) { - return false; - } - S7VarPayloadDataItem that = (S7VarPayloadDataItem) o; - return (getReturnCode() == that.getReturnCode()) - && (getTransportSize() == that.getTransportSize()) - && (getData() == that.getData()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getReturnCode(), getTransportSize(), getData()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java deleted file mode 100644 index 718ce59fab0..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java +++ /dev/null @@ -1,139 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7VarPayloadStatusItem implements Message { - - // Properties. - protected final DataTransportErrorCode returnCode; - - public S7VarPayloadStatusItem(DataTransportErrorCode returnCode) { - super(); - this.returnCode = returnCode; - } - - public DataTransportErrorCode getReturnCode() { - return returnCode; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7VarPayloadStatusItem"); - - // Simple Field (returnCode) - writeSimpleEnumField( - "returnCode", - "DataTransportErrorCode", - returnCode, - new DataWriterEnumDefault<>( - DataTransportErrorCode::getValue, - DataTransportErrorCode::name, - writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("S7VarPayloadStatusItem"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7VarPayloadStatusItem _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (returnCode) - lengthInBits += 8; - - return lengthInBits; - } - - public static S7VarPayloadStatusItem staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static S7VarPayloadStatusItem staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7VarPayloadStatusItem"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - DataTransportErrorCode returnCode = - readEnumField( - "returnCode", - "DataTransportErrorCode", - new DataReaderEnumDefault<>( - DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("S7VarPayloadStatusItem"); - // Create the instance - S7VarPayloadStatusItem _s7VarPayloadStatusItem; - _s7VarPayloadStatusItem = new S7VarPayloadStatusItem(returnCode); - return _s7VarPayloadStatusItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7VarPayloadStatusItem)) { - return false; - } - S7VarPayloadStatusItem that = (S7VarPayloadStatusItem) o; - return (getReturnCode() == that.getReturnCode()) && true; - } - - @Override - public int hashCode() { - return Objects.hash(getReturnCode()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java deleted file mode 100644 index a6bf2223a27..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public abstract class S7VarRequestParameterItem implements Message { - - // Abstract accessors for discriminator values. - public abstract Short getItemType(); - - public S7VarRequestParameterItem() { - super(); - } - - protected abstract void serializeS7VarRequestParameterItemChild(WriteBuffer writeBuffer) - throws SerializationException; - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7VarRequestParameterItem"); - - // Discriminator Field (itemType) (Used as input to a switch field) - writeDiscriminatorField("itemType", getItemType(), writeUnsignedShort(writeBuffer, 8)); - - // Switch field (Serialize the sub-type) - serializeS7VarRequestParameterItemChild(writeBuffer); - - writeBuffer.popContext("S7VarRequestParameterItem"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - S7VarRequestParameterItem _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Discriminator Field (itemType) - lengthInBits += 8; - - // Length of sub-type elements will be added by sub-type... - - return lengthInBits; - } - - public static S7VarRequestParameterItem staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static S7VarRequestParameterItem staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7VarRequestParameterItem"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short itemType = readDiscriminatorField("itemType", readUnsignedShort(readBuffer, 8)); - - // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) - S7VarRequestParameterItemBuilder builder = null; - if (EvaluationHelper.equals(itemType, (short) 0x12)) { - builder = - S7VarRequestParameterItemAddress.staticParseS7VarRequestParameterItemBuilder(readBuffer); - } - if (builder == null) { - throw new ParseException( - "Unsupported case for discriminated type" - + " parameters [" - + "itemType=" - + itemType - + "]"); - } - - readBuffer.closeContext("S7VarRequestParameterItem"); - // Create the instance - S7VarRequestParameterItem _s7VarRequestParameterItem = builder.build(); - return _s7VarRequestParameterItem; - } - - public interface S7VarRequestParameterItemBuilder { - S7VarRequestParameterItem build(); - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7VarRequestParameterItem)) { - return false; - } - S7VarRequestParameterItem that = (S7VarRequestParameterItem) o; - return true; - } - - @Override - public int hashCode() { - return Objects.hash(); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java deleted file mode 100644 index 2acc460e075..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class S7VarRequestParameterItemAddress extends S7VarRequestParameterItem implements Message { - - // Accessors for discriminator values. - public Short getItemType() { - return (short) 0x12; - } - - // Properties. - protected final S7Address address; - - public S7VarRequestParameterItemAddress(S7Address address) { - super(); - this.address = address; - } - - public S7Address getAddress() { - return address; - } - - @Override - protected void serializeS7VarRequestParameterItemChild(WriteBuffer writeBuffer) - throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("S7VarRequestParameterItemAddress"); - - // Implicit Field (itemLength) (Used for parsing, but its value is not stored as it's implicitly - // given by the objects content) - short itemLength = (short) (getAddress().getLengthInBytes()); - writeImplicitField("itemLength", itemLength, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (address) - writeSimpleField("address", address, new DataWriterComplexDefault<>(writeBuffer)); - - writeBuffer.popContext("S7VarRequestParameterItemAddress"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = super.getLengthInBits(); - S7VarRequestParameterItemAddress _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Implicit Field (itemLength) - lengthInBits += 8; - - // Simple field (address) - lengthInBits += address.getLengthInBits(); - - return lengthInBits; - } - - public static S7VarRequestParameterItemBuilder staticParseS7VarRequestParameterItemBuilder( - ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("S7VarRequestParameterItemAddress"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short itemLength = readImplicitField("itemLength", readUnsignedShort(readBuffer, 8)); - - S7Address address = - readSimpleField( - "address", - new DataReaderComplexDefault<>(() -> S7Address.staticParse(readBuffer), readBuffer)); - - readBuffer.closeContext("S7VarRequestParameterItemAddress"); - // Create the instance - return new S7VarRequestParameterItemAddressBuilderImpl(address); - } - - public static class S7VarRequestParameterItemAddressBuilderImpl - implements S7VarRequestParameterItem.S7VarRequestParameterItemBuilder { - private final S7Address address; - - public S7VarRequestParameterItemAddressBuilderImpl(S7Address address) { - this.address = address; - } - - public S7VarRequestParameterItemAddress build() { - S7VarRequestParameterItemAddress s7VarRequestParameterItemAddress = - new S7VarRequestParameterItemAddress(address); - return s7VarRequestParameterItemAddress; - } - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof S7VarRequestParameterItemAddress)) { - return false; - } - S7VarRequestParameterItemAddress that = (S7VarRequestParameterItemAddress) o; - return (getAddress() == that.getAddress()) && super.equals(that) && true; - } - - @Override - public int hashCode() { - return Objects.hash(super.hashCode(), getAddress()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java deleted file mode 100644 index 488cc8dc647..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class State implements Message { - - // Properties. - protected final boolean SIG_8; - protected final boolean SIG_7; - protected final boolean SIG_6; - protected final boolean SIG_5; - protected final boolean SIG_4; - protected final boolean SIG_3; - protected final boolean SIG_2; - protected final boolean SIG_1; - - public State( - boolean SIG_8, - boolean SIG_7, - boolean SIG_6, - boolean SIG_5, - boolean SIG_4, - boolean SIG_3, - boolean SIG_2, - boolean SIG_1) { - super(); - this.SIG_8 = SIG_8; - this.SIG_7 = SIG_7; - this.SIG_6 = SIG_6; - this.SIG_5 = SIG_5; - this.SIG_4 = SIG_4; - this.SIG_3 = SIG_3; - this.SIG_2 = SIG_2; - this.SIG_1 = SIG_1; - } - - public boolean getSIG_8() { - return SIG_8; - } - - public boolean getSIG_7() { - return SIG_7; - } - - public boolean getSIG_6() { - return SIG_6; - } - - public boolean getSIG_5() { - return SIG_5; - } - - public boolean getSIG_4() { - return SIG_4; - } - - public boolean getSIG_3() { - return SIG_3; - } - - public boolean getSIG_2() { - return SIG_2; - } - - public boolean getSIG_1() { - return SIG_1; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("State"); - - // Simple Field (SIG_8) - writeSimpleField("SIG_8", SIG_8, writeBoolean(writeBuffer)); - - // Simple Field (SIG_7) - writeSimpleField("SIG_7", SIG_7, writeBoolean(writeBuffer)); - - // Simple Field (SIG_6) - writeSimpleField("SIG_6", SIG_6, writeBoolean(writeBuffer)); - - // Simple Field (SIG_5) - writeSimpleField("SIG_5", SIG_5, writeBoolean(writeBuffer)); - - // Simple Field (SIG_4) - writeSimpleField("SIG_4", SIG_4, writeBoolean(writeBuffer)); - - // Simple Field (SIG_3) - writeSimpleField("SIG_3", SIG_3, writeBoolean(writeBuffer)); - - // Simple Field (SIG_2) - writeSimpleField("SIG_2", SIG_2, writeBoolean(writeBuffer)); - - // Simple Field (SIG_1) - writeSimpleField("SIG_1", SIG_1, writeBoolean(writeBuffer)); - - writeBuffer.popContext("State"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - State _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (SIG_8) - lengthInBits += 1; - - // Simple field (SIG_7) - lengthInBits += 1; - - // Simple field (SIG_6) - lengthInBits += 1; - - // Simple field (SIG_5) - lengthInBits += 1; - - // Simple field (SIG_4) - lengthInBits += 1; - - // Simple field (SIG_3) - lengthInBits += 1; - - // Simple field (SIG_2) - lengthInBits += 1; - - // Simple field (SIG_1) - lengthInBits += 1; - - return lengthInBits; - } - - public static State staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static State staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("State"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - boolean SIG_8 = readSimpleField("SIG_8", readBoolean(readBuffer)); - - boolean SIG_7 = readSimpleField("SIG_7", readBoolean(readBuffer)); - - boolean SIG_6 = readSimpleField("SIG_6", readBoolean(readBuffer)); - - boolean SIG_5 = readSimpleField("SIG_5", readBoolean(readBuffer)); - - boolean SIG_4 = readSimpleField("SIG_4", readBoolean(readBuffer)); - - boolean SIG_3 = readSimpleField("SIG_3", readBoolean(readBuffer)); - - boolean SIG_2 = readSimpleField("SIG_2", readBoolean(readBuffer)); - - boolean SIG_1 = readSimpleField("SIG_1", readBoolean(readBuffer)); - - readBuffer.closeContext("State"); - // Create the instance - State _state; - _state = new State(SIG_8, SIG_7, SIG_6, SIG_5, SIG_4, SIG_3, SIG_2, SIG_1); - return _state; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof State)) { - return false; - } - State that = (State) o; - return (getSIG_8() == that.getSIG_8()) - && (getSIG_7() == that.getSIG_7()) - && (getSIG_6() == that.getSIG_6()) - && (getSIG_5() == that.getSIG_5()) - && (getSIG_4() == that.getSIG_4()) - && (getSIG_3() == that.getSIG_3()) - && (getSIG_2() == that.getSIG_2()) - && (getSIG_1() == that.getSIG_1()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash( - getSIG_8(), - getSIG_7(), - getSIG_6(), - getSIG_5(), - getSIG_4(), - getSIG_3(), - getSIG_2(), - getSIG_1()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java deleted file mode 100644 index 620086f2625..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class SubItem implements Message { - - // Properties. - protected final short bytesToRead; - protected final int dbNumber; - protected final int startAddress; - - public SubItem(short bytesToRead, int dbNumber, int startAddress) { - super(); - this.bytesToRead = bytesToRead; - this.dbNumber = dbNumber; - this.startAddress = startAddress; - } - - public short getBytesToRead() { - return bytesToRead; - } - - public int getDbNumber() { - return dbNumber; - } - - public int getStartAddress() { - return startAddress; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("SubItem"); - - // Simple Field (bytesToRead) - writeSimpleField("bytesToRead", bytesToRead, writeUnsignedShort(writeBuffer, 8)); - - // Simple Field (dbNumber) - writeSimpleField("dbNumber", dbNumber, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (startAddress) - writeSimpleField("startAddress", startAddress, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("SubItem"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - SubItem _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (bytesToRead) - lengthInBits += 8; - - // Simple field (dbNumber) - lengthInBits += 16; - - // Simple field (startAddress) - lengthInBits += 16; - - return lengthInBits; - } - - public static SubItem staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static SubItem staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("SubItem"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short bytesToRead = readSimpleField("bytesToRead", readUnsignedShort(readBuffer, 8)); - - int dbNumber = readSimpleField("dbNumber", readUnsignedInt(readBuffer, 16)); - - int startAddress = readSimpleField("startAddress", readUnsignedInt(readBuffer, 16)); - - readBuffer.closeContext("SubItem"); - // Create the instance - SubItem _subItem; - _subItem = new SubItem(bytesToRead, dbNumber, startAddress); - return _subItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof SubItem)) { - return false; - } - SubItem that = (SubItem) o; - return (getBytesToRead() == that.getBytesToRead()) - && (getDbNumber() == that.getDbNumber()) - && (getStartAddress() == that.getStartAddress()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getBytesToRead(), getDbNumber(), getStartAddress()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java deleted file mode 100644 index f0795feaa37..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum SyntaxIdType { - S7ANY((short) 0x01), - PBC_ID((short) 0x13), - ALARM_LOCKFREESET((short) 0x15), - ALARM_INDSET((short) 0x16), - ALARM_ACKSET((short) 0x19), - ALARM_QUERYREQSET((short) 0x1A), - NOTIFY_INDSET((short) 0x1C), - NCK((short) 0x82), - NCK_METRIC((short) 0x83), - NCK_INCH((short) 0x84), - DRIVEESANY((short) 0xA2), - SYM1200((short) 0xB2), - DBREAD((short) 0xB0); - private static final Map map; - - static { - map = new HashMap<>(); - for (SyntaxIdType value : SyntaxIdType.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - SyntaxIdType(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static SyntaxIdType enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java deleted file mode 100644 index e656a4637ab..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java +++ /dev/null @@ -1,190 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class SzlDataTreeItem implements Message { - - // Properties. - protected final int itemIndex; - protected final byte[] mlfb; - protected final int moduleTypeId; - protected final int ausbg; - protected final int ausbe; - - public SzlDataTreeItem(int itemIndex, byte[] mlfb, int moduleTypeId, int ausbg, int ausbe) { - super(); - this.itemIndex = itemIndex; - this.mlfb = mlfb; - this.moduleTypeId = moduleTypeId; - this.ausbg = ausbg; - this.ausbe = ausbe; - } - - public int getItemIndex() { - return itemIndex; - } - - public byte[] getMlfb() { - return mlfb; - } - - public int getModuleTypeId() { - return moduleTypeId; - } - - public int getAusbg() { - return ausbg; - } - - public int getAusbe() { - return ausbe; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("SzlDataTreeItem"); - - // Simple Field (itemIndex) - writeSimpleField("itemIndex", itemIndex, writeUnsignedInt(writeBuffer, 16)); - - // Array Field (mlfb) - writeByteArrayField("mlfb", mlfb, writeByteArray(writeBuffer, 8)); - - // Simple Field (moduleTypeId) - writeSimpleField("moduleTypeId", moduleTypeId, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (ausbg) - writeSimpleField("ausbg", ausbg, writeUnsignedInt(writeBuffer, 16)); - - // Simple Field (ausbe) - writeSimpleField("ausbe", ausbe, writeUnsignedInt(writeBuffer, 16)); - - writeBuffer.popContext("SzlDataTreeItem"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - SzlDataTreeItem _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (itemIndex) - lengthInBits += 16; - - // Array field - if (mlfb != null) { - lengthInBits += 8 * mlfb.length; - } - - // Simple field (moduleTypeId) - lengthInBits += 16; - - // Simple field (ausbg) - lengthInBits += 16; - - // Simple field (ausbe) - lengthInBits += 16; - - return lengthInBits; - } - - public static SzlDataTreeItem staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static SzlDataTreeItem staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("SzlDataTreeItem"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - int itemIndex = readSimpleField("itemIndex", readUnsignedInt(readBuffer, 16)); - - byte[] mlfb = readBuffer.readByteArray("mlfb", Math.toIntExact(20)); - - int moduleTypeId = readSimpleField("moduleTypeId", readUnsignedInt(readBuffer, 16)); - - int ausbg = readSimpleField("ausbg", readUnsignedInt(readBuffer, 16)); - - int ausbe = readSimpleField("ausbe", readUnsignedInt(readBuffer, 16)); - - readBuffer.closeContext("SzlDataTreeItem"); - // Create the instance - SzlDataTreeItem _szlDataTreeItem; - _szlDataTreeItem = new SzlDataTreeItem(itemIndex, mlfb, moduleTypeId, ausbg, ausbe); - return _szlDataTreeItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof SzlDataTreeItem)) { - return false; - } - SzlDataTreeItem that = (SzlDataTreeItem) o; - return (getItemIndex() == that.getItemIndex()) - && (getMlfb() == that.getMlfb()) - && (getModuleTypeId() == that.getModuleTypeId()) - && (getAusbg() == that.getAusbg()) - && (getAusbe() == that.getAusbe()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getItemIndex(), getMlfb(), getModuleTypeId(), getAusbg(), getAusbe()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java deleted file mode 100644 index 69c2b8d94d3..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java +++ /dev/null @@ -1,179 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class SzlId implements Message { - - // Properties. - protected final SzlModuleTypeClass typeClass; - protected final byte sublistExtract; - protected final SzlSublist sublistList; - - public SzlId(SzlModuleTypeClass typeClass, byte sublistExtract, SzlSublist sublistList) { - super(); - this.typeClass = typeClass; - this.sublistExtract = sublistExtract; - this.sublistList = sublistList; - } - - public SzlModuleTypeClass getTypeClass() { - return typeClass; - } - - public byte getSublistExtract() { - return sublistExtract; - } - - public SzlSublist getSublistList() { - return sublistList; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("SzlId"); - - // Simple Field (typeClass) - writeSimpleEnumField( - "typeClass", - "SzlModuleTypeClass", - typeClass, - new DataWriterEnumDefault<>( - SzlModuleTypeClass::getValue, - SzlModuleTypeClass::name, - writeUnsignedByte(writeBuffer, 4))); - - // Simple Field (sublistExtract) - writeSimpleField("sublistExtract", sublistExtract, writeUnsignedByte(writeBuffer, 4)); - - // Simple Field (sublistList) - writeSimpleEnumField( - "sublistList", - "SzlSublist", - sublistList, - new DataWriterEnumDefault<>( - SzlSublist::getValue, SzlSublist::name, writeUnsignedShort(writeBuffer, 8))); - - writeBuffer.popContext("SzlId"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - SzlId _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Simple field (typeClass) - lengthInBits += 4; - - // Simple field (sublistExtract) - lengthInBits += 4; - - // Simple field (sublistList) - lengthInBits += 8; - - return lengthInBits; - } - - public static SzlId staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static SzlId staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("SzlId"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - SzlModuleTypeClass typeClass = - readEnumField( - "typeClass", - "SzlModuleTypeClass", - new DataReaderEnumDefault<>( - SzlModuleTypeClass::enumForValue, readUnsignedByte(readBuffer, 4))); - - byte sublistExtract = readSimpleField("sublistExtract", readUnsignedByte(readBuffer, 4)); - - SzlSublist sublistList = - readEnumField( - "sublistList", - "SzlSublist", - new DataReaderEnumDefault<>( - SzlSublist::enumForValue, readUnsignedShort(readBuffer, 8))); - - readBuffer.closeContext("SzlId"); - // Create the instance - SzlId _szlId; - _szlId = new SzlId(typeClass, sublistExtract, sublistList); - return _szlId; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof SzlId)) { - return false; - } - SzlId that = (SzlId) o; - return (getTypeClass() == that.getTypeClass()) - && (getSublistExtract() == that.getSublistExtract()) - && (getSublistList() == that.getSublistList()) - && true; - } - - @Override - public int hashCode() { - return Objects.hash(getTypeClass(), getSublistExtract(), getSublistList()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java deleted file mode 100644 index 18ffefb3f04..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum SzlModuleTypeClass { - CPU((byte) 0x0), - IM((byte) 0x4), - FM((byte) 0x8), - CP((byte) 0xC); - private static final Map map; - - static { - map = new HashMap<>(); - for (SzlModuleTypeClass value : SzlModuleTypeClass.values()) { - map.put((byte) value.getValue(), value); - } - } - - private final byte value; - - SzlModuleTypeClass(byte value) { - this.value = value; - } - - public byte getValue() { - return value; - } - - public static SzlModuleTypeClass enumForValue(byte value) { - return map.get(value); - } - - public static Boolean isDefined(byte value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java deleted file mode 100644 index 3659cf9fa0a..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum SzlSublist { - NONE((short) 0x00), - MODULE_IDENTIFICATION((short) 0x11), - CPU_FEATURES((short) 0x12), - USER_MEMORY_AREA((short) 0x13), - SYSTEM_AREAS((short) 0x14), - BLOCK_TYPES((short) 0x15), - STATUS_MODULE_LEDS((short) 0x19), - COMPONENT_IDENTIFICATION((short) 0x1C), - INTERRUPT_STATUS((short) 0x22), - ASSIGNMENT_BETWEEN_PROCESS_IMAGE_PARTITIONS_AND_OBS((short) 0x25), - COMMUNICATION_STATUS_DATA((short) 0x32), - H_CPU_GROUP_INFORMATION((short) 0x71), - STATUS_SINGLE_MODULE_LED((short) 0x74), - SWITCHED_DP_SLAVES_H_SYSTEM((short) 0x75), - DP_MASTER_SYSTEM_INFORMATION((short) 0x90), - MODULE_STATUS_INFORMATION((short) 0x91), - RACK_OR_STATION_STATUS_INFORMATION((short) 0x92), - RACK_OR_STATION_STATUS_INFORMATION_2((short) 0x94), - ADDITIONAL_DP_MASTER_SYSTEM_OR_PROFINET_IO_SYSTEM_INFORMATION((short) 0x95), - MODULE_STATUS_INFORMATION_PROFINET_IO_AND_PROFIBUS_DP((short) 0x96), - TOOL_CHANGER_INFORMATION_PROFINET((short) 0x9C), - DIAGNOSTIC_BUFFER((short) 0xA0), - MODULE_DIAGNOSTIC_INFORMATION_DR0((short) 0xB1), - MODULE_DIAGNOSTIC_INFORMATION_DR1_GI((short) 0xB2), - MODULE_DIAGNOSTIC_INFORMATION_DR1_LA((short) 0xB3), - DIAGNOSTIC_DATA_DP_SLAVE((short) 0xB4); - private static final Map map; - - static { - map = new HashMap<>(); - for (SzlSublist value : SzlSublist.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - SzlSublist(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static SzlSublist enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java deleted file mode 100644 index 10eab0edc43..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; -import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; -import static org.apache.plc4x.java.spi.generation.StaticHelper.*; - -import java.time.*; -import java.util.*; -import org.apache.plc4x.java.api.exceptions.*; -import org.apache.plc4x.java.api.value.*; -import org.apache.plc4x.java.spi.codegen.*; -import org.apache.plc4x.java.spi.codegen.fields.*; -import org.apache.plc4x.java.spi.codegen.io.*; -import org.apache.plc4x.java.spi.generation.*; - -// Code generated by code-generation. DO NOT EDIT. - -public class TPKTPacket implements Message { - - // Constant values. - public static final Short PROTOCOLID = 0x03; - - // Properties. - protected final COTPPacket payload; - - public TPKTPacket(COTPPacket payload) { - super(); - this.payload = payload; - } - - public COTPPacket getPayload() { - return payload; - } - - public short getProtocolId() { - return PROTOCOLID; - } - - public void serialize(WriteBuffer writeBuffer) throws SerializationException { - PositionAware positionAware = writeBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - writeBuffer.pushContext("TPKTPacket"); - - // Const Field (protocolId) - writeConstField( - "protocolId", - PROTOCOLID, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Reserved Field (reserved) - writeReservedField( - "reserved", - (short) 0x00, - writeUnsignedShort(writeBuffer, 8), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Implicit Field (len) (Used for parsing, but its value is not stored as it's implicitly given - // by the objects content) - int len = (int) ((getPayload().getLengthInBytes()) + (4)); - writeImplicitField( - "len", - len, - writeUnsignedInt(writeBuffer, 16), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - // Simple Field (payload) - writeSimpleField( - "payload", - payload, - new DataWriterComplexDefault<>(writeBuffer), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - writeBuffer.popContext("TPKTPacket"); - } - - @Override - public int getLengthInBytes() { - return (int) Math.ceil((float) getLengthInBits() / 8.0); - } - - @Override - public int getLengthInBits() { - int lengthInBits = 0; - TPKTPacket _value = this; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - // Const Field (protocolId) - lengthInBits += 8; - - // Reserved Field (reserved) - lengthInBits += 8; - - // Implicit Field (len) - lengthInBits += 16; - - // Simple field (payload) - lengthInBits += payload.getLengthInBits(); - - return lengthInBits; - } - - public static TPKTPacket staticParse(ReadBuffer readBuffer, Object... args) - throws ParseException { - PositionAware positionAware = readBuffer; - return staticParse(readBuffer); - } - - public static TPKTPacket staticParse(ReadBuffer readBuffer) throws ParseException { - readBuffer.pullContext("TPKTPacket"); - PositionAware positionAware = readBuffer; - boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); - - short protocolId = - readConstField( - "protocolId", - readUnsignedShort(readBuffer, 8), - TPKTPacket.PROTOCOLID, - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - Short reservedField0 = - readReservedField( - "reserved", - readUnsignedShort(readBuffer, 8), - (short) 0x00, - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - int len = - readImplicitField( - "len", readUnsignedInt(readBuffer, 16), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - COTPPacket payload = - readSimpleField( - "payload", - new DataReaderComplexDefault<>( - () -> COTPPacket.staticParse(readBuffer, (int) ((len) - (4))), readBuffer), - WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); - - readBuffer.closeContext("TPKTPacket"); - // Create the instance - TPKTPacket _tPKTPacket; - _tPKTPacket = new TPKTPacket(payload); - return _tPKTPacket; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (!(o instanceof TPKTPacket)) { - return false; - } - TPKTPacket that = (TPKTPacket) o; - return (getPayload() == that.getPayload()) && true; - } - - @Override - public int hashCode() { - return Objects.hash(getPayload()); - } - - @Override - public String toString() { - WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); - try { - writeBufferBoxBased.writeSerializable(this); - } catch (SerializationException e) { - throw new RuntimeException(e); - } - return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java deleted file mode 100644 index 573645a8e68..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.HashMap; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum TimeBase { - B01SEC((short) 0x00), - B1SEC((short) 0x01), - B10SEC((short) 0X02); - private static final Map map; - - static { - map = new HashMap<>(); - for (TimeBase value : TimeBase.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - - TimeBase(short value) { - this.value = value; - } - - public short getValue() { - return value; - } - - public static TimeBase enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java deleted file mode 100644 index bdab50692d3..00000000000 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java +++ /dev/null @@ -1,680 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.plc4x.java.s7.readwrite; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -// Code generated by code-generation. DO NOT EDIT. - -public enum TransportSize { - BOOL( - (short) 0x01, - (boolean) true, - (boolean) true, - (short) 0x01, - (short) 1, - (boolean) true, - (boolean) true, - (short) 'X', - (boolean) true, - DataTransportSize.BIT, - (String) "IEC61131_BOOL", - null), - BYTE( - (short) 0x02, - (boolean) true, - (boolean) true, - (short) 0x02, - (short) 1, - (boolean) true, - (boolean) true, - (short) 'B', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_BYTE", - null), - WORD( - (short) 0x03, - (boolean) true, - (boolean) true, - (short) 0x04, - (short) 2, - (boolean) true, - (boolean) true, - (short) 'W', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_WORD", - null), - DWORD( - (short) 0x04, - (boolean) true, - (boolean) true, - (short) 0x06, - (short) 4, - (boolean) true, - (boolean) true, - (short) 'D', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_DWORD", - TransportSize.WORD), - LWORD( - (short) 0x05, - (boolean) false, - (boolean) false, - (short) 0x00, - (short) 8, - (boolean) false, - (boolean) false, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_LWORD", - null), - INT( - (short) 0x06, - (boolean) true, - (boolean) true, - (short) 0x05, - (short) 2, - (boolean) true, - (boolean) true, - (short) 'W', - (boolean) true, - DataTransportSize.INTEGER, - (String) "IEC61131_INT", - null), - UINT( - (short) 0x07, - (boolean) false, - (boolean) true, - (short) 0x05, - (short) 2, - (boolean) false, - (boolean) true, - (short) 'W', - (boolean) true, - DataTransportSize.INTEGER, - (String) "IEC61131_UINT", - TransportSize.INT), - SINT( - (short) 0x08, - (boolean) false, - (boolean) true, - (short) 0x02, - (short) 1, - (boolean) false, - (boolean) true, - (short) 'B', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_SINT", - TransportSize.INT), - USINT( - (short) 0x09, - (boolean) false, - (boolean) true, - (short) 0x02, - (short) 1, - (boolean) false, - (boolean) true, - (short) 'B', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_USINT", - TransportSize.INT), - DINT( - (short) 0x0A, - (boolean) true, - (boolean) true, - (short) 0x07, - (short) 4, - (boolean) true, - (boolean) true, - (short) 'D', - (boolean) true, - DataTransportSize.INTEGER, - (String) "IEC61131_DINT", - TransportSize.INT), - UDINT( - (short) 0x0B, - (boolean) false, - (boolean) true, - (short) 0x07, - (short) 4, - (boolean) false, - (boolean) true, - (short) 'D', - (boolean) true, - DataTransportSize.INTEGER, - (String) "IEC61131_UDINT", - TransportSize.INT), - LINT( - (short) 0x0C, - (boolean) false, - (boolean) false, - (short) 0x00, - (short) 8, - (boolean) false, - (boolean) false, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_LINT", - TransportSize.INT), - ULINT( - (short) 0x0D, - (boolean) false, - (boolean) false, - (short) 0x00, - (short) 16, - (boolean) false, - (boolean) false, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_ULINT", - TransportSize.INT), - REAL( - (short) 0x0E, - (boolean) true, - (boolean) true, - (short) 0x08, - (short) 4, - (boolean) true, - (boolean) true, - (short) 'D', - (boolean) true, - DataTransportSize.REAL, - (String) "IEC61131_REAL", - null), - LREAL( - (short) 0x0F, - (boolean) false, - (boolean) false, - (short) 0x30, - (short) 8, - (boolean) false, - (boolean) true, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_LREAL", - TransportSize.REAL), - CHAR( - (short) 0x10, - (boolean) true, - (boolean) true, - (short) 0x03, - (short) 1, - (boolean) true, - (boolean) true, - (short) 'B', - (boolean) true, - DataTransportSize.OCTET_STRING, - (String) "IEC61131_CHAR", - null), - WCHAR( - (short) 0x11, - (boolean) false, - (boolean) true, - (short) 0x13, - (short) 2, - (boolean) false, - (boolean) true, - (short) 'X', - (boolean) true, - DataTransportSize.OCTET_STRING, - (String) "IEC61131_WCHAR", - null), - STRING( - (short) 0x12, - (boolean) true, - (boolean) true, - (short) 0x03, - (short) 1, - (boolean) true, - (boolean) true, - (short) 'X', - (boolean) true, - DataTransportSize.OCTET_STRING, - (String) "IEC61131_STRING", - null), - WSTRING( - (short) 0x13, - (boolean) false, - (boolean) true, - (short) 0x00, - (short) 2, - (boolean) false, - (boolean) true, - (short) 'X', - (boolean) true, - DataTransportSize.OCTET_STRING, - (String) "IEC61131_WSTRING", - null), - TIME( - (short) 0x14, - (boolean) true, - (boolean) true, - (short) 0x0B, - (short) 4, - (boolean) true, - (boolean) true, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_TIME", - null), - LTIME( - (short) 0x16, - (boolean) false, - (boolean) false, - (short) 0x00, - (short) 8, - (boolean) false, - (boolean) false, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_LTIME", - TransportSize.TIME), - DATE( - (short) 0x17, - (boolean) true, - (boolean) true, - (short) 0x09, - (short) 2, - (boolean) true, - (boolean) true, - (short) 'X', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_DATE", - null), - TIME_OF_DAY( - (short) 0x18, - (boolean) true, - (boolean) true, - (short) 0x06, - (short) 4, - (boolean) true, - (boolean) true, - (short) 'X', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_TIME_OF_DAY", - null), - TOD( - (short) 0x19, - (boolean) true, - (boolean) true, - (short) 0x06, - (short) 4, - (boolean) true, - (boolean) true, - (short) 'X', - (boolean) true, - DataTransportSize.BYTE_WORD_DWORD, - (String) "IEC61131_TIME_OF_DAY", - null), - DATE_AND_TIME( - (short) 0x1A, - (boolean) true, - (boolean) false, - (short) 0x0F, - (short) 12, - (boolean) true, - (boolean) false, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_DATE_AND_TIME", - null), - DT( - (short) 0x1B, - (boolean) true, - (boolean) false, - (short) 0x0F, - (short) 12, - (boolean) true, - (boolean) false, - (short) 'X', - (boolean) true, - null, - (String) "IEC61131_DATE_AND_TIME", - null); - private static final Map map; - - static { - map = new HashMap<>(); - for (TransportSize value : TransportSize.values()) { - map.put((short) value.getValue(), value); - } - } - - private final short value; - private final boolean supported_S7_300; - private final boolean supported_LOGO; - private final short code; - private final short sizeInBytes; - private final boolean supported_S7_400; - private final boolean supported_S7_1200; - private final short shortName; - private final boolean supported_S7_1500; - private final DataTransportSize dataTransportSize; - private final String dataProtocolId; - private final TransportSize baseType; - - TransportSize( - short value, - boolean supported_S7_300, - boolean supported_LOGO, - short code, - short sizeInBytes, - boolean supported_S7_400, - boolean supported_S7_1200, - short shortName, - boolean supported_S7_1500, - DataTransportSize dataTransportSize, - String dataProtocolId, - TransportSize baseType) { - this.value = value; - this.supported_S7_300 = supported_S7_300; - this.supported_LOGO = supported_LOGO; - this.code = code; - this.sizeInBytes = sizeInBytes; - this.supported_S7_400 = supported_S7_400; - this.supported_S7_1200 = supported_S7_1200; - this.shortName = shortName; - this.supported_S7_1500 = supported_S7_1500; - this.dataTransportSize = dataTransportSize; - this.dataProtocolId = dataProtocolId; - this.baseType = baseType; - } - - public short getValue() { - return value; - } - - public boolean getSupported_S7_300() { - return supported_S7_300; - } - - public static TransportSize firstEnumForFieldSupported_S7_300(boolean fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_300() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSupported_S7_300(boolean fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_300() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public boolean getSupported_LOGO() { - return supported_LOGO; - } - - public static TransportSize firstEnumForFieldSupported_LOGO(boolean fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_LOGO() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSupported_LOGO(boolean fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_LOGO() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public short getCode() { - return code; - } - - public static TransportSize firstEnumForFieldCode(short fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getCode() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldCode(short fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getCode() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public short getSizeInBytes() { - return sizeInBytes; - } - - public static TransportSize firstEnumForFieldSizeInBytes(short fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getSizeInBytes() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSizeInBytes(short fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getSizeInBytes() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public boolean getSupported_S7_400() { - return supported_S7_400; - } - - public static TransportSize firstEnumForFieldSupported_S7_400(boolean fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_400() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSupported_S7_400(boolean fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_400() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public boolean getSupported_S7_1200() { - return supported_S7_1200; - } - - public static TransportSize firstEnumForFieldSupported_S7_1200(boolean fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_1200() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSupported_S7_1200(boolean fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_1200() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public short getShortName() { - return shortName; - } - - public static TransportSize firstEnumForFieldShortName(short fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getShortName() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldShortName(short fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getShortName() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public boolean getSupported_S7_1500() { - return supported_S7_1500; - } - - public static TransportSize firstEnumForFieldSupported_S7_1500(boolean fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_1500() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldSupported_S7_1500(boolean fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getSupported_S7_1500() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public DataTransportSize getDataTransportSize() { - return dataTransportSize; - } - - public static TransportSize firstEnumForFieldDataTransportSize(DataTransportSize fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getDataTransportSize() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldDataTransportSize(DataTransportSize fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getDataTransportSize() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public String getDataProtocolId() { - return dataProtocolId; - } - - public static TransportSize firstEnumForFieldDataProtocolId(String fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getDataProtocolId().equals(fieldValue)) { - return _val; - } - } - return null; - } - - public static List enumsForFieldDataProtocolId(String fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getDataProtocolId().equals(fieldValue)) { - _values.add(_val); - } - } - return _values; - } - - public TransportSize getBaseType() { - return baseType; - } - - public static TransportSize firstEnumForFieldBaseType(TransportSize fieldValue) { - for (TransportSize _val : TransportSize.values()) { - if (_val.getBaseType() == fieldValue) { - return _val; - } - } - return null; - } - - public static List enumsForFieldBaseType(TransportSize fieldValue) { - List _values = new ArrayList<>(); - for (TransportSize _val : TransportSize.values()) { - if (_val.getBaseType() == fieldValue) { - _values.add(_val); - } - } - return _values; - } - - public static TransportSize enumForValue(short value) { - return map.get(value); - } - - public static Boolean isDefined(short value) { - return map.containsKey(value); - } -} diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java index 8222917bc69..f82ab94bbcc 100644 --- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java @@ -250,6 +250,7 @@ private void Write() { if (!isConnected.get()) return; try { final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) + writeRequest.addTagAddress("TAG00", "%DB400:4:DWORD",(long) 0x0001_0001); //(02) writeRequest.addTagAddress("TAG01", "%DB400:4:TIME",Duration.ofDays(5)); //(02) diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java index ff35f6b9dc2..40876e4f880 100644 --- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java +++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcTIME.java @@ -27,6 +27,7 @@ import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.temporal.ChronoUnit; +import java.time.temporal.TemporalUnit; public class PlcTIME extends PlcSimpleValue { @@ -109,10 +110,11 @@ public String toString() { @Override public void serialize(WriteBuffer writeBuffer) throws SerializationException { - String valueString = value.toString(); - writeBuffer.writeString(getClass().getSimpleName(), - valueString.getBytes(StandardCharsets.UTF_8).length*8, - valueString, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); +// String valueString = value.toString(); +// writeBuffer.writeString(getClass().getSimpleName(), +// valueString.getBytes(StandardCharsets.UTF_8).length*8, +// valueString, WithOption.WithEncoding(StandardCharsets.UTF_8.name())); + writeBuffer.writeLong(getClass().getSimpleName(), 32, value.toMillis()); } } From 00b58d61ec1d02eed9cbc81f19e38969da547d3a Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Sun, 3 Dec 2023 08:54:58 -0400 Subject: [PATCH 15/21] Arreglando el manejo de los tipos TIME. modificacion del PlcTIME y s7.mspec. --- plc4j/drivers/s7/pom.xml | 4 +- .../s7/readwrite/Alarm8MessageQueryType.java | 252 +++++++ .../AlarmMessageAckObjectPushType.java | 253 +++++++ .../s7/readwrite/AlarmMessageAckPushType.java | 192 +++++ .../AlarmMessageAckResponseType.java | 164 +++++ .../s7/readwrite/AlarmMessageAckType.java | 170 +++++ .../readwrite/AlarmMessageObjectAckType.java | 246 +++++++ .../readwrite/AlarmMessageObjectPushType.java | 329 +++++++++ .../AlarmMessageObjectQueryType.java | 310 ++++++++ .../s7/readwrite/AlarmMessagePushType.java | 192 +++++ .../s7/readwrite/AlarmMessageQueryType.java | 252 +++++++ .../java/s7/readwrite/AlarmStateType.java | 59 ++ .../plc4x/java/s7/readwrite/AlarmType.java | 56 ++ .../readwrite/AssociatedQueryValueType.java | 204 ++++++ .../s7/readwrite/AssociatedValueType.java | 220 ++++++ .../plc4x/java/s7/readwrite/COTPPacket.java | 238 ++++++ .../COTPPacketConnectionRequest.java | 200 ++++++ .../COTPPacketConnectionResponse.java | 200 ++++++ .../java/s7/readwrite/COTPPacketData.java | 159 ++++ .../COTPPacketDisconnectRequest.java | 200 ++++++ .../COTPPacketDisconnectResponse.java | 167 +++++ .../s7/readwrite/COTPPacketTpduError.java | 165 +++++ .../java/s7/readwrite/COTPParameter.java | 182 +++++ .../s7/readwrite/COTPParameterCalledTsap.java | 141 ++++ .../readwrite/COTPParameterCallingTsap.java | 141 ++++ .../s7/readwrite/COTPParameterChecksum.java | 141 ++++ ...ameterDisconnectAdditionalInformation.java | 145 ++++ .../s7/readwrite/COTPParameterTpduSize.java | 151 ++++ .../java/s7/readwrite/COTPProtocolClass.java | 58 ++ .../plc4x/java/s7/readwrite/COTPTpduSize.java | 87 +++ .../java/s7/readwrite/CpuSubscribeEvents.java | 57 ++ .../s7/readwrite/CycServiceItemAnyType.java | 244 +++++++ .../readwrite/CycServiceItemDbReadType.java | 169 +++++ .../java/s7/readwrite/CycServiceItemType.java | 189 +++++ .../plc4x/java/s7/readwrite/DataItem.java | 531 ++++++++++++++ .../s7/readwrite/DataTransportErrorCode.java | 59 ++ .../java/s7/readwrite/DataTransportSize.java | 87 +++ .../plc4x/java/s7/readwrite/DateAndTime.java | 313 ++++++++ .../plc4x/java/s7/readwrite/DeviceGroup.java | 56 ++ .../plc4x/java/s7/readwrite/EventType.java | 58 ++ .../plc4x/java/s7/readwrite/MemoryArea.java | 89 +++ .../java/s7/readwrite/ModeTransitionType.java | 62 ++ .../plc4x/java/s7/readwrite/QueryType.java | 57 ++ .../plc4x/java/s7/readwrite/S7Address.java | 146 ++++ .../plc4x/java/s7/readwrite/S7AddressAny.java | 276 +++++++ .../java/s7/readwrite/S7DataAlarmMessage.java | 192 +++++ .../plc4x/java/s7/readwrite/S7Message.java | 262 +++++++ .../s7/readwrite/S7MessageObjectRequest.java | 256 +++++++ .../s7/readwrite/S7MessageObjectResponse.java | 196 +++++ .../java/s7/readwrite/S7MessageRequest.java | 120 ++++ .../java/s7/readwrite/S7MessageResponse.java | 164 +++++ .../s7/readwrite/S7MessageResponseData.java | 165 +++++ .../java/s7/readwrite/S7MessageUserData.java | 121 ++++ .../plc4x/java/s7/readwrite/S7Parameter.java | 187 +++++ .../readwrite/S7ParameterModeTransition.java | 252 +++++++ .../readwrite/S7ParameterReadVarRequest.java | 165 +++++ .../readwrite/S7ParameterReadVarResponse.java | 145 ++++ .../S7ParameterSetupCommunication.java | 191 +++++ .../s7/readwrite/S7ParameterUserData.java | 164 +++++ .../s7/readwrite/S7ParameterUserDataItem.java | 148 ++++ .../S7ParameterUserDataItemCPUFunctions.java | 337 +++++++++ .../readwrite/S7ParameterWriteVarRequest.java | 165 +++++ .../S7ParameterWriteVarResponse.java | 145 ++++ .../plc4x/java/s7/readwrite/S7Payload.java | 179 +++++ .../java/s7/readwrite/S7PayloadAlarm8.java | 160 +++++ .../s7/readwrite/S7PayloadAlarmAckInd.java | 160 +++++ .../java/s7/readwrite/S7PayloadAlarmS.java | 160 +++++ .../java/s7/readwrite/S7PayloadAlarmSC.java | 160 +++++ .../java/s7/readwrite/S7PayloadAlarmSQ.java | 160 +++++ .../readwrite/S7PayloadDiagnosticMessage.java | 295 ++++++++ .../java/s7/readwrite/S7PayloadNotify.java | 160 +++++ .../java/s7/readwrite/S7PayloadNotify8.java | 160 +++++ .../readwrite/S7PayloadReadVarResponse.java | 154 ++++ .../java/s7/readwrite/S7PayloadUserData.java | 172 +++++ .../s7/readwrite/S7PayloadUserDataItem.java | 483 +++++++++++++ .../S7PayloadUserDataItemClkFRequest.java | 134 ++++ .../S7PayloadUserDataItemClkFResponse.java | 203 ++++++ .../S7PayloadUserDataItemClkRequest.java | 134 ++++ .../S7PayloadUserDataItemClkResponse.java | 203 ++++++ .../S7PayloadUserDataItemClkSetRequest.java | 177 +++++ .../S7PayloadUserDataItemClkSetResponse.java | 134 ++++ ...aItemCpuFunctionAlarmAckErrorResponse.java | 138 ++++ ...serDataItemCpuFunctionAlarmAckRequest.java | 201 ++++++ ...erDataItemCpuFunctionAlarmAckResponse.java | 195 +++++ ...rDataItemCpuFunctionAlarmQueryRequest.java | 316 ++++++++ ...DataItemCpuFunctionAlarmQueryResponse.java | 166 +++++ ...uFunctionMsgSubscriptionAlarmResponse.java | 258 +++++++ ...ItemCpuFunctionMsgSubscriptionRequest.java | 250 +++++++ ...temCpuFunctionMsgSubscriptionResponse.java | 138 ++++ ...CpuFunctionMsgSubscriptionSysResponse.java | 182 +++++ ...taItemCpuFunctionReadSzlNoDataRequest.java | 138 ++++ ...UserDataItemCpuFunctionReadSzlRequest.java | 183 +++++ ...serDataItemCpuFunctionReadSzlResponse.java | 166 +++++ ...ataItemCyclicServicesChangeDrivenPush.java | 192 +++++ ...ServicesChangeDrivenSubscribeResponse.java | 193 +++++ ...erDataItemCyclicServicesErrorResponse.java | 138 ++++ ...PayloadUserDataItemCyclicServicesPush.java | 190 +++++ ...ataItemCyclicServicesSubscribeRequest.java | 239 ++++++ ...taItemCyclicServicesSubscribeResponse.java | 192 +++++ ...aItemCyclicServicesUnsubscribeRequest.java | 181 +++++ ...ItemCyclicServicesUnsubscribeResponse.java | 138 ++++ .../readwrite/S7PayloadWriteVarRequest.java | 154 ++++ .../readwrite/S7PayloadWriteVarResponse.java | 154 ++++ .../s7/readwrite/S7VarPayloadDataItem.java | 220 ++++++ .../s7/readwrite/S7VarPayloadStatusItem.java | 139 ++++ .../readwrite/S7VarRequestParameterItem.java | 148 ++++ .../S7VarRequestParameterItemAddress.java | 155 ++++ .../apache/plc4x/java/s7/readwrite/State.java | 248 +++++++ .../plc4x/java/s7/readwrite/SubItem.java | 157 ++++ .../plc4x/java/s7/readwrite/SyntaxIdType.java | 66 ++ .../java/s7/readwrite/SzlDataTreeItem.java | 190 +++++ .../apache/plc4x/java/s7/readwrite/SzlId.java | 179 +++++ .../java/s7/readwrite/SzlModuleTypeClass.java | 57 ++ .../plc4x/java/s7/readwrite/SzlSublist.java | 79 ++ .../plc4x/java/s7/readwrite/TPKTPacket.java | 193 +++++ .../plc4x/java/s7/readwrite/TimeBase.java | 56 ++ .../java/s7/readwrite/TransportSize.java | 680 ++++++++++++++++++ .../plc4j/s7event/PlcReadDataS7400H.java | 5 +- .../src/main/resources/protocols/s7/s7.mspec | 2 +- 119 files changed, 21105 insertions(+), 5 deletions(-) create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java create mode 100644 plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java diff --git a/plc4j/drivers/s7/pom.xml b/plc4j/drivers/s7/pom.xml index 4cf409d0136..44c86effb70 100644 --- a/plc4j/drivers/s7/pom.xml +++ b/plc4j/drivers/s7/pom.xml @@ -36,8 +36,8 @@ - - + + org.apache.karaf.tooling karaf-maven-plugin diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java new file mode 100644 index 00000000000..31e7dab0922 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/Alarm8MessageQueryType.java @@ -0,0 +1,252 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class Alarm8MessageQueryType implements Message { + + // Properties. + protected final short functionId; + protected final short numberOfObjects; + protected final DataTransportErrorCode returnCode; + protected final DataTransportSize transportSize; + protected final int byteCount; + protected final List messageObjects; + + public Alarm8MessageQueryType( + short functionId, + short numberOfObjects, + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int byteCount, + List messageObjects) { + super(); + this.functionId = functionId; + this.numberOfObjects = numberOfObjects; + this.returnCode = returnCode; + this.transportSize = transportSize; + this.byteCount = byteCount; + this.messageObjects = messageObjects; + } + + public short getFunctionId() { + return functionId; + } + + public short getNumberOfObjects() { + return numberOfObjects; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public DataTransportSize getTransportSize() { + return transportSize; + } + + public int getByteCount() { + return byteCount; + } + + public List getMessageObjects() { + return messageObjects; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("Alarm8MessageQueryType"); + + // Simple Field (functionId) + writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (numberOfObjects) + writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (transportSize) + writeSimpleEnumField( + "transportSize", + "DataTransportSize", + transportSize, + new DataWriterEnumDefault<>( + DataTransportSize::getValue, + DataTransportSize::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (byteCount) + writeSimpleField("byteCount", byteCount, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (messageObjects) + writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); + + writeBuffer.popContext("Alarm8MessageQueryType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + Alarm8MessageQueryType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (functionId) + lengthInBits += 8; + + // Simple field (numberOfObjects) + lengthInBits += 8; + + // Simple field (returnCode) + lengthInBits += 8; + + // Simple field (transportSize) + lengthInBits += 8; + + // Simple field (byteCount) + lengthInBits += 16; + + // Array field + if (messageObjects != null) { + int i = 0; + for (AlarmMessageObjectQueryType element : messageObjects) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static Alarm8MessageQueryType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static Alarm8MessageQueryType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("Alarm8MessageQueryType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); + + short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + DataTransportSize transportSize = + readEnumField( + "transportSize", + "DataTransportSize", + new DataReaderEnumDefault<>( + DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + int byteCount = readSimpleField("byteCount", readUnsignedInt(readBuffer, 16)); + + List messageObjects = + readCountArrayField( + "messageObjects", + new DataReaderComplexDefault<>( + () -> AlarmMessageObjectQueryType.staticParse(readBuffer), readBuffer), + (byteCount) / (12)); + + readBuffer.closeContext("Alarm8MessageQueryType"); + // Create the instance + Alarm8MessageQueryType _alarm8MessageQueryType; + _alarm8MessageQueryType = + new Alarm8MessageQueryType( + functionId, numberOfObjects, returnCode, transportSize, byteCount, messageObjects); + return _alarm8MessageQueryType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Alarm8MessageQueryType)) { + return false; + } + Alarm8MessageQueryType that = (Alarm8MessageQueryType) o; + return (getFunctionId() == that.getFunctionId()) + && (getNumberOfObjects() == that.getNumberOfObjects()) + && (getReturnCode() == that.getReturnCode()) + && (getTransportSize() == that.getTransportSize()) + && (getByteCount() == that.getByteCount()) + && (getMessageObjects() == that.getMessageObjects()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getFunctionId(), + getNumberOfObjects(), + getReturnCode(), + getTransportSize(), + getByteCount(), + getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java new file mode 100644 index 00000000000..342589eba6d --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckObjectPushType.java @@ -0,0 +1,253 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageAckObjectPushType implements Message { + + // Constant values. + public static final Short VARIABLESPEC = 0x12; + + // Properties. + protected final short lengthSpec; + protected final SyntaxIdType syntaxId; + protected final short numberOfValues; + protected final long eventId; + protected final State ackStateGoing; + protected final State ackStateComing; + + public AlarmMessageAckObjectPushType( + short lengthSpec, + SyntaxIdType syntaxId, + short numberOfValues, + long eventId, + State ackStateGoing, + State ackStateComing) { + super(); + this.lengthSpec = lengthSpec; + this.syntaxId = syntaxId; + this.numberOfValues = numberOfValues; + this.eventId = eventId; + this.ackStateGoing = ackStateGoing; + this.ackStateComing = ackStateComing; + } + + public short getLengthSpec() { + return lengthSpec; + } + + public SyntaxIdType getSyntaxId() { + return syntaxId; + } + + public short getNumberOfValues() { + return numberOfValues; + } + + public long getEventId() { + return eventId; + } + + public State getAckStateGoing() { + return ackStateGoing; + } + + public State getAckStateComing() { + return ackStateComing; + } + + public short getVariableSpec() { + return VARIABLESPEC; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageAckObjectPushType"); + + // Const Field (variableSpec) + writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (lengthSpec) + writeSimpleField("lengthSpec", lengthSpec, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (syntaxId) + writeSimpleEnumField( + "syntaxId", + "SyntaxIdType", + syntaxId, + new DataWriterEnumDefault<>( + SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (numberOfValues) + writeSimpleField("numberOfValues", numberOfValues, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (eventId) + writeSimpleField("eventId", eventId, writeUnsignedLong(writeBuffer, 32)); + + // Simple Field (ackStateGoing) + writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (ackStateComing) + writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("AlarmMessageAckObjectPushType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageAckObjectPushType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (variableSpec) + lengthInBits += 8; + + // Simple field (lengthSpec) + lengthInBits += 8; + + // Simple field (syntaxId) + lengthInBits += 8; + + // Simple field (numberOfValues) + lengthInBits += 8; + + // Simple field (eventId) + lengthInBits += 32; + + // Simple field (ackStateGoing) + lengthInBits += ackStateGoing.getLengthInBits(); + + // Simple field (ackStateComing) + lengthInBits += ackStateComing.getLengthInBits(); + + return lengthInBits; + } + + public static AlarmMessageAckObjectPushType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageAckObjectPushType staticParse(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("AlarmMessageAckObjectPushType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short variableSpec = + readConstField( + "variableSpec", + readUnsignedShort(readBuffer, 8), + AlarmMessageAckObjectPushType.VARIABLESPEC); + + short lengthSpec = readSimpleField("lengthSpec", readUnsignedShort(readBuffer, 8)); + + SyntaxIdType syntaxId = + readEnumField( + "syntaxId", + "SyntaxIdType", + new DataReaderEnumDefault<>( + SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); + + short numberOfValues = readSimpleField("numberOfValues", readUnsignedShort(readBuffer, 8)); + + long eventId = readSimpleField("eventId", readUnsignedLong(readBuffer, 32)); + + State ackStateGoing = + readSimpleField( + "ackStateGoing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + State ackStateComing = + readSimpleField( + "ackStateComing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("AlarmMessageAckObjectPushType"); + // Create the instance + AlarmMessageAckObjectPushType _alarmMessageAckObjectPushType; + _alarmMessageAckObjectPushType = + new AlarmMessageAckObjectPushType( + lengthSpec, syntaxId, numberOfValues, eventId, ackStateGoing, ackStateComing); + return _alarmMessageAckObjectPushType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageAckObjectPushType)) { + return false; + } + AlarmMessageAckObjectPushType that = (AlarmMessageAckObjectPushType) o; + return (getLengthSpec() == that.getLengthSpec()) + && (getSyntaxId() == that.getSyntaxId()) + && (getNumberOfValues() == that.getNumberOfValues()) + && (getEventId() == that.getEventId()) + && (getAckStateGoing() == that.getAckStateGoing()) + && (getAckStateComing() == that.getAckStateComing()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getLengthSpec(), + getSyntaxId(), + getNumberOfValues(), + getEventId(), + getAckStateGoing(), + getAckStateComing()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java new file mode 100644 index 00000000000..48491b961ad --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckPushType.java @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageAckPushType implements Message { + + // Properties. + protected final DateAndTime TimeStamp; + protected final short functionId; + protected final short numberOfObjects; + protected final List messageObjects; + + public AlarmMessageAckPushType( + DateAndTime TimeStamp, + short functionId, + short numberOfObjects, + List messageObjects) { + super(); + this.TimeStamp = TimeStamp; + this.functionId = functionId; + this.numberOfObjects = numberOfObjects; + this.messageObjects = messageObjects; + } + + public DateAndTime getTimeStamp() { + return TimeStamp; + } + + public short getFunctionId() { + return functionId; + } + + public short getNumberOfObjects() { + return numberOfObjects; + } + + public List getMessageObjects() { + return messageObjects; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageAckPushType"); + + // Simple Field (TimeStamp) + writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (functionId) + writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (numberOfObjects) + writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (messageObjects) + writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); + + writeBuffer.popContext("AlarmMessageAckPushType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageAckPushType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (TimeStamp) + lengthInBits += TimeStamp.getLengthInBits(); + + // Simple field (functionId) + lengthInBits += 8; + + // Simple field (numberOfObjects) + lengthInBits += 8; + + // Array field + if (messageObjects != null) { + int i = 0; + for (AlarmMessageAckObjectPushType element : messageObjects) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static AlarmMessageAckPushType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageAckPushType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("AlarmMessageAckPushType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DateAndTime TimeStamp = + readSimpleField( + "TimeStamp", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); + + short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + List messageObjects = + readCountArrayField( + "messageObjects", + new DataReaderComplexDefault<>( + () -> AlarmMessageAckObjectPushType.staticParse(readBuffer), readBuffer), + numberOfObjects); + + readBuffer.closeContext("AlarmMessageAckPushType"); + // Create the instance + AlarmMessageAckPushType _alarmMessageAckPushType; + _alarmMessageAckPushType = + new AlarmMessageAckPushType(TimeStamp, functionId, numberOfObjects, messageObjects); + return _alarmMessageAckPushType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageAckPushType)) { + return false; + } + AlarmMessageAckPushType that = (AlarmMessageAckPushType) o; + return (getTimeStamp() == that.getTimeStamp()) + && (getFunctionId() == that.getFunctionId()) + && (getNumberOfObjects() == that.getNumberOfObjects()) + && (getMessageObjects() == that.getMessageObjects()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getTimeStamp(), getFunctionId(), getNumberOfObjects(), getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java new file mode 100644 index 00000000000..e588b6ca414 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckResponseType.java @@ -0,0 +1,164 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageAckResponseType implements Message { + + // Properties. + protected final short functionId; + protected final short numberOfObjects; + protected final List messageObjects; + + public AlarmMessageAckResponseType( + short functionId, short numberOfObjects, List messageObjects) { + super(); + this.functionId = functionId; + this.numberOfObjects = numberOfObjects; + this.messageObjects = messageObjects; + } + + public short getFunctionId() { + return functionId; + } + + public short getNumberOfObjects() { + return numberOfObjects; + } + + public List getMessageObjects() { + return messageObjects; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageAckResponseType"); + + // Simple Field (functionId) + writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (numberOfObjects) + writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (messageObjects) + writeSimpleTypeArrayField("messageObjects", messageObjects, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("AlarmMessageAckResponseType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageAckResponseType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (functionId) + lengthInBits += 8; + + // Simple field (numberOfObjects) + lengthInBits += 8; + + // Array field + if (messageObjects != null) { + lengthInBits += 8 * messageObjects.size(); + } + + return lengthInBits; + } + + public static AlarmMessageAckResponseType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageAckResponseType staticParse(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("AlarmMessageAckResponseType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); + + short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + List messageObjects = + readCountArrayField("messageObjects", readUnsignedShort(readBuffer, 8), numberOfObjects); + + readBuffer.closeContext("AlarmMessageAckResponseType"); + // Create the instance + AlarmMessageAckResponseType _alarmMessageAckResponseType; + _alarmMessageAckResponseType = + new AlarmMessageAckResponseType(functionId, numberOfObjects, messageObjects); + return _alarmMessageAckResponseType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageAckResponseType)) { + return false; + } + AlarmMessageAckResponseType that = (AlarmMessageAckResponseType) o; + return (getFunctionId() == that.getFunctionId()) + && (getNumberOfObjects() == that.getNumberOfObjects()) + && (getMessageObjects() == that.getMessageObjects()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getFunctionId(), getNumberOfObjects(), getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java new file mode 100644 index 00000000000..bea2571d061 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageAckType.java @@ -0,0 +1,170 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageAckType implements Message { + + // Properties. + protected final short functionId; + protected final short numberOfObjects; + protected final List messageObjects; + + public AlarmMessageAckType( + short functionId, short numberOfObjects, List messageObjects) { + super(); + this.functionId = functionId; + this.numberOfObjects = numberOfObjects; + this.messageObjects = messageObjects; + } + + public short getFunctionId() { + return functionId; + } + + public short getNumberOfObjects() { + return numberOfObjects; + } + + public List getMessageObjects() { + return messageObjects; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageAckType"); + + // Simple Field (functionId) + writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (numberOfObjects) + writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (messageObjects) + writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); + + writeBuffer.popContext("AlarmMessageAckType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageAckType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (functionId) + lengthInBits += 8; + + // Simple field (numberOfObjects) + lengthInBits += 8; + + // Array field + if (messageObjects != null) { + int i = 0; + for (AlarmMessageObjectAckType element : messageObjects) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static AlarmMessageAckType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageAckType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("AlarmMessageAckType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); + + short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + List messageObjects = + readCountArrayField( + "messageObjects", + new DataReaderComplexDefault<>( + () -> AlarmMessageObjectAckType.staticParse(readBuffer), readBuffer), + numberOfObjects); + + readBuffer.closeContext("AlarmMessageAckType"); + // Create the instance + AlarmMessageAckType _alarmMessageAckType; + _alarmMessageAckType = new AlarmMessageAckType(functionId, numberOfObjects, messageObjects); + return _alarmMessageAckType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageAckType)) { + return false; + } + AlarmMessageAckType that = (AlarmMessageAckType) o; + return (getFunctionId() == that.getFunctionId()) + && (getNumberOfObjects() == that.getNumberOfObjects()) + && (getMessageObjects() == that.getMessageObjects()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getFunctionId(), getNumberOfObjects(), getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java new file mode 100644 index 00000000000..fc3ff163982 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectAckType.java @@ -0,0 +1,246 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageObjectAckType implements Message { + + // Constant values. + public static final Short VARIABLESPEC = 0x12; + public static final Short LENGTH = 0x08; + + // Properties. + protected final SyntaxIdType syntaxId; + protected final short numberOfValues; + protected final long eventId; + protected final State ackStateGoing; + protected final State ackStateComing; + + public AlarmMessageObjectAckType( + SyntaxIdType syntaxId, + short numberOfValues, + long eventId, + State ackStateGoing, + State ackStateComing) { + super(); + this.syntaxId = syntaxId; + this.numberOfValues = numberOfValues; + this.eventId = eventId; + this.ackStateGoing = ackStateGoing; + this.ackStateComing = ackStateComing; + } + + public SyntaxIdType getSyntaxId() { + return syntaxId; + } + + public short getNumberOfValues() { + return numberOfValues; + } + + public long getEventId() { + return eventId; + } + + public State getAckStateGoing() { + return ackStateGoing; + } + + public State getAckStateComing() { + return ackStateComing; + } + + public short getVariableSpec() { + return VARIABLESPEC; + } + + public short getLength() { + return LENGTH; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageObjectAckType"); + + // Const Field (variableSpec) + writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); + + // Const Field (length) + writeConstField("length", LENGTH, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (syntaxId) + writeSimpleEnumField( + "syntaxId", + "SyntaxIdType", + syntaxId, + new DataWriterEnumDefault<>( + SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (numberOfValues) + writeSimpleField("numberOfValues", numberOfValues, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (eventId) + writeSimpleField("eventId", eventId, writeUnsignedLong(writeBuffer, 32)); + + // Simple Field (ackStateGoing) + writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (ackStateComing) + writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("AlarmMessageObjectAckType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageObjectAckType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (variableSpec) + lengthInBits += 8; + + // Const Field (length) + lengthInBits += 8; + + // Simple field (syntaxId) + lengthInBits += 8; + + // Simple field (numberOfValues) + lengthInBits += 8; + + // Simple field (eventId) + lengthInBits += 32; + + // Simple field (ackStateGoing) + lengthInBits += ackStateGoing.getLengthInBits(); + + // Simple field (ackStateComing) + lengthInBits += ackStateComing.getLengthInBits(); + + return lengthInBits; + } + + public static AlarmMessageObjectAckType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageObjectAckType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("AlarmMessageObjectAckType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short variableSpec = + readConstField( + "variableSpec", + readUnsignedShort(readBuffer, 8), + AlarmMessageObjectAckType.VARIABLESPEC); + + short length = + readConstField( + "length", readUnsignedShort(readBuffer, 8), AlarmMessageObjectAckType.LENGTH); + + SyntaxIdType syntaxId = + readEnumField( + "syntaxId", + "SyntaxIdType", + new DataReaderEnumDefault<>( + SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); + + short numberOfValues = readSimpleField("numberOfValues", readUnsignedShort(readBuffer, 8)); + + long eventId = readSimpleField("eventId", readUnsignedLong(readBuffer, 32)); + + State ackStateGoing = + readSimpleField( + "ackStateGoing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + State ackStateComing = + readSimpleField( + "ackStateComing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("AlarmMessageObjectAckType"); + // Create the instance + AlarmMessageObjectAckType _alarmMessageObjectAckType; + _alarmMessageObjectAckType = + new AlarmMessageObjectAckType( + syntaxId, numberOfValues, eventId, ackStateGoing, ackStateComing); + return _alarmMessageObjectAckType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageObjectAckType)) { + return false; + } + AlarmMessageObjectAckType that = (AlarmMessageObjectAckType) o; + return (getSyntaxId() == that.getSyntaxId()) + && (getNumberOfValues() == that.getNumberOfValues()) + && (getEventId() == that.getEventId()) + && (getAckStateGoing() == that.getAckStateGoing()) + && (getAckStateComing() == that.getAckStateComing()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getSyntaxId(), getNumberOfValues(), getEventId(), getAckStateGoing(), getAckStateComing()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java new file mode 100644 index 00000000000..42777096da9 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectPushType.java @@ -0,0 +1,329 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageObjectPushType implements Message { + + // Constant values. + public static final Short VARIABLESPEC = 0x12; + + // Properties. + protected final short lengthSpec; + protected final SyntaxIdType syntaxId; + protected final short numberOfValues; + protected final long eventId; + protected final State eventState; + protected final State localState; + protected final State ackStateGoing; + protected final State ackStateComing; + protected final List AssociatedValues; + + public AlarmMessageObjectPushType( + short lengthSpec, + SyntaxIdType syntaxId, + short numberOfValues, + long eventId, + State eventState, + State localState, + State ackStateGoing, + State ackStateComing, + List AssociatedValues) { + super(); + this.lengthSpec = lengthSpec; + this.syntaxId = syntaxId; + this.numberOfValues = numberOfValues; + this.eventId = eventId; + this.eventState = eventState; + this.localState = localState; + this.ackStateGoing = ackStateGoing; + this.ackStateComing = ackStateComing; + this.AssociatedValues = AssociatedValues; + } + + public short getLengthSpec() { + return lengthSpec; + } + + public SyntaxIdType getSyntaxId() { + return syntaxId; + } + + public short getNumberOfValues() { + return numberOfValues; + } + + public long getEventId() { + return eventId; + } + + public State getEventState() { + return eventState; + } + + public State getLocalState() { + return localState; + } + + public State getAckStateGoing() { + return ackStateGoing; + } + + public State getAckStateComing() { + return ackStateComing; + } + + public List getAssociatedValues() { + return AssociatedValues; + } + + public short getVariableSpec() { + return VARIABLESPEC; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageObjectPushType"); + + // Const Field (variableSpec) + writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (lengthSpec) + writeSimpleField("lengthSpec", lengthSpec, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (syntaxId) + writeSimpleEnumField( + "syntaxId", + "SyntaxIdType", + syntaxId, + new DataWriterEnumDefault<>( + SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (numberOfValues) + writeSimpleField("numberOfValues", numberOfValues, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (eventId) + writeSimpleField("eventId", eventId, writeUnsignedLong(writeBuffer, 32)); + + // Simple Field (eventState) + writeSimpleField("eventState", eventState, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (localState) + writeSimpleField("localState", localState, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (ackStateGoing) + writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (ackStateComing) + writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); + + // Array Field (AssociatedValues) + writeComplexTypeArrayField("AssociatedValues", AssociatedValues, writeBuffer); + + writeBuffer.popContext("AlarmMessageObjectPushType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageObjectPushType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (variableSpec) + lengthInBits += 8; + + // Simple field (lengthSpec) + lengthInBits += 8; + + // Simple field (syntaxId) + lengthInBits += 8; + + // Simple field (numberOfValues) + lengthInBits += 8; + + // Simple field (eventId) + lengthInBits += 32; + + // Simple field (eventState) + lengthInBits += eventState.getLengthInBits(); + + // Simple field (localState) + lengthInBits += localState.getLengthInBits(); + + // Simple field (ackStateGoing) + lengthInBits += ackStateGoing.getLengthInBits(); + + // Simple field (ackStateComing) + lengthInBits += ackStateComing.getLengthInBits(); + + // Array field + if (AssociatedValues != null) { + int i = 0; + for (AssociatedValueType element : AssociatedValues) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= AssociatedValues.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static AlarmMessageObjectPushType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageObjectPushType staticParse(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("AlarmMessageObjectPushType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short variableSpec = + readConstField( + "variableSpec", + readUnsignedShort(readBuffer, 8), + AlarmMessageObjectPushType.VARIABLESPEC); + + short lengthSpec = readSimpleField("lengthSpec", readUnsignedShort(readBuffer, 8)); + + SyntaxIdType syntaxId = + readEnumField( + "syntaxId", + "SyntaxIdType", + new DataReaderEnumDefault<>( + SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); + + short numberOfValues = readSimpleField("numberOfValues", readUnsignedShort(readBuffer, 8)); + + long eventId = readSimpleField("eventId", readUnsignedLong(readBuffer, 32)); + + State eventState = + readSimpleField( + "eventState", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + State localState = + readSimpleField( + "localState", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + State ackStateGoing = + readSimpleField( + "ackStateGoing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + State ackStateComing = + readSimpleField( + "ackStateComing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + List AssociatedValues = + readCountArrayField( + "AssociatedValues", + new DataReaderComplexDefault<>( + () -> AssociatedValueType.staticParse(readBuffer), readBuffer), + numberOfValues); + + readBuffer.closeContext("AlarmMessageObjectPushType"); + // Create the instance + AlarmMessageObjectPushType _alarmMessageObjectPushType; + _alarmMessageObjectPushType = + new AlarmMessageObjectPushType( + lengthSpec, + syntaxId, + numberOfValues, + eventId, + eventState, + localState, + ackStateGoing, + ackStateComing, + AssociatedValues); + return _alarmMessageObjectPushType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageObjectPushType)) { + return false; + } + AlarmMessageObjectPushType that = (AlarmMessageObjectPushType) o; + return (getLengthSpec() == that.getLengthSpec()) + && (getSyntaxId() == that.getSyntaxId()) + && (getNumberOfValues() == that.getNumberOfValues()) + && (getEventId() == that.getEventId()) + && (getEventState() == that.getEventState()) + && (getLocalState() == that.getLocalState()) + && (getAckStateGoing() == that.getAckStateGoing()) + && (getAckStateComing() == that.getAckStateComing()) + && (getAssociatedValues() == that.getAssociatedValues()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getLengthSpec(), + getSyntaxId(), + getNumberOfValues(), + getEventId(), + getEventState(), + getLocalState(), + getAckStateGoing(), + getAckStateComing(), + getAssociatedValues()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java new file mode 100644 index 00000000000..7d931070da7 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageObjectQueryType.java @@ -0,0 +1,310 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageObjectQueryType implements Message { + + // Constant values. + public static final Short VARIABLESPEC = 0x12; + + // Properties. + protected final short lengthDataset; + protected final State eventState; + protected final State ackStateGoing; + protected final State ackStateComing; + protected final DateAndTime timeComing; + protected final AssociatedValueType valueComing; + protected final DateAndTime timeGoing; + protected final AssociatedValueType valueGoing; + + public AlarmMessageObjectQueryType( + short lengthDataset, + State eventState, + State ackStateGoing, + State ackStateComing, + DateAndTime timeComing, + AssociatedValueType valueComing, + DateAndTime timeGoing, + AssociatedValueType valueGoing) { + super(); + this.lengthDataset = lengthDataset; + this.eventState = eventState; + this.ackStateGoing = ackStateGoing; + this.ackStateComing = ackStateComing; + this.timeComing = timeComing; + this.valueComing = valueComing; + this.timeGoing = timeGoing; + this.valueGoing = valueGoing; + } + + public short getLengthDataset() { + return lengthDataset; + } + + public State getEventState() { + return eventState; + } + + public State getAckStateGoing() { + return ackStateGoing; + } + + public State getAckStateComing() { + return ackStateComing; + } + + public DateAndTime getTimeComing() { + return timeComing; + } + + public AssociatedValueType getValueComing() { + return valueComing; + } + + public DateAndTime getTimeGoing() { + return timeGoing; + } + + public AssociatedValueType getValueGoing() { + return valueGoing; + } + + public short getVariableSpec() { + return VARIABLESPEC; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageObjectQueryType"); + + // Simple Field (lengthDataset) + writeSimpleField("lengthDataset", lengthDataset, writeUnsignedShort(writeBuffer, 8)); + + // Reserved Field (reserved) + writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16)); + + // Const Field (variableSpec) + writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (eventState) + writeSimpleField("eventState", eventState, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (ackStateGoing) + writeSimpleField("ackStateGoing", ackStateGoing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (ackStateComing) + writeSimpleField("ackStateComing", ackStateComing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (timeComing) + writeSimpleField("timeComing", timeComing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (valueComing) + writeSimpleField("valueComing", valueComing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (timeGoing) + writeSimpleField("timeGoing", timeGoing, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (valueGoing) + writeSimpleField("valueGoing", valueGoing, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("AlarmMessageObjectQueryType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageObjectQueryType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (lengthDataset) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 16; + + // Const Field (variableSpec) + lengthInBits += 8; + + // Simple field (eventState) + lengthInBits += eventState.getLengthInBits(); + + // Simple field (ackStateGoing) + lengthInBits += ackStateGoing.getLengthInBits(); + + // Simple field (ackStateComing) + lengthInBits += ackStateComing.getLengthInBits(); + + // Simple field (timeComing) + lengthInBits += timeComing.getLengthInBits(); + + // Simple field (valueComing) + lengthInBits += valueComing.getLengthInBits(); + + // Simple field (timeGoing) + lengthInBits += timeGoing.getLengthInBits(); + + // Simple field (valueGoing) + lengthInBits += valueGoing.getLengthInBits(); + + return lengthInBits; + } + + public static AlarmMessageObjectQueryType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageObjectQueryType staticParse(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("AlarmMessageObjectQueryType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short lengthDataset = readSimpleField("lengthDataset", readUnsignedShort(readBuffer, 8)); + + Integer reservedField0 = + readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000); + + short variableSpec = + readConstField( + "variableSpec", + readUnsignedShort(readBuffer, 8), + AlarmMessageObjectQueryType.VARIABLESPEC); + + State eventState = + readSimpleField( + "eventState", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + State ackStateGoing = + readSimpleField( + "ackStateGoing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + State ackStateComing = + readSimpleField( + "ackStateComing", + new DataReaderComplexDefault<>(() -> State.staticParse(readBuffer), readBuffer)); + + DateAndTime timeComing = + readSimpleField( + "timeComing", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + AssociatedValueType valueComing = + readSimpleField( + "valueComing", + new DataReaderComplexDefault<>( + () -> AssociatedValueType.staticParse(readBuffer), readBuffer)); + + DateAndTime timeGoing = + readSimpleField( + "timeGoing", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + AssociatedValueType valueGoing = + readSimpleField( + "valueGoing", + new DataReaderComplexDefault<>( + () -> AssociatedValueType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("AlarmMessageObjectQueryType"); + // Create the instance + AlarmMessageObjectQueryType _alarmMessageObjectQueryType; + _alarmMessageObjectQueryType = + new AlarmMessageObjectQueryType( + lengthDataset, + eventState, + ackStateGoing, + ackStateComing, + timeComing, + valueComing, + timeGoing, + valueGoing); + return _alarmMessageObjectQueryType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageObjectQueryType)) { + return false; + } + AlarmMessageObjectQueryType that = (AlarmMessageObjectQueryType) o; + return (getLengthDataset() == that.getLengthDataset()) + && (getEventState() == that.getEventState()) + && (getAckStateGoing() == that.getAckStateGoing()) + && (getAckStateComing() == that.getAckStateComing()) + && (getTimeComing() == that.getTimeComing()) + && (getValueComing() == that.getValueComing()) + && (getTimeGoing() == that.getTimeGoing()) + && (getValueGoing() == that.getValueGoing()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getLengthDataset(), + getEventState(), + getAckStateGoing(), + getAckStateComing(), + getTimeComing(), + getValueComing(), + getTimeGoing(), + getValueGoing()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java new file mode 100644 index 00000000000..a6b578a1e97 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessagePushType.java @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessagePushType implements Message { + + // Properties. + protected final DateAndTime TimeStamp; + protected final short functionId; + protected final short numberOfObjects; + protected final List messageObjects; + + public AlarmMessagePushType( + DateAndTime TimeStamp, + short functionId, + short numberOfObjects, + List messageObjects) { + super(); + this.TimeStamp = TimeStamp; + this.functionId = functionId; + this.numberOfObjects = numberOfObjects; + this.messageObjects = messageObjects; + } + + public DateAndTime getTimeStamp() { + return TimeStamp; + } + + public short getFunctionId() { + return functionId; + } + + public short getNumberOfObjects() { + return numberOfObjects; + } + + public List getMessageObjects() { + return messageObjects; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessagePushType"); + + // Simple Field (TimeStamp) + writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (functionId) + writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (numberOfObjects) + writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (messageObjects) + writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); + + writeBuffer.popContext("AlarmMessagePushType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessagePushType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (TimeStamp) + lengthInBits += TimeStamp.getLengthInBits(); + + // Simple field (functionId) + lengthInBits += 8; + + // Simple field (numberOfObjects) + lengthInBits += 8; + + // Array field + if (messageObjects != null) { + int i = 0; + for (AlarmMessageObjectPushType element : messageObjects) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static AlarmMessagePushType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessagePushType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("AlarmMessagePushType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DateAndTime TimeStamp = + readSimpleField( + "TimeStamp", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); + + short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + List messageObjects = + readCountArrayField( + "messageObjects", + new DataReaderComplexDefault<>( + () -> AlarmMessageObjectPushType.staticParse(readBuffer), readBuffer), + numberOfObjects); + + readBuffer.closeContext("AlarmMessagePushType"); + // Create the instance + AlarmMessagePushType _alarmMessagePushType; + _alarmMessagePushType = + new AlarmMessagePushType(TimeStamp, functionId, numberOfObjects, messageObjects); + return _alarmMessagePushType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessagePushType)) { + return false; + } + AlarmMessagePushType that = (AlarmMessagePushType) o; + return (getTimeStamp() == that.getTimeStamp()) + && (getFunctionId() == that.getFunctionId()) + && (getNumberOfObjects() == that.getNumberOfObjects()) + && (getMessageObjects() == that.getMessageObjects()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getTimeStamp(), getFunctionId(), getNumberOfObjects(), getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java new file mode 100644 index 00000000000..53eddc50a4d --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmMessageQueryType.java @@ -0,0 +1,252 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AlarmMessageQueryType implements Message { + + // Constant values. + public static final Integer DATALENGTH = 0xFFFF; + + // Properties. + protected final short functionId; + protected final short numberOfObjects; + protected final DataTransportErrorCode returnCode; + protected final DataTransportSize transportSize; + protected final List messageObjects; + + public AlarmMessageQueryType( + short functionId, + short numberOfObjects, + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + List messageObjects) { + super(); + this.functionId = functionId; + this.numberOfObjects = numberOfObjects; + this.returnCode = returnCode; + this.transportSize = transportSize; + this.messageObjects = messageObjects; + } + + public short getFunctionId() { + return functionId; + } + + public short getNumberOfObjects() { + return numberOfObjects; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public DataTransportSize getTransportSize() { + return transportSize; + } + + public List getMessageObjects() { + return messageObjects; + } + + public int getDataLength() { + return DATALENGTH; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AlarmMessageQueryType"); + + // Simple Field (functionId) + writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (numberOfObjects) + writeSimpleField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (transportSize) + writeSimpleEnumField( + "transportSize", + "DataTransportSize", + transportSize, + new DataWriterEnumDefault<>( + DataTransportSize::getValue, + DataTransportSize::name, + writeUnsignedShort(writeBuffer, 8))); + + // Const Field (DataLength) + writeConstField("DataLength", DATALENGTH, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (messageObjects) + writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); + + writeBuffer.popContext("AlarmMessageQueryType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AlarmMessageQueryType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (functionId) + lengthInBits += 8; + + // Simple field (numberOfObjects) + lengthInBits += 8; + + // Simple field (returnCode) + lengthInBits += 8; + + // Simple field (transportSize) + lengthInBits += 8; + + // Const Field (DataLength) + lengthInBits += 16; + + // Array field + if (messageObjects != null) { + int i = 0; + for (AlarmMessageObjectQueryType element : messageObjects) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static AlarmMessageQueryType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AlarmMessageQueryType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("AlarmMessageQueryType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); + + short numberOfObjects = readSimpleField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + DataTransportSize transportSize = + readEnumField( + "transportSize", + "DataTransportSize", + new DataReaderEnumDefault<>( + DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + int DataLength = + readConstField( + "DataLength", readUnsignedInt(readBuffer, 16), AlarmMessageQueryType.DATALENGTH); + + List messageObjects = + readCountArrayField( + "messageObjects", + new DataReaderComplexDefault<>( + () -> AlarmMessageObjectQueryType.staticParse(readBuffer), readBuffer), + numberOfObjects); + + readBuffer.closeContext("AlarmMessageQueryType"); + // Create the instance + AlarmMessageQueryType _alarmMessageQueryType; + _alarmMessageQueryType = + new AlarmMessageQueryType( + functionId, numberOfObjects, returnCode, transportSize, messageObjects); + return _alarmMessageQueryType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AlarmMessageQueryType)) { + return false; + } + AlarmMessageQueryType that = (AlarmMessageQueryType) o; + return (getFunctionId() == that.getFunctionId()) + && (getNumberOfObjects() == that.getNumberOfObjects()) + && (getReturnCode() == that.getReturnCode()) + && (getTransportSize() == that.getTransportSize()) + && (getMessageObjects() == that.getMessageObjects()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getFunctionId(), + getNumberOfObjects(), + getReturnCode(), + getTransportSize(), + getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java new file mode 100644 index 00000000000..5a038892956 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmStateType.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum AlarmStateType { + SCAN_ABORT((short) 0x00), + SCAN_INITIATE((short) 0x01), + ALARM_ABORT((short) 0x04), + ALARM_INITIATE((short) 0x05), + ALARM_S_ABORT((short) 0x08), + ALARM_S_INITIATE((short) 0x09); + private static final Map map; + + static { + map = new HashMap<>(); + for (AlarmStateType value : AlarmStateType.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + AlarmStateType(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static AlarmStateType enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java new file mode 100644 index 00000000000..3693907d2a4 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AlarmType.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum AlarmType { + SCAN((short) 0x01), + ALARM_8((short) 0x02), + ALARM_S((short) 0x04); + private static final Map map; + + static { + map = new HashMap<>(); + for (AlarmType value : AlarmType.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + AlarmType(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static AlarmType enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java new file mode 100644 index 00000000000..9f7a355161d --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedQueryValueType.java @@ -0,0 +1,204 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AssociatedQueryValueType implements Message { + + // Properties. + protected final DataTransportErrorCode returnCode; + protected final DataTransportSize transportSize; + protected final int valueLength; + protected final List data; + + public AssociatedQueryValueType( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int valueLength, + List data) { + super(); + this.returnCode = returnCode; + this.transportSize = transportSize; + this.valueLength = valueLength; + this.data = data; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public DataTransportSize getTransportSize() { + return transportSize; + } + + public int getValueLength() { + return valueLength; + } + + public List getData() { + return data; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AssociatedQueryValueType"); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (transportSize) + writeSimpleEnumField( + "transportSize", + "DataTransportSize", + transportSize, + new DataWriterEnumDefault<>( + DataTransportSize::getValue, + DataTransportSize::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (valueLength) + writeSimpleField("valueLength", valueLength, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (data) + writeSimpleTypeArrayField("data", data, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("AssociatedQueryValueType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AssociatedQueryValueType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (returnCode) + lengthInBits += 8; + + // Simple field (transportSize) + lengthInBits += 8; + + // Simple field (valueLength) + lengthInBits += 16; + + // Array field + if (data != null) { + lengthInBits += 8 * data.size(); + } + + return lengthInBits; + } + + public static AssociatedQueryValueType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AssociatedQueryValueType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("AssociatedQueryValueType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + DataTransportSize transportSize = + readEnumField( + "transportSize", + "DataTransportSize", + new DataReaderEnumDefault<>( + DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + int valueLength = readSimpleField("valueLength", readUnsignedInt(readBuffer, 16)); + + List data = readCountArrayField("data", readUnsignedShort(readBuffer, 8), valueLength); + + readBuffer.closeContext("AssociatedQueryValueType"); + // Create the instance + AssociatedQueryValueType _associatedQueryValueType; + _associatedQueryValueType = + new AssociatedQueryValueType(returnCode, transportSize, valueLength, data); + return _associatedQueryValueType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AssociatedQueryValueType)) { + return false; + } + AssociatedQueryValueType that = (AssociatedQueryValueType) o; + return (getReturnCode() == that.getReturnCode()) + && (getTransportSize() == that.getTransportSize()) + && (getValueLength() == that.getValueLength()) + && (getData() == that.getData()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getReturnCode(), getTransportSize(), getValueLength(), getData()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java new file mode 100644 index 00000000000..d3807cd3865 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/AssociatedValueType.java @@ -0,0 +1,220 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class AssociatedValueType implements Message { + + // Properties. + protected final DataTransportErrorCode returnCode; + protected final DataTransportSize transportSize; + protected final int valueLength; + protected final List data; + + public AssociatedValueType( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int valueLength, + List data) { + super(); + this.returnCode = returnCode; + this.transportSize = transportSize; + this.valueLength = valueLength; + this.data = data; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public DataTransportSize getTransportSize() { + return transportSize; + } + + public int getValueLength() { + return valueLength; + } + + public List getData() { + return data; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("AssociatedValueType"); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (transportSize) + writeSimpleEnumField( + "transportSize", + "DataTransportSize", + transportSize, + new DataWriterEnumDefault<>( + DataTransportSize::getValue, + DataTransportSize::name, + writeUnsignedShort(writeBuffer, 8))); + + // Manual Field (valueLength) + writeManualField( + "valueLength", + () -> + org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.LeftShift3( + writeBuffer, valueLength), + writeBuffer); + + // Array Field (data) + writeSimpleTypeArrayField("data", data, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("AssociatedValueType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + AssociatedValueType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (returnCode) + lengthInBits += 8; + + // Simple field (transportSize) + lengthInBits += 8; + + // Manual Field (valueLength) + lengthInBits += 2; + + // Array field + if (data != null) { + lengthInBits += 8 * data.size(); + } + + return lengthInBits; + } + + public static AssociatedValueType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static AssociatedValueType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("AssociatedValueType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + DataTransportSize transportSize = + readEnumField( + "transportSize", + "DataTransportSize", + new DataReaderEnumDefault<>( + DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + int valueLength = + readManualField( + "valueLength", + readBuffer, + () -> + (int) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.RightShift3( + readBuffer, transportSize))); + + List data = + readCountArrayField( + "data", + readUnsignedShort(readBuffer, 8), + org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.EventItemLength( + readBuffer, valueLength)); + + readBuffer.closeContext("AssociatedValueType"); + // Create the instance + AssociatedValueType _associatedValueType; + _associatedValueType = new AssociatedValueType(returnCode, transportSize, valueLength, data); + return _associatedValueType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof AssociatedValueType)) { + return false; + } + AssociatedValueType that = (AssociatedValueType) o; + return (getReturnCode() == that.getReturnCode()) + && (getTransportSize() == that.getTransportSize()) + && (getValueLength() == that.getValueLength()) + && (getData() == that.getData()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getReturnCode(), getTransportSize(), getValueLength(), getData()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java new file mode 100644 index 00000000000..6d4f3cd49ba --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacket.java @@ -0,0 +1,238 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class COTPPacket implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getTpduCode(); + + // Properties. + protected final List parameters; + protected final S7Message payload; + + public COTPPacket(List parameters, S7Message payload) { + super(); + this.parameters = parameters; + this.payload = payload; + } + + public List getParameters() { + return parameters; + } + + public S7Message getPayload() { + return payload; + } + + protected abstract void serializeCOTPPacketChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + int startPos = positionAware.getPos(); + writeBuffer.pushContext("COTPPacket"); + + // Implicit Field (headerLength) (Used for parsing, but its value is not stored as it's + // implicitly given by the objects content) + short headerLength = + (short) + ((getLengthInBytes()) + - ((((((((getPayload()) != (null))) ? getPayload().getLengthInBytes() : 0))) + + (1)))); + writeImplicitField("headerLength", headerLength, writeUnsignedShort(writeBuffer, 8)); + + // Discriminator Field (tpduCode) (Used as input to a switch field) + writeDiscriminatorField("tpduCode", getTpduCode(), writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeCOTPPacketChild(writeBuffer); + + // Array Field (parameters) + writeComplexTypeArrayField("parameters", parameters, writeBuffer); + + // Optional Field (payload) (Can be skipped, if the value is null) + writeOptionalField("payload", payload, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("COTPPacket"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + COTPPacket _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Implicit Field (headerLength) + lengthInBits += 8; + + // Discriminator Field (tpduCode) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + // Array field + if (parameters != null) { + for (Message element : parameters) { + lengthInBits += element.getLengthInBits(); + } + } + + // Optional Field (payload) + if (payload != null) { + lengthInBits += payload.getLengthInBits(); + } + + return lengthInBits; + } + + public static COTPPacket staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + if ((args == null) || (args.length != 1)) { + throw new PlcRuntimeException( + "Wrong number of arguments, expected 1, but got " + args.length); + } + Integer cotpLen; + if (args[0] instanceof Integer) { + cotpLen = (Integer) args[0]; + } else if (args[0] instanceof String) { + cotpLen = Integer.valueOf((String) args[0]); + } else { + throw new PlcRuntimeException( + "Argument 0 expected to be of type Integer or a string which is parseable but was " + + args[0].getClass().getName()); + } + return staticParse(readBuffer, cotpLen); + } + + public static COTPPacket staticParse(ReadBuffer readBuffer, Integer cotpLen) + throws ParseException { + readBuffer.pullContext("COTPPacket"); + PositionAware positionAware = readBuffer; + int startPos = positionAware.getPos(); + int curPos; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short headerLength = readImplicitField("headerLength", readUnsignedShort(readBuffer, 8)); + + short tpduCode = readDiscriminatorField("tpduCode", readUnsignedShort(readBuffer, 8)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + COTPPacketBuilder builder = null; + if (EvaluationHelper.equals(tpduCode, (short) 0xF0)) { + builder = COTPPacketData.staticParseCOTPPacketBuilder(readBuffer, cotpLen); + } else if (EvaluationHelper.equals(tpduCode, (short) 0xE0)) { + builder = COTPPacketConnectionRequest.staticParseCOTPPacketBuilder(readBuffer, cotpLen); + } else if (EvaluationHelper.equals(tpduCode, (short) 0xD0)) { + builder = COTPPacketConnectionResponse.staticParseCOTPPacketBuilder(readBuffer, cotpLen); + } else if (EvaluationHelper.equals(tpduCode, (short) 0x80)) { + builder = COTPPacketDisconnectRequest.staticParseCOTPPacketBuilder(readBuffer, cotpLen); + } else if (EvaluationHelper.equals(tpduCode, (short) 0xC0)) { + builder = COTPPacketDisconnectResponse.staticParseCOTPPacketBuilder(readBuffer, cotpLen); + } else if (EvaluationHelper.equals(tpduCode, (short) 0x70)) { + builder = COTPPacketTpduError.staticParseCOTPPacketBuilder(readBuffer, cotpLen); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "tpduCode=" + + tpduCode + + "]"); + } + + List parameters = + readLengthArrayField( + "parameters", + new DataReaderComplexDefault<>( + () -> + COTPParameter.staticParse( + readBuffer, + (short) ((((headerLength) + (1))) - ((positionAware.getPos() - startPos)))), + readBuffer), + (((headerLength) + (1))) - ((positionAware.getPos() - startPos))); + + S7Message payload = + readOptionalField( + "payload", + new DataReaderComplexDefault<>(() -> S7Message.staticParse(readBuffer), readBuffer), + ((positionAware.getPos() - startPos)) < (cotpLen)); + + readBuffer.closeContext("COTPPacket"); + // Create the instance + COTPPacket _cOTPPacket = builder.build(parameters, payload); + return _cOTPPacket; + } + + public interface COTPPacketBuilder { + COTPPacket build(List parameters, S7Message payload); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPPacket)) { + return false; + } + COTPPacket that = (COTPPacket) o; + return (getParameters() == that.getParameters()) && (getPayload() == that.getPayload()) && true; + } + + @Override + public int hashCode() { + return Objects.hash(getParameters(), getPayload()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java new file mode 100644 index 00000000000..f5c7bb10507 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionRequest.java @@ -0,0 +1,200 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPPacketConnectionRequest extends COTPPacket implements Message { + + // Accessors for discriminator values. + public Short getTpduCode() { + return (short) 0xE0; + } + + // Properties. + protected final int destinationReference; + protected final int sourceReference; + protected final COTPProtocolClass protocolClass; + + public COTPPacketConnectionRequest( + List parameters, + S7Message payload, + int destinationReference, + int sourceReference, + COTPProtocolClass protocolClass) { + super(parameters, payload); + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + this.protocolClass = protocolClass; + } + + public int getDestinationReference() { + return destinationReference; + } + + public int getSourceReference() { + return sourceReference; + } + + public COTPProtocolClass getProtocolClass() { + return protocolClass; + } + + @Override + protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPPacketConnectionRequest"); + + // Simple Field (destinationReference) + writeSimpleField( + "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (sourceReference) + writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (protocolClass) + writeSimpleEnumField( + "protocolClass", + "COTPProtocolClass", + protocolClass, + new DataWriterEnumDefault<>( + COTPProtocolClass::getValue, + COTPProtocolClass::name, + writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("COTPPacketConnectionRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPPacketConnectionRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (destinationReference) + lengthInBits += 16; + + // Simple field (sourceReference) + lengthInBits += 16; + + // Simple field (protocolClass) + lengthInBits += 8; + + return lengthInBits; + } + + public static COTPPacketBuilder staticParseCOTPPacketBuilder( + ReadBuffer readBuffer, Integer cotpLen) throws ParseException { + readBuffer.pullContext("COTPPacketConnectionRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int destinationReference = + readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); + + int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); + + COTPProtocolClass protocolClass = + readEnumField( + "protocolClass", + "COTPProtocolClass", + new DataReaderEnumDefault<>( + COTPProtocolClass::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("COTPPacketConnectionRequest"); + // Create the instance + return new COTPPacketConnectionRequestBuilderImpl( + destinationReference, sourceReference, protocolClass); + } + + public static class COTPPacketConnectionRequestBuilderImpl + implements COTPPacket.COTPPacketBuilder { + private final int destinationReference; + private final int sourceReference; + private final COTPProtocolClass protocolClass; + + public COTPPacketConnectionRequestBuilderImpl( + int destinationReference, int sourceReference, COTPProtocolClass protocolClass) { + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + this.protocolClass = protocolClass; + } + + public COTPPacketConnectionRequest build(List parameters, S7Message payload) { + COTPPacketConnectionRequest cOTPPacketConnectionRequest = + new COTPPacketConnectionRequest( + parameters, payload, destinationReference, sourceReference, protocolClass); + return cOTPPacketConnectionRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPPacketConnectionRequest)) { + return false; + } + COTPPacketConnectionRequest that = (COTPPacketConnectionRequest) o; + return (getDestinationReference() == that.getDestinationReference()) + && (getSourceReference() == that.getSourceReference()) + && (getProtocolClass() == that.getProtocolClass()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), getDestinationReference(), getSourceReference(), getProtocolClass()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java new file mode 100644 index 00000000000..1d64fa5fa2e --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketConnectionResponse.java @@ -0,0 +1,200 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPPacketConnectionResponse extends COTPPacket implements Message { + + // Accessors for discriminator values. + public Short getTpduCode() { + return (short) 0xD0; + } + + // Properties. + protected final int destinationReference; + protected final int sourceReference; + protected final COTPProtocolClass protocolClass; + + public COTPPacketConnectionResponse( + List parameters, + S7Message payload, + int destinationReference, + int sourceReference, + COTPProtocolClass protocolClass) { + super(parameters, payload); + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + this.protocolClass = protocolClass; + } + + public int getDestinationReference() { + return destinationReference; + } + + public int getSourceReference() { + return sourceReference; + } + + public COTPProtocolClass getProtocolClass() { + return protocolClass; + } + + @Override + protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPPacketConnectionResponse"); + + // Simple Field (destinationReference) + writeSimpleField( + "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (sourceReference) + writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (protocolClass) + writeSimpleEnumField( + "protocolClass", + "COTPProtocolClass", + protocolClass, + new DataWriterEnumDefault<>( + COTPProtocolClass::getValue, + COTPProtocolClass::name, + writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("COTPPacketConnectionResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPPacketConnectionResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (destinationReference) + lengthInBits += 16; + + // Simple field (sourceReference) + lengthInBits += 16; + + // Simple field (protocolClass) + lengthInBits += 8; + + return lengthInBits; + } + + public static COTPPacketBuilder staticParseCOTPPacketBuilder( + ReadBuffer readBuffer, Integer cotpLen) throws ParseException { + readBuffer.pullContext("COTPPacketConnectionResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int destinationReference = + readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); + + int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); + + COTPProtocolClass protocolClass = + readEnumField( + "protocolClass", + "COTPProtocolClass", + new DataReaderEnumDefault<>( + COTPProtocolClass::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("COTPPacketConnectionResponse"); + // Create the instance + return new COTPPacketConnectionResponseBuilderImpl( + destinationReference, sourceReference, protocolClass); + } + + public static class COTPPacketConnectionResponseBuilderImpl + implements COTPPacket.COTPPacketBuilder { + private final int destinationReference; + private final int sourceReference; + private final COTPProtocolClass protocolClass; + + public COTPPacketConnectionResponseBuilderImpl( + int destinationReference, int sourceReference, COTPProtocolClass protocolClass) { + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + this.protocolClass = protocolClass; + } + + public COTPPacketConnectionResponse build(List parameters, S7Message payload) { + COTPPacketConnectionResponse cOTPPacketConnectionResponse = + new COTPPacketConnectionResponse( + parameters, payload, destinationReference, sourceReference, protocolClass); + return cOTPPacketConnectionResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPPacketConnectionResponse)) { + return false; + } + COTPPacketConnectionResponse that = (COTPPacketConnectionResponse) o; + return (getDestinationReference() == that.getDestinationReference()) + && (getSourceReference() == that.getSourceReference()) + && (getProtocolClass() == that.getProtocolClass()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), getDestinationReference(), getSourceReference(), getProtocolClass()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java new file mode 100644 index 00000000000..233483c1a72 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketData.java @@ -0,0 +1,159 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPPacketData extends COTPPacket implements Message { + + // Accessors for discriminator values. + public Short getTpduCode() { + return (short) 0xF0; + } + + // Properties. + protected final boolean eot; + protected final byte tpduRef; + + public COTPPacketData( + List parameters, S7Message payload, boolean eot, byte tpduRef) { + super(parameters, payload); + this.eot = eot; + this.tpduRef = tpduRef; + } + + public boolean getEot() { + return eot; + } + + public byte getTpduRef() { + return tpduRef; + } + + @Override + protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPPacketData"); + + // Simple Field (eot) + writeSimpleField("eot", eot, writeBoolean(writeBuffer)); + + // Simple Field (tpduRef) + writeSimpleField("tpduRef", tpduRef, writeUnsignedByte(writeBuffer, 7)); + + writeBuffer.popContext("COTPPacketData"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPPacketData _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (eot) + lengthInBits += 1; + + // Simple field (tpduRef) + lengthInBits += 7; + + return lengthInBits; + } + + public static COTPPacketBuilder staticParseCOTPPacketBuilder( + ReadBuffer readBuffer, Integer cotpLen) throws ParseException { + readBuffer.pullContext("COTPPacketData"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + boolean eot = readSimpleField("eot", readBoolean(readBuffer)); + + byte tpduRef = readSimpleField("tpduRef", readUnsignedByte(readBuffer, 7)); + + readBuffer.closeContext("COTPPacketData"); + // Create the instance + return new COTPPacketDataBuilderImpl(eot, tpduRef); + } + + public static class COTPPacketDataBuilderImpl implements COTPPacket.COTPPacketBuilder { + private final boolean eot; + private final byte tpduRef; + + public COTPPacketDataBuilderImpl(boolean eot, byte tpduRef) { + this.eot = eot; + this.tpduRef = tpduRef; + } + + public COTPPacketData build(List parameters, S7Message payload) { + COTPPacketData cOTPPacketData = new COTPPacketData(parameters, payload, eot, tpduRef); + return cOTPPacketData; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPPacketData)) { + return false; + } + COTPPacketData that = (COTPPacketData) o; + return (getEot() == that.getEot()) + && (getTpduRef() == that.getTpduRef()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getEot(), getTpduRef()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java new file mode 100644 index 00000000000..8c1ef73f6fd --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectRequest.java @@ -0,0 +1,200 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPPacketDisconnectRequest extends COTPPacket implements Message { + + // Accessors for discriminator values. + public Short getTpduCode() { + return (short) 0x80; + } + + // Properties. + protected final int destinationReference; + protected final int sourceReference; + protected final COTPProtocolClass protocolClass; + + public COTPPacketDisconnectRequest( + List parameters, + S7Message payload, + int destinationReference, + int sourceReference, + COTPProtocolClass protocolClass) { + super(parameters, payload); + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + this.protocolClass = protocolClass; + } + + public int getDestinationReference() { + return destinationReference; + } + + public int getSourceReference() { + return sourceReference; + } + + public COTPProtocolClass getProtocolClass() { + return protocolClass; + } + + @Override + protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPPacketDisconnectRequest"); + + // Simple Field (destinationReference) + writeSimpleField( + "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (sourceReference) + writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (protocolClass) + writeSimpleEnumField( + "protocolClass", + "COTPProtocolClass", + protocolClass, + new DataWriterEnumDefault<>( + COTPProtocolClass::getValue, + COTPProtocolClass::name, + writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("COTPPacketDisconnectRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPPacketDisconnectRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (destinationReference) + lengthInBits += 16; + + // Simple field (sourceReference) + lengthInBits += 16; + + // Simple field (protocolClass) + lengthInBits += 8; + + return lengthInBits; + } + + public static COTPPacketBuilder staticParseCOTPPacketBuilder( + ReadBuffer readBuffer, Integer cotpLen) throws ParseException { + readBuffer.pullContext("COTPPacketDisconnectRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int destinationReference = + readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); + + int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); + + COTPProtocolClass protocolClass = + readEnumField( + "protocolClass", + "COTPProtocolClass", + new DataReaderEnumDefault<>( + COTPProtocolClass::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("COTPPacketDisconnectRequest"); + // Create the instance + return new COTPPacketDisconnectRequestBuilderImpl( + destinationReference, sourceReference, protocolClass); + } + + public static class COTPPacketDisconnectRequestBuilderImpl + implements COTPPacket.COTPPacketBuilder { + private final int destinationReference; + private final int sourceReference; + private final COTPProtocolClass protocolClass; + + public COTPPacketDisconnectRequestBuilderImpl( + int destinationReference, int sourceReference, COTPProtocolClass protocolClass) { + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + this.protocolClass = protocolClass; + } + + public COTPPacketDisconnectRequest build(List parameters, S7Message payload) { + COTPPacketDisconnectRequest cOTPPacketDisconnectRequest = + new COTPPacketDisconnectRequest( + parameters, payload, destinationReference, sourceReference, protocolClass); + return cOTPPacketDisconnectRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPPacketDisconnectRequest)) { + return false; + } + COTPPacketDisconnectRequest that = (COTPPacketDisconnectRequest) o; + return (getDestinationReference() == that.getDestinationReference()) + && (getSourceReference() == that.getSourceReference()) + && (getProtocolClass() == that.getProtocolClass()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), getDestinationReference(), getSourceReference(), getProtocolClass()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java new file mode 100644 index 00000000000..90bae295940 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketDisconnectResponse.java @@ -0,0 +1,167 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPPacketDisconnectResponse extends COTPPacket implements Message { + + // Accessors for discriminator values. + public Short getTpduCode() { + return (short) 0xC0; + } + + // Properties. + protected final int destinationReference; + protected final int sourceReference; + + public COTPPacketDisconnectResponse( + List parameters, + S7Message payload, + int destinationReference, + int sourceReference) { + super(parameters, payload); + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + } + + public int getDestinationReference() { + return destinationReference; + } + + public int getSourceReference() { + return sourceReference; + } + + @Override + protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPPacketDisconnectResponse"); + + // Simple Field (destinationReference) + writeSimpleField( + "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (sourceReference) + writeSimpleField("sourceReference", sourceReference, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("COTPPacketDisconnectResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPPacketDisconnectResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (destinationReference) + lengthInBits += 16; + + // Simple field (sourceReference) + lengthInBits += 16; + + return lengthInBits; + } + + public static COTPPacketBuilder staticParseCOTPPacketBuilder( + ReadBuffer readBuffer, Integer cotpLen) throws ParseException { + readBuffer.pullContext("COTPPacketDisconnectResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int destinationReference = + readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); + + int sourceReference = readSimpleField("sourceReference", readUnsignedInt(readBuffer, 16)); + + readBuffer.closeContext("COTPPacketDisconnectResponse"); + // Create the instance + return new COTPPacketDisconnectResponseBuilderImpl(destinationReference, sourceReference); + } + + public static class COTPPacketDisconnectResponseBuilderImpl + implements COTPPacket.COTPPacketBuilder { + private final int destinationReference; + private final int sourceReference; + + public COTPPacketDisconnectResponseBuilderImpl(int destinationReference, int sourceReference) { + this.destinationReference = destinationReference; + this.sourceReference = sourceReference; + } + + public COTPPacketDisconnectResponse build(List parameters, S7Message payload) { + COTPPacketDisconnectResponse cOTPPacketDisconnectResponse = + new COTPPacketDisconnectResponse( + parameters, payload, destinationReference, sourceReference); + return cOTPPacketDisconnectResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPPacketDisconnectResponse)) { + return false; + } + COTPPacketDisconnectResponse that = (COTPPacketDisconnectResponse) o; + return (getDestinationReference() == that.getDestinationReference()) + && (getSourceReference() == that.getSourceReference()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getDestinationReference(), getSourceReference()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java new file mode 100644 index 00000000000..bb6c4ed3aa2 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPPacketTpduError.java @@ -0,0 +1,165 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPPacketTpduError extends COTPPacket implements Message { + + // Accessors for discriminator values. + public Short getTpduCode() { + return (short) 0x70; + } + + // Properties. + protected final int destinationReference; + protected final short rejectCause; + + public COTPPacketTpduError( + List parameters, + S7Message payload, + int destinationReference, + short rejectCause) { + super(parameters, payload); + this.destinationReference = destinationReference; + this.rejectCause = rejectCause; + } + + public int getDestinationReference() { + return destinationReference; + } + + public short getRejectCause() { + return rejectCause; + } + + @Override + protected void serializeCOTPPacketChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPPacketTpduError"); + + // Simple Field (destinationReference) + writeSimpleField( + "destinationReference", destinationReference, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (rejectCause) + writeSimpleField("rejectCause", rejectCause, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("COTPPacketTpduError"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPPacketTpduError _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (destinationReference) + lengthInBits += 16; + + // Simple field (rejectCause) + lengthInBits += 8; + + return lengthInBits; + } + + public static COTPPacketBuilder staticParseCOTPPacketBuilder( + ReadBuffer readBuffer, Integer cotpLen) throws ParseException { + readBuffer.pullContext("COTPPacketTpduError"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int destinationReference = + readSimpleField("destinationReference", readUnsignedInt(readBuffer, 16)); + + short rejectCause = readSimpleField("rejectCause", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("COTPPacketTpduError"); + // Create the instance + return new COTPPacketTpduErrorBuilderImpl(destinationReference, rejectCause); + } + + public static class COTPPacketTpduErrorBuilderImpl implements COTPPacket.COTPPacketBuilder { + private final int destinationReference; + private final short rejectCause; + + public COTPPacketTpduErrorBuilderImpl(int destinationReference, short rejectCause) { + this.destinationReference = destinationReference; + this.rejectCause = rejectCause; + } + + public COTPPacketTpduError build(List parameters, S7Message payload) { + COTPPacketTpduError cOTPPacketTpduError = + new COTPPacketTpduError(parameters, payload, destinationReference, rejectCause); + return cOTPPacketTpduError; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPPacketTpduError)) { + return false; + } + COTPPacketTpduError that = (COTPPacketTpduError) o; + return (getDestinationReference() == that.getDestinationReference()) + && (getRejectCause() == that.getRejectCause()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getDestinationReference(), getRejectCause()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java new file mode 100644 index 00000000000..d056c5f92fc --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameter.java @@ -0,0 +1,182 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class COTPParameter implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getParameterType(); + + public COTPParameter() { + super(); + } + + protected abstract void serializeCOTPParameterChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPParameter"); + + // Discriminator Field (parameterType) (Used as input to a switch field) + writeDiscriminatorField( + "parameterType", getParameterType(), writeUnsignedShort(writeBuffer, 8)); + + // Implicit Field (parameterLength) (Used for parsing, but its value is not stored as it's + // implicitly given by the objects content) + short parameterLength = (short) ((getLengthInBytes()) - (2)); + writeImplicitField("parameterLength", parameterLength, writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeCOTPParameterChild(writeBuffer); + + writeBuffer.popContext("COTPParameter"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + COTPParameter _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Discriminator Field (parameterType) + lengthInBits += 8; + + // Implicit Field (parameterLength) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static COTPParameter staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + if ((args == null) || (args.length != 1)) { + throw new PlcRuntimeException( + "Wrong number of arguments, expected 1, but got " + args.length); + } + Short rest; + if (args[0] instanceof Short) { + rest = (Short) args[0]; + } else if (args[0] instanceof String) { + rest = Short.valueOf((String) args[0]); + } else { + throw new PlcRuntimeException( + "Argument 0 expected to be of type Short or a string which is parseable but was " + + args[0].getClass().getName()); + } + return staticParse(readBuffer, rest); + } + + public static COTPParameter staticParse(ReadBuffer readBuffer, Short rest) throws ParseException { + readBuffer.pullContext("COTPParameter"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short parameterType = readDiscriminatorField("parameterType", readUnsignedShort(readBuffer, 8)); + + short parameterLength = readImplicitField("parameterLength", readUnsignedShort(readBuffer, 8)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + COTPParameterBuilder builder = null; + if (EvaluationHelper.equals(parameterType, (short) 0xC0)) { + builder = COTPParameterTpduSize.staticParseCOTPParameterBuilder(readBuffer, rest); + } else if (EvaluationHelper.equals(parameterType, (short) 0xC1)) { + builder = COTPParameterCallingTsap.staticParseCOTPParameterBuilder(readBuffer, rest); + } else if (EvaluationHelper.equals(parameterType, (short) 0xC2)) { + builder = COTPParameterCalledTsap.staticParseCOTPParameterBuilder(readBuffer, rest); + } else if (EvaluationHelper.equals(parameterType, (short) 0xC3)) { + builder = COTPParameterChecksum.staticParseCOTPParameterBuilder(readBuffer, rest); + } else if (EvaluationHelper.equals(parameterType, (short) 0xE0)) { + builder = + COTPParameterDisconnectAdditionalInformation.staticParseCOTPParameterBuilder( + readBuffer, rest); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "parameterType=" + + parameterType + + "]"); + } + + readBuffer.closeContext("COTPParameter"); + // Create the instance + COTPParameter _cOTPParameter = builder.build(); + return _cOTPParameter; + } + + public interface COTPParameterBuilder { + COTPParameter build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPParameter)) { + return false; + } + COTPParameter that = (COTPParameter) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java new file mode 100644 index 00000000000..154495f6808 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCalledTsap.java @@ -0,0 +1,141 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPParameterCalledTsap extends COTPParameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0xC2; + } + + // Properties. + protected final int tsapId; + + public COTPParameterCalledTsap(int tsapId) { + super(); + this.tsapId = tsapId; + } + + public int getTsapId() { + return tsapId; + } + + @Override + protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPParameterCalledTsap"); + + // Simple Field (tsapId) + writeSimpleField("tsapId", tsapId, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("COTPParameterCalledTsap"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPParameterCalledTsap _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (tsapId) + lengthInBits += 16; + + return lengthInBits; + } + + public static COTPParameterBuilder staticParseCOTPParameterBuilder( + ReadBuffer readBuffer, Short rest) throws ParseException { + readBuffer.pullContext("COTPParameterCalledTsap"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int tsapId = readSimpleField("tsapId", readUnsignedInt(readBuffer, 16)); + + readBuffer.closeContext("COTPParameterCalledTsap"); + // Create the instance + return new COTPParameterCalledTsapBuilderImpl(tsapId); + } + + public static class COTPParameterCalledTsapBuilderImpl + implements COTPParameter.COTPParameterBuilder { + private final int tsapId; + + public COTPParameterCalledTsapBuilderImpl(int tsapId) { + this.tsapId = tsapId; + } + + public COTPParameterCalledTsap build() { + COTPParameterCalledTsap cOTPParameterCalledTsap = new COTPParameterCalledTsap(tsapId); + return cOTPParameterCalledTsap; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPParameterCalledTsap)) { + return false; + } + COTPParameterCalledTsap that = (COTPParameterCalledTsap) o; + return (getTsapId() == that.getTsapId()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getTsapId()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java new file mode 100644 index 00000000000..b61845ae97a --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterCallingTsap.java @@ -0,0 +1,141 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPParameterCallingTsap extends COTPParameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0xC1; + } + + // Properties. + protected final int tsapId; + + public COTPParameterCallingTsap(int tsapId) { + super(); + this.tsapId = tsapId; + } + + public int getTsapId() { + return tsapId; + } + + @Override + protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPParameterCallingTsap"); + + // Simple Field (tsapId) + writeSimpleField("tsapId", tsapId, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("COTPParameterCallingTsap"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPParameterCallingTsap _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (tsapId) + lengthInBits += 16; + + return lengthInBits; + } + + public static COTPParameterBuilder staticParseCOTPParameterBuilder( + ReadBuffer readBuffer, Short rest) throws ParseException { + readBuffer.pullContext("COTPParameterCallingTsap"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int tsapId = readSimpleField("tsapId", readUnsignedInt(readBuffer, 16)); + + readBuffer.closeContext("COTPParameterCallingTsap"); + // Create the instance + return new COTPParameterCallingTsapBuilderImpl(tsapId); + } + + public static class COTPParameterCallingTsapBuilderImpl + implements COTPParameter.COTPParameterBuilder { + private final int tsapId; + + public COTPParameterCallingTsapBuilderImpl(int tsapId) { + this.tsapId = tsapId; + } + + public COTPParameterCallingTsap build() { + COTPParameterCallingTsap cOTPParameterCallingTsap = new COTPParameterCallingTsap(tsapId); + return cOTPParameterCallingTsap; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPParameterCallingTsap)) { + return false; + } + COTPParameterCallingTsap that = (COTPParameterCallingTsap) o; + return (getTsapId() == that.getTsapId()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getTsapId()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java new file mode 100644 index 00000000000..bfa89f0ff1e --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterChecksum.java @@ -0,0 +1,141 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPParameterChecksum extends COTPParameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0xC3; + } + + // Properties. + protected final short crc; + + public COTPParameterChecksum(short crc) { + super(); + this.crc = crc; + } + + public short getCrc() { + return crc; + } + + @Override + protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPParameterChecksum"); + + // Simple Field (crc) + writeSimpleField("crc", crc, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("COTPParameterChecksum"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPParameterChecksum _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (crc) + lengthInBits += 8; + + return lengthInBits; + } + + public static COTPParameterBuilder staticParseCOTPParameterBuilder( + ReadBuffer readBuffer, Short rest) throws ParseException { + readBuffer.pullContext("COTPParameterChecksum"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short crc = readSimpleField("crc", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("COTPParameterChecksum"); + // Create the instance + return new COTPParameterChecksumBuilderImpl(crc); + } + + public static class COTPParameterChecksumBuilderImpl + implements COTPParameter.COTPParameterBuilder { + private final short crc; + + public COTPParameterChecksumBuilderImpl(short crc) { + this.crc = crc; + } + + public COTPParameterChecksum build() { + COTPParameterChecksum cOTPParameterChecksum = new COTPParameterChecksum(crc); + return cOTPParameterChecksum; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPParameterChecksum)) { + return false; + } + COTPParameterChecksum that = (COTPParameterChecksum) o; + return (getCrc() == that.getCrc()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getCrc()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java new file mode 100644 index 00000000000..9846b0517fe --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterDisconnectAdditionalInformation.java @@ -0,0 +1,145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPParameterDisconnectAdditionalInformation extends COTPParameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0xE0; + } + + // Properties. + protected final byte[] data; + + public COTPParameterDisconnectAdditionalInformation(byte[] data) { + super(); + this.data = data; + } + + public byte[] getData() { + return data; + } + + @Override + protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPParameterDisconnectAdditionalInformation"); + + // Array Field (data) + writeByteArrayField("data", data, writeByteArray(writeBuffer, 8)); + + writeBuffer.popContext("COTPParameterDisconnectAdditionalInformation"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPParameterDisconnectAdditionalInformation _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Array field + if (data != null) { + lengthInBits += 8 * data.length; + } + + return lengthInBits; + } + + public static COTPParameterBuilder staticParseCOTPParameterBuilder( + ReadBuffer readBuffer, Short rest) throws ParseException { + readBuffer.pullContext("COTPParameterDisconnectAdditionalInformation"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + byte[] data = readBuffer.readByteArray("data", Math.toIntExact(rest)); + + readBuffer.closeContext("COTPParameterDisconnectAdditionalInformation"); + // Create the instance + return new COTPParameterDisconnectAdditionalInformationBuilderImpl(data); + } + + public static class COTPParameterDisconnectAdditionalInformationBuilderImpl + implements COTPParameter.COTPParameterBuilder { + private final byte[] data; + + public COTPParameterDisconnectAdditionalInformationBuilderImpl(byte[] data) { + this.data = data; + } + + public COTPParameterDisconnectAdditionalInformation build() { + COTPParameterDisconnectAdditionalInformation cOTPParameterDisconnectAdditionalInformation = + new COTPParameterDisconnectAdditionalInformation(data); + return cOTPParameterDisconnectAdditionalInformation; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPParameterDisconnectAdditionalInformation)) { + return false; + } + COTPParameterDisconnectAdditionalInformation that = + (COTPParameterDisconnectAdditionalInformation) o; + return (getData() == that.getData()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getData()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java new file mode 100644 index 00000000000..be740620a83 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPParameterTpduSize.java @@ -0,0 +1,151 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class COTPParameterTpduSize extends COTPParameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0xC0; + } + + // Properties. + protected final COTPTpduSize tpduSize; + + public COTPParameterTpduSize(COTPTpduSize tpduSize) { + super(); + this.tpduSize = tpduSize; + } + + public COTPTpduSize getTpduSize() { + return tpduSize; + } + + @Override + protected void serializeCOTPParameterChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("COTPParameterTpduSize"); + + // Simple Field (tpduSize) + writeSimpleEnumField( + "tpduSize", + "COTPTpduSize", + tpduSize, + new DataWriterEnumDefault<>( + COTPTpduSize::getValue, COTPTpduSize::name, writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("COTPParameterTpduSize"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + COTPParameterTpduSize _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (tpduSize) + lengthInBits += 8; + + return lengthInBits; + } + + public static COTPParameterBuilder staticParseCOTPParameterBuilder( + ReadBuffer readBuffer, Short rest) throws ParseException { + readBuffer.pullContext("COTPParameterTpduSize"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + COTPTpduSize tpduSize = + readEnumField( + "tpduSize", + "COTPTpduSize", + new DataReaderEnumDefault<>( + COTPTpduSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("COTPParameterTpduSize"); + // Create the instance + return new COTPParameterTpduSizeBuilderImpl(tpduSize); + } + + public static class COTPParameterTpduSizeBuilderImpl + implements COTPParameter.COTPParameterBuilder { + private final COTPTpduSize tpduSize; + + public COTPParameterTpduSizeBuilderImpl(COTPTpduSize tpduSize) { + this.tpduSize = tpduSize; + } + + public COTPParameterTpduSize build() { + COTPParameterTpduSize cOTPParameterTpduSize = new COTPParameterTpduSize(tpduSize); + return cOTPParameterTpduSize; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof COTPParameterTpduSize)) { + return false; + } + COTPParameterTpduSize that = (COTPParameterTpduSize) o; + return (getTpduSize() == that.getTpduSize()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getTpduSize()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java new file mode 100644 index 00000000000..01715721bc9 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPProtocolClass.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum COTPProtocolClass { + CLASS_0((short) 0x00), + CLASS_1((short) 0x10), + CLASS_2((short) 0x20), + CLASS_3((short) 0x30), + CLASS_4((short) 0x40); + private static final Map map; + + static { + map = new HashMap<>(); + for (COTPProtocolClass value : COTPProtocolClass.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + COTPProtocolClass(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static COTPProtocolClass enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java new file mode 100644 index 00000000000..9f7df7129aa --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/COTPTpduSize.java @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum COTPTpduSize { + SIZE_128((short) 0x07, (int) 128), + SIZE_256((short) 0x08, (int) 256), + SIZE_512((short) 0x09, (int) 512), + SIZE_1024((short) 0x0a, (int) 1024), + SIZE_2048((short) 0x0b, (int) 2048), + SIZE_4096((short) 0x0c, (int) 4096), + SIZE_8192((short) 0x0d, (int) 8192); + private static final Map map; + + static { + map = new HashMap<>(); + for (COTPTpduSize value : COTPTpduSize.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + private final int sizeInBytes; + + COTPTpduSize(short value, int sizeInBytes) { + this.value = value; + this.sizeInBytes = sizeInBytes; + } + + public short getValue() { + return value; + } + + public int getSizeInBytes() { + return sizeInBytes; + } + + public static COTPTpduSize firstEnumForFieldSizeInBytes(int fieldValue) { + for (COTPTpduSize _val : COTPTpduSize.values()) { + if (_val.getSizeInBytes() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSizeInBytes(int fieldValue) { + List _values = new ArrayList<>(); + for (COTPTpduSize _val : COTPTpduSize.values()) { + if (_val.getSizeInBytes() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public static COTPTpduSize enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java new file mode 100644 index 00000000000..10be0b999da --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CpuSubscribeEvents.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum CpuSubscribeEvents { + CPU((short) 0x01), + IM((short) 0x02), + FM((short) 0x04), + CP((short) 0x80); + private static final Map map; + + static { + map = new HashMap<>(); + for (CpuSubscribeEvents value : CpuSubscribeEvents.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + CpuSubscribeEvents(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static CpuSubscribeEvents enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java new file mode 100644 index 00000000000..c15002a449e --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemAnyType.java @@ -0,0 +1,244 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class CycServiceItemAnyType extends CycServiceItemType implements Message { + + // Accessors for discriminator values. + + // Properties. + protected final TransportSize transportSize; + protected final int length; + protected final int dbNumber; + protected final MemoryArea memoryArea; + protected final int address; + + public CycServiceItemAnyType( + short byteLength, + short syntaxId, + TransportSize transportSize, + int length, + int dbNumber, + MemoryArea memoryArea, + int address) { + super(byteLength, syntaxId); + this.transportSize = transportSize; + this.length = length; + this.dbNumber = dbNumber; + this.memoryArea = memoryArea; + this.address = address; + } + + public TransportSize getTransportSize() { + return transportSize; + } + + public int getLength() { + return length; + } + + public int getDbNumber() { + return dbNumber; + } + + public MemoryArea getMemoryArea() { + return memoryArea; + } + + public int getAddress() { + return address; + } + + @Override + protected void serializeCycServiceItemTypeChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("CycServiceItemAnyType"); + + // Enum field (transportSize) + writeEnumField( + "transportSize", + "TransportSize", + transportSize, + new DataWriterEnumDefault<>( + TransportSize::getCode, TransportSize::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (length) + writeSimpleField("length", length, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (dbNumber) + writeSimpleField("dbNumber", dbNumber, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (memoryArea) + writeSimpleEnumField( + "memoryArea", + "MemoryArea", + memoryArea, + new DataWriterEnumDefault<>( + MemoryArea::getValue, MemoryArea::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (address) + writeSimpleField("address", address, writeUnsignedInt(writeBuffer, 24)); + + writeBuffer.popContext("CycServiceItemAnyType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + CycServiceItemAnyType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Enum Field (transportSize) + lengthInBits += 8; + + // Simple field (length) + lengthInBits += 16; + + // Simple field (dbNumber) + lengthInBits += 16; + + // Simple field (memoryArea) + lengthInBits += 8; + + // Simple field (address) + lengthInBits += 24; + + return lengthInBits; + } + + public static CycServiceItemTypeBuilder staticParseCycServiceItemTypeBuilder( + ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("CycServiceItemAnyType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + TransportSize transportSize = + readEnumField( + "transportSize", + "TransportSize", + readEnum(TransportSize::firstEnumForFieldCode, readUnsignedShort(readBuffer, 8))); + + int length = readSimpleField("length", readUnsignedInt(readBuffer, 16)); + + int dbNumber = readSimpleField("dbNumber", readUnsignedInt(readBuffer, 16)); + + MemoryArea memoryArea = + readEnumField( + "memoryArea", + "MemoryArea", + new DataReaderEnumDefault<>( + MemoryArea::enumForValue, readUnsignedShort(readBuffer, 8))); + + int address = readSimpleField("address", readUnsignedInt(readBuffer, 24)); + + readBuffer.closeContext("CycServiceItemAnyType"); + // Create the instance + return new CycServiceItemAnyTypeBuilderImpl( + transportSize, length, dbNumber, memoryArea, address); + } + + public static class CycServiceItemAnyTypeBuilderImpl + implements CycServiceItemType.CycServiceItemTypeBuilder { + private final TransportSize transportSize; + private final int length; + private final int dbNumber; + private final MemoryArea memoryArea; + private final int address; + + public CycServiceItemAnyTypeBuilderImpl( + TransportSize transportSize, int length, int dbNumber, MemoryArea memoryArea, int address) { + this.transportSize = transportSize; + this.length = length; + this.dbNumber = dbNumber; + this.memoryArea = memoryArea; + this.address = address; + } + + public CycServiceItemAnyType build(short byteLength, short syntaxId) { + CycServiceItemAnyType cycServiceItemAnyType = + new CycServiceItemAnyType( + byteLength, syntaxId, transportSize, length, dbNumber, memoryArea, address); + return cycServiceItemAnyType; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof CycServiceItemAnyType)) { + return false; + } + CycServiceItemAnyType that = (CycServiceItemAnyType) o; + return (getTransportSize() == that.getTransportSize()) + && (getLength() == that.getLength()) + && (getDbNumber() == that.getDbNumber()) + && (getMemoryArea() == that.getMemoryArea()) + && (getAddress() == that.getAddress()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), + getTransportSize(), + getLength(), + getDbNumber(), + getMemoryArea(), + getAddress()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java new file mode 100644 index 00000000000..73363758ddd --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemDbReadType.java @@ -0,0 +1,169 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class CycServiceItemDbReadType extends CycServiceItemType implements Message { + + // Accessors for discriminator values. + + // Properties. + protected final short numberOfAreas; + protected final List items; + + public CycServiceItemDbReadType( + short byteLength, short syntaxId, short numberOfAreas, List items) { + super(byteLength, syntaxId); + this.numberOfAreas = numberOfAreas; + this.items = items; + } + + public short getNumberOfAreas() { + return numberOfAreas; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeCycServiceItemTypeChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("CycServiceItemDbReadType"); + + // Simple Field (numberOfAreas) + writeSimpleField("numberOfAreas", numberOfAreas, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("CycServiceItemDbReadType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + CycServiceItemDbReadType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (numberOfAreas) + lengthInBits += 8; + + // Array field + if (items != null) { + int i = 0; + for (SubItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static CycServiceItemTypeBuilder staticParseCycServiceItemTypeBuilder( + ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("CycServiceItemDbReadType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short numberOfAreas = readSimpleField("numberOfAreas", readUnsignedShort(readBuffer, 8)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>(() -> SubItem.staticParse(readBuffer), readBuffer), + numberOfAreas); + + readBuffer.closeContext("CycServiceItemDbReadType"); + // Create the instance + return new CycServiceItemDbReadTypeBuilderImpl(numberOfAreas, items); + } + + public static class CycServiceItemDbReadTypeBuilderImpl + implements CycServiceItemType.CycServiceItemTypeBuilder { + private final short numberOfAreas; + private final List items; + + public CycServiceItemDbReadTypeBuilderImpl(short numberOfAreas, List items) { + this.numberOfAreas = numberOfAreas; + this.items = items; + } + + public CycServiceItemDbReadType build(short byteLength, short syntaxId) { + CycServiceItemDbReadType cycServiceItemDbReadType = + new CycServiceItemDbReadType(byteLength, syntaxId, numberOfAreas, items); + return cycServiceItemDbReadType; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof CycServiceItemDbReadType)) { + return false; + } + CycServiceItemDbReadType that = (CycServiceItemDbReadType) o; + return (getNumberOfAreas() == that.getNumberOfAreas()) + && (getItems() == that.getItems()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getNumberOfAreas(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java new file mode 100644 index 00000000000..9dca1f7e3ed --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/CycServiceItemType.java @@ -0,0 +1,189 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class CycServiceItemType implements Message { + + // Abstract accessors for discriminator values. + + // Constant values. + public static final Short FUNCTIONID = 0x12; + + // Properties. + protected final short byteLength; + protected final short syntaxId; + + public CycServiceItemType(short byteLength, short syntaxId) { + super(); + this.byteLength = byteLength; + this.syntaxId = syntaxId; + } + + public short getByteLength() { + return byteLength; + } + + public short getSyntaxId() { + return syntaxId; + } + + public short getFunctionId() { + return FUNCTIONID; + } + + protected abstract void serializeCycServiceItemTypeChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("CycServiceItemType"); + + // Const Field (functionId) + writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (byteLength) + writeSimpleField("byteLength", byteLength, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (syntaxId) + writeSimpleField("syntaxId", syntaxId, writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeCycServiceItemTypeChild(writeBuffer); + + writeBuffer.popContext("CycServiceItemType"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + CycServiceItemType _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (functionId) + lengthInBits += 8; + + // Simple field (byteLength) + lengthInBits += 8; + + // Simple field (syntaxId) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static CycServiceItemType staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static CycServiceItemType staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("CycServiceItemType"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = + readConstField( + "functionId", readUnsignedShort(readBuffer, 8), CycServiceItemType.FUNCTIONID); + + short byteLength = readSimpleField("byteLength", readUnsignedShort(readBuffer, 8)); + + short syntaxId = readSimpleField("syntaxId", readUnsignedShort(readBuffer, 8)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + CycServiceItemTypeBuilder builder = null; + if (EvaluationHelper.equals(syntaxId, (short) 0x10)) { + builder = CycServiceItemAnyType.staticParseCycServiceItemTypeBuilder(readBuffer); + } else if (EvaluationHelper.equals(syntaxId, (short) 0xb0)) { + builder = CycServiceItemDbReadType.staticParseCycServiceItemTypeBuilder(readBuffer); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "syntaxId=" + + syntaxId + + "]"); + } + + readBuffer.closeContext("CycServiceItemType"); + // Create the instance + CycServiceItemType _cycServiceItemType = builder.build(byteLength, syntaxId); + return _cycServiceItemType; + } + + public interface CycServiceItemTypeBuilder { + CycServiceItemType build(short byteLength, short syntaxId); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof CycServiceItemType)) { + return false; + } + CycServiceItemType that = (CycServiceItemType) o; + return (getByteLength() == that.getByteLength()) + && (getSyntaxId() == that.getSyntaxId()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getByteLength(), getSyntaxId()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java new file mode 100644 index 00000000000..8cbcc67d768 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -0,0 +1,531 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.math.BigInteger; +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.WithOption; +import org.apache.plc4x.java.spi.generation.ByteOrder; +import org.apache.plc4x.java.spi.generation.EvaluationHelper; +import org.apache.plc4x.java.spi.generation.ParseException; +import org.apache.plc4x.java.spi.generation.ReadBuffer; +import org.apache.plc4x.java.spi.generation.SerializationException; +import org.apache.plc4x.java.spi.generation.WriteBuffer; +import org.apache.plc4x.java.spi.values.*; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +// Code generated by code-generation. DO NOT EDIT. + +public class DataItem { + + private static final Logger LOGGER = LoggerFactory.getLogger(DataItem.class); + + public static PlcValue staticParse( + ReadBuffer readBuffer, String dataProtocolId, Integer stringLength) throws ParseException { + if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BOOL")) { // BOOL + + // Reserved Field (Compartmentalized so the "reserved" variable can't leak) + { + byte reserved = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedByte("", 7); + if (reserved != (byte) 0x00) { + LOGGER.info( + "Expected constant value " + 0x00 + " but got " + reserved + " for reserved field."); + } + } + + // Simple Field (value) + Boolean value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readBit(""); + + return new PlcBOOL(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BYTE")) { // BYTE + + // Simple Field (value) + Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); + + return new PlcBYTE(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WORD")) { // WORD + + // Simple Field (value) + Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); + + return new PlcWORD(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DWORD")) { // DWORD + + // Simple Field (value) + Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32); + + return new PlcDWORD(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LWORD")) { // LWORD + + // Simple Field (value) + BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedBigInteger("", 64); + + return new PlcLWORD(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_SINT")) { // SINT + + // Simple Field (value) + Byte value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readSignedByte("", 8); + + return new PlcSINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_USINT")) { // USINT + + // Simple Field (value) + Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); + + return new PlcUSINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_INT")) { // INT + + // Simple Field (value) + Short value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readShort("", 16); + + return new PlcINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UINT")) { // UINT + + // Simple Field (value) + Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); + + return new PlcUINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DINT")) { // DINT + + // Simple Field (value) + Integer value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32); + + return new PlcDINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UDINT")) { // UDINT + + // Simple Field (value) + Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32); + + return new PlcUDINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LINT")) { // LINT + + // Simple Field (value) + Long value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readLong("", 64); + + return new PlcLINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_ULINT")) { // ULINT + + // Simple Field (value) + BigInteger value = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedBigInteger("", 64); + + return new PlcULINT(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_REAL")) { // REAL + + // Simple Field (value) + Float value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readFloat("", 32); + + return new PlcREAL(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LREAL")) { // LREAL + + // Simple Field (value) + Double value = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readDouble("", 64); + + return new PlcLREAL(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_CHAR")) { // CHAR + + // Simple Field (value) + String value = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readString("", 8, WithOption.WithEncoding("UTF-8")); + + return new PlcCHAR(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WCHAR")) { // CHAR + + // Simple Field (value) + String value = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readString("", 16, WithOption.WithEncoding("UTF-16")); + + return new PlcCHAR(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_STRING")) { // STRING + + // Manual Field (value) + String value = + (String) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseS7String( + readBuffer, stringLength, "UTF-8")); + + return new PlcSTRING(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WSTRING")) { // STRING + + // Manual Field (value) + String value = + (String) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseS7String( + readBuffer, stringLength, "UTF-16")); + + return new PlcSTRING(value); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME + + // Simple Field (milliseconds) + Integer milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32); + + return PlcTIME.ofMilliseconds(milliseconds); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME + + // Simple Field (nanoseconds) + BigInteger nanoseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedBigInteger("", 64); + + return PlcLTIME.ofNanoseconds(nanoseconds); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE + + // Simple Field (daysSinceSiemensEpoch) + Integer daysSinceSiemensEpoch = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedInt("", 16); + + return PlcDATE.ofDaysSinceSiemensEpoch(daysSinceSiemensEpoch); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY + + // Simple Field (millisecondsSinceMidnight) + Long millisecondsSinceMidnight = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedLong("", 32); + + return PlcTIME_OF_DAY.ofMillisecondsSinceMidnight(millisecondsSinceMidnight); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME_OF_DAY")) { // LTIME_OF_DAY + + // Simple Field (nanosecondsSinceMidnight) + BigInteger nanosecondsSinceMidnight = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedBigInteger("", 64); + + return PlcLTIME_OF_DAY.ofNanosecondsSinceMidnight(nanosecondsSinceMidnight); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE_AND_TIME")) { // DATE_AND_TIME + + // Simple Field (year) + Integer year = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedInt("", 16); + + // Simple Field (month) + Short month = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); + + // Simple Field (day) + Short day = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); + + // Simple Field (dayOfWeek) + Short dayOfWeek = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedShort("", 8); + + // Simple Field (hour) + Short hour = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); + + // Simple Field (minutes) + Short minutes = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); + + // Simple Field (seconds) + Short seconds = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedShort("", 8); + + // Simple Field (nanoseconds) + Long nanoseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedLong("", 32); + + return PlcDATE_AND_TIME.ofSegments( + year.intValue(), + (month == 0) ? 1 : month.intValue(), + (day == 0) ? 1 : day.intValue(), + hour.intValue(), + minutes.intValue(), + seconds.intValue(), + nanoseconds.intValue()); + } + return null; + } + + public static void staticSerialize( + WriteBuffer writeBuffer, PlcValue _value, String dataProtocolId, Integer stringLength) + throws SerializationException { + staticSerialize(writeBuffer, _value, dataProtocolId, stringLength, ByteOrder.BIG_ENDIAN); + } + + public static void staticSerialize( + WriteBuffer writeBuffer, + PlcValue _value, + String dataProtocolId, + Integer stringLength, + ByteOrder byteOrder) + throws SerializationException { + if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BOOL")) { // BOOL + // Reserved Field + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedByte("", 7, ((Number) (byte) 0x00).byteValue()); + // Simple Field (value) + boolean value = (boolean) _value.getBoolean(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeBit("", (boolean) (value)); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BYTE")) { // BYTE + // Simple Field (value) + short value = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WORD")) { // WORD + // Simple Field (value) + int value = (int) _value.getInt(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DWORD")) { // DWORD + // Simple Field (value) + long value = (long) _value.getLong(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LWORD")) { // LWORD + // Simple Field (value) + BigInteger value = (BigInteger) _value.getBigInteger(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value)); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_SINT")) { // SINT + // Simple Field (value) + byte value = (byte) _value.getByte(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeSignedByte("", 8, ((Number) (value)).byteValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_USINT")) { // USINT + // Simple Field (value) + short value = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (value)).shortValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_INT")) { // INT + // Simple Field (value) + short value = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeShort("", 16, ((Number) (value)).shortValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UINT")) { // UINT + // Simple Field (value) + int value = (int) _value.getInt(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (value)).intValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DINT")) { // DINT + // Simple Field (value) + int value = (int) _value.getInt(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (value)).intValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UDINT")) { // UDINT + // Simple Field (value) + long value = (long) _value.getLong(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedLong("", 32, ((Number) (value)).longValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LINT")) { // LINT + // Simple Field (value) + long value = (long) _value.getLong(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeLong("", 64, ((Number) (value)).longValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_ULINT")) { // ULINT + // Simple Field (value) + BigInteger value = (BigInteger) _value.getBigInteger(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (value)); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_REAL")) { // REAL + // Simple Field (value) + float value = (float) _value.getFloat(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeFloat("", 32, (value)); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LREAL")) { // LREAL + // Simple Field (value) + double value = (double) _value.getDouble(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeDouble("", 64, (value)); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_CHAR")) { // CHAR + // Simple Field (value) + String value = (String) _value.getString(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeString( + "", 8, (String) (value), WithOption.WithEncoding("UTF-8")); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WCHAR")) { // CHAR + // Simple Field (value) + String value = (String) _value.getString(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeString( + "", 16, (String) (value), WithOption.WithEncoding("UTF-16")); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_STRING")) { // STRING + // Manual Field (value) + org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeS7String( + writeBuffer, _value, stringLength, "UTF-8"); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WSTRING")) { // STRING + // Manual Field (value) + org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeS7String( + writeBuffer, _value, stringLength, "UTF-16"); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME + // Simple Field (milliseconds) + int milliseconds = (int) _value.getInt(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (milliseconds)).intValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME + // Simple Field (nanoseconds) + BigInteger nanoseconds = (BigInteger) _value.getBigInteger(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (nanoseconds)); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE + // Simple Field (daysSinceSiemensEpoch) + int daysSinceSiemensEpoch = (int) ((PlcDATE) _value).getDaysSinceSiemensEpoch(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedInt( + "", 16, ((Number) (daysSinceSiemensEpoch)).intValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY + // Simple Field (millisecondsSinceMidnight) + long millisecondsSinceMidnight = (long) _value.getLong(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( + "", 32, ((Number) (millisecondsSinceMidnight)).longValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME_OF_DAY")) { // LTIME_OF_DAY + // Simple Field (nanosecondsSinceMidnight) + BigInteger nanosecondsSinceMidnight = (BigInteger) _value.getBigInteger(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger( + "", 64, (BigInteger) (nanosecondsSinceMidnight)); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE_AND_TIME")) { // DATE_AND_TIME + // Simple Field (year) + int year = (int) _value.getInt(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedInt("", 16, ((Number) (year)).intValue()); + // Simple Field (month) + short month = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (month)).shortValue()); + // Simple Field (day) + short day = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (day)).shortValue()); + // Simple Field (dayOfWeek) + short dayOfWeek = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort( + "", 8, ((Number) (dayOfWeek)).shortValue()); + // Simple Field (hour) + short hour = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (hour)).shortValue()); + // Simple Field (minutes) + short minutes = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (minutes)).shortValue()); + // Simple Field (seconds) + short seconds = (short) _value.getShort(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedShort("", 8, ((Number) (seconds)).shortValue()); + // Simple Field (nanoseconds) + long nanoseconds = (long) _value.getLong(); + /*TODO: migrate me*/ + /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( + "", 32, ((Number) (nanoseconds)).longValue()); + } + } + + public static int getLengthInBytes(PlcValue _value, String dataProtocolId, Integer stringLength) { + return (int) Math.ceil((float) getLengthInBits(_value, dataProtocolId, stringLength) / 8.0); + } + + public static int getLengthInBits(PlcValue _value, String dataProtocolId, Integer stringLength) { + int sizeInBits = 0; + if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BOOL")) { // BOOL + // Reserved Field + sizeInBits += 7; + // Simple Field (value) + sizeInBits += 1; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_BYTE")) { // BYTE + // Simple Field (value) + sizeInBits += 8; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WORD")) { // WORD + // Simple Field (value) + sizeInBits += 16; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DWORD")) { // DWORD + // Simple Field (value) + sizeInBits += 32; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LWORD")) { // LWORD + // Simple Field (value) + sizeInBits += 64; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_SINT")) { // SINT + // Simple Field (value) + sizeInBits += 8; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_USINT")) { // USINT + // Simple Field (value) + sizeInBits += 8; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_INT")) { // INT + // Simple Field (value) + sizeInBits += 16; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UINT")) { // UINT + // Simple Field (value) + sizeInBits += 16; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DINT")) { // DINT + // Simple Field (value) + sizeInBits += 32; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_UDINT")) { // UDINT + // Simple Field (value) + sizeInBits += 32; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LINT")) { // LINT + // Simple Field (value) + sizeInBits += 64; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_ULINT")) { // ULINT + // Simple Field (value) + sizeInBits += 64; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_REAL")) { // REAL + // Simple Field (value) + sizeInBits += 32; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LREAL")) { // LREAL + // Simple Field (value) + sizeInBits += 64; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_CHAR")) { // CHAR + // Simple Field (value) + sizeInBits += 8; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WCHAR")) { // CHAR + // Simple Field (value) + sizeInBits += 16; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_STRING")) { // STRING + // Manual Field (value) + sizeInBits += (((stringLength) * (8))) + (16); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_WSTRING")) { // STRING + // Manual Field (value) + sizeInBits += (((stringLength) * (16))) + (32); + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME + // Simple Field (milliseconds) + sizeInBits += 32; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME + // Simple Field (nanoseconds) + sizeInBits += 64; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE + // Simple Field (daysSinceSiemensEpoch) + sizeInBits += 16; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY + // Simple Field (millisecondsSinceMidnight) + sizeInBits += 32; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME_OF_DAY")) { // LTIME_OF_DAY + // Simple Field (nanosecondsSinceMidnight) + sizeInBits += 64; + } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE_AND_TIME")) { // DATE_AND_TIME + // Simple Field (year) + sizeInBits += 16; + // Simple Field (month) + sizeInBits += 8; + // Simple Field (day) + sizeInBits += 8; + // Simple Field (dayOfWeek) + sizeInBits += 8; + // Simple Field (hour) + sizeInBits += 8; + // Simple Field (minutes) + sizeInBits += 8; + // Simple Field (seconds) + sizeInBits += 8; + // Simple Field (nanoseconds) + sizeInBits += 32; + } + return sizeInBits; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java new file mode 100644 index 00000000000..72da9d71528 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportErrorCode.java @@ -0,0 +1,59 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum DataTransportErrorCode { + RESERVED((short) 0x00), + OK((short) 0xFF), + ACCESS_DENIED((short) 0x03), + INVALID_ADDRESS((short) 0x05), + DATA_TYPE_NOT_SUPPORTED((short) 0x06), + NOT_FOUND((short) 0x0A); + private static final Map map; + + static { + map = new HashMap<>(); + for (DataTransportErrorCode value : DataTransportErrorCode.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + DataTransportErrorCode(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static DataTransportErrorCode enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java new file mode 100644 index 00000000000..bc667c57c38 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataTransportSize.java @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum DataTransportSize { + NULL((short) 0x00, (boolean) false), + BIT((short) 0x03, (boolean) true), + BYTE_WORD_DWORD((short) 0x04, (boolean) true), + INTEGER((short) 0x05, (boolean) true), + DINTEGER((short) 0x06, (boolean) false), + REAL((short) 0x07, (boolean) false), + OCTET_STRING((short) 0x09, (boolean) false); + private static final Map map; + + static { + map = new HashMap<>(); + for (DataTransportSize value : DataTransportSize.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + private final boolean sizeInBits; + + DataTransportSize(short value, boolean sizeInBits) { + this.value = value; + this.sizeInBits = sizeInBits; + } + + public short getValue() { + return value; + } + + public boolean getSizeInBits() { + return sizeInBits; + } + + public static DataTransportSize firstEnumForFieldSizeInBits(boolean fieldValue) { + for (DataTransportSize _val : DataTransportSize.values()) { + if (_val.getSizeInBits() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSizeInBits(boolean fieldValue) { + List _values = new ArrayList<>(); + for (DataTransportSize _val : DataTransportSize.values()) { + if (_val.getSizeInBits() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public static DataTransportSize enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java new file mode 100644 index 00000000000..6b52808638f --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DateAndTime.java @@ -0,0 +1,313 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class DateAndTime implements Message { + + // Properties. + protected final short year; + protected final short month; + protected final short day; + protected final short hour; + protected final short minutes; + protected final short seconds; + protected final short msec; + protected final byte dow; + + public DateAndTime( + short year, + short month, + short day, + short hour, + short minutes, + short seconds, + short msec, + byte dow) { + super(); + this.year = year; + this.month = month; + this.day = day; + this.hour = hour; + this.minutes = minutes; + this.seconds = seconds; + this.msec = msec; + this.dow = dow; + } + + public short getYear() { + return year; + } + + public short getMonth() { + return month; + } + + public short getDay() { + return day; + } + + public short getHour() { + return hour; + } + + public short getMinutes() { + return minutes; + } + + public short getSeconds() { + return seconds; + } + + public short getMsec() { + return msec; + } + + public byte getDow() { + return dow; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("DateAndTime"); + + // Manual Field (year) + writeManualField( + "year", + () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, year), + writeBuffer); + + // Manual Field (month) + writeManualField( + "month", + () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, month), + writeBuffer); + + // Manual Field (day) + writeManualField( + "day", + () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, day), + writeBuffer); + + // Manual Field (hour) + writeManualField( + "hour", + () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, hour), + writeBuffer); + + // Manual Field (minutes) + writeManualField( + "minutes", + () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, minutes), + writeBuffer); + + // Manual Field (seconds) + writeManualField( + "seconds", + () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.ByteToBcd(writeBuffer, seconds), + writeBuffer); + + // Manual Field (msec) + writeManualField( + "msec", + () -> org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.IntToS7msec(writeBuffer, msec), + writeBuffer); + + // Simple Field (dow) + writeSimpleField("dow", dow, writeUnsignedByte(writeBuffer, 4)); + + writeBuffer.popContext("DateAndTime"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + DateAndTime _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Manual Field (year) + lengthInBits += 8; + + // Manual Field (month) + lengthInBits += 8; + + // Manual Field (day) + lengthInBits += 8; + + // Manual Field (hour) + lengthInBits += 8; + + // Manual Field (minutes) + lengthInBits += 8; + + // Manual Field (seconds) + lengthInBits += 8; + + // Manual Field (msec) + lengthInBits += 12; + + // Simple field (dow) + lengthInBits += 4; + + return lengthInBits; + } + + public static DateAndTime staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static DateAndTime staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("DateAndTime"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short year = + readManualField( + "year", + readBuffer, + () -> + (short) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); + + short month = + readManualField( + "month", + readBuffer, + () -> + (short) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); + + short day = + readManualField( + "day", + readBuffer, + () -> + (short) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); + + short hour = + readManualField( + "hour", + readBuffer, + () -> + (short) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); + + short minutes = + readManualField( + "minutes", + readBuffer, + () -> + (short) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); + + short seconds = + readManualField( + "seconds", + readBuffer, + () -> + (short) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.BcdToInt(readBuffer))); + + short msec = + readManualField( + "msec", + readBuffer, + () -> + (short) + (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.S7msecToInt( + readBuffer))); + + byte dow = readSimpleField("dow", readUnsignedByte(readBuffer, 4)); + + readBuffer.closeContext("DateAndTime"); + // Create the instance + DateAndTime _dateAndTime; + _dateAndTime = new DateAndTime(year, month, day, hour, minutes, seconds, msec, dow); + return _dateAndTime; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof DateAndTime)) { + return false; + } + DateAndTime that = (DateAndTime) o; + return (getYear() == that.getYear()) + && (getMonth() == that.getMonth()) + && (getDay() == that.getDay()) + && (getHour() == that.getHour()) + && (getMinutes() == that.getMinutes()) + && (getSeconds() == that.getSeconds()) + && (getMsec() == that.getMsec()) + && (getDow() == that.getDow()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getYear(), + getMonth(), + getDay(), + getHour(), + getMinutes(), + getSeconds(), + getMsec(), + getDow()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java new file mode 100644 index 00000000000..6386830857b --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DeviceGroup.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum DeviceGroup { + PG_OR_PC((short) 0x01), + OS((short) 0x02), + OTHERS((short) 0x03); + private static final Map map; + + static { + map = new HashMap<>(); + for (DeviceGroup value : DeviceGroup.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + DeviceGroup(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static DeviceGroup enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java new file mode 100644 index 00000000000..b80be908777 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/EventType.java @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum EventType { + MODE((short) 0x01), + SYS((short) 0x02), + USR((short) 0x04), + ALM((short) 0x80), + CYC((short) 0x69); + private static final Map map; + + static { + map = new HashMap<>(); + for (EventType value : EventType.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + EventType(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static EventType enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java new file mode 100644 index 00000000000..16146f7ab20 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/MemoryArea.java @@ -0,0 +1,89 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum MemoryArea { + COUNTERS((short) 0x1C, (String) "C"), + TIMERS((short) 0x1D, (String) "T"), + DIRECT_PERIPHERAL_ACCESS((short) 0x80, (String) "D"), + INPUTS((short) 0x81, (String) "I"), + OUTPUTS((short) 0x82, (String) "Q"), + FLAGS_MARKERS((short) 0x83, (String) "M"), + DATA_BLOCKS((short) 0x84, (String) "DB"), + INSTANCE_DATA_BLOCKS((short) 0x85, (String) "DBI"), + LOCAL_DATA((short) 0x86, (String) "LD"); + private static final Map map; + + static { + map = new HashMap<>(); + for (MemoryArea value : MemoryArea.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + private final String shortName; + + MemoryArea(short value, String shortName) { + this.value = value; + this.shortName = shortName; + } + + public short getValue() { + return value; + } + + public String getShortName() { + return shortName; + } + + public static MemoryArea firstEnumForFieldShortName(String fieldValue) { + for (MemoryArea _val : MemoryArea.values()) { + if (_val.getShortName().equals(fieldValue)) { + return _val; + } + } + return null; + } + + public static List enumsForFieldShortName(String fieldValue) { + List _values = new ArrayList<>(); + for (MemoryArea _val : MemoryArea.values()) { + if (_val.getShortName().equals(fieldValue)) { + _values.add(_val); + } + } + return _values; + } + + public static MemoryArea enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java new file mode 100644 index 00000000000..affc7ccb3eb --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/ModeTransitionType.java @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum ModeTransitionType { + STOP((short) 0x00), + WARM_RESTART((short) 0x01), + RUN((short) 0x02), + HOT_RESTART((short) 0x03), + HOLD((short) 0x04), + COLD_RESTART((short) 0x06), + RUN_R((short) 0x09), + LINK_UP((short) 0x11), + UPDATE((short) 0x12); + private static final Map map; + + static { + map = new HashMap<>(); + for (ModeTransitionType value : ModeTransitionType.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + ModeTransitionType(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static ModeTransitionType enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java new file mode 100644 index 00000000000..6a0986380cb --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/QueryType.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum QueryType { + BYALARMTYPE((short) 0x01), + ALARM_8((short) 0x02), + ALARM_S((short) 0x04), + ALARM_8P((short) 0x09); + private static final Map map; + + static { + map = new HashMap<>(); + for (QueryType value : QueryType.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + QueryType(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static QueryType enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java new file mode 100644 index 00000000000..3fdb19bcae3 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Address.java @@ -0,0 +1,146 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7Address implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getAddressType(); + + public S7Address() { + super(); + } + + protected abstract void serializeS7AddressChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7Address"); + + // Discriminator Field (addressType) (Used as input to a switch field) + writeDiscriminatorField("addressType", getAddressType(), writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeS7AddressChild(writeBuffer); + + writeBuffer.popContext("S7Address"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7Address _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Discriminator Field (addressType) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static S7Address staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static S7Address staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7Address"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short addressType = readDiscriminatorField("addressType", readUnsignedShort(readBuffer, 8)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7AddressBuilder builder = null; + if (EvaluationHelper.equals(addressType, (short) 0x10)) { + builder = S7AddressAny.staticParseS7AddressBuilder(readBuffer); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "addressType=" + + addressType + + "]"); + } + + readBuffer.closeContext("S7Address"); + // Create the instance + S7Address _s7Address = builder.build(); + return _s7Address; + } + + public interface S7AddressBuilder { + S7Address build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7Address)) { + return false; + } + S7Address that = (S7Address) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java new file mode 100644 index 00000000000..d990a8d900d --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7AddressAny.java @@ -0,0 +1,276 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7AddressAny extends S7Address implements Message { + + // Accessors for discriminator values. + public Short getAddressType() { + return (short) 0x10; + } + + // Properties. + protected final TransportSize transportSize; + protected final int numberOfElements; + protected final int dbNumber; + protected final MemoryArea area; + protected final int byteAddress; + protected final byte bitAddress; + + public S7AddressAny( + TransportSize transportSize, + int numberOfElements, + int dbNumber, + MemoryArea area, + int byteAddress, + byte bitAddress) { + super(); + this.transportSize = transportSize; + this.numberOfElements = numberOfElements; + this.dbNumber = dbNumber; + this.area = area; + this.byteAddress = byteAddress; + this.bitAddress = bitAddress; + } + + public TransportSize getTransportSize() { + return transportSize; + } + + public int getNumberOfElements() { + return numberOfElements; + } + + public int getDbNumber() { + return dbNumber; + } + + public MemoryArea getArea() { + return area; + } + + public int getByteAddress() { + return byteAddress; + } + + public byte getBitAddress() { + return bitAddress; + } + + @Override + protected void serializeS7AddressChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7AddressAny"); + + // Enum field (transportSize) + writeEnumField( + "transportSize", + "TransportSize", + transportSize, + new DataWriterEnumDefault<>( + TransportSize::getCode, TransportSize::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (numberOfElements) + writeSimpleField("numberOfElements", numberOfElements, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (dbNumber) + writeSimpleField("dbNumber", dbNumber, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (area) + writeSimpleEnumField( + "area", + "MemoryArea", + area, + new DataWriterEnumDefault<>( + MemoryArea::getValue, MemoryArea::name, writeUnsignedShort(writeBuffer, 8))); + + // Reserved Field (reserved) + writeReservedField("reserved", (byte) 0x00, writeUnsignedByte(writeBuffer, 5)); + + // Simple Field (byteAddress) + writeSimpleField("byteAddress", byteAddress, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (bitAddress) + writeSimpleField("bitAddress", bitAddress, writeUnsignedByte(writeBuffer, 3)); + + writeBuffer.popContext("S7AddressAny"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7AddressAny _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Enum Field (transportSize) + lengthInBits += 8; + + // Simple field (numberOfElements) + lengthInBits += 16; + + // Simple field (dbNumber) + lengthInBits += 16; + + // Simple field (area) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 5; + + // Simple field (byteAddress) + lengthInBits += 16; + + // Simple field (bitAddress) + lengthInBits += 3; + + return lengthInBits; + } + + public static S7AddressBuilder staticParseS7AddressBuilder(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("S7AddressAny"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + TransportSize transportSize = + readEnumField( + "transportSize", + "TransportSize", + readEnum(TransportSize::firstEnumForFieldCode, readUnsignedShort(readBuffer, 8))); + + int numberOfElements = readSimpleField("numberOfElements", readUnsignedInt(readBuffer, 16)); + + int dbNumber = readSimpleField("dbNumber", readUnsignedInt(readBuffer, 16)); + + MemoryArea area = + readEnumField( + "area", + "MemoryArea", + new DataReaderEnumDefault<>( + MemoryArea::enumForValue, readUnsignedShort(readBuffer, 8))); + + Byte reservedField0 = + readReservedField("reserved", readUnsignedByte(readBuffer, 5), (byte) 0x00); + + int byteAddress = readSimpleField("byteAddress", readUnsignedInt(readBuffer, 16)); + + byte bitAddress = readSimpleField("bitAddress", readUnsignedByte(readBuffer, 3)); + + readBuffer.closeContext("S7AddressAny"); + // Create the instance + return new S7AddressAnyBuilderImpl( + transportSize, numberOfElements, dbNumber, area, byteAddress, bitAddress); + } + + public static class S7AddressAnyBuilderImpl implements S7Address.S7AddressBuilder { + private final TransportSize transportSize; + private final int numberOfElements; + private final int dbNumber; + private final MemoryArea area; + private final int byteAddress; + private final byte bitAddress; + + public S7AddressAnyBuilderImpl( + TransportSize transportSize, + int numberOfElements, + int dbNumber, + MemoryArea area, + int byteAddress, + byte bitAddress) { + this.transportSize = transportSize; + this.numberOfElements = numberOfElements; + this.dbNumber = dbNumber; + this.area = area; + this.byteAddress = byteAddress; + this.bitAddress = bitAddress; + } + + public S7AddressAny build() { + S7AddressAny s7AddressAny = + new S7AddressAny( + transportSize, numberOfElements, dbNumber, area, byteAddress, bitAddress); + return s7AddressAny; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7AddressAny)) { + return false; + } + S7AddressAny that = (S7AddressAny) o; + return (getTransportSize() == that.getTransportSize()) + && (getNumberOfElements() == that.getNumberOfElements()) + && (getDbNumber() == that.getDbNumber()) + && (getArea() == that.getArea()) + && (getByteAddress() == that.getByteAddress()) + && (getBitAddress() == that.getBitAddress()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), + getTransportSize(), + getNumberOfElements(), + getDbNumber(), + getArea(), + getByteAddress(), + getBitAddress()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java new file mode 100644 index 00000000000..92e453cc402 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7DataAlarmMessage.java @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7DataAlarmMessage implements Message { + + // Abstract accessors for discriminator values. + public abstract Byte getCpuFunctionType(); + + // Constant values. + public static final Short FUNCTIONID = 0x00; + public static final Short NUMBERMESSAGEOBJ = 0x01; + + public S7DataAlarmMessage() { + super(); + } + + public short getFunctionId() { + return FUNCTIONID; + } + + public short getNumberMessageObj() { + return NUMBERMESSAGEOBJ; + } + + protected abstract void serializeS7DataAlarmMessageChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7DataAlarmMessage"); + + // Const Field (functionId) + writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); + + // Const Field (numberMessageObj) + writeConstField("numberMessageObj", NUMBERMESSAGEOBJ, writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeS7DataAlarmMessageChild(writeBuffer); + + writeBuffer.popContext("S7DataAlarmMessage"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7DataAlarmMessage _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (functionId) + lengthInBits += 8; + + // Const Field (numberMessageObj) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static S7DataAlarmMessage staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + if ((args == null) || (args.length != 1)) { + throw new PlcRuntimeException( + "Wrong number of arguments, expected 1, but got " + args.length); + } + Byte cpuFunctionType; + if (args[0] instanceof Byte) { + cpuFunctionType = (Byte) args[0]; + } else if (args[0] instanceof String) { + cpuFunctionType = Byte.valueOf((String) args[0]); + } else { + throw new PlcRuntimeException( + "Argument 0 expected to be of type Byte or a string which is parseable but was " + + args[0].getClass().getName()); + } + return staticParse(readBuffer, cpuFunctionType); + } + + public static S7DataAlarmMessage staticParse(ReadBuffer readBuffer, Byte cpuFunctionType) + throws ParseException { + readBuffer.pullContext("S7DataAlarmMessage"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = + readConstField( + "functionId", readUnsignedShort(readBuffer, 8), S7DataAlarmMessage.FUNCTIONID); + + short numberMessageObj = + readConstField( + "numberMessageObj", + readUnsignedShort(readBuffer, 8), + S7DataAlarmMessage.NUMBERMESSAGEOBJ); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7DataAlarmMessageBuilder builder = null; + if (EvaluationHelper.equals(cpuFunctionType, (byte) 0x04)) { + builder = + S7MessageObjectRequest.staticParseS7DataAlarmMessageBuilder(readBuffer, cpuFunctionType); + } else if (EvaluationHelper.equals(cpuFunctionType, (byte) 0x08)) { + builder = + S7MessageObjectResponse.staticParseS7DataAlarmMessageBuilder(readBuffer, cpuFunctionType); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "cpuFunctionType=" + + cpuFunctionType + + "]"); + } + + readBuffer.closeContext("S7DataAlarmMessage"); + // Create the instance + S7DataAlarmMessage _s7DataAlarmMessage = builder.build(); + return _s7DataAlarmMessage; + } + + public interface S7DataAlarmMessageBuilder { + S7DataAlarmMessage build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7DataAlarmMessage)) { + return false; + } + S7DataAlarmMessage that = (S7DataAlarmMessage) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java new file mode 100644 index 00000000000..19cf023dbf2 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Message.java @@ -0,0 +1,262 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7Message implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getMessageType(); + + // Constant values. + public static final Short PROTOCOLID = 0x32; + + // Properties. + protected final int tpduReference; + protected final S7Parameter parameter; + protected final S7Payload payload; + + public S7Message(int tpduReference, S7Parameter parameter, S7Payload payload) { + super(); + this.tpduReference = tpduReference; + this.parameter = parameter; + this.payload = payload; + } + + public int getTpduReference() { + return tpduReference; + } + + public S7Parameter getParameter() { + return parameter; + } + + public S7Payload getPayload() { + return payload; + } + + public short getProtocolId() { + return PROTOCOLID; + } + + protected abstract void serializeS7MessageChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7Message"); + + // Const Field (protocolId) + writeConstField("protocolId", PROTOCOLID, writeUnsignedShort(writeBuffer, 8)); + + // Discriminator Field (messageType) (Used as input to a switch field) + writeDiscriminatorField("messageType", getMessageType(), writeUnsignedShort(writeBuffer, 8)); + + // Reserved Field (reserved) + writeReservedField("reserved", (int) 0x0000, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (tpduReference) + writeSimpleField("tpduReference", tpduReference, writeUnsignedInt(writeBuffer, 16)); + + // Implicit Field (parameterLength) (Used for parsing, but its value is not stored as it's + // implicitly given by the objects content) + int parameterLength = + (int) ((((getParameter()) != (null)) ? getParameter().getLengthInBytes() : 0)); + writeImplicitField("parameterLength", parameterLength, writeUnsignedInt(writeBuffer, 16)); + + // Implicit Field (payloadLength) (Used for parsing, but its value is not stored as it's + // implicitly given by the objects content) + int payloadLength = (int) ((((getPayload()) != (null)) ? getPayload().getLengthInBytes() : 0)); + writeImplicitField("payloadLength", payloadLength, writeUnsignedInt(writeBuffer, 16)); + + // Switch field (Serialize the sub-type) + serializeS7MessageChild(writeBuffer); + + // Optional Field (parameter) (Can be skipped, if the value is null) + writeOptionalField("parameter", parameter, new DataWriterComplexDefault<>(writeBuffer)); + + // Optional Field (payload) (Can be skipped, if the value is null) + writeOptionalField("payload", payload, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7Message"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7Message _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (protocolId) + lengthInBits += 8; + + // Discriminator Field (messageType) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 16; + + // Simple field (tpduReference) + lengthInBits += 16; + + // Implicit Field (parameterLength) + lengthInBits += 16; + + // Implicit Field (payloadLength) + lengthInBits += 16; + + // Length of sub-type elements will be added by sub-type... + + // Optional Field (parameter) + if (parameter != null) { + lengthInBits += parameter.getLengthInBits(); + } + + // Optional Field (payload) + if (payload != null) { + lengthInBits += payload.getLengthInBits(); + } + + return lengthInBits; + } + + public static S7Message staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static S7Message staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7Message"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short protocolId = + readConstField("protocolId", readUnsignedShort(readBuffer, 8), S7Message.PROTOCOLID); + + short messageType = readDiscriminatorField("messageType", readUnsignedShort(readBuffer, 8)); + + Integer reservedField0 = + readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0000); + + int tpduReference = readSimpleField("tpduReference", readUnsignedInt(readBuffer, 16)); + + int parameterLength = readImplicitField("parameterLength", readUnsignedInt(readBuffer, 16)); + + int payloadLength = readImplicitField("payloadLength", readUnsignedInt(readBuffer, 16)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7MessageBuilder builder = null; + if (EvaluationHelper.equals(messageType, (short) 0x01)) { + builder = S7MessageRequest.staticParseS7MessageBuilder(readBuffer); + } else if (EvaluationHelper.equals(messageType, (short) 0x02)) { + builder = S7MessageResponse.staticParseS7MessageBuilder(readBuffer); + } else if (EvaluationHelper.equals(messageType, (short) 0x03)) { + builder = S7MessageResponseData.staticParseS7MessageBuilder(readBuffer); + } else if (EvaluationHelper.equals(messageType, (short) 0x07)) { + builder = S7MessageUserData.staticParseS7MessageBuilder(readBuffer); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "messageType=" + + messageType + + "]"); + } + + S7Parameter parameter = + readOptionalField( + "parameter", + new DataReaderComplexDefault<>( + () -> S7Parameter.staticParse(readBuffer, (short) (messageType)), readBuffer), + (parameterLength) > (0)); + + S7Payload payload = + readOptionalField( + "payload", + new DataReaderComplexDefault<>( + () -> + S7Payload.staticParse( + readBuffer, (short) (messageType), (S7Parameter) (parameter)), + readBuffer), + (payloadLength) > (0)); + + readBuffer.closeContext("S7Message"); + // Create the instance + S7Message _s7Message = builder.build(tpduReference, parameter, payload); + return _s7Message; + } + + public interface S7MessageBuilder { + S7Message build(int tpduReference, S7Parameter parameter, S7Payload payload); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7Message)) { + return false; + } + S7Message that = (S7Message) o; + return (getTpduReference() == that.getTpduReference()) + && (getParameter() == that.getParameter()) + && (getPayload() == that.getPayload()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getTpduReference(), getParameter(), getPayload()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java new file mode 100644 index 00000000000..fcdf0b49c24 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectRequest.java @@ -0,0 +1,256 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7MessageObjectRequest extends S7DataAlarmMessage implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + // Constant values. + public static final Short VARIABLESPEC = 0x12; + public static final Short LENGTH = 0x08; + + // Properties. + protected final SyntaxIdType syntaxId; + protected final QueryType queryType; + protected final AlarmType alarmType; + + public S7MessageObjectRequest(SyntaxIdType syntaxId, QueryType queryType, AlarmType alarmType) { + super(); + this.syntaxId = syntaxId; + this.queryType = queryType; + this.alarmType = alarmType; + } + + public SyntaxIdType getSyntaxId() { + return syntaxId; + } + + public QueryType getQueryType() { + return queryType; + } + + public AlarmType getAlarmType() { + return alarmType; + } + + public short getVariableSpec() { + return VARIABLESPEC; + } + + public short getLength() { + return LENGTH; + } + + @Override + protected void serializeS7DataAlarmMessageChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7MessageObjectRequest"); + + // Const Field (variableSpec) + writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); + + // Const Field (length) + writeConstField("length", LENGTH, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (syntaxId) + writeSimpleEnumField( + "syntaxId", + "SyntaxIdType", + syntaxId, + new DataWriterEnumDefault<>( + SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (queryType) + writeSimpleEnumField( + "queryType", + "QueryType", + queryType, + new DataWriterEnumDefault<>( + QueryType::getValue, QueryType::name, writeUnsignedShort(writeBuffer, 8))); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x34, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (alarmType) + writeSimpleEnumField( + "alarmType", + "AlarmType", + alarmType, + new DataWriterEnumDefault<>( + AlarmType::getValue, AlarmType::name, writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("S7MessageObjectRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7MessageObjectRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (variableSpec) + lengthInBits += 8; + + // Const Field (length) + lengthInBits += 8; + + // Simple field (syntaxId) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + // Simple field (queryType) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + // Simple field (alarmType) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7DataAlarmMessageBuilder staticParseS7DataAlarmMessageBuilder( + ReadBuffer readBuffer, Byte cpuFunctionType) throws ParseException { + readBuffer.pullContext("S7MessageObjectRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short variableSpec = + readConstField( + "variableSpec", readUnsignedShort(readBuffer, 8), S7MessageObjectRequest.VARIABLESPEC); + + short length = + readConstField("length", readUnsignedShort(readBuffer, 8), S7MessageObjectRequest.LENGTH); + + SyntaxIdType syntaxId = + readEnumField( + "syntaxId", + "SyntaxIdType", + new DataReaderEnumDefault<>( + SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); + + Short reservedField0 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); + + QueryType queryType = + readEnumField( + "queryType", + "QueryType", + new DataReaderEnumDefault<>(QueryType::enumForValue, readUnsignedShort(readBuffer, 8))); + + Short reservedField1 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x34); + + AlarmType alarmType = + readEnumField( + "alarmType", + "AlarmType", + new DataReaderEnumDefault<>(AlarmType::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("S7MessageObjectRequest"); + // Create the instance + return new S7MessageObjectRequestBuilderImpl(syntaxId, queryType, alarmType); + } + + public static class S7MessageObjectRequestBuilderImpl + implements S7DataAlarmMessage.S7DataAlarmMessageBuilder { + private final SyntaxIdType syntaxId; + private final QueryType queryType; + private final AlarmType alarmType; + + public S7MessageObjectRequestBuilderImpl( + SyntaxIdType syntaxId, QueryType queryType, AlarmType alarmType) { + this.syntaxId = syntaxId; + this.queryType = queryType; + this.alarmType = alarmType; + } + + public S7MessageObjectRequest build() { + S7MessageObjectRequest s7MessageObjectRequest = + new S7MessageObjectRequest(syntaxId, queryType, alarmType); + return s7MessageObjectRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7MessageObjectRequest)) { + return false; + } + S7MessageObjectRequest that = (S7MessageObjectRequest) o; + return (getSyntaxId() == that.getSyntaxId()) + && (getQueryType() == that.getQueryType()) + && (getAlarmType() == that.getAlarmType()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getSyntaxId(), getQueryType(), getAlarmType()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java new file mode 100644 index 00000000000..812a27a0bcf --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageObjectResponse.java @@ -0,0 +1,196 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7MessageObjectResponse extends S7DataAlarmMessage implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + // Properties. + protected final DataTransportErrorCode returnCode; + protected final DataTransportSize transportSize; + + public S7MessageObjectResponse( + DataTransportErrorCode returnCode, DataTransportSize transportSize) { + super(); + this.returnCode = returnCode; + this.transportSize = transportSize; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public DataTransportSize getTransportSize() { + return transportSize; + } + + @Override + protected void serializeS7DataAlarmMessageChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7MessageObjectResponse"); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (transportSize) + writeSimpleEnumField( + "transportSize", + "DataTransportSize", + transportSize, + new DataWriterEnumDefault<>( + DataTransportSize::getValue, + DataTransportSize::name, + writeUnsignedShort(writeBuffer, 8))); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7MessageObjectResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7MessageObjectResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (returnCode) + lengthInBits += 8; + + // Simple field (transportSize) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7DataAlarmMessageBuilder staticParseS7DataAlarmMessageBuilder( + ReadBuffer readBuffer, Byte cpuFunctionType) throws ParseException { + readBuffer.pullContext("S7MessageObjectResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + DataTransportSize transportSize = + readEnumField( + "transportSize", + "DataTransportSize", + new DataReaderEnumDefault<>( + DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + Short reservedField0 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); + + readBuffer.closeContext("S7MessageObjectResponse"); + // Create the instance + return new S7MessageObjectResponseBuilderImpl(returnCode, transportSize); + } + + public static class S7MessageObjectResponseBuilderImpl + implements S7DataAlarmMessage.S7DataAlarmMessageBuilder { + private final DataTransportErrorCode returnCode; + private final DataTransportSize transportSize; + + public S7MessageObjectResponseBuilderImpl( + DataTransportErrorCode returnCode, DataTransportSize transportSize) { + this.returnCode = returnCode; + this.transportSize = transportSize; + } + + public S7MessageObjectResponse build() { + S7MessageObjectResponse s7MessageObjectResponse = + new S7MessageObjectResponse(returnCode, transportSize); + return s7MessageObjectResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7MessageObjectResponse)) { + return false; + } + S7MessageObjectResponse that = (S7MessageObjectResponse) o; + return (getReturnCode() == that.getReturnCode()) + && (getTransportSize() == that.getTransportSize()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getReturnCode(), getTransportSize()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java new file mode 100644 index 00000000000..d7f55537d40 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageRequest.java @@ -0,0 +1,120 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7MessageRequest extends S7Message implements Message { + + // Accessors for discriminator values. + public Short getMessageType() { + return (short) 0x01; + } + + public S7MessageRequest(int tpduReference, S7Parameter parameter, S7Payload payload) { + super(tpduReference, parameter, payload); + } + + @Override + protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7MessageRequest"); + + writeBuffer.popContext("S7MessageRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7MessageRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("S7MessageRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7MessageRequest"); + // Create the instance + return new S7MessageRequestBuilderImpl(); + } + + public static class S7MessageRequestBuilderImpl implements S7Message.S7MessageBuilder { + + public S7MessageRequestBuilderImpl() {} + + public S7MessageRequest build(int tpduReference, S7Parameter parameter, S7Payload payload) { + S7MessageRequest s7MessageRequest = new S7MessageRequest(tpduReference, parameter, payload); + return s7MessageRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7MessageRequest)) { + return false; + } + S7MessageRequest that = (S7MessageRequest) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java new file mode 100644 index 00000000000..c32725f02a8 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponse.java @@ -0,0 +1,164 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7MessageResponse extends S7Message implements Message { + + // Accessors for discriminator values. + public Short getMessageType() { + return (short) 0x02; + } + + // Properties. + protected final short errorClass; + protected final short errorCode; + + public S7MessageResponse( + int tpduReference, + S7Parameter parameter, + S7Payload payload, + short errorClass, + short errorCode) { + super(tpduReference, parameter, payload); + this.errorClass = errorClass; + this.errorCode = errorCode; + } + + public short getErrorClass() { + return errorClass; + } + + public short getErrorCode() { + return errorCode; + } + + @Override + protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7MessageResponse"); + + // Simple Field (errorClass) + writeSimpleField("errorClass", errorClass, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (errorCode) + writeSimpleField("errorCode", errorCode, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7MessageResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7MessageResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (errorClass) + lengthInBits += 8; + + // Simple field (errorCode) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("S7MessageResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short errorClass = readSimpleField("errorClass", readUnsignedShort(readBuffer, 8)); + + short errorCode = readSimpleField("errorCode", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7MessageResponse"); + // Create the instance + return new S7MessageResponseBuilderImpl(errorClass, errorCode); + } + + public static class S7MessageResponseBuilderImpl implements S7Message.S7MessageBuilder { + private final short errorClass; + private final short errorCode; + + public S7MessageResponseBuilderImpl(short errorClass, short errorCode) { + this.errorClass = errorClass; + this.errorCode = errorCode; + } + + public S7MessageResponse build(int tpduReference, S7Parameter parameter, S7Payload payload) { + S7MessageResponse s7MessageResponse = + new S7MessageResponse(tpduReference, parameter, payload, errorClass, errorCode); + return s7MessageResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7MessageResponse)) { + return false; + } + S7MessageResponse that = (S7MessageResponse) o; + return (getErrorClass() == that.getErrorClass()) + && (getErrorCode() == that.getErrorCode()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getErrorClass(), getErrorCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java new file mode 100644 index 00000000000..a4e957df96a --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageResponseData.java @@ -0,0 +1,165 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7MessageResponseData extends S7Message implements Message { + + // Accessors for discriminator values. + public Short getMessageType() { + return (short) 0x03; + } + + // Properties. + protected final short errorClass; + protected final short errorCode; + + public S7MessageResponseData( + int tpduReference, + S7Parameter parameter, + S7Payload payload, + short errorClass, + short errorCode) { + super(tpduReference, parameter, payload); + this.errorClass = errorClass; + this.errorCode = errorCode; + } + + public short getErrorClass() { + return errorClass; + } + + public short getErrorCode() { + return errorCode; + } + + @Override + protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7MessageResponseData"); + + // Simple Field (errorClass) + writeSimpleField("errorClass", errorClass, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (errorCode) + writeSimpleField("errorCode", errorCode, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7MessageResponseData"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7MessageResponseData _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (errorClass) + lengthInBits += 8; + + // Simple field (errorCode) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("S7MessageResponseData"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short errorClass = readSimpleField("errorClass", readUnsignedShort(readBuffer, 8)); + + short errorCode = readSimpleField("errorCode", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7MessageResponseData"); + // Create the instance + return new S7MessageResponseDataBuilderImpl(errorClass, errorCode); + } + + public static class S7MessageResponseDataBuilderImpl implements S7Message.S7MessageBuilder { + private final short errorClass; + private final short errorCode; + + public S7MessageResponseDataBuilderImpl(short errorClass, short errorCode) { + this.errorClass = errorClass; + this.errorCode = errorCode; + } + + public S7MessageResponseData build( + int tpduReference, S7Parameter parameter, S7Payload payload) { + S7MessageResponseData s7MessageResponseData = + new S7MessageResponseData(tpduReference, parameter, payload, errorClass, errorCode); + return s7MessageResponseData; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7MessageResponseData)) { + return false; + } + S7MessageResponseData that = (S7MessageResponseData) o; + return (getErrorClass() == that.getErrorClass()) + && (getErrorCode() == that.getErrorCode()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getErrorClass(), getErrorCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java new file mode 100644 index 00000000000..93c380103cd --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7MessageUserData.java @@ -0,0 +1,121 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7MessageUserData extends S7Message implements Message { + + // Accessors for discriminator values. + public Short getMessageType() { + return (short) 0x07; + } + + public S7MessageUserData(int tpduReference, S7Parameter parameter, S7Payload payload) { + super(tpduReference, parameter, payload); + } + + @Override + protected void serializeS7MessageChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7MessageUserData"); + + writeBuffer.popContext("S7MessageUserData"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7MessageUserData _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7MessageBuilder staticParseS7MessageBuilder(ReadBuffer readBuffer) + throws ParseException { + readBuffer.pullContext("S7MessageUserData"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7MessageUserData"); + // Create the instance + return new S7MessageUserDataBuilderImpl(); + } + + public static class S7MessageUserDataBuilderImpl implements S7Message.S7MessageBuilder { + + public S7MessageUserDataBuilderImpl() {} + + public S7MessageUserData build(int tpduReference, S7Parameter parameter, S7Payload payload) { + S7MessageUserData s7MessageUserData = + new S7MessageUserData(tpduReference, parameter, payload); + return s7MessageUserData; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7MessageUserData)) { + return false; + } + S7MessageUserData that = (S7MessageUserData) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java new file mode 100644 index 00000000000..d02b9522305 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Parameter.java @@ -0,0 +1,187 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7Parameter implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getMessageType(); + + public abstract Short getParameterType(); + + public S7Parameter() { + super(); + } + + protected abstract void serializeS7ParameterChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7Parameter"); + + // Discriminator Field (parameterType) (Used as input to a switch field) + writeDiscriminatorField( + "parameterType", getParameterType(), writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeS7ParameterChild(writeBuffer); + + writeBuffer.popContext("S7Parameter"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7Parameter _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Discriminator Field (parameterType) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static S7Parameter staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + if ((args == null) || (args.length != 1)) { + throw new PlcRuntimeException( + "Wrong number of arguments, expected 1, but got " + args.length); + } + Short messageType; + if (args[0] instanceof Short) { + messageType = (Short) args[0]; + } else if (args[0] instanceof String) { + messageType = Short.valueOf((String) args[0]); + } else { + throw new PlcRuntimeException( + "Argument 0 expected to be of type Short or a string which is parseable but was " + + args[0].getClass().getName()); + } + return staticParse(readBuffer, messageType); + } + + public static S7Parameter staticParse(ReadBuffer readBuffer, Short messageType) + throws ParseException { + readBuffer.pullContext("S7Parameter"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short parameterType = readDiscriminatorField("parameterType", readUnsignedShort(readBuffer, 8)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7ParameterBuilder builder = null; + if (EvaluationHelper.equals(parameterType, (short) 0xF0)) { + builder = + S7ParameterSetupCommunication.staticParseS7ParameterBuilder(readBuffer, messageType); + } else if (EvaluationHelper.equals(parameterType, (short) 0x04) + && EvaluationHelper.equals(messageType, (short) 0x01)) { + builder = S7ParameterReadVarRequest.staticParseS7ParameterBuilder(readBuffer, messageType); + } else if (EvaluationHelper.equals(parameterType, (short) 0x04) + && EvaluationHelper.equals(messageType, (short) 0x03)) { + builder = S7ParameterReadVarResponse.staticParseS7ParameterBuilder(readBuffer, messageType); + } else if (EvaluationHelper.equals(parameterType, (short) 0x05) + && EvaluationHelper.equals(messageType, (short) 0x01)) { + builder = S7ParameterWriteVarRequest.staticParseS7ParameterBuilder(readBuffer, messageType); + } else if (EvaluationHelper.equals(parameterType, (short) 0x05) + && EvaluationHelper.equals(messageType, (short) 0x03)) { + builder = S7ParameterWriteVarResponse.staticParseS7ParameterBuilder(readBuffer, messageType); + } else if (EvaluationHelper.equals(parameterType, (short) 0x00) + && EvaluationHelper.equals(messageType, (short) 0x07)) { + builder = S7ParameterUserData.staticParseS7ParameterBuilder(readBuffer, messageType); + } else if (EvaluationHelper.equals(parameterType, (short) 0x01) + && EvaluationHelper.equals(messageType, (short) 0x07)) { + builder = S7ParameterModeTransition.staticParseS7ParameterBuilder(readBuffer, messageType); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "parameterType=" + + parameterType + + " " + + "messageType=" + + messageType + + "]"); + } + + readBuffer.closeContext("S7Parameter"); + // Create the instance + S7Parameter _s7Parameter = builder.build(); + return _s7Parameter; + } + + public interface S7ParameterBuilder { + S7Parameter build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7Parameter)) { + return false; + } + S7Parameter that = (S7Parameter) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java new file mode 100644 index 00000000000..8858e89a028 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterModeTransition.java @@ -0,0 +1,252 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterModeTransition extends S7Parameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0x01; + } + + public Short getMessageType() { + return (short) 0x07; + } + + // Properties. + protected final short method; + protected final byte cpuFunctionType; + protected final byte cpuFunctionGroup; + protected final short currentMode; + protected final short sequenceNumber; + + public S7ParameterModeTransition( + short method, + byte cpuFunctionType, + byte cpuFunctionGroup, + short currentMode, + short sequenceNumber) { + super(); + this.method = method; + this.cpuFunctionType = cpuFunctionType; + this.cpuFunctionGroup = cpuFunctionGroup; + this.currentMode = currentMode; + this.sequenceNumber = sequenceNumber; + } + + public short getMethod() { + return method; + } + + public byte getCpuFunctionType() { + return cpuFunctionType; + } + + public byte getCpuFunctionGroup() { + return cpuFunctionGroup; + } + + public short getCurrentMode() { + return currentMode; + } + + public short getSequenceNumber() { + return sequenceNumber; + } + + @Override + protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterModeTransition"); + + // Reserved Field (reserved) + writeReservedField("reserved", (int) 0x0010, writeUnsignedInt(writeBuffer, 16)); + + // Implicit Field (itemLength) (Used for parsing, but its value is not stored as it's implicitly + // given by the objects content) + short itemLength = (short) ((getLengthInBytes()) - (2)); + writeImplicitField("itemLength", itemLength, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (method) + writeSimpleField("method", method, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (cpuFunctionType) + writeSimpleField("cpuFunctionType", cpuFunctionType, writeUnsignedByte(writeBuffer, 4)); + + // Simple Field (cpuFunctionGroup) + writeSimpleField("cpuFunctionGroup", cpuFunctionGroup, writeUnsignedByte(writeBuffer, 4)); + + // Simple Field (currentMode) + writeSimpleField("currentMode", currentMode, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (sequenceNumber) + writeSimpleField("sequenceNumber", sequenceNumber, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7ParameterModeTransition"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterModeTransition _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Reserved Field (reserved) + lengthInBits += 16; + + // Implicit Field (itemLength) + lengthInBits += 8; + + // Simple field (method) + lengthInBits += 8; + + // Simple field (cpuFunctionType) + lengthInBits += 4; + + // Simple field (cpuFunctionGroup) + lengthInBits += 4; + + // Simple field (currentMode) + lengthInBits += 8; + + // Simple field (sequenceNumber) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7ParameterBuilder staticParseS7ParameterBuilder( + ReadBuffer readBuffer, Short messageType) throws ParseException { + readBuffer.pullContext("S7ParameterModeTransition"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + Integer reservedField0 = + readReservedField("reserved", readUnsignedInt(readBuffer, 16), (int) 0x0010); + + short itemLength = readImplicitField("itemLength", readUnsignedShort(readBuffer, 8)); + + short method = readSimpleField("method", readUnsignedShort(readBuffer, 8)); + + byte cpuFunctionType = readSimpleField("cpuFunctionType", readUnsignedByte(readBuffer, 4)); + + byte cpuFunctionGroup = readSimpleField("cpuFunctionGroup", readUnsignedByte(readBuffer, 4)); + + short currentMode = readSimpleField("currentMode", readUnsignedShort(readBuffer, 8)); + + short sequenceNumber = readSimpleField("sequenceNumber", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7ParameterModeTransition"); + // Create the instance + return new S7ParameterModeTransitionBuilderImpl( + method, cpuFunctionType, cpuFunctionGroup, currentMode, sequenceNumber); + } + + public static class S7ParameterModeTransitionBuilderImpl + implements S7Parameter.S7ParameterBuilder { + private final short method; + private final byte cpuFunctionType; + private final byte cpuFunctionGroup; + private final short currentMode; + private final short sequenceNumber; + + public S7ParameterModeTransitionBuilderImpl( + short method, + byte cpuFunctionType, + byte cpuFunctionGroup, + short currentMode, + short sequenceNumber) { + this.method = method; + this.cpuFunctionType = cpuFunctionType; + this.cpuFunctionGroup = cpuFunctionGroup; + this.currentMode = currentMode; + this.sequenceNumber = sequenceNumber; + } + + public S7ParameterModeTransition build() { + S7ParameterModeTransition s7ParameterModeTransition = + new S7ParameterModeTransition( + method, cpuFunctionType, cpuFunctionGroup, currentMode, sequenceNumber); + return s7ParameterModeTransition; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterModeTransition)) { + return false; + } + S7ParameterModeTransition that = (S7ParameterModeTransition) o; + return (getMethod() == that.getMethod()) + && (getCpuFunctionType() == that.getCpuFunctionType()) + && (getCpuFunctionGroup() == that.getCpuFunctionGroup()) + && (getCurrentMode() == that.getCurrentMode()) + && (getSequenceNumber() == that.getSequenceNumber()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), + getMethod(), + getCpuFunctionType(), + getCpuFunctionGroup(), + getCurrentMode(), + getSequenceNumber()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java new file mode 100644 index 00000000000..1cd784f0ee9 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarRequest.java @@ -0,0 +1,165 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterReadVarRequest extends S7Parameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0x04; + } + + public Short getMessageType() { + return (short) 0x01; + } + + // Properties. + protected final List items; + + public S7ParameterReadVarRequest(List items) { + super(); + this.items = items; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterReadVarRequest"); + + // Implicit Field (numItems) (Used for parsing, but its value is not stored as it's implicitly + // given by the objects content) + short numItems = (short) (COUNT(getItems())); + writeImplicitField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7ParameterReadVarRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterReadVarRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Implicit Field (numItems) + lengthInBits += 8; + + // Array field + if (items != null) { + int i = 0; + for (S7VarRequestParameterItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7ParameterBuilder staticParseS7ParameterBuilder( + ReadBuffer readBuffer, Short messageType) throws ParseException { + readBuffer.pullContext("S7ParameterReadVarRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short numItems = readImplicitField("numItems", readUnsignedShort(readBuffer, 8)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> S7VarRequestParameterItem.staticParse(readBuffer), readBuffer), + numItems); + + readBuffer.closeContext("S7ParameterReadVarRequest"); + // Create the instance + return new S7ParameterReadVarRequestBuilderImpl(items); + } + + public static class S7ParameterReadVarRequestBuilderImpl + implements S7Parameter.S7ParameterBuilder { + private final List items; + + public S7ParameterReadVarRequestBuilderImpl(List items) { + this.items = items; + } + + public S7ParameterReadVarRequest build() { + S7ParameterReadVarRequest s7ParameterReadVarRequest = new S7ParameterReadVarRequest(items); + return s7ParameterReadVarRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterReadVarRequest)) { + return false; + } + S7ParameterReadVarRequest that = (S7ParameterReadVarRequest) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java new file mode 100644 index 00000000000..c79fc96629b --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterReadVarResponse.java @@ -0,0 +1,145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterReadVarResponse extends S7Parameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0x04; + } + + public Short getMessageType() { + return (short) 0x03; + } + + // Properties. + protected final short numItems; + + public S7ParameterReadVarResponse(short numItems) { + super(); + this.numItems = numItems; + } + + public short getNumItems() { + return numItems; + } + + @Override + protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterReadVarResponse"); + + // Simple Field (numItems) + writeSimpleField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7ParameterReadVarResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterReadVarResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (numItems) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7ParameterBuilder staticParseS7ParameterBuilder( + ReadBuffer readBuffer, Short messageType) throws ParseException { + readBuffer.pullContext("S7ParameterReadVarResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short numItems = readSimpleField("numItems", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7ParameterReadVarResponse"); + // Create the instance + return new S7ParameterReadVarResponseBuilderImpl(numItems); + } + + public static class S7ParameterReadVarResponseBuilderImpl + implements S7Parameter.S7ParameterBuilder { + private final short numItems; + + public S7ParameterReadVarResponseBuilderImpl(short numItems) { + this.numItems = numItems; + } + + public S7ParameterReadVarResponse build() { + S7ParameterReadVarResponse s7ParameterReadVarResponse = + new S7ParameterReadVarResponse(numItems); + return s7ParameterReadVarResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterReadVarResponse)) { + return false; + } + S7ParameterReadVarResponse that = (S7ParameterReadVarResponse) o; + return (getNumItems() == that.getNumItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getNumItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java new file mode 100644 index 00000000000..c9d4cf0974e --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterSetupCommunication.java @@ -0,0 +1,191 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterSetupCommunication extends S7Parameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0xF0; + } + + public Short getMessageType() { + return 0; + } + + // Properties. + protected final int maxAmqCaller; + protected final int maxAmqCallee; + protected final int pduLength; + + public S7ParameterSetupCommunication(int maxAmqCaller, int maxAmqCallee, int pduLength) { + super(); + this.maxAmqCaller = maxAmqCaller; + this.maxAmqCallee = maxAmqCallee; + this.pduLength = pduLength; + } + + public int getMaxAmqCaller() { + return maxAmqCaller; + } + + public int getMaxAmqCallee() { + return maxAmqCallee; + } + + public int getPduLength() { + return pduLength; + } + + @Override + protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterSetupCommunication"); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (maxAmqCaller) + writeSimpleField("maxAmqCaller", maxAmqCaller, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (maxAmqCallee) + writeSimpleField("maxAmqCallee", maxAmqCallee, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (pduLength) + writeSimpleField("pduLength", pduLength, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("S7ParameterSetupCommunication"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterSetupCommunication _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Reserved Field (reserved) + lengthInBits += 8; + + // Simple field (maxAmqCaller) + lengthInBits += 16; + + // Simple field (maxAmqCallee) + lengthInBits += 16; + + // Simple field (pduLength) + lengthInBits += 16; + + return lengthInBits; + } + + public static S7ParameterBuilder staticParseS7ParameterBuilder( + ReadBuffer readBuffer, Short messageType) throws ParseException { + readBuffer.pullContext("S7ParameterSetupCommunication"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + Short reservedField0 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); + + int maxAmqCaller = readSimpleField("maxAmqCaller", readUnsignedInt(readBuffer, 16)); + + int maxAmqCallee = readSimpleField("maxAmqCallee", readUnsignedInt(readBuffer, 16)); + + int pduLength = readSimpleField("pduLength", readUnsignedInt(readBuffer, 16)); + + readBuffer.closeContext("S7ParameterSetupCommunication"); + // Create the instance + return new S7ParameterSetupCommunicationBuilderImpl(maxAmqCaller, maxAmqCallee, pduLength); + } + + public static class S7ParameterSetupCommunicationBuilderImpl + implements S7Parameter.S7ParameterBuilder { + private final int maxAmqCaller; + private final int maxAmqCallee; + private final int pduLength; + + public S7ParameterSetupCommunicationBuilderImpl( + int maxAmqCaller, int maxAmqCallee, int pduLength) { + this.maxAmqCaller = maxAmqCaller; + this.maxAmqCallee = maxAmqCallee; + this.pduLength = pduLength; + } + + public S7ParameterSetupCommunication build() { + S7ParameterSetupCommunication s7ParameterSetupCommunication = + new S7ParameterSetupCommunication(maxAmqCaller, maxAmqCallee, pduLength); + return s7ParameterSetupCommunication; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterSetupCommunication)) { + return false; + } + S7ParameterSetupCommunication that = (S7ParameterSetupCommunication) o; + return (getMaxAmqCaller() == that.getMaxAmqCaller()) + && (getMaxAmqCallee() == that.getMaxAmqCallee()) + && (getPduLength() == that.getPduLength()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getMaxAmqCaller(), getMaxAmqCallee(), getPduLength()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java new file mode 100644 index 00000000000..a0013a3181f --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserData.java @@ -0,0 +1,164 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterUserData extends S7Parameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0x00; + } + + public Short getMessageType() { + return (short) 0x07; + } + + // Properties. + protected final List items; + + public S7ParameterUserData(List items) { + super(); + this.items = items; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterUserData"); + + // Implicit Field (numItems) (Used for parsing, but its value is not stored as it's implicitly + // given by the objects content) + short numItems = (short) (COUNT(getItems())); + writeImplicitField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7ParameterUserData"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterUserData _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Implicit Field (numItems) + lengthInBits += 8; + + // Array field + if (items != null) { + int i = 0; + for (S7ParameterUserDataItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7ParameterBuilder staticParseS7ParameterBuilder( + ReadBuffer readBuffer, Short messageType) throws ParseException { + readBuffer.pullContext("S7ParameterUserData"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short numItems = readImplicitField("numItems", readUnsignedShort(readBuffer, 8)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> S7ParameterUserDataItem.staticParse(readBuffer), readBuffer), + numItems); + + readBuffer.closeContext("S7ParameterUserData"); + // Create the instance + return new S7ParameterUserDataBuilderImpl(items); + } + + public static class S7ParameterUserDataBuilderImpl implements S7Parameter.S7ParameterBuilder { + private final List items; + + public S7ParameterUserDataBuilderImpl(List items) { + this.items = items; + } + + public S7ParameterUserData build() { + S7ParameterUserData s7ParameterUserData = new S7ParameterUserData(items); + return s7ParameterUserData; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterUserData)) { + return false; + } + S7ParameterUserData that = (S7ParameterUserData) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java new file mode 100644 index 00000000000..b041ad34770 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItem.java @@ -0,0 +1,148 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7ParameterUserDataItem implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getItemType(); + + public S7ParameterUserDataItem() { + super(); + } + + protected abstract void serializeS7ParameterUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterUserDataItem"); + + // Discriminator Field (itemType) (Used as input to a switch field) + writeDiscriminatorField("itemType", getItemType(), writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeS7ParameterUserDataItemChild(writeBuffer); + + writeBuffer.popContext("S7ParameterUserDataItem"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7ParameterUserDataItem _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Discriminator Field (itemType) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static S7ParameterUserDataItem staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static S7ParameterUserDataItem staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7ParameterUserDataItem"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short itemType = readDiscriminatorField("itemType", readUnsignedShort(readBuffer, 8)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7ParameterUserDataItemBuilder builder = null; + if (EvaluationHelper.equals(itemType, (short) 0x12)) { + builder = + S7ParameterUserDataItemCPUFunctions.staticParseS7ParameterUserDataItemBuilder(readBuffer); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "itemType=" + + itemType + + "]"); + } + + readBuffer.closeContext("S7ParameterUserDataItem"); + // Create the instance + S7ParameterUserDataItem _s7ParameterUserDataItem = builder.build(); + return _s7ParameterUserDataItem; + } + + public interface S7ParameterUserDataItemBuilder { + S7ParameterUserDataItem build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterUserDataItem)) { + return false; + } + S7ParameterUserDataItem that = (S7ParameterUserDataItem) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java new file mode 100644 index 00000000000..7f330b5b2b7 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterUserDataItemCPUFunctions.java @@ -0,0 +1,337 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterUserDataItemCPUFunctions extends S7ParameterUserDataItem + implements Message { + + // Accessors for discriminator values. + public Short getItemType() { + return (short) 0x12; + } + + // Properties. + protected final short method; + protected final byte cpuFunctionType; + protected final byte cpuFunctionGroup; + protected final short cpuSubfunction; + protected final short sequenceNumber; + protected final Short dataUnitReferenceNumber; + protected final Short lastDataUnit; + protected final Integer errorCode; + + public S7ParameterUserDataItemCPUFunctions( + short method, + byte cpuFunctionType, + byte cpuFunctionGroup, + short cpuSubfunction, + short sequenceNumber, + Short dataUnitReferenceNumber, + Short lastDataUnit, + Integer errorCode) { + super(); + this.method = method; + this.cpuFunctionType = cpuFunctionType; + this.cpuFunctionGroup = cpuFunctionGroup; + this.cpuSubfunction = cpuSubfunction; + this.sequenceNumber = sequenceNumber; + this.dataUnitReferenceNumber = dataUnitReferenceNumber; + this.lastDataUnit = lastDataUnit; + this.errorCode = errorCode; + } + + public short getMethod() { + return method; + } + + public byte getCpuFunctionType() { + return cpuFunctionType; + } + + public byte getCpuFunctionGroup() { + return cpuFunctionGroup; + } + + public short getCpuSubfunction() { + return cpuSubfunction; + } + + public short getSequenceNumber() { + return sequenceNumber; + } + + public Short getDataUnitReferenceNumber() { + return dataUnitReferenceNumber; + } + + public Short getLastDataUnit() { + return lastDataUnit; + } + + public Integer getErrorCode() { + return errorCode; + } + + @Override + protected void serializeS7ParameterUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterUserDataItemCPUFunctions"); + + // Implicit Field (itemLength) (Used for parsing, but its value is not stored as it's implicitly + // given by the objects content) + short itemLength = (short) ((getLengthInBytes()) - (2)); + writeImplicitField("itemLength", itemLength, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (method) + writeSimpleField("method", method, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (cpuFunctionType) + writeSimpleField("cpuFunctionType", cpuFunctionType, writeUnsignedByte(writeBuffer, 4)); + + // Simple Field (cpuFunctionGroup) + writeSimpleField("cpuFunctionGroup", cpuFunctionGroup, writeUnsignedByte(writeBuffer, 4)); + + // Simple Field (cpuSubfunction) + writeSimpleField("cpuSubfunction", cpuSubfunction, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (sequenceNumber) + writeSimpleField("sequenceNumber", sequenceNumber, writeUnsignedShort(writeBuffer, 8)); + + // Optional Field (dataUnitReferenceNumber) (Can be skipped, if the value is null) + writeOptionalField( + "dataUnitReferenceNumber", dataUnitReferenceNumber, writeUnsignedShort(writeBuffer, 8)); + + // Optional Field (lastDataUnit) (Can be skipped, if the value is null) + writeOptionalField("lastDataUnit", lastDataUnit, writeUnsignedShort(writeBuffer, 8)); + + // Optional Field (errorCode) (Can be skipped, if the value is null) + writeOptionalField("errorCode", errorCode, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("S7ParameterUserDataItemCPUFunctions"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterUserDataItemCPUFunctions _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Implicit Field (itemLength) + lengthInBits += 8; + + // Simple field (method) + lengthInBits += 8; + + // Simple field (cpuFunctionType) + lengthInBits += 4; + + // Simple field (cpuFunctionGroup) + lengthInBits += 4; + + // Simple field (cpuSubfunction) + lengthInBits += 8; + + // Simple field (sequenceNumber) + lengthInBits += 8; + + // Optional Field (dataUnitReferenceNumber) + if (dataUnitReferenceNumber != null) { + lengthInBits += 8; + } + + // Optional Field (lastDataUnit) + if (lastDataUnit != null) { + lengthInBits += 8; + } + + // Optional Field (errorCode) + if (errorCode != null) { + lengthInBits += 16; + } + + return lengthInBits; + } + + public static S7ParameterUserDataItemBuilder staticParseS7ParameterUserDataItemBuilder( + ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7ParameterUserDataItemCPUFunctions"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short itemLength = readImplicitField("itemLength", readUnsignedShort(readBuffer, 8)); + + short method = readSimpleField("method", readUnsignedShort(readBuffer, 8)); + + byte cpuFunctionType = readSimpleField("cpuFunctionType", readUnsignedByte(readBuffer, 4)); + + byte cpuFunctionGroup = readSimpleField("cpuFunctionGroup", readUnsignedByte(readBuffer, 4)); + + short cpuSubfunction = readSimpleField("cpuSubfunction", readUnsignedShort(readBuffer, 8)); + + short sequenceNumber = readSimpleField("sequenceNumber", readUnsignedShort(readBuffer, 8)); + + Short dataUnitReferenceNumber = + readOptionalField( + "dataUnitReferenceNumber", + readUnsignedShort(readBuffer, 8), + (((cpuFunctionType) == (8))) + || (((((cpuFunctionType) == (0))) && (((cpuFunctionGroup) == (2)))))); + + Short lastDataUnit = + readOptionalField( + "lastDataUnit", + readUnsignedShort(readBuffer, 8), + (((cpuFunctionType) == (8))) + || (((((cpuFunctionType) == (0))) && (((cpuFunctionGroup) == (2)))))); + + Integer errorCode = + readOptionalField( + "errorCode", + readUnsignedInt(readBuffer, 16), + (((cpuFunctionType) == (8))) + || (((((cpuFunctionType) == (0))) && (((cpuFunctionGroup) == (2)))))); + + readBuffer.closeContext("S7ParameterUserDataItemCPUFunctions"); + // Create the instance + return new S7ParameterUserDataItemCPUFunctionsBuilderImpl( + method, + cpuFunctionType, + cpuFunctionGroup, + cpuSubfunction, + sequenceNumber, + dataUnitReferenceNumber, + lastDataUnit, + errorCode); + } + + public static class S7ParameterUserDataItemCPUFunctionsBuilderImpl + implements S7ParameterUserDataItem.S7ParameterUserDataItemBuilder { + private final short method; + private final byte cpuFunctionType; + private final byte cpuFunctionGroup; + private final short cpuSubfunction; + private final short sequenceNumber; + private final Short dataUnitReferenceNumber; + private final Short lastDataUnit; + private final Integer errorCode; + + public S7ParameterUserDataItemCPUFunctionsBuilderImpl( + short method, + byte cpuFunctionType, + byte cpuFunctionGroup, + short cpuSubfunction, + short sequenceNumber, + Short dataUnitReferenceNumber, + Short lastDataUnit, + Integer errorCode) { + this.method = method; + this.cpuFunctionType = cpuFunctionType; + this.cpuFunctionGroup = cpuFunctionGroup; + this.cpuSubfunction = cpuSubfunction; + this.sequenceNumber = sequenceNumber; + this.dataUnitReferenceNumber = dataUnitReferenceNumber; + this.lastDataUnit = lastDataUnit; + this.errorCode = errorCode; + } + + public S7ParameterUserDataItemCPUFunctions build() { + S7ParameterUserDataItemCPUFunctions s7ParameterUserDataItemCPUFunctions = + new S7ParameterUserDataItemCPUFunctions( + method, + cpuFunctionType, + cpuFunctionGroup, + cpuSubfunction, + sequenceNumber, + dataUnitReferenceNumber, + lastDataUnit, + errorCode); + return s7ParameterUserDataItemCPUFunctions; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterUserDataItemCPUFunctions)) { + return false; + } + S7ParameterUserDataItemCPUFunctions that = (S7ParameterUserDataItemCPUFunctions) o; + return (getMethod() == that.getMethod()) + && (getCpuFunctionType() == that.getCpuFunctionType()) + && (getCpuFunctionGroup() == that.getCpuFunctionGroup()) + && (getCpuSubfunction() == that.getCpuSubfunction()) + && (getSequenceNumber() == that.getSequenceNumber()) + && (getDataUnitReferenceNumber() == that.getDataUnitReferenceNumber()) + && (getLastDataUnit() == that.getLastDataUnit()) + && (getErrorCode() == that.getErrorCode()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), + getMethod(), + getCpuFunctionType(), + getCpuFunctionGroup(), + getCpuSubfunction(), + getSequenceNumber(), + getDataUnitReferenceNumber(), + getLastDataUnit(), + getErrorCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java new file mode 100644 index 00000000000..b70182a707d --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarRequest.java @@ -0,0 +1,165 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterWriteVarRequest extends S7Parameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0x05; + } + + public Short getMessageType() { + return (short) 0x01; + } + + // Properties. + protected final List items; + + public S7ParameterWriteVarRequest(List items) { + super(); + this.items = items; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterWriteVarRequest"); + + // Implicit Field (numItems) (Used for parsing, but its value is not stored as it's implicitly + // given by the objects content) + short numItems = (short) (COUNT(getItems())); + writeImplicitField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7ParameterWriteVarRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterWriteVarRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Implicit Field (numItems) + lengthInBits += 8; + + // Array field + if (items != null) { + int i = 0; + for (S7VarRequestParameterItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7ParameterBuilder staticParseS7ParameterBuilder( + ReadBuffer readBuffer, Short messageType) throws ParseException { + readBuffer.pullContext("S7ParameterWriteVarRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short numItems = readImplicitField("numItems", readUnsignedShort(readBuffer, 8)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> S7VarRequestParameterItem.staticParse(readBuffer), readBuffer), + numItems); + + readBuffer.closeContext("S7ParameterWriteVarRequest"); + // Create the instance + return new S7ParameterWriteVarRequestBuilderImpl(items); + } + + public static class S7ParameterWriteVarRequestBuilderImpl + implements S7Parameter.S7ParameterBuilder { + private final List items; + + public S7ParameterWriteVarRequestBuilderImpl(List items) { + this.items = items; + } + + public S7ParameterWriteVarRequest build() { + S7ParameterWriteVarRequest s7ParameterWriteVarRequest = new S7ParameterWriteVarRequest(items); + return s7ParameterWriteVarRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterWriteVarRequest)) { + return false; + } + S7ParameterWriteVarRequest that = (S7ParameterWriteVarRequest) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java new file mode 100644 index 00000000000..58fb3442e63 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7ParameterWriteVarResponse.java @@ -0,0 +1,145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7ParameterWriteVarResponse extends S7Parameter implements Message { + + // Accessors for discriminator values. + public Short getParameterType() { + return (short) 0x05; + } + + public Short getMessageType() { + return (short) 0x03; + } + + // Properties. + protected final short numItems; + + public S7ParameterWriteVarResponse(short numItems) { + super(); + this.numItems = numItems; + } + + public short getNumItems() { + return numItems; + } + + @Override + protected void serializeS7ParameterChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7ParameterWriteVarResponse"); + + // Simple Field (numItems) + writeSimpleField("numItems", numItems, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7ParameterWriteVarResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7ParameterWriteVarResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (numItems) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7ParameterBuilder staticParseS7ParameterBuilder( + ReadBuffer readBuffer, Short messageType) throws ParseException { + readBuffer.pullContext("S7ParameterWriteVarResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short numItems = readSimpleField("numItems", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7ParameterWriteVarResponse"); + // Create the instance + return new S7ParameterWriteVarResponseBuilderImpl(numItems); + } + + public static class S7ParameterWriteVarResponseBuilderImpl + implements S7Parameter.S7ParameterBuilder { + private final short numItems; + + public S7ParameterWriteVarResponseBuilderImpl(short numItems) { + this.numItems = numItems; + } + + public S7ParameterWriteVarResponse build() { + S7ParameterWriteVarResponse s7ParameterWriteVarResponse = + new S7ParameterWriteVarResponse(numItems); + return s7ParameterWriteVarResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7ParameterWriteVarResponse)) { + return false; + } + S7ParameterWriteVarResponse that = (S7ParameterWriteVarResponse) o; + return (getNumItems() == that.getNumItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getNumItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java new file mode 100644 index 00000000000..27068e8ebcc --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7Payload.java @@ -0,0 +1,179 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7Payload implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getMessageType(); + + public abstract Short getParameterParameterType(); + + public S7Payload() { + super(); + } + + protected abstract void serializeS7PayloadChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7Payload"); + + // Switch field (Serialize the sub-type) + serializeS7PayloadChild(writeBuffer); + + writeBuffer.popContext("S7Payload"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7Payload _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static S7Payload staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { + PositionAware positionAware = readBuffer; + if ((args == null) || (args.length != 2)) { + throw new PlcRuntimeException( + "Wrong number of arguments, expected 2, but got " + args.length); + } + Short messageType; + if (args[0] instanceof Short) { + messageType = (Short) args[0]; + } else if (args[0] instanceof String) { + messageType = Short.valueOf((String) args[0]); + } else { + throw new PlcRuntimeException( + "Argument 0 expected to be of type Short or a string which is parseable but was " + + args[0].getClass().getName()); + } + S7Parameter parameter; + if (args[1] instanceof S7Parameter) { + parameter = (S7Parameter) args[1]; + } else { + throw new PlcRuntimeException( + "Argument 1 expected to be of type S7Parameter or a string which is parseable but was " + + args[1].getClass().getName()); + } + return staticParse(readBuffer, messageType, parameter); + } + + public static S7Payload staticParse( + ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { + readBuffer.pullContext("S7Payload"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7PayloadBuilder builder = null; + if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x04) + && EvaluationHelper.equals(messageType, (short) 0x03)) { + builder = + S7PayloadReadVarResponse.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); + } else if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x05) + && EvaluationHelper.equals(messageType, (short) 0x01)) { + builder = + S7PayloadWriteVarRequest.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); + } else if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x05) + && EvaluationHelper.equals(messageType, (short) 0x03)) { + builder = + S7PayloadWriteVarResponse.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); + } else if (EvaluationHelper.equals(parameter.getParameterType(), (short) 0x00) + && EvaluationHelper.equals(messageType, (short) 0x07)) { + builder = S7PayloadUserData.staticParseS7PayloadBuilder(readBuffer, messageType, parameter); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "parameterparameterType=" + + parameter.getParameterType() + + " " + + "messageType=" + + messageType + + "]"); + } + + readBuffer.closeContext("S7Payload"); + // Create the instance + S7Payload _s7Payload = builder.build(); + return _s7Payload; + } + + public interface S7PayloadBuilder { + S7Payload build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7Payload)) { + return false; + } + S7Payload that = (S7Payload) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java new file mode 100644 index 00000000000..8642ab90b7e --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarm8.java @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadAlarm8 extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x05; + } + + // Properties. + protected final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarm8( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + AlarmMessagePushType alarmMessage) { + super(returnCode, transportSize, dataLength); + this.alarmMessage = alarmMessage; + } + + public AlarmMessagePushType getAlarmMessage() { + return alarmMessage; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadAlarm8"); + + // Simple Field (alarmMessage) + writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadAlarm8"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadAlarm8 _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (alarmMessage) + lengthInBits += alarmMessage.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadAlarm8"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + AlarmMessagePushType alarmMessage = + readSimpleField( + "alarmMessage", + new DataReaderComplexDefault<>( + () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadAlarm8"); + // Create the instance + return new S7PayloadAlarm8BuilderImpl(alarmMessage); + } + + public static class S7PayloadAlarm8BuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarm8BuilderImpl(AlarmMessagePushType alarmMessage) { + this.alarmMessage = alarmMessage; + } + + public S7PayloadAlarm8 build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadAlarm8 s7PayloadAlarm8 = + new S7PayloadAlarm8(returnCode, transportSize, dataLength, alarmMessage); + return s7PayloadAlarm8; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadAlarm8)) { + return false; + } + S7PayloadAlarm8 that = (S7PayloadAlarm8) o; + return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAlarmMessage()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java new file mode 100644 index 00000000000..15880f9c2af --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmAckInd.java @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadAlarmAckInd extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x0c; + } + + // Properties. + protected final AlarmMessageAckPushType alarmMessage; + + public S7PayloadAlarmAckInd( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + AlarmMessageAckPushType alarmMessage) { + super(returnCode, transportSize, dataLength); + this.alarmMessage = alarmMessage; + } + + public AlarmMessageAckPushType getAlarmMessage() { + return alarmMessage; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadAlarmAckInd"); + + // Simple Field (alarmMessage) + writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadAlarmAckInd"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadAlarmAckInd _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (alarmMessage) + lengthInBits += alarmMessage.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadAlarmAckInd"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + AlarmMessageAckPushType alarmMessage = + readSimpleField( + "alarmMessage", + new DataReaderComplexDefault<>( + () -> AlarmMessageAckPushType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadAlarmAckInd"); + // Create the instance + return new S7PayloadAlarmAckIndBuilderImpl(alarmMessage); + } + + public static class S7PayloadAlarmAckIndBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final AlarmMessageAckPushType alarmMessage; + + public S7PayloadAlarmAckIndBuilderImpl(AlarmMessageAckPushType alarmMessage) { + this.alarmMessage = alarmMessage; + } + + public S7PayloadAlarmAckInd build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadAlarmAckInd s7PayloadAlarmAckInd = + new S7PayloadAlarmAckInd(returnCode, transportSize, dataLength, alarmMessage); + return s7PayloadAlarmAckInd; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadAlarmAckInd)) { + return false; + } + S7PayloadAlarmAckInd that = (S7PayloadAlarmAckInd) o; + return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAlarmMessage()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java new file mode 100644 index 00000000000..24a994f5fc1 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmS.java @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadAlarmS extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x12; + } + + // Properties. + protected final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarmS( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + AlarmMessagePushType alarmMessage) { + super(returnCode, transportSize, dataLength); + this.alarmMessage = alarmMessage; + } + + public AlarmMessagePushType getAlarmMessage() { + return alarmMessage; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadAlarmS"); + + // Simple Field (alarmMessage) + writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadAlarmS"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadAlarmS _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (alarmMessage) + lengthInBits += alarmMessage.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadAlarmS"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + AlarmMessagePushType alarmMessage = + readSimpleField( + "alarmMessage", + new DataReaderComplexDefault<>( + () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadAlarmS"); + // Create the instance + return new S7PayloadAlarmSBuilderImpl(alarmMessage); + } + + public static class S7PayloadAlarmSBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarmSBuilderImpl(AlarmMessagePushType alarmMessage) { + this.alarmMessage = alarmMessage; + } + + public S7PayloadAlarmS build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadAlarmS s7PayloadAlarmS = + new S7PayloadAlarmS(returnCode, transportSize, dataLength, alarmMessage); + return s7PayloadAlarmS; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadAlarmS)) { + return false; + } + S7PayloadAlarmS that = (S7PayloadAlarmS) o; + return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAlarmMessage()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java new file mode 100644 index 00000000000..e1ca33f3648 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSC.java @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadAlarmSC extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x13; + } + + // Properties. + protected final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarmSC( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + AlarmMessagePushType alarmMessage) { + super(returnCode, transportSize, dataLength); + this.alarmMessage = alarmMessage; + } + + public AlarmMessagePushType getAlarmMessage() { + return alarmMessage; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadAlarmSC"); + + // Simple Field (alarmMessage) + writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadAlarmSC"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadAlarmSC _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (alarmMessage) + lengthInBits += alarmMessage.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadAlarmSC"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + AlarmMessagePushType alarmMessage = + readSimpleField( + "alarmMessage", + new DataReaderComplexDefault<>( + () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadAlarmSC"); + // Create the instance + return new S7PayloadAlarmSCBuilderImpl(alarmMessage); + } + + public static class S7PayloadAlarmSCBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarmSCBuilderImpl(AlarmMessagePushType alarmMessage) { + this.alarmMessage = alarmMessage; + } + + public S7PayloadAlarmSC build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadAlarmSC s7PayloadAlarmSC = + new S7PayloadAlarmSC(returnCode, transportSize, dataLength, alarmMessage); + return s7PayloadAlarmSC; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadAlarmSC)) { + return false; + } + S7PayloadAlarmSC that = (S7PayloadAlarmSC) o; + return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAlarmMessage()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java new file mode 100644 index 00000000000..d944a03afc9 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadAlarmSQ.java @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadAlarmSQ extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x11; + } + + // Properties. + protected final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarmSQ( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + AlarmMessagePushType alarmMessage) { + super(returnCode, transportSize, dataLength); + this.alarmMessage = alarmMessage; + } + + public AlarmMessagePushType getAlarmMessage() { + return alarmMessage; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadAlarmSQ"); + + // Simple Field (alarmMessage) + writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadAlarmSQ"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadAlarmSQ _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (alarmMessage) + lengthInBits += alarmMessage.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadAlarmSQ"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + AlarmMessagePushType alarmMessage = + readSimpleField( + "alarmMessage", + new DataReaderComplexDefault<>( + () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadAlarmSQ"); + // Create the instance + return new S7PayloadAlarmSQBuilderImpl(alarmMessage); + } + + public static class S7PayloadAlarmSQBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final AlarmMessagePushType alarmMessage; + + public S7PayloadAlarmSQBuilderImpl(AlarmMessagePushType alarmMessage) { + this.alarmMessage = alarmMessage; + } + + public S7PayloadAlarmSQ build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadAlarmSQ s7PayloadAlarmSQ = + new S7PayloadAlarmSQ(returnCode, transportSize, dataLength, alarmMessage); + return s7PayloadAlarmSQ; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadAlarmSQ)) { + return false; + } + S7PayloadAlarmSQ that = (S7PayloadAlarmSQ) o; + return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAlarmMessage()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java new file mode 100644 index 00000000000..f22947b4779 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadDiagnosticMessage.java @@ -0,0 +1,295 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadDiagnosticMessage extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x03; + } + + // Properties. + protected final int EventId; + protected final short PriorityClass; + protected final short ObNumber; + protected final int DatId; + protected final int Info1; + protected final long Info2; + protected final DateAndTime TimeStamp; + + public S7PayloadDiagnosticMessage( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + int EventId, + short PriorityClass, + short ObNumber, + int DatId, + int Info1, + long Info2, + DateAndTime TimeStamp) { + super(returnCode, transportSize, dataLength); + this.EventId = EventId; + this.PriorityClass = PriorityClass; + this.ObNumber = ObNumber; + this.DatId = DatId; + this.Info1 = Info1; + this.Info2 = Info2; + this.TimeStamp = TimeStamp; + } + + public int getEventId() { + return EventId; + } + + public short getPriorityClass() { + return PriorityClass; + } + + public short getObNumber() { + return ObNumber; + } + + public int getDatId() { + return DatId; + } + + public int getInfo1() { + return Info1; + } + + public long getInfo2() { + return Info2; + } + + public DateAndTime getTimeStamp() { + return TimeStamp; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadDiagnosticMessage"); + + // Simple Field (EventId) + writeSimpleField("EventId", EventId, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (PriorityClass) + writeSimpleField("PriorityClass", PriorityClass, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (ObNumber) + writeSimpleField("ObNumber", ObNumber, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (DatId) + writeSimpleField("DatId", DatId, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (Info1) + writeSimpleField("Info1", Info1, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (Info2) + writeSimpleField("Info2", Info2, writeUnsignedLong(writeBuffer, 32)); + + // Simple Field (TimeStamp) + writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadDiagnosticMessage"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadDiagnosticMessage _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (EventId) + lengthInBits += 16; + + // Simple field (PriorityClass) + lengthInBits += 8; + + // Simple field (ObNumber) + lengthInBits += 8; + + // Simple field (DatId) + lengthInBits += 16; + + // Simple field (Info1) + lengthInBits += 16; + + // Simple field (Info2) + lengthInBits += 32; + + // Simple field (TimeStamp) + lengthInBits += TimeStamp.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadDiagnosticMessage"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int EventId = readSimpleField("EventId", readUnsignedInt(readBuffer, 16)); + + short PriorityClass = readSimpleField("PriorityClass", readUnsignedShort(readBuffer, 8)); + + short ObNumber = readSimpleField("ObNumber", readUnsignedShort(readBuffer, 8)); + + int DatId = readSimpleField("DatId", readUnsignedInt(readBuffer, 16)); + + int Info1 = readSimpleField("Info1", readUnsignedInt(readBuffer, 16)); + + long Info2 = readSimpleField("Info2", readUnsignedLong(readBuffer, 32)); + + DateAndTime TimeStamp = + readSimpleField( + "TimeStamp", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadDiagnosticMessage"); + // Create the instance + return new S7PayloadDiagnosticMessageBuilderImpl( + EventId, PriorityClass, ObNumber, DatId, Info1, Info2, TimeStamp); + } + + public static class S7PayloadDiagnosticMessageBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final int EventId; + private final short PriorityClass; + private final short ObNumber; + private final int DatId; + private final int Info1; + private final long Info2; + private final DateAndTime TimeStamp; + + public S7PayloadDiagnosticMessageBuilderImpl( + int EventId, + short PriorityClass, + short ObNumber, + int DatId, + int Info1, + long Info2, + DateAndTime TimeStamp) { + this.EventId = EventId; + this.PriorityClass = PriorityClass; + this.ObNumber = ObNumber; + this.DatId = DatId; + this.Info1 = Info1; + this.Info2 = Info2; + this.TimeStamp = TimeStamp; + } + + public S7PayloadDiagnosticMessage build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadDiagnosticMessage s7PayloadDiagnosticMessage = + new S7PayloadDiagnosticMessage( + returnCode, + transportSize, + dataLength, + EventId, + PriorityClass, + ObNumber, + DatId, + Info1, + Info2, + TimeStamp); + return s7PayloadDiagnosticMessage; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadDiagnosticMessage)) { + return false; + } + S7PayloadDiagnosticMessage that = (S7PayloadDiagnosticMessage) o; + return (getEventId() == that.getEventId()) + && (getPriorityClass() == that.getPriorityClass()) + && (getObNumber() == that.getObNumber()) + && (getDatId() == that.getDatId()) + && (getInfo1() == that.getInfo1()) + && (getInfo2() == that.getInfo2()) + && (getTimeStamp() == that.getTimeStamp()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), + getEventId(), + getPriorityClass(), + getObNumber(), + getDatId(), + getInfo1(), + getInfo2(), + getTimeStamp()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java new file mode 100644 index 00000000000..f6bf5231723 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify.java @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadNotify extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x06; + } + + // Properties. + protected final AlarmMessagePushType alarmMessage; + + public S7PayloadNotify( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + AlarmMessagePushType alarmMessage) { + super(returnCode, transportSize, dataLength); + this.alarmMessage = alarmMessage; + } + + public AlarmMessagePushType getAlarmMessage() { + return alarmMessage; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadNotify"); + + // Simple Field (alarmMessage) + writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadNotify"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadNotify _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (alarmMessage) + lengthInBits += alarmMessage.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadNotify"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + AlarmMessagePushType alarmMessage = + readSimpleField( + "alarmMessage", + new DataReaderComplexDefault<>( + () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadNotify"); + // Create the instance + return new S7PayloadNotifyBuilderImpl(alarmMessage); + } + + public static class S7PayloadNotifyBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final AlarmMessagePushType alarmMessage; + + public S7PayloadNotifyBuilderImpl(AlarmMessagePushType alarmMessage) { + this.alarmMessage = alarmMessage; + } + + public S7PayloadNotify build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadNotify s7PayloadNotify = + new S7PayloadNotify(returnCode, transportSize, dataLength, alarmMessage); + return s7PayloadNotify; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadNotify)) { + return false; + } + S7PayloadNotify that = (S7PayloadNotify) o; + return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAlarmMessage()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java new file mode 100644 index 00000000000..1c7542a478f --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadNotify8.java @@ -0,0 +1,160 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadNotify8 extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x16; + } + + // Properties. + protected final AlarmMessagePushType alarmMessage; + + public S7PayloadNotify8( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + AlarmMessagePushType alarmMessage) { + super(returnCode, transportSize, dataLength); + this.alarmMessage = alarmMessage; + } + + public AlarmMessagePushType getAlarmMessage() { + return alarmMessage; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadNotify8"); + + // Simple Field (alarmMessage) + writeSimpleField("alarmMessage", alarmMessage, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadNotify8"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadNotify8 _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (alarmMessage) + lengthInBits += alarmMessage.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadNotify8"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + AlarmMessagePushType alarmMessage = + readSimpleField( + "alarmMessage", + new DataReaderComplexDefault<>( + () -> AlarmMessagePushType.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadNotify8"); + // Create the instance + return new S7PayloadNotify8BuilderImpl(alarmMessage); + } + + public static class S7PayloadNotify8BuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final AlarmMessagePushType alarmMessage; + + public S7PayloadNotify8BuilderImpl(AlarmMessagePushType alarmMessage) { + this.alarmMessage = alarmMessage; + } + + public S7PayloadNotify8 build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadNotify8 s7PayloadNotify8 = + new S7PayloadNotify8(returnCode, transportSize, dataLength, alarmMessage); + return s7PayloadNotify8; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadNotify8)) { + return false; + } + S7PayloadNotify8 that = (S7PayloadNotify8) o; + return (getAlarmMessage() == that.getAlarmMessage()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAlarmMessage()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java new file mode 100644 index 00000000000..4520e992e16 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadReadVarResponse.java @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadReadVarResponse extends S7Payload implements Message { + + // Accessors for discriminator values. + public Short getParameterParameterType() { + return (short) 0x04; + } + + public Short getMessageType() { + return (short) 0x03; + } + + // Properties. + protected final List items; + + public S7PayloadReadVarResponse(List items) { + super(); + this.items = items; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadReadVarResponse"); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadReadVarResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadReadVarResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Array field + if (items != null) { + int i = 0; + for (S7VarPayloadDataItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadBuilder staticParseS7PayloadBuilder( + ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { + readBuffer.pullContext("S7PayloadReadVarResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> S7VarPayloadDataItem.staticParse(readBuffer), readBuffer), + CAST(parameter, S7ParameterReadVarResponse.class).getNumItems()); + + readBuffer.closeContext("S7PayloadReadVarResponse"); + // Create the instance + return new S7PayloadReadVarResponseBuilderImpl(items); + } + + public static class S7PayloadReadVarResponseBuilderImpl implements S7Payload.S7PayloadBuilder { + private final List items; + + public S7PayloadReadVarResponseBuilderImpl(List items) { + this.items = items; + } + + public S7PayloadReadVarResponse build() { + S7PayloadReadVarResponse s7PayloadReadVarResponse = new S7PayloadReadVarResponse(items); + return s7PayloadReadVarResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadReadVarResponse)) { + return false; + } + S7PayloadReadVarResponse that = (S7PayloadReadVarResponse) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java new file mode 100644 index 00000000000..466513678c3 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserData.java @@ -0,0 +1,172 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserData extends S7Payload implements Message { + + // Accessors for discriminator values. + public Short getParameterParameterType() { + return (short) 0x00; + } + + public Short getMessageType() { + return (short) 0x07; + } + + // Properties. + protected final List items; + + public S7PayloadUserData(List items) { + super(); + this.items = items; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserData"); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadUserData"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserData _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Array field + if (items != null) { + int i = 0; + for (S7PayloadUserDataItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadBuilder staticParseS7PayloadBuilder( + ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { + readBuffer.pullContext("S7PayloadUserData"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> + S7PayloadUserDataItem.staticParse( + readBuffer, + (byte) + (CAST( + CAST(parameter, S7ParameterUserData.class).getItems().get(0), + S7ParameterUserDataItemCPUFunctions.class) + .getCpuFunctionGroup()), + (byte) + (CAST( + CAST(parameter, S7ParameterUserData.class).getItems().get(0), + S7ParameterUserDataItemCPUFunctions.class) + .getCpuFunctionType()), + (short) + (CAST( + CAST(parameter, S7ParameterUserData.class).getItems().get(0), + S7ParameterUserDataItemCPUFunctions.class) + .getCpuSubfunction())), + readBuffer), + COUNT(CAST(parameter, S7ParameterUserData.class).getItems())); + + readBuffer.closeContext("S7PayloadUserData"); + // Create the instance + return new S7PayloadUserDataBuilderImpl(items); + } + + public static class S7PayloadUserDataBuilderImpl implements S7Payload.S7PayloadBuilder { + private final List items; + + public S7PayloadUserDataBuilderImpl(List items) { + this.items = items; + } + + public S7PayloadUserData build() { + S7PayloadUserData s7PayloadUserData = new S7PayloadUserData(items); + return s7PayloadUserData; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserData)) { + return false; + } + S7PayloadUserData that = (S7PayloadUserData) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java new file mode 100644 index 00000000000..16ef4c273d8 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItem.java @@ -0,0 +1,483 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7PayloadUserDataItem implements Message { + + // Abstract accessors for discriminator values. + public abstract Byte getCpuFunctionGroup(); + + public abstract Byte getCpuFunctionType(); + + public abstract Short getCpuSubfunction(); + + // Properties. + protected final DataTransportErrorCode returnCode; + protected final DataTransportSize transportSize; + protected final int dataLength; + + public S7PayloadUserDataItem( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(); + this.returnCode = returnCode; + this.transportSize = transportSize; + this.dataLength = dataLength; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public DataTransportSize getTransportSize() { + return transportSize; + } + + public int getDataLength() { + return dataLength; + } + + protected abstract void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItem"); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (transportSize) + writeSimpleEnumField( + "transportSize", + "DataTransportSize", + transportSize, + new DataWriterEnumDefault<>( + DataTransportSize::getValue, + DataTransportSize::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (dataLength) + writeSimpleField("dataLength", dataLength, writeUnsignedInt(writeBuffer, 16)); + + // Switch field (Serialize the sub-type) + serializeS7PayloadUserDataItemChild(writeBuffer); + + writeBuffer.popContext("S7PayloadUserDataItem"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7PayloadUserDataItem _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (returnCode) + lengthInBits += 8; + + // Simple field (transportSize) + lengthInBits += 8; + + // Simple field (dataLength) + lengthInBits += 16; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static S7PayloadUserDataItem staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + if ((args == null) || (args.length != 3)) { + throw new PlcRuntimeException( + "Wrong number of arguments, expected 3, but got " + args.length); + } + Byte cpuFunctionGroup; + if (args[0] instanceof Byte) { + cpuFunctionGroup = (Byte) args[0]; + } else if (args[0] instanceof String) { + cpuFunctionGroup = Byte.valueOf((String) args[0]); + } else { + throw new PlcRuntimeException( + "Argument 0 expected to be of type Byte or a string which is parseable but was " + + args[0].getClass().getName()); + } + Byte cpuFunctionType; + if (args[1] instanceof Byte) { + cpuFunctionType = (Byte) args[1]; + } else if (args[1] instanceof String) { + cpuFunctionType = Byte.valueOf((String) args[1]); + } else { + throw new PlcRuntimeException( + "Argument 1 expected to be of type Byte or a string which is parseable but was " + + args[1].getClass().getName()); + } + Short cpuSubfunction; + if (args[2] instanceof Short) { + cpuSubfunction = (Short) args[2]; + } else if (args[2] instanceof String) { + cpuSubfunction = Short.valueOf((String) args[2]); + } else { + throw new PlcRuntimeException( + "Argument 2 expected to be of type Short or a string which is parseable but was " + + args[2].getClass().getName()); + } + return staticParse(readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } + + public static S7PayloadUserDataItem staticParse( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItem"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + DataTransportSize transportSize = + readEnumField( + "transportSize", + "DataTransportSize", + new DataReaderEnumDefault<>( + DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + int dataLength = readSimpleField("dataLength", readUnsignedInt(readBuffer, 16)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7PayloadUserDataItemBuilder builder = null; + if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { + builder = + S7PayloadUserDataItemCyclicServicesPush.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x05)) { + builder = + S7PayloadUserDataItemCyclicServicesChangeDrivenPush + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { + builder = + S7PayloadUserDataItemCyclicServicesSubscribeRequest + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { + builder = + S7PayloadUserDataItemCyclicServicesUnsubscribeRequest + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { + builder = + S7PayloadUserDataItemCyclicServicesSubscribeResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { + builder = + S7PayloadUserDataItemCyclicServicesUnsubscribeResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x05) + && EvaluationHelper.equals(dataLength, (int) 0x00)) { + builder = + S7PayloadUserDataItemCyclicServicesErrorResponse.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x02) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x05)) { + builder = + S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x03)) { + builder = + S7PayloadDiagnosticMessage.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x05)) { + builder = + S7PayloadAlarm8.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x06)) { + builder = + S7PayloadNotify.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x0c)) { + builder = + S7PayloadAlarmAckInd.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x11)) { + builder = + S7PayloadAlarmSQ.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x12)) { + builder = + S7PayloadAlarmS.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x13)) { + builder = + S7PayloadAlarmSC.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x00) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x16)) { + builder = + S7PayloadNotify8.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01) + && EvaluationHelper.equals(dataLength, (int) 0x00)) { + builder = + S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { + builder = + S7PayloadUserDataItemCpuFunctionReadSzlRequest.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { + builder = + S7PayloadUserDataItemCpuFunctionReadSzlResponse.staticParseS7PayloadUserDataItemBuilder( + readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x02)) { + builder = + S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x02) + && EvaluationHelper.equals(dataLength, (int) 0x00)) { + builder = + S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x02) + && EvaluationHelper.equals(dataLength, (int) 0x02)) { + builder = + S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x02) + && EvaluationHelper.equals(dataLength, (int) 0x05)) { + builder = + S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x0b)) { + builder = + S7PayloadUserDataItemCpuFunctionAlarmAckRequest.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x0b) + && EvaluationHelper.equals(dataLength, (int) 0x00)) { + builder = + S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x0b)) { + builder = + S7PayloadUserDataItemCpuFunctionAlarmAckResponse.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x13)) { + builder = + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x04) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x13)) { + builder = + S7PayloadUserDataItemCpuFunctionAlarmQueryResponse + .staticParseS7PayloadUserDataItemBuilder( + readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { + builder = + S7PayloadUserDataItemClkRequest.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x01)) { + builder = + S7PayloadUserDataItemClkResponse.staticParseS7PayloadUserDataItemBuilder( + readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x03)) { + builder = + S7PayloadUserDataItemClkFRequest.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x03)) { + builder = + S7PayloadUserDataItemClkFResponse.staticParseS7PayloadUserDataItemBuilder( + readBuffer, dataLength, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x04) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { + builder = + S7PayloadUserDataItemClkSetRequest.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } else if (EvaluationHelper.equals(cpuFunctionGroup, (byte) 0x07) + && EvaluationHelper.equals(cpuFunctionType, (byte) 0x08) + && EvaluationHelper.equals(cpuSubfunction, (short) 0x04)) { + builder = + S7PayloadUserDataItemClkSetResponse.staticParseS7PayloadUserDataItemBuilder( + readBuffer, cpuFunctionGroup, cpuFunctionType, cpuSubfunction); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "cpuFunctionGroup=" + + cpuFunctionGroup + + " " + + "cpuFunctionType=" + + cpuFunctionType + + " " + + "cpuSubfunction=" + + cpuSubfunction + + " " + + "dataLength=" + + dataLength + + "]"); + } + + readBuffer.closeContext("S7PayloadUserDataItem"); + // Create the instance + S7PayloadUserDataItem _s7PayloadUserDataItem = + builder.build(returnCode, transportSize, dataLength); + return _s7PayloadUserDataItem; + } + + public interface S7PayloadUserDataItemBuilder { + S7PayloadUserDataItem build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItem)) { + return false; + } + S7PayloadUserDataItem that = (S7PayloadUserDataItem) o; + return (getReturnCode() == that.getReturnCode()) + && (getTransportSize() == that.getTransportSize()) + && (getDataLength() == that.getDataLength()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getReturnCode(), getTransportSize(), getDataLength()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java new file mode 100644 index 00000000000..4c527a9242a --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFRequest.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemClkFRequest extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x07; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x03; + } + + public S7PayloadUserDataItemClkFRequest( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemClkFRequest"); + + writeBuffer.popContext("S7PayloadUserDataItemClkFRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemClkFRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemClkFRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemClkFRequest"); + // Create the instance + return new S7PayloadUserDataItemClkFRequestBuilderImpl(); + } + + public static class S7PayloadUserDataItemClkFRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemClkFRequestBuilderImpl() {} + + public S7PayloadUserDataItemClkFRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemClkFRequest s7PayloadUserDataItemClkFRequest = + new S7PayloadUserDataItemClkFRequest(returnCode, transportSize, dataLength); + return s7PayloadUserDataItemClkFRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemClkFRequest)) { + return false; + } + S7PayloadUserDataItemClkFRequest that = (S7PayloadUserDataItemClkFRequest) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java new file mode 100644 index 00000000000..6f7d4540f79 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkFResponse.java @@ -0,0 +1,203 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemClkFResponse extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x07; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x03; + } + + // Properties. + protected final short Reserved; + protected final short Year1; + protected final DateAndTime TimeStamp; + + public S7PayloadUserDataItemClkFResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + short Reserved, + short Year1, + DateAndTime TimeStamp) { + super(returnCode, transportSize, dataLength); + this.Reserved = Reserved; + this.Year1 = Year1; + this.TimeStamp = TimeStamp; + } + + public short getReserved() { + return Reserved; + } + + public short getYear1() { + return Year1; + } + + public DateAndTime getTimeStamp() { + return TimeStamp; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemClkFResponse"); + + // Simple Field (Reserved) + writeSimpleField("Reserved", Reserved, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (Year1) + writeSimpleField("Year1", Year1, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (TimeStamp) + writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadUserDataItemClkFResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemClkFResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (Reserved) + lengthInBits += 8; + + // Simple field (Year1) + lengthInBits += 8; + + // Simple field (TimeStamp) + lengthInBits += TimeStamp.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, + Integer dataLength, + Byte cpuFunctionGroup, + Byte cpuFunctionType, + Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemClkFResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short Reserved = readSimpleField("Reserved", readUnsignedShort(readBuffer, 8)); + + short Year1 = readSimpleField("Year1", readUnsignedShort(readBuffer, 8)); + + DateAndTime TimeStamp = + readSimpleField( + "TimeStamp", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadUserDataItemClkFResponse"); + // Create the instance + return new S7PayloadUserDataItemClkFResponseBuilderImpl(Reserved, Year1, TimeStamp); + } + + public static class S7PayloadUserDataItemClkFResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final short Reserved; + private final short Year1; + private final DateAndTime TimeStamp; + + public S7PayloadUserDataItemClkFResponseBuilderImpl( + short Reserved, short Year1, DateAndTime TimeStamp) { + this.Reserved = Reserved; + this.Year1 = Year1; + this.TimeStamp = TimeStamp; + } + + public S7PayloadUserDataItemClkFResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemClkFResponse s7PayloadUserDataItemClkFResponse = + new S7PayloadUserDataItemClkFResponse( + returnCode, transportSize, dataLength, Reserved, Year1, TimeStamp); + return s7PayloadUserDataItemClkFResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemClkFResponse)) { + return false; + } + S7PayloadUserDataItemClkFResponse that = (S7PayloadUserDataItemClkFResponse) o; + return (getReserved() == that.getReserved()) + && (getYear1() == that.getYear1()) + && (getTimeStamp() == that.getTimeStamp()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getReserved(), getYear1(), getTimeStamp()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java new file mode 100644 index 00000000000..2ac4fc7b39f --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkRequest.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemClkRequest extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x07; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + public S7PayloadUserDataItemClkRequest( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemClkRequest"); + + writeBuffer.popContext("S7PayloadUserDataItemClkRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemClkRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemClkRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemClkRequest"); + // Create the instance + return new S7PayloadUserDataItemClkRequestBuilderImpl(); + } + + public static class S7PayloadUserDataItemClkRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemClkRequestBuilderImpl() {} + + public S7PayloadUserDataItemClkRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemClkRequest s7PayloadUserDataItemClkRequest = + new S7PayloadUserDataItemClkRequest(returnCode, transportSize, dataLength); + return s7PayloadUserDataItemClkRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemClkRequest)) { + return false; + } + S7PayloadUserDataItemClkRequest that = (S7PayloadUserDataItemClkRequest) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java new file mode 100644 index 00000000000..3ebeb32ca99 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkResponse.java @@ -0,0 +1,203 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemClkResponse extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x07; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + // Properties. + protected final short Reserved; + protected final short Year1; + protected final DateAndTime TimeStamp; + + public S7PayloadUserDataItemClkResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + short Reserved, + short Year1, + DateAndTime TimeStamp) { + super(returnCode, transportSize, dataLength); + this.Reserved = Reserved; + this.Year1 = Year1; + this.TimeStamp = TimeStamp; + } + + public short getReserved() { + return Reserved; + } + + public short getYear1() { + return Year1; + } + + public DateAndTime getTimeStamp() { + return TimeStamp; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemClkResponse"); + + // Simple Field (Reserved) + writeSimpleField("Reserved", Reserved, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (Year1) + writeSimpleField("Year1", Year1, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (TimeStamp) + writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadUserDataItemClkResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemClkResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (Reserved) + lengthInBits += 8; + + // Simple field (Year1) + lengthInBits += 8; + + // Simple field (TimeStamp) + lengthInBits += TimeStamp.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, + Integer dataLength, + Byte cpuFunctionGroup, + Byte cpuFunctionType, + Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemClkResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short Reserved = readSimpleField("Reserved", readUnsignedShort(readBuffer, 8)); + + short Year1 = readSimpleField("Year1", readUnsignedShort(readBuffer, 8)); + + DateAndTime TimeStamp = + readSimpleField( + "TimeStamp", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadUserDataItemClkResponse"); + // Create the instance + return new S7PayloadUserDataItemClkResponseBuilderImpl(Reserved, Year1, TimeStamp); + } + + public static class S7PayloadUserDataItemClkResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final short Reserved; + private final short Year1; + private final DateAndTime TimeStamp; + + public S7PayloadUserDataItemClkResponseBuilderImpl( + short Reserved, short Year1, DateAndTime TimeStamp) { + this.Reserved = Reserved; + this.Year1 = Year1; + this.TimeStamp = TimeStamp; + } + + public S7PayloadUserDataItemClkResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemClkResponse s7PayloadUserDataItemClkResponse = + new S7PayloadUserDataItemClkResponse( + returnCode, transportSize, dataLength, Reserved, Year1, TimeStamp); + return s7PayloadUserDataItemClkResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemClkResponse)) { + return false; + } + S7PayloadUserDataItemClkResponse that = (S7PayloadUserDataItemClkResponse) o; + return (getReserved() == that.getReserved()) + && (getYear1() == that.getYear1()) + && (getTimeStamp() == that.getTimeStamp()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getReserved(), getYear1(), getTimeStamp()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java new file mode 100644 index 00000000000..9de7ca3487d --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetRequest.java @@ -0,0 +1,177 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemClkSetRequest extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x07; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x04; + } + + // Properties. + protected final DateAndTime TimeStamp; + + public S7PayloadUserDataItemClkSetRequest( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + DateAndTime TimeStamp) { + super(returnCode, transportSize, dataLength); + this.TimeStamp = TimeStamp; + } + + public DateAndTime getTimeStamp() { + return TimeStamp; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemClkSetRequest"); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (TimeStamp) + writeSimpleField("TimeStamp", TimeStamp, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7PayloadUserDataItemClkSetRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemClkSetRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Reserved Field (reserved) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + // Simple field (TimeStamp) + lengthInBits += TimeStamp.getLengthInBits(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemClkSetRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + Short reservedField0 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); + + Short reservedField1 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); + + DateAndTime TimeStamp = + readSimpleField( + "TimeStamp", + new DataReaderComplexDefault<>(() -> DateAndTime.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7PayloadUserDataItemClkSetRequest"); + // Create the instance + return new S7PayloadUserDataItemClkSetRequestBuilderImpl(TimeStamp); + } + + public static class S7PayloadUserDataItemClkSetRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final DateAndTime TimeStamp; + + public S7PayloadUserDataItemClkSetRequestBuilderImpl(DateAndTime TimeStamp) { + this.TimeStamp = TimeStamp; + } + + public S7PayloadUserDataItemClkSetRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemClkSetRequest s7PayloadUserDataItemClkSetRequest = + new S7PayloadUserDataItemClkSetRequest(returnCode, transportSize, dataLength, TimeStamp); + return s7PayloadUserDataItemClkSetRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemClkSetRequest)) { + return false; + } + S7PayloadUserDataItemClkSetRequest that = (S7PayloadUserDataItemClkSetRequest) o; + return (getTimeStamp() == that.getTimeStamp()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getTimeStamp()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java new file mode 100644 index 00000000000..ece52dd08ee --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemClkSetResponse.java @@ -0,0 +1,134 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemClkSetResponse extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x07; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x04; + } + + public S7PayloadUserDataItemClkSetResponse( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemClkSetResponse"); + + writeBuffer.popContext("S7PayloadUserDataItemClkSetResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemClkSetResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemClkSetResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemClkSetResponse"); + // Create the instance + return new S7PayloadUserDataItemClkSetResponseBuilderImpl(); + } + + public static class S7PayloadUserDataItemClkSetResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemClkSetResponseBuilderImpl() {} + + public S7PayloadUserDataItemClkSetResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemClkSetResponse s7PayloadUserDataItemClkSetResponse = + new S7PayloadUserDataItemClkSetResponse(returnCode, transportSize, dataLength); + return s7PayloadUserDataItemClkSetResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemClkSetResponse)) { + return false; + } + S7PayloadUserDataItemClkSetResponse that = (S7PayloadUserDataItemClkSetResponse) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java new file mode 100644 index 00000000000..1d3d6828ff2 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x0b; + } + + public S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponseBuilderImpl(); + } + + public static class S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponseBuilderImpl() {} + + public S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse + s7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse = + new S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse( + returnCode, transportSize, dataLength); + return s7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse)) { + return false; + } + S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse that = + (S7PayloadUserDataItemCpuFunctionAlarmAckErrorResponse) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java new file mode 100644 index 00000000000..c74ec909136 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckRequest.java @@ -0,0 +1,201 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionAlarmAckRequest extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x0b; + } + + // Constant values. + public static final Short FUNCTIONID = 0x09; + + // Properties. + protected final List messageObjects; + + public S7PayloadUserDataItemCpuFunctionAlarmAckRequest( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + List messageObjects) { + super(returnCode, transportSize, dataLength); + this.messageObjects = messageObjects; + } + + public List getMessageObjects() { + return messageObjects; + } + + public short getFunctionId() { + return FUNCTIONID; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); + + // Const Field (functionId) + writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); + + // Implicit Field (numberOfObjects) (Used for parsing, but its value is not stored as it's + // implicitly given by the objects content) + short numberOfObjects = (short) (COUNT(getMessageObjects())); + writeImplicitField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (messageObjects) + writeComplexTypeArrayField("messageObjects", messageObjects, writeBuffer); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionAlarmAckRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (functionId) + lengthInBits += 8; + + // Implicit Field (numberOfObjects) + lengthInBits += 8; + + // Array field + if (messageObjects != null) { + int i = 0; + for (AlarmMessageObjectAckType element : messageObjects) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= messageObjects.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = + readConstField( + "functionId", + readUnsignedShort(readBuffer, 8), + S7PayloadUserDataItemCpuFunctionAlarmAckRequest.FUNCTIONID); + + short numberOfObjects = readImplicitField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + List messageObjects = + readCountArrayField( + "messageObjects", + new DataReaderComplexDefault<>( + () -> AlarmMessageObjectAckType.staticParse(readBuffer), readBuffer), + numberOfObjects); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmAckRequest"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionAlarmAckRequestBuilderImpl(messageObjects); + } + + public static class S7PayloadUserDataItemCpuFunctionAlarmAckRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final List messageObjects; + + public S7PayloadUserDataItemCpuFunctionAlarmAckRequestBuilderImpl( + List messageObjects) { + this.messageObjects = messageObjects; + } + + public S7PayloadUserDataItemCpuFunctionAlarmAckRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionAlarmAckRequest + s7PayloadUserDataItemCpuFunctionAlarmAckRequest = + new S7PayloadUserDataItemCpuFunctionAlarmAckRequest( + returnCode, transportSize, dataLength, messageObjects); + return s7PayloadUserDataItemCpuFunctionAlarmAckRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmAckRequest)) { + return false; + } + S7PayloadUserDataItemCpuFunctionAlarmAckRequest that = + (S7PayloadUserDataItemCpuFunctionAlarmAckRequest) o; + return (getMessageObjects() == that.getMessageObjects()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java new file mode 100644 index 00000000000..3be0eb08c87 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmAckResponse.java @@ -0,0 +1,195 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionAlarmAckResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x0b; + } + + // Properties. + protected final short functionId; + protected final List messageObjects; + + public S7PayloadUserDataItemCpuFunctionAlarmAckResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + short functionId, + List messageObjects) { + super(returnCode, transportSize, dataLength); + this.functionId = functionId; + this.messageObjects = messageObjects; + } + + public short getFunctionId() { + return functionId; + } + + public List getMessageObjects() { + return messageObjects; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); + + // Simple Field (functionId) + writeSimpleField("functionId", functionId, writeUnsignedShort(writeBuffer, 8)); + + // Implicit Field (numberOfObjects) (Used for parsing, but its value is not stored as it's + // implicitly given by the objects content) + short numberOfObjects = (short) (COUNT(getMessageObjects())); + writeImplicitField("numberOfObjects", numberOfObjects, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (messageObjects) + writeSimpleTypeArrayField("messageObjects", messageObjects, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionAlarmAckResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (functionId) + lengthInBits += 8; + + // Implicit Field (numberOfObjects) + lengthInBits += 8; + + // Array field + if (messageObjects != null) { + lengthInBits += 8 * messageObjects.size(); + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = readSimpleField("functionId", readUnsignedShort(readBuffer, 8)); + + short numberOfObjects = readImplicitField("numberOfObjects", readUnsignedShort(readBuffer, 8)); + + List messageObjects = + readCountArrayField("messageObjects", readUnsignedShort(readBuffer, 8), numberOfObjects); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmAckResponse"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionAlarmAckResponseBuilderImpl( + functionId, messageObjects); + } + + public static class S7PayloadUserDataItemCpuFunctionAlarmAckResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final short functionId; + private final List messageObjects; + + public S7PayloadUserDataItemCpuFunctionAlarmAckResponseBuilderImpl( + short functionId, List messageObjects) { + this.functionId = functionId; + this.messageObjects = messageObjects; + } + + public S7PayloadUserDataItemCpuFunctionAlarmAckResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionAlarmAckResponse + s7PayloadUserDataItemCpuFunctionAlarmAckResponse = + new S7PayloadUserDataItemCpuFunctionAlarmAckResponse( + returnCode, transportSize, dataLength, functionId, messageObjects); + return s7PayloadUserDataItemCpuFunctionAlarmAckResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmAckResponse)) { + return false; + } + S7PayloadUserDataItemCpuFunctionAlarmAckResponse that = + (S7PayloadUserDataItemCpuFunctionAlarmAckResponse) o; + return (getFunctionId() == that.getFunctionId()) + && (getMessageObjects() == that.getMessageObjects()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getFunctionId(), getMessageObjects()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java new file mode 100644 index 00000000000..86ef1925c10 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.java @@ -0,0 +1,316 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionAlarmQueryRequest extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x13; + } + + // Constant values. + public static final Short FUNCTIONID = 0x00; + public static final Short NUMBERMESSAGEOBJ = 0x01; + public static final Short VARIABLESPEC = 0x12; + public static final Short LENGTH = 0x08; + + // Properties. + protected final SyntaxIdType syntaxId; + protected final QueryType queryType; + protected final AlarmType alarmType; + + public S7PayloadUserDataItemCpuFunctionAlarmQueryRequest( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + SyntaxIdType syntaxId, + QueryType queryType, + AlarmType alarmType) { + super(returnCode, transportSize, dataLength); + this.syntaxId = syntaxId; + this.queryType = queryType; + this.alarmType = alarmType; + } + + public SyntaxIdType getSyntaxId() { + return syntaxId; + } + + public QueryType getQueryType() { + return queryType; + } + + public AlarmType getAlarmType() { + return alarmType; + } + + public short getFunctionId() { + return FUNCTIONID; + } + + public short getNumberMessageObj() { + return NUMBERMESSAGEOBJ; + } + + public short getVariableSpec() { + return VARIABLESPEC; + } + + public short getLength() { + return LENGTH; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); + + // Const Field (functionId) + writeConstField("functionId", FUNCTIONID, writeUnsignedShort(writeBuffer, 8)); + + // Const Field (numberMessageObj) + writeConstField("numberMessageObj", NUMBERMESSAGEOBJ, writeUnsignedShort(writeBuffer, 8)); + + // Const Field (variableSpec) + writeConstField("variableSpec", VARIABLESPEC, writeUnsignedShort(writeBuffer, 8)); + + // Const Field (length) + writeConstField("length", LENGTH, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (syntaxId) + writeSimpleEnumField( + "syntaxId", + "SyntaxIdType", + syntaxId, + new DataWriterEnumDefault<>( + SyntaxIdType::getValue, SyntaxIdType::name, writeUnsignedShort(writeBuffer, 8))); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (queryType) + writeSimpleEnumField( + "queryType", + "QueryType", + queryType, + new DataWriterEnumDefault<>( + QueryType::getValue, QueryType::name, writeUnsignedShort(writeBuffer, 8))); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x34, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (alarmType) + writeSimpleEnumField( + "alarmType", + "AlarmType", + alarmType, + new DataWriterEnumDefault<>( + AlarmType::getValue, AlarmType::name, writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (functionId) + lengthInBits += 8; + + // Const Field (numberMessageObj) + lengthInBits += 8; + + // Const Field (variableSpec) + lengthInBits += 8; + + // Const Field (length) + lengthInBits += 8; + + // Simple field (syntaxId) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + // Simple field (queryType) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + // Simple field (alarmType) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short functionId = + readConstField( + "functionId", + readUnsignedShort(readBuffer, 8), + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.FUNCTIONID); + + short numberMessageObj = + readConstField( + "numberMessageObj", + readUnsignedShort(readBuffer, 8), + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.NUMBERMESSAGEOBJ); + + short variableSpec = + readConstField( + "variableSpec", + readUnsignedShort(readBuffer, 8), + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.VARIABLESPEC); + + short length = + readConstField( + "length", + readUnsignedShort(readBuffer, 8), + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest.LENGTH); + + SyntaxIdType syntaxId = + readEnumField( + "syntaxId", + "SyntaxIdType", + new DataReaderEnumDefault<>( + SyntaxIdType::enumForValue, readUnsignedShort(readBuffer, 8))); + + Short reservedField0 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); + + QueryType queryType = + readEnumField( + "queryType", + "QueryType", + new DataReaderEnumDefault<>(QueryType::enumForValue, readUnsignedShort(readBuffer, 8))); + + Short reservedField1 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x34); + + AlarmType alarmType = + readEnumField( + "alarmType", + "AlarmType", + new DataReaderEnumDefault<>(AlarmType::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmQueryRequest"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionAlarmQueryRequestBuilderImpl( + syntaxId, queryType, alarmType); + } + + public static class S7PayloadUserDataItemCpuFunctionAlarmQueryRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final SyntaxIdType syntaxId; + private final QueryType queryType; + private final AlarmType alarmType; + + public S7PayloadUserDataItemCpuFunctionAlarmQueryRequestBuilderImpl( + SyntaxIdType syntaxId, QueryType queryType, AlarmType alarmType) { + this.syntaxId = syntaxId; + this.queryType = queryType; + this.alarmType = alarmType; + } + + public S7PayloadUserDataItemCpuFunctionAlarmQueryRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest + s7PayloadUserDataItemCpuFunctionAlarmQueryRequest = + new S7PayloadUserDataItemCpuFunctionAlarmQueryRequest( + returnCode, transportSize, dataLength, syntaxId, queryType, alarmType); + return s7PayloadUserDataItemCpuFunctionAlarmQueryRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmQueryRequest)) { + return false; + } + S7PayloadUserDataItemCpuFunctionAlarmQueryRequest that = + (S7PayloadUserDataItemCpuFunctionAlarmQueryRequest) o; + return (getSyntaxId() == that.getSyntaxId()) + && (getQueryType() == that.getQueryType()) + && (getAlarmType() == that.getAlarmType()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getSyntaxId(), getQueryType(), getAlarmType()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java new file mode 100644 index 00000000000..8cf96d3469a --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionAlarmQueryResponse.java @@ -0,0 +1,166 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionAlarmQueryResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x13; + } + + // Properties. + protected final byte[] items; + + public S7PayloadUserDataItemCpuFunctionAlarmQueryResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + byte[] items) { + super(returnCode, transportSize, dataLength); + this.items = items; + } + + public byte[] getItems() { + return items; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); + + // Array Field (items) + writeByteArrayField("items", items, writeByteArray(writeBuffer, 8)); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionAlarmQueryResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Array field + if (items != null) { + lengthInBits += 8 * items.length; + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, + Integer dataLength, + Byte cpuFunctionGroup, + Byte cpuFunctionType, + Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + byte[] items = readBuffer.readByteArray("items", Math.toIntExact(dataLength)); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionAlarmQueryResponse"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionAlarmQueryResponseBuilderImpl(items); + } + + public static class S7PayloadUserDataItemCpuFunctionAlarmQueryResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final byte[] items; + + public S7PayloadUserDataItemCpuFunctionAlarmQueryResponseBuilderImpl(byte[] items) { + this.items = items; + } + + public S7PayloadUserDataItemCpuFunctionAlarmQueryResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionAlarmQueryResponse + s7PayloadUserDataItemCpuFunctionAlarmQueryResponse = + new S7PayloadUserDataItemCpuFunctionAlarmQueryResponse( + returnCode, transportSize, dataLength, items); + return s7PayloadUserDataItemCpuFunctionAlarmQueryResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionAlarmQueryResponse)) { + return false; + } + S7PayloadUserDataItemCpuFunctionAlarmQueryResponse that = + (S7PayloadUserDataItemCpuFunctionAlarmQueryResponse) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java new file mode 100644 index 00000000000..642c00f863e --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse.java @@ -0,0 +1,258 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse + extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x02; + } + + // Properties. + protected final short result; + protected final short reserved01; + protected final AlarmType alarmType; + protected final short reserved02; + protected final short reserved03; + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + short result, + short reserved01, + AlarmType alarmType, + short reserved02, + short reserved03) { + super(returnCode, transportSize, dataLength); + this.result = result; + this.reserved01 = reserved01; + this.alarmType = alarmType; + this.reserved02 = reserved02; + this.reserved03 = reserved03; + } + + public short getResult() { + return result; + } + + public short getReserved01() { + return reserved01; + } + + public AlarmType getAlarmType() { + return alarmType; + } + + public short getReserved02() { + return reserved02; + } + + public short getReserved03() { + return reserved03; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); + + // Simple Field (result) + writeSimpleField("result", result, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (reserved01) + writeSimpleField("reserved01", reserved01, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (alarmType) + writeSimpleEnumField( + "alarmType", + "AlarmType", + alarmType, + new DataWriterEnumDefault<>( + AlarmType::getValue, AlarmType::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (reserved02) + writeSimpleField("reserved02", reserved02, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (reserved03) + writeSimpleField("reserved03", reserved03, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (result) + lengthInBits += 8; + + // Simple field (reserved01) + lengthInBits += 8; + + // Simple field (alarmType) + lengthInBits += 8; + + // Simple field (reserved02) + lengthInBits += 8; + + // Simple field (reserved03) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short result = readSimpleField("result", readUnsignedShort(readBuffer, 8)); + + short reserved01 = readSimpleField("reserved01", readUnsignedShort(readBuffer, 8)); + + AlarmType alarmType = + readEnumField( + "alarmType", + "AlarmType", + new DataReaderEnumDefault<>(AlarmType::enumForValue, readUnsignedShort(readBuffer, 8))); + + short reserved02 = readSimpleField("reserved02", readUnsignedShort(readBuffer, 8)); + + short reserved03 = readSimpleField("reserved03", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponseBuilderImpl( + result, reserved01, alarmType, reserved02, reserved03); + } + + public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final short result; + private final short reserved01; + private final AlarmType alarmType; + private final short reserved02; + private final short reserved03; + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponseBuilderImpl( + short result, short reserved01, AlarmType alarmType, short reserved02, short reserved03) { + this.result = result; + this.reserved01 = reserved01; + this.alarmType = alarmType; + this.reserved02 = reserved02; + this.reserved03 = reserved03; + } + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse + s7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse = + new S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse( + returnCode, + transportSize, + dataLength, + result, + reserved01, + alarmType, + reserved02, + reserved03); + return s7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse)) { + return false; + } + S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse that = + (S7PayloadUserDataItemCpuFunctionMsgSubscriptionAlarmResponse) o; + return (getResult() == that.getResult()) + && (getReserved01() == that.getReserved01()) + && (getAlarmType() == that.getAlarmType()) + && (getReserved02() == that.getReserved02()) + && (getReserved03() == that.getReserved03()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), + getResult(), + getReserved01(), + getAlarmType(), + getReserved02(), + getReserved03()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java new file mode 100644 index 00000000000..c75ceaf52e1 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest.java @@ -0,0 +1,250 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x02; + } + + // Properties. + protected final short Subscription; + protected final String magicKey; + protected final AlarmStateType Alarmtype; + protected final Short Reserve; + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + short Subscription, + String magicKey, + AlarmStateType Alarmtype, + Short Reserve) { + super(returnCode, transportSize, dataLength); + this.Subscription = Subscription; + this.magicKey = magicKey; + this.Alarmtype = Alarmtype; + this.Reserve = Reserve; + } + + public short getSubscription() { + return Subscription; + } + + public String getMagicKey() { + return magicKey; + } + + public AlarmStateType getAlarmtype() { + return Alarmtype; + } + + public Short getReserve() { + return Reserve; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); + + // Simple Field (Subscription) + writeSimpleField("Subscription", Subscription, writeUnsignedShort(writeBuffer, 8)); + + // Reserved Field (reserved) + writeReservedField("reserved", (short) 0x00, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (magicKey) + writeSimpleField("magicKey", magicKey, writeString(writeBuffer, 64)); + + // Optional Field (Alarmtype) (Can be skipped, if the value is null) + writeOptionalEnumField( + "Alarmtype", + "AlarmStateType", + Alarmtype, + new DataWriterEnumDefault<>( + AlarmStateType::getValue, AlarmStateType::name, writeUnsignedShort(writeBuffer, 8)), + (getSubscription()) >= (128)); + + // Optional Field (Reserve) (Can be skipped, if the value is null) + writeOptionalField("Reserve", Reserve, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (Subscription) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + // Simple field (magicKey) + lengthInBits += 64; + + // Optional Field (Alarmtype) + if (Alarmtype != null) { + lengthInBits += 8; + } + + // Optional Field (Reserve) + if (Reserve != null) { + lengthInBits += 8; + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short Subscription = readSimpleField("Subscription", readUnsignedShort(readBuffer, 8)); + + Short reservedField0 = + readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00); + + String magicKey = readSimpleField("magicKey", readString(readBuffer, 64)); + + AlarmStateType Alarmtype = + readOptionalField( + "Alarmtype", + new DataReaderEnumDefault<>( + AlarmStateType::enumForValue, readUnsignedShort(readBuffer, 8)), + (Subscription) >= (128)); + + Short Reserve = + readOptionalField("Reserve", readUnsignedShort(readBuffer, 8), (Subscription) >= (128)); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequestBuilderImpl( + Subscription, magicKey, Alarmtype, Reserve); + } + + public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final short Subscription; + private final String magicKey; + private final AlarmStateType Alarmtype; + private final Short Reserve; + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequestBuilderImpl( + short Subscription, String magicKey, AlarmStateType Alarmtype, Short Reserve) { + this.Subscription = Subscription; + this.magicKey = magicKey; + this.Alarmtype = Alarmtype; + this.Reserve = Reserve; + } + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest + s7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest = + new S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest( + returnCode, + transportSize, + dataLength, + Subscription, + magicKey, + Alarmtype, + Reserve); + return s7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest)) { + return false; + } + S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest that = + (S7PayloadUserDataItemCpuFunctionMsgSubscriptionRequest) o; + return (getSubscription() == that.getSubscription()) + && (getMagicKey() == that.getMagicKey()) + && (getAlarmtype() == that.getAlarmtype()) + && (getReserve() == that.getReserve()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), getSubscription(), getMagicKey(), getAlarmtype(), getReserve()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java new file mode 100644 index 00000000000..e63f6c495c0 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x02; + } + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponseBuilderImpl(); + } + + public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponseBuilderImpl() {} + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse + s7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse = + new S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse( + returnCode, transportSize, dataLength); + return s7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse)) { + return false; + } + S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse that = + (S7PayloadUserDataItemCpuFunctionMsgSubscriptionResponse) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java new file mode 100644 index 00000000000..d8f5fac1d79 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse.java @@ -0,0 +1,182 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse + extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x02; + } + + // Properties. + protected final short result; + protected final short reserved01; + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + short result, + short reserved01) { + super(returnCode, transportSize, dataLength); + this.result = result; + this.reserved01 = reserved01; + } + + public short getResult() { + return result; + } + + public short getReserved01() { + return reserved01; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); + + // Simple Field (result) + writeSimpleField("result", result, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (reserved01) + writeSimpleField("reserved01", reserved01, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (result) + lengthInBits += 8; + + // Simple field (reserved01) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short result = readSimpleField("result", readUnsignedShort(readBuffer, 8)); + + short reserved01 = readSimpleField("reserved01", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponseBuilderImpl( + result, reserved01); + } + + public static class S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final short result; + private final short reserved01; + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponseBuilderImpl( + short result, short reserved01) { + this.result = result; + this.reserved01 = reserved01; + } + + public S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse + s7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse = + new S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse( + returnCode, transportSize, dataLength, result, reserved01); + return s7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse)) { + return false; + } + S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse that = + (S7PayloadUserDataItemCpuFunctionMsgSubscriptionSysResponse) o; + return (getResult() == that.getResult()) + && (getReserved01() == that.getReserved01()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getResult(), getReserved01()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java new file mode 100644 index 00000000000..947c57fa9dc --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest.java @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + public S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequestBuilderImpl(); + } + + public static class S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequestBuilderImpl() {} + + public S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest + s7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest = + new S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest( + returnCode, transportSize, dataLength); + return s7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest)) { + return false; + } + S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest that = + (S7PayloadUserDataItemCpuFunctionReadSzlNoDataRequest) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java new file mode 100644 index 00000000000..31c17cd57de --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlRequest.java @@ -0,0 +1,183 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionReadSzlRequest extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + // Properties. + protected final SzlId szlId; + protected final int szlIndex; + + public S7PayloadUserDataItemCpuFunctionReadSzlRequest( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + SzlId szlId, + int szlIndex) { + super(returnCode, transportSize, dataLength); + this.szlId = szlId; + this.szlIndex = szlIndex; + } + + public SzlId getSzlId() { + return szlId; + } + + public int getSzlIndex() { + return szlIndex; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); + + // Simple Field (szlId) + writeSimpleField("szlId", szlId, new DataWriterComplexDefault<>(writeBuffer)); + + // Simple Field (szlIndex) + writeSimpleField("szlIndex", szlIndex, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionReadSzlRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (szlId) + lengthInBits += szlId.getLengthInBits(); + + // Simple field (szlIndex) + lengthInBits += 16; + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + SzlId szlId = + readSimpleField( + "szlId", + new DataReaderComplexDefault<>(() -> SzlId.staticParse(readBuffer), readBuffer)); + + int szlIndex = readSimpleField("szlIndex", readUnsignedInt(readBuffer, 16)); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionReadSzlRequest"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionReadSzlRequestBuilderImpl(szlId, szlIndex); + } + + public static class S7PayloadUserDataItemCpuFunctionReadSzlRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final SzlId szlId; + private final int szlIndex; + + public S7PayloadUserDataItemCpuFunctionReadSzlRequestBuilderImpl(SzlId szlId, int szlIndex) { + this.szlId = szlId; + this.szlIndex = szlIndex; + } + + public S7PayloadUserDataItemCpuFunctionReadSzlRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionReadSzlRequest + s7PayloadUserDataItemCpuFunctionReadSzlRequest = + new S7PayloadUserDataItemCpuFunctionReadSzlRequest( + returnCode, transportSize, dataLength, szlId, szlIndex); + return s7PayloadUserDataItemCpuFunctionReadSzlRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionReadSzlRequest)) { + return false; + } + S7PayloadUserDataItemCpuFunctionReadSzlRequest that = + (S7PayloadUserDataItemCpuFunctionReadSzlRequest) o; + return (getSzlId() == that.getSzlId()) + && (getSzlIndex() == that.getSzlIndex()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getSzlId(), getSzlIndex()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java new file mode 100644 index 00000000000..59cd4a3653c --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCpuFunctionReadSzlResponse.java @@ -0,0 +1,166 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCpuFunctionReadSzlResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x04; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + // Properties. + protected final byte[] items; + + public S7PayloadUserDataItemCpuFunctionReadSzlResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + byte[] items) { + super(returnCode, transportSize, dataLength); + this.items = items; + } + + public byte[] getItems() { + return items; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); + + // Array Field (items) + writeByteArrayField("items", items, writeByteArray(writeBuffer, 8)); + + writeBuffer.popContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCpuFunctionReadSzlResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Array field + if (items != null) { + lengthInBits += 8 * items.length; + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, + Integer dataLength, + Byte cpuFunctionGroup, + Byte cpuFunctionType, + Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + byte[] items = readBuffer.readByteArray("items", Math.toIntExact(dataLength)); + + readBuffer.closeContext("S7PayloadUserDataItemCpuFunctionReadSzlResponse"); + // Create the instance + return new S7PayloadUserDataItemCpuFunctionReadSzlResponseBuilderImpl(items); + } + + public static class S7PayloadUserDataItemCpuFunctionReadSzlResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final byte[] items; + + public S7PayloadUserDataItemCpuFunctionReadSzlResponseBuilderImpl(byte[] items) { + this.items = items; + } + + public S7PayloadUserDataItemCpuFunctionReadSzlResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCpuFunctionReadSzlResponse + s7PayloadUserDataItemCpuFunctionReadSzlResponse = + new S7PayloadUserDataItemCpuFunctionReadSzlResponse( + returnCode, transportSize, dataLength, items); + return s7PayloadUserDataItemCpuFunctionReadSzlResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCpuFunctionReadSzlResponse)) { + return false; + } + S7PayloadUserDataItemCpuFunctionReadSzlResponse that = + (S7PayloadUserDataItemCpuFunctionReadSzlResponse) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java new file mode 100644 index 00000000000..c1ea18e262d --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenPush.java @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesChangeDrivenPush extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x05; + } + + // Properties. + protected final int itemsCount; + protected final List items; + + public S7PayloadUserDataItemCyclicServicesChangeDrivenPush( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + int itemsCount, + List items) { + super(returnCode, transportSize, dataLength); + this.itemsCount = itemsCount; + this.items = items; + } + + public int getItemsCount() { + return itemsCount; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); + + // Simple Field (itemsCount) + writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesChangeDrivenPush _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (itemsCount) + lengthInBits += 16; + + // Array field + if (items != null) { + int i = 0; + for (AssociatedQueryValueType element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> AssociatedQueryValueType.staticParse(readBuffer), readBuffer), + itemsCount); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesChangeDrivenPush"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesChangeDrivenPushBuilderImpl(itemsCount, items); + } + + public static class S7PayloadUserDataItemCyclicServicesChangeDrivenPushBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final int itemsCount; + private final List items; + + public S7PayloadUserDataItemCyclicServicesChangeDrivenPushBuilderImpl( + int itemsCount, List items) { + this.itemsCount = itemsCount; + this.items = items; + } + + public S7PayloadUserDataItemCyclicServicesChangeDrivenPush build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesChangeDrivenPush + s7PayloadUserDataItemCyclicServicesChangeDrivenPush = + new S7PayloadUserDataItemCyclicServicesChangeDrivenPush( + returnCode, transportSize, dataLength, itemsCount, items); + return s7PayloadUserDataItemCyclicServicesChangeDrivenPush; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesChangeDrivenPush)) { + return false; + } + S7PayloadUserDataItemCyclicServicesChangeDrivenPush that = + (S7PayloadUserDataItemCyclicServicesChangeDrivenPush) o; + return (getItemsCount() == that.getItemsCount()) + && (getItems() == that.getItems()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItemsCount(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java new file mode 100644 index 00000000000..38bc3d39110 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse.java @@ -0,0 +1,193 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse + extends S7PayloadUserDataItem implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x05; + } + + // Properties. + protected final int itemsCount; + protected final List items; + + public S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + int itemsCount, + List items) { + super(returnCode, transportSize, dataLength); + this.itemsCount = itemsCount; + this.items = items; + } + + public int getItemsCount() { + return itemsCount; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); + + // Simple Field (itemsCount) + writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (itemsCount) + lengthInBits += 16; + + // Array field + if (items != null) { + int i = 0; + for (AssociatedQueryValueType element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> AssociatedQueryValueType.staticParse(readBuffer), readBuffer), + itemsCount); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponseBuilderImpl( + itemsCount, items); + } + + public static class S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final int itemsCount; + private final List items; + + public S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponseBuilderImpl( + int itemsCount, List items) { + this.itemsCount = itemsCount; + this.items = items; + } + + public S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse + s7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse = + new S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse( + returnCode, transportSize, dataLength, itemsCount, items); + return s7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse)) { + return false; + } + S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse that = + (S7PayloadUserDataItemCyclicServicesChangeDrivenSubscribeResponse) o; + return (getItemsCount() == that.getItemsCount()) + && (getItems() == that.getItems()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItemsCount(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java new file mode 100644 index 00000000000..f9613dcb1ad --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesErrorResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesErrorResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x05; + } + + public S7PayloadUserDataItemCyclicServicesErrorResponse( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesErrorResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesErrorResponse"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesErrorResponseBuilderImpl(); + } + + public static class S7PayloadUserDataItemCyclicServicesErrorResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemCyclicServicesErrorResponseBuilderImpl() {} + + public S7PayloadUserDataItemCyclicServicesErrorResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesErrorResponse + s7PayloadUserDataItemCyclicServicesErrorResponse = + new S7PayloadUserDataItemCyclicServicesErrorResponse( + returnCode, transportSize, dataLength); + return s7PayloadUserDataItemCyclicServicesErrorResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesErrorResponse)) { + return false; + } + S7PayloadUserDataItemCyclicServicesErrorResponse that = + (S7PayloadUserDataItemCyclicServicesErrorResponse) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java new file mode 100644 index 00000000000..c2341a414b8 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesPush.java @@ -0,0 +1,190 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesPush extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x00; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + // Properties. + protected final int itemsCount; + protected final List items; + + public S7PayloadUserDataItemCyclicServicesPush( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + int itemsCount, + List items) { + super(returnCode, transportSize, dataLength); + this.itemsCount = itemsCount; + this.items = items; + } + + public int getItemsCount() { + return itemsCount; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesPush"); + + // Simple Field (itemsCount) + writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesPush"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesPush _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (itemsCount) + lengthInBits += 16; + + // Array field + if (items != null) { + int i = 0; + for (AssociatedValueType element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesPush"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> AssociatedValueType.staticParse(readBuffer), readBuffer), + itemsCount); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesPush"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesPushBuilderImpl(itemsCount, items); + } + + public static class S7PayloadUserDataItemCyclicServicesPushBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final int itemsCount; + private final List items; + + public S7PayloadUserDataItemCyclicServicesPushBuilderImpl( + int itemsCount, List items) { + this.itemsCount = itemsCount; + this.items = items; + } + + public S7PayloadUserDataItemCyclicServicesPush build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesPush s7PayloadUserDataItemCyclicServicesPush = + new S7PayloadUserDataItemCyclicServicesPush( + returnCode, transportSize, dataLength, itemsCount, items); + return s7PayloadUserDataItemCyclicServicesPush; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesPush)) { + return false; + } + S7PayloadUserDataItemCyclicServicesPush that = (S7PayloadUserDataItemCyclicServicesPush) o; + return (getItemsCount() == that.getItemsCount()) + && (getItems() == that.getItems()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItemsCount(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java new file mode 100644 index 00000000000..7376db3a7cf --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeRequest.java @@ -0,0 +1,239 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesSubscribeRequest extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + // Properties. + protected final int itemsCount; + protected final TimeBase timeBase; + protected final short timeFactor; + protected final List item; + + public S7PayloadUserDataItemCyclicServicesSubscribeRequest( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + int itemsCount, + TimeBase timeBase, + short timeFactor, + List item) { + super(returnCode, transportSize, dataLength); + this.itemsCount = itemsCount; + this.timeBase = timeBase; + this.timeFactor = timeFactor; + this.item = item; + } + + public int getItemsCount() { + return itemsCount; + } + + public TimeBase getTimeBase() { + return timeBase; + } + + public short getTimeFactor() { + return timeFactor; + } + + public List getItem() { + return item; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); + + // Simple Field (itemsCount) + writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (timeBase) + writeSimpleEnumField( + "timeBase", + "TimeBase", + timeBase, + new DataWriterEnumDefault<>( + TimeBase::getValue, TimeBase::name, writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (timeFactor) + writeSimpleField("timeFactor", timeFactor, writeUnsignedShort(writeBuffer, 8)); + + // Array Field (item) + writeComplexTypeArrayField("item", item, writeBuffer); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesSubscribeRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (itemsCount) + lengthInBits += 16; + + // Simple field (timeBase) + lengthInBits += 8; + + // Simple field (timeFactor) + lengthInBits += 8; + + // Array field + if (item != null) { + int i = 0; + for (CycServiceItemType element : item) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= item.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); + + TimeBase timeBase = + readEnumField( + "timeBase", + "TimeBase", + new DataReaderEnumDefault<>(TimeBase::enumForValue, readUnsignedShort(readBuffer, 8))); + + short timeFactor = readSimpleField("timeFactor", readUnsignedShort(readBuffer, 8)); + + List item = + readCountArrayField( + "item", + new DataReaderComplexDefault<>( + () -> CycServiceItemType.staticParse(readBuffer), readBuffer), + itemsCount); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesSubscribeRequest"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesSubscribeRequestBuilderImpl( + itemsCount, timeBase, timeFactor, item); + } + + public static class S7PayloadUserDataItemCyclicServicesSubscribeRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final int itemsCount; + private final TimeBase timeBase; + private final short timeFactor; + private final List item; + + public S7PayloadUserDataItemCyclicServicesSubscribeRequestBuilderImpl( + int itemsCount, TimeBase timeBase, short timeFactor, List item) { + this.itemsCount = itemsCount; + this.timeBase = timeBase; + this.timeFactor = timeFactor; + this.item = item; + } + + public S7PayloadUserDataItemCyclicServicesSubscribeRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesSubscribeRequest + s7PayloadUserDataItemCyclicServicesSubscribeRequest = + new S7PayloadUserDataItemCyclicServicesSubscribeRequest( + returnCode, transportSize, dataLength, itemsCount, timeBase, timeFactor, item); + return s7PayloadUserDataItemCyclicServicesSubscribeRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesSubscribeRequest)) { + return false; + } + S7PayloadUserDataItemCyclicServicesSubscribeRequest that = + (S7PayloadUserDataItemCyclicServicesSubscribeRequest) o; + return (getItemsCount() == that.getItemsCount()) + && (getTimeBase() == that.getTimeBase()) + && (getTimeFactor() == that.getTimeFactor()) + && (getItem() == that.getItem()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + super.hashCode(), getItemsCount(), getTimeBase(), getTimeFactor(), getItem()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java new file mode 100644 index 00000000000..fbef37afb23 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesSubscribeResponse.java @@ -0,0 +1,192 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesSubscribeResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x01; + } + + // Properties. + protected final int itemsCount; + protected final List items; + + public S7PayloadUserDataItemCyclicServicesSubscribeResponse( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + int itemsCount, + List items) { + super(returnCode, transportSize, dataLength); + this.itemsCount = itemsCount; + this.items = items; + } + + public int getItemsCount() { + return itemsCount; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); + + // Simple Field (itemsCount) + writeSimpleField("itemsCount", itemsCount, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesSubscribeResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (itemsCount) + lengthInBits += 16; + + // Array field + if (items != null) { + int i = 0; + for (AssociatedValueType element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int itemsCount = readSimpleField("itemsCount", readUnsignedInt(readBuffer, 16)); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> AssociatedValueType.staticParse(readBuffer), readBuffer), + itemsCount); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesSubscribeResponse"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesSubscribeResponseBuilderImpl(itemsCount, items); + } + + public static class S7PayloadUserDataItemCyclicServicesSubscribeResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final int itemsCount; + private final List items; + + public S7PayloadUserDataItemCyclicServicesSubscribeResponseBuilderImpl( + int itemsCount, List items) { + this.itemsCount = itemsCount; + this.items = items; + } + + public S7PayloadUserDataItemCyclicServicesSubscribeResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesSubscribeResponse + s7PayloadUserDataItemCyclicServicesSubscribeResponse = + new S7PayloadUserDataItemCyclicServicesSubscribeResponse( + returnCode, transportSize, dataLength, itemsCount, items); + return s7PayloadUserDataItemCyclicServicesSubscribeResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesSubscribeResponse)) { + return false; + } + S7PayloadUserDataItemCyclicServicesSubscribeResponse that = + (S7PayloadUserDataItemCyclicServicesSubscribeResponse) o; + return (getItemsCount() == that.getItemsCount()) + && (getItems() == that.getItems()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItemsCount(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java new file mode 100644 index 00000000000..eadbcbbb3f7 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeRequest.java @@ -0,0 +1,181 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesUnsubscribeRequest extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x04; + } + + public Short getCpuSubfunction() { + return (short) 0x04; + } + + // Properties. + protected final short function; + protected final short jobId; + + public S7PayloadUserDataItemCyclicServicesUnsubscribeRequest( + DataTransportErrorCode returnCode, + DataTransportSize transportSize, + int dataLength, + short function, + short jobId) { + super(returnCode, transportSize, dataLength); + this.function = function; + this.jobId = jobId; + } + + public short getFunction() { + return function; + } + + public short getJobId() { + return jobId; + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); + + // Simple Field (function) + writeSimpleField("function", function, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (jobId) + writeSimpleField("jobId", jobId, writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesUnsubscribeRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (function) + lengthInBits += 8; + + // Simple field (jobId) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short function = readSimpleField("function", readUnsignedShort(readBuffer, 8)); + + short jobId = readSimpleField("jobId", readUnsignedShort(readBuffer, 8)); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesUnsubscribeRequest"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesUnsubscribeRequestBuilderImpl(function, jobId); + } + + public static class S7PayloadUserDataItemCyclicServicesUnsubscribeRequestBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + private final short function; + private final short jobId; + + public S7PayloadUserDataItemCyclicServicesUnsubscribeRequestBuilderImpl( + short function, short jobId) { + this.function = function; + this.jobId = jobId; + } + + public S7PayloadUserDataItemCyclicServicesUnsubscribeRequest build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesUnsubscribeRequest + s7PayloadUserDataItemCyclicServicesUnsubscribeRequest = + new S7PayloadUserDataItemCyclicServicesUnsubscribeRequest( + returnCode, transportSize, dataLength, function, jobId); + return s7PayloadUserDataItemCyclicServicesUnsubscribeRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesUnsubscribeRequest)) { + return false; + } + S7PayloadUserDataItemCyclicServicesUnsubscribeRequest that = + (S7PayloadUserDataItemCyclicServicesUnsubscribeRequest) o; + return (getFunction() == that.getFunction()) + && (getJobId() == that.getJobId()) + && super.equals(that) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getFunction(), getJobId()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java new file mode 100644 index 00000000000..9e3e74c323c --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadUserDataItemCyclicServicesUnsubscribeResponse.java @@ -0,0 +1,138 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadUserDataItemCyclicServicesUnsubscribeResponse extends S7PayloadUserDataItem + implements Message { + + // Accessors for discriminator values. + public Byte getCpuFunctionGroup() { + return (byte) 0x02; + } + + public Byte getCpuFunctionType() { + return (byte) 0x08; + } + + public Short getCpuSubfunction() { + return (short) 0x04; + } + + public S7PayloadUserDataItemCyclicServicesUnsubscribeResponse( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + super(returnCode, transportSize, dataLength); + } + + @Override + protected void serializeS7PayloadUserDataItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); + + writeBuffer.popContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadUserDataItemCyclicServicesUnsubscribeResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + return lengthInBits; + } + + public static S7PayloadUserDataItemBuilder staticParseS7PayloadUserDataItemBuilder( + ReadBuffer readBuffer, Byte cpuFunctionGroup, Byte cpuFunctionType, Short cpuSubfunction) + throws ParseException { + readBuffer.pullContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + readBuffer.closeContext("S7PayloadUserDataItemCyclicServicesUnsubscribeResponse"); + // Create the instance + return new S7PayloadUserDataItemCyclicServicesUnsubscribeResponseBuilderImpl(); + } + + public static class S7PayloadUserDataItemCyclicServicesUnsubscribeResponseBuilderImpl + implements S7PayloadUserDataItem.S7PayloadUserDataItemBuilder { + + public S7PayloadUserDataItemCyclicServicesUnsubscribeResponseBuilderImpl() {} + + public S7PayloadUserDataItemCyclicServicesUnsubscribeResponse build( + DataTransportErrorCode returnCode, DataTransportSize transportSize, int dataLength) { + S7PayloadUserDataItemCyclicServicesUnsubscribeResponse + s7PayloadUserDataItemCyclicServicesUnsubscribeResponse = + new S7PayloadUserDataItemCyclicServicesUnsubscribeResponse( + returnCode, transportSize, dataLength); + return s7PayloadUserDataItemCyclicServicesUnsubscribeResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadUserDataItemCyclicServicesUnsubscribeResponse)) { + return false; + } + S7PayloadUserDataItemCyclicServicesUnsubscribeResponse that = + (S7PayloadUserDataItemCyclicServicesUnsubscribeResponse) o; + return super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java new file mode 100644 index 00000000000..5c31abe5b18 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarRequest.java @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadWriteVarRequest extends S7Payload implements Message { + + // Accessors for discriminator values. + public Short getParameterParameterType() { + return (short) 0x05; + } + + public Short getMessageType() { + return (short) 0x01; + } + + // Properties. + protected final List items; + + public S7PayloadWriteVarRequest(List items) { + super(); + this.items = items; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadWriteVarRequest"); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadWriteVarRequest"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadWriteVarRequest _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Array field + if (items != null) { + int i = 0; + for (S7VarPayloadDataItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadBuilder staticParseS7PayloadBuilder( + ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { + readBuffer.pullContext("S7PayloadWriteVarRequest"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> S7VarPayloadDataItem.staticParse(readBuffer), readBuffer), + COUNT(CAST(parameter, S7ParameterWriteVarRequest.class).getItems())); + + readBuffer.closeContext("S7PayloadWriteVarRequest"); + // Create the instance + return new S7PayloadWriteVarRequestBuilderImpl(items); + } + + public static class S7PayloadWriteVarRequestBuilderImpl implements S7Payload.S7PayloadBuilder { + private final List items; + + public S7PayloadWriteVarRequestBuilderImpl(List items) { + this.items = items; + } + + public S7PayloadWriteVarRequest build() { + S7PayloadWriteVarRequest s7PayloadWriteVarRequest = new S7PayloadWriteVarRequest(items); + return s7PayloadWriteVarRequest; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadWriteVarRequest)) { + return false; + } + S7PayloadWriteVarRequest that = (S7PayloadWriteVarRequest) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java new file mode 100644 index 00000000000..fca9a9f20d6 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7PayloadWriteVarResponse.java @@ -0,0 +1,154 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7PayloadWriteVarResponse extends S7Payload implements Message { + + // Accessors for discriminator values. + public Short getParameterParameterType() { + return (short) 0x05; + } + + public Short getMessageType() { + return (short) 0x03; + } + + // Properties. + protected final List items; + + public S7PayloadWriteVarResponse(List items) { + super(); + this.items = items; + } + + public List getItems() { + return items; + } + + @Override + protected void serializeS7PayloadChild(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7PayloadWriteVarResponse"); + + // Array Field (items) + writeComplexTypeArrayField("items", items, writeBuffer); + + writeBuffer.popContext("S7PayloadWriteVarResponse"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7PayloadWriteVarResponse _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Array field + if (items != null) { + int i = 0; + for (S7VarPayloadStatusItem element : items) { + ThreadLocalHelper.lastItemThreadLocal.set(++i >= items.size()); + lengthInBits += element.getLengthInBits(); + } + } + + return lengthInBits; + } + + public static S7PayloadBuilder staticParseS7PayloadBuilder( + ReadBuffer readBuffer, Short messageType, S7Parameter parameter) throws ParseException { + readBuffer.pullContext("S7PayloadWriteVarResponse"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + List items = + readCountArrayField( + "items", + new DataReaderComplexDefault<>( + () -> S7VarPayloadStatusItem.staticParse(readBuffer), readBuffer), + CAST(parameter, S7ParameterWriteVarResponse.class).getNumItems()); + + readBuffer.closeContext("S7PayloadWriteVarResponse"); + // Create the instance + return new S7PayloadWriteVarResponseBuilderImpl(items); + } + + public static class S7PayloadWriteVarResponseBuilderImpl implements S7Payload.S7PayloadBuilder { + private final List items; + + public S7PayloadWriteVarResponseBuilderImpl(List items) { + this.items = items; + } + + public S7PayloadWriteVarResponse build() { + S7PayloadWriteVarResponse s7PayloadWriteVarResponse = new S7PayloadWriteVarResponse(items); + return s7PayloadWriteVarResponse; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7PayloadWriteVarResponse)) { + return false; + } + S7PayloadWriteVarResponse that = (S7PayloadWriteVarResponse) o; + return (getItems() == that.getItems()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getItems()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java new file mode 100644 index 00000000000..813eb4234a5 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadDataItem.java @@ -0,0 +1,220 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7VarPayloadDataItem implements Message { + + // Properties. + protected final DataTransportErrorCode returnCode; + protected final DataTransportSize transportSize; + protected final byte[] data; + + public S7VarPayloadDataItem( + DataTransportErrorCode returnCode, DataTransportSize transportSize, byte[] data) { + super(); + this.returnCode = returnCode; + this.transportSize = transportSize; + this.data = data; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public DataTransportSize getTransportSize() { + return transportSize; + } + + public byte[] getData() { + return data; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7VarPayloadDataItem"); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + // Simple Field (transportSize) + writeSimpleEnumField( + "transportSize", + "DataTransportSize", + transportSize, + new DataWriterEnumDefault<>( + DataTransportSize::getValue, + DataTransportSize::name, + writeUnsignedShort(writeBuffer, 8))); + + // Implicit Field (dataLength) (Used for parsing, but its value is not stored as it's implicitly + // given by the objects content) + int dataLength = + (int) + ((COUNT(getData())) + * ((((((getTransportSize()) == (DataTransportSize.BIT))) + ? 1 + : (((getTransportSize().getSizeInBits()) ? 8 : 1)))))); + writeImplicitField("dataLength", dataLength, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (data) + writeByteArrayField("data", data, writeByteArray(writeBuffer, 8)); + + // Padding Field (padding) + writePaddingField( + "padding", + (int) ((((!(_lastItem))) ? ((COUNT(data)) % (2)) : 0)), + (short) 0x00, + writeUnsignedShort(writeBuffer, 8)); + + writeBuffer.popContext("S7VarPayloadDataItem"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7VarPayloadDataItem _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (returnCode) + lengthInBits += 8; + + // Simple field (transportSize) + lengthInBits += 8; + + // Implicit Field (dataLength) + lengthInBits += 16; + + // Array field + if (data != null) { + lengthInBits += 8 * data.length; + } + + // Padding Field (padding) + int _timesPadding = (int) ((((!(_lastItem))) ? ((COUNT(data)) % (2)) : 0)); + while (_timesPadding-- > 0) { + lengthInBits += 8; + } + + return lengthInBits; + } + + public static S7VarPayloadDataItem staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static S7VarPayloadDataItem staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7VarPayloadDataItem"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + DataTransportSize transportSize = + readEnumField( + "transportSize", + "DataTransportSize", + new DataReaderEnumDefault<>( + DataTransportSize::enumForValue, readUnsignedShort(readBuffer, 8))); + + int dataLength = readImplicitField("dataLength", readUnsignedInt(readBuffer, 16)); + + byte[] data = + readBuffer.readByteArray( + "data", + Math.toIntExact( + ((transportSize.getSizeInBits()) ? CEIL((dataLength) / (8.0)) : dataLength))); + + readPaddingField( + readUnsignedShort(readBuffer, 8), (int) ((((!(_lastItem))) ? ((COUNT(data)) % (2)) : 0))); + + readBuffer.closeContext("S7VarPayloadDataItem"); + // Create the instance + S7VarPayloadDataItem _s7VarPayloadDataItem; + _s7VarPayloadDataItem = new S7VarPayloadDataItem(returnCode, transportSize, data); + return _s7VarPayloadDataItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7VarPayloadDataItem)) { + return false; + } + S7VarPayloadDataItem that = (S7VarPayloadDataItem) o; + return (getReturnCode() == that.getReturnCode()) + && (getTransportSize() == that.getTransportSize()) + && (getData() == that.getData()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getReturnCode(), getTransportSize(), getData()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java new file mode 100644 index 00000000000..718ce59fab0 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarPayloadStatusItem.java @@ -0,0 +1,139 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7VarPayloadStatusItem implements Message { + + // Properties. + protected final DataTransportErrorCode returnCode; + + public S7VarPayloadStatusItem(DataTransportErrorCode returnCode) { + super(); + this.returnCode = returnCode; + } + + public DataTransportErrorCode getReturnCode() { + return returnCode; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7VarPayloadStatusItem"); + + // Simple Field (returnCode) + writeSimpleEnumField( + "returnCode", + "DataTransportErrorCode", + returnCode, + new DataWriterEnumDefault<>( + DataTransportErrorCode::getValue, + DataTransportErrorCode::name, + writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("S7VarPayloadStatusItem"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7VarPayloadStatusItem _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (returnCode) + lengthInBits += 8; + + return lengthInBits; + } + + public static S7VarPayloadStatusItem staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static S7VarPayloadStatusItem staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7VarPayloadStatusItem"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + DataTransportErrorCode returnCode = + readEnumField( + "returnCode", + "DataTransportErrorCode", + new DataReaderEnumDefault<>( + DataTransportErrorCode::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("S7VarPayloadStatusItem"); + // Create the instance + S7VarPayloadStatusItem _s7VarPayloadStatusItem; + _s7VarPayloadStatusItem = new S7VarPayloadStatusItem(returnCode); + return _s7VarPayloadStatusItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7VarPayloadStatusItem)) { + return false; + } + S7VarPayloadStatusItem that = (S7VarPayloadStatusItem) o; + return (getReturnCode() == that.getReturnCode()) && true; + } + + @Override + public int hashCode() { + return Objects.hash(getReturnCode()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java new file mode 100644 index 00000000000..a6bf2223a27 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItem.java @@ -0,0 +1,148 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public abstract class S7VarRequestParameterItem implements Message { + + // Abstract accessors for discriminator values. + public abstract Short getItemType(); + + public S7VarRequestParameterItem() { + super(); + } + + protected abstract void serializeS7VarRequestParameterItemChild(WriteBuffer writeBuffer) + throws SerializationException; + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7VarRequestParameterItem"); + + // Discriminator Field (itemType) (Used as input to a switch field) + writeDiscriminatorField("itemType", getItemType(), writeUnsignedShort(writeBuffer, 8)); + + // Switch field (Serialize the sub-type) + serializeS7VarRequestParameterItemChild(writeBuffer); + + writeBuffer.popContext("S7VarRequestParameterItem"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + S7VarRequestParameterItem _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Discriminator Field (itemType) + lengthInBits += 8; + + // Length of sub-type elements will be added by sub-type... + + return lengthInBits; + } + + public static S7VarRequestParameterItem staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static S7VarRequestParameterItem staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7VarRequestParameterItem"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short itemType = readDiscriminatorField("itemType", readUnsignedShort(readBuffer, 8)); + + // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type) + S7VarRequestParameterItemBuilder builder = null; + if (EvaluationHelper.equals(itemType, (short) 0x12)) { + builder = + S7VarRequestParameterItemAddress.staticParseS7VarRequestParameterItemBuilder(readBuffer); + } + if (builder == null) { + throw new ParseException( + "Unsupported case for discriminated type" + + " parameters [" + + "itemType=" + + itemType + + "]"); + } + + readBuffer.closeContext("S7VarRequestParameterItem"); + // Create the instance + S7VarRequestParameterItem _s7VarRequestParameterItem = builder.build(); + return _s7VarRequestParameterItem; + } + + public interface S7VarRequestParameterItemBuilder { + S7VarRequestParameterItem build(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7VarRequestParameterItem)) { + return false; + } + S7VarRequestParameterItem that = (S7VarRequestParameterItem) o; + return true; + } + + @Override + public int hashCode() { + return Objects.hash(); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java new file mode 100644 index 00000000000..2acc460e075 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/S7VarRequestParameterItemAddress.java @@ -0,0 +1,155 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class S7VarRequestParameterItemAddress extends S7VarRequestParameterItem implements Message { + + // Accessors for discriminator values. + public Short getItemType() { + return (short) 0x12; + } + + // Properties. + protected final S7Address address; + + public S7VarRequestParameterItemAddress(S7Address address) { + super(); + this.address = address; + } + + public S7Address getAddress() { + return address; + } + + @Override + protected void serializeS7VarRequestParameterItemChild(WriteBuffer writeBuffer) + throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("S7VarRequestParameterItemAddress"); + + // Implicit Field (itemLength) (Used for parsing, but its value is not stored as it's implicitly + // given by the objects content) + short itemLength = (short) (getAddress().getLengthInBytes()); + writeImplicitField("itemLength", itemLength, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (address) + writeSimpleField("address", address, new DataWriterComplexDefault<>(writeBuffer)); + + writeBuffer.popContext("S7VarRequestParameterItemAddress"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = super.getLengthInBits(); + S7VarRequestParameterItemAddress _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Implicit Field (itemLength) + lengthInBits += 8; + + // Simple field (address) + lengthInBits += address.getLengthInBits(); + + return lengthInBits; + } + + public static S7VarRequestParameterItemBuilder staticParseS7VarRequestParameterItemBuilder( + ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("S7VarRequestParameterItemAddress"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short itemLength = readImplicitField("itemLength", readUnsignedShort(readBuffer, 8)); + + S7Address address = + readSimpleField( + "address", + new DataReaderComplexDefault<>(() -> S7Address.staticParse(readBuffer), readBuffer)); + + readBuffer.closeContext("S7VarRequestParameterItemAddress"); + // Create the instance + return new S7VarRequestParameterItemAddressBuilderImpl(address); + } + + public static class S7VarRequestParameterItemAddressBuilderImpl + implements S7VarRequestParameterItem.S7VarRequestParameterItemBuilder { + private final S7Address address; + + public S7VarRequestParameterItemAddressBuilderImpl(S7Address address) { + this.address = address; + } + + public S7VarRequestParameterItemAddress build() { + S7VarRequestParameterItemAddress s7VarRequestParameterItemAddress = + new S7VarRequestParameterItemAddress(address); + return s7VarRequestParameterItemAddress; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof S7VarRequestParameterItemAddress)) { + return false; + } + S7VarRequestParameterItemAddress that = (S7VarRequestParameterItemAddress) o; + return (getAddress() == that.getAddress()) && super.equals(that) && true; + } + + @Override + public int hashCode() { + return Objects.hash(super.hashCode(), getAddress()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java new file mode 100644 index 00000000000..488cc8dc647 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/State.java @@ -0,0 +1,248 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class State implements Message { + + // Properties. + protected final boolean SIG_8; + protected final boolean SIG_7; + protected final boolean SIG_6; + protected final boolean SIG_5; + protected final boolean SIG_4; + protected final boolean SIG_3; + protected final boolean SIG_2; + protected final boolean SIG_1; + + public State( + boolean SIG_8, + boolean SIG_7, + boolean SIG_6, + boolean SIG_5, + boolean SIG_4, + boolean SIG_3, + boolean SIG_2, + boolean SIG_1) { + super(); + this.SIG_8 = SIG_8; + this.SIG_7 = SIG_7; + this.SIG_6 = SIG_6; + this.SIG_5 = SIG_5; + this.SIG_4 = SIG_4; + this.SIG_3 = SIG_3; + this.SIG_2 = SIG_2; + this.SIG_1 = SIG_1; + } + + public boolean getSIG_8() { + return SIG_8; + } + + public boolean getSIG_7() { + return SIG_7; + } + + public boolean getSIG_6() { + return SIG_6; + } + + public boolean getSIG_5() { + return SIG_5; + } + + public boolean getSIG_4() { + return SIG_4; + } + + public boolean getSIG_3() { + return SIG_3; + } + + public boolean getSIG_2() { + return SIG_2; + } + + public boolean getSIG_1() { + return SIG_1; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("State"); + + // Simple Field (SIG_8) + writeSimpleField("SIG_8", SIG_8, writeBoolean(writeBuffer)); + + // Simple Field (SIG_7) + writeSimpleField("SIG_7", SIG_7, writeBoolean(writeBuffer)); + + // Simple Field (SIG_6) + writeSimpleField("SIG_6", SIG_6, writeBoolean(writeBuffer)); + + // Simple Field (SIG_5) + writeSimpleField("SIG_5", SIG_5, writeBoolean(writeBuffer)); + + // Simple Field (SIG_4) + writeSimpleField("SIG_4", SIG_4, writeBoolean(writeBuffer)); + + // Simple Field (SIG_3) + writeSimpleField("SIG_3", SIG_3, writeBoolean(writeBuffer)); + + // Simple Field (SIG_2) + writeSimpleField("SIG_2", SIG_2, writeBoolean(writeBuffer)); + + // Simple Field (SIG_1) + writeSimpleField("SIG_1", SIG_1, writeBoolean(writeBuffer)); + + writeBuffer.popContext("State"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + State _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (SIG_8) + lengthInBits += 1; + + // Simple field (SIG_7) + lengthInBits += 1; + + // Simple field (SIG_6) + lengthInBits += 1; + + // Simple field (SIG_5) + lengthInBits += 1; + + // Simple field (SIG_4) + lengthInBits += 1; + + // Simple field (SIG_3) + lengthInBits += 1; + + // Simple field (SIG_2) + lengthInBits += 1; + + // Simple field (SIG_1) + lengthInBits += 1; + + return lengthInBits; + } + + public static State staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static State staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("State"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + boolean SIG_8 = readSimpleField("SIG_8", readBoolean(readBuffer)); + + boolean SIG_7 = readSimpleField("SIG_7", readBoolean(readBuffer)); + + boolean SIG_6 = readSimpleField("SIG_6", readBoolean(readBuffer)); + + boolean SIG_5 = readSimpleField("SIG_5", readBoolean(readBuffer)); + + boolean SIG_4 = readSimpleField("SIG_4", readBoolean(readBuffer)); + + boolean SIG_3 = readSimpleField("SIG_3", readBoolean(readBuffer)); + + boolean SIG_2 = readSimpleField("SIG_2", readBoolean(readBuffer)); + + boolean SIG_1 = readSimpleField("SIG_1", readBoolean(readBuffer)); + + readBuffer.closeContext("State"); + // Create the instance + State _state; + _state = new State(SIG_8, SIG_7, SIG_6, SIG_5, SIG_4, SIG_3, SIG_2, SIG_1); + return _state; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof State)) { + return false; + } + State that = (State) o; + return (getSIG_8() == that.getSIG_8()) + && (getSIG_7() == that.getSIG_7()) + && (getSIG_6() == that.getSIG_6()) + && (getSIG_5() == that.getSIG_5()) + && (getSIG_4() == that.getSIG_4()) + && (getSIG_3() == that.getSIG_3()) + && (getSIG_2() == that.getSIG_2()) + && (getSIG_1() == that.getSIG_1()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash( + getSIG_8(), + getSIG_7(), + getSIG_6(), + getSIG_5(), + getSIG_4(), + getSIG_3(), + getSIG_2(), + getSIG_1()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java new file mode 100644 index 00000000000..620086f2625 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SubItem.java @@ -0,0 +1,157 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class SubItem implements Message { + + // Properties. + protected final short bytesToRead; + protected final int dbNumber; + protected final int startAddress; + + public SubItem(short bytesToRead, int dbNumber, int startAddress) { + super(); + this.bytesToRead = bytesToRead; + this.dbNumber = dbNumber; + this.startAddress = startAddress; + } + + public short getBytesToRead() { + return bytesToRead; + } + + public int getDbNumber() { + return dbNumber; + } + + public int getStartAddress() { + return startAddress; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("SubItem"); + + // Simple Field (bytesToRead) + writeSimpleField("bytesToRead", bytesToRead, writeUnsignedShort(writeBuffer, 8)); + + // Simple Field (dbNumber) + writeSimpleField("dbNumber", dbNumber, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (startAddress) + writeSimpleField("startAddress", startAddress, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("SubItem"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + SubItem _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (bytesToRead) + lengthInBits += 8; + + // Simple field (dbNumber) + lengthInBits += 16; + + // Simple field (startAddress) + lengthInBits += 16; + + return lengthInBits; + } + + public static SubItem staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static SubItem staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("SubItem"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short bytesToRead = readSimpleField("bytesToRead", readUnsignedShort(readBuffer, 8)); + + int dbNumber = readSimpleField("dbNumber", readUnsignedInt(readBuffer, 16)); + + int startAddress = readSimpleField("startAddress", readUnsignedInt(readBuffer, 16)); + + readBuffer.closeContext("SubItem"); + // Create the instance + SubItem _subItem; + _subItem = new SubItem(bytesToRead, dbNumber, startAddress); + return _subItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof SubItem)) { + return false; + } + SubItem that = (SubItem) o; + return (getBytesToRead() == that.getBytesToRead()) + && (getDbNumber() == that.getDbNumber()) + && (getStartAddress() == that.getStartAddress()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getBytesToRead(), getDbNumber(), getStartAddress()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java new file mode 100644 index 00000000000..f0795feaa37 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SyntaxIdType.java @@ -0,0 +1,66 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum SyntaxIdType { + S7ANY((short) 0x01), + PBC_ID((short) 0x13), + ALARM_LOCKFREESET((short) 0x15), + ALARM_INDSET((short) 0x16), + ALARM_ACKSET((short) 0x19), + ALARM_QUERYREQSET((short) 0x1A), + NOTIFY_INDSET((short) 0x1C), + NCK((short) 0x82), + NCK_METRIC((short) 0x83), + NCK_INCH((short) 0x84), + DRIVEESANY((short) 0xA2), + SYM1200((short) 0xB2), + DBREAD((short) 0xB0); + private static final Map map; + + static { + map = new HashMap<>(); + for (SyntaxIdType value : SyntaxIdType.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + SyntaxIdType(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static SyntaxIdType enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java new file mode 100644 index 00000000000..e656a4637ab --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlDataTreeItem.java @@ -0,0 +1,190 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class SzlDataTreeItem implements Message { + + // Properties. + protected final int itemIndex; + protected final byte[] mlfb; + protected final int moduleTypeId; + protected final int ausbg; + protected final int ausbe; + + public SzlDataTreeItem(int itemIndex, byte[] mlfb, int moduleTypeId, int ausbg, int ausbe) { + super(); + this.itemIndex = itemIndex; + this.mlfb = mlfb; + this.moduleTypeId = moduleTypeId; + this.ausbg = ausbg; + this.ausbe = ausbe; + } + + public int getItemIndex() { + return itemIndex; + } + + public byte[] getMlfb() { + return mlfb; + } + + public int getModuleTypeId() { + return moduleTypeId; + } + + public int getAusbg() { + return ausbg; + } + + public int getAusbe() { + return ausbe; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("SzlDataTreeItem"); + + // Simple Field (itemIndex) + writeSimpleField("itemIndex", itemIndex, writeUnsignedInt(writeBuffer, 16)); + + // Array Field (mlfb) + writeByteArrayField("mlfb", mlfb, writeByteArray(writeBuffer, 8)); + + // Simple Field (moduleTypeId) + writeSimpleField("moduleTypeId", moduleTypeId, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (ausbg) + writeSimpleField("ausbg", ausbg, writeUnsignedInt(writeBuffer, 16)); + + // Simple Field (ausbe) + writeSimpleField("ausbe", ausbe, writeUnsignedInt(writeBuffer, 16)); + + writeBuffer.popContext("SzlDataTreeItem"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + SzlDataTreeItem _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (itemIndex) + lengthInBits += 16; + + // Array field + if (mlfb != null) { + lengthInBits += 8 * mlfb.length; + } + + // Simple field (moduleTypeId) + lengthInBits += 16; + + // Simple field (ausbg) + lengthInBits += 16; + + // Simple field (ausbe) + lengthInBits += 16; + + return lengthInBits; + } + + public static SzlDataTreeItem staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static SzlDataTreeItem staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("SzlDataTreeItem"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + int itemIndex = readSimpleField("itemIndex", readUnsignedInt(readBuffer, 16)); + + byte[] mlfb = readBuffer.readByteArray("mlfb", Math.toIntExact(20)); + + int moduleTypeId = readSimpleField("moduleTypeId", readUnsignedInt(readBuffer, 16)); + + int ausbg = readSimpleField("ausbg", readUnsignedInt(readBuffer, 16)); + + int ausbe = readSimpleField("ausbe", readUnsignedInt(readBuffer, 16)); + + readBuffer.closeContext("SzlDataTreeItem"); + // Create the instance + SzlDataTreeItem _szlDataTreeItem; + _szlDataTreeItem = new SzlDataTreeItem(itemIndex, mlfb, moduleTypeId, ausbg, ausbe); + return _szlDataTreeItem; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof SzlDataTreeItem)) { + return false; + } + SzlDataTreeItem that = (SzlDataTreeItem) o; + return (getItemIndex() == that.getItemIndex()) + && (getMlfb() == that.getMlfb()) + && (getModuleTypeId() == that.getModuleTypeId()) + && (getAusbg() == that.getAusbg()) + && (getAusbe() == that.getAusbe()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getItemIndex(), getMlfb(), getModuleTypeId(), getAusbg(), getAusbe()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java new file mode 100644 index 00000000000..69c2b8d94d3 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlId.java @@ -0,0 +1,179 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class SzlId implements Message { + + // Properties. + protected final SzlModuleTypeClass typeClass; + protected final byte sublistExtract; + protected final SzlSublist sublistList; + + public SzlId(SzlModuleTypeClass typeClass, byte sublistExtract, SzlSublist sublistList) { + super(); + this.typeClass = typeClass; + this.sublistExtract = sublistExtract; + this.sublistList = sublistList; + } + + public SzlModuleTypeClass getTypeClass() { + return typeClass; + } + + public byte getSublistExtract() { + return sublistExtract; + } + + public SzlSublist getSublistList() { + return sublistList; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("SzlId"); + + // Simple Field (typeClass) + writeSimpleEnumField( + "typeClass", + "SzlModuleTypeClass", + typeClass, + new DataWriterEnumDefault<>( + SzlModuleTypeClass::getValue, + SzlModuleTypeClass::name, + writeUnsignedByte(writeBuffer, 4))); + + // Simple Field (sublistExtract) + writeSimpleField("sublistExtract", sublistExtract, writeUnsignedByte(writeBuffer, 4)); + + // Simple Field (sublistList) + writeSimpleEnumField( + "sublistList", + "SzlSublist", + sublistList, + new DataWriterEnumDefault<>( + SzlSublist::getValue, SzlSublist::name, writeUnsignedShort(writeBuffer, 8))); + + writeBuffer.popContext("SzlId"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + SzlId _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Simple field (typeClass) + lengthInBits += 4; + + // Simple field (sublistExtract) + lengthInBits += 4; + + // Simple field (sublistList) + lengthInBits += 8; + + return lengthInBits; + } + + public static SzlId staticParse(ReadBuffer readBuffer, Object... args) throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static SzlId staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("SzlId"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + SzlModuleTypeClass typeClass = + readEnumField( + "typeClass", + "SzlModuleTypeClass", + new DataReaderEnumDefault<>( + SzlModuleTypeClass::enumForValue, readUnsignedByte(readBuffer, 4))); + + byte sublistExtract = readSimpleField("sublistExtract", readUnsignedByte(readBuffer, 4)); + + SzlSublist sublistList = + readEnumField( + "sublistList", + "SzlSublist", + new DataReaderEnumDefault<>( + SzlSublist::enumForValue, readUnsignedShort(readBuffer, 8))); + + readBuffer.closeContext("SzlId"); + // Create the instance + SzlId _szlId; + _szlId = new SzlId(typeClass, sublistExtract, sublistList); + return _szlId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof SzlId)) { + return false; + } + SzlId that = (SzlId) o; + return (getTypeClass() == that.getTypeClass()) + && (getSublistExtract() == that.getSublistExtract()) + && (getSublistList() == that.getSublistList()) + && true; + } + + @Override + public int hashCode() { + return Objects.hash(getTypeClass(), getSublistExtract(), getSublistList()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java new file mode 100644 index 00000000000..18ffefb3f04 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlModuleTypeClass.java @@ -0,0 +1,57 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum SzlModuleTypeClass { + CPU((byte) 0x0), + IM((byte) 0x4), + FM((byte) 0x8), + CP((byte) 0xC); + private static final Map map; + + static { + map = new HashMap<>(); + for (SzlModuleTypeClass value : SzlModuleTypeClass.values()) { + map.put((byte) value.getValue(), value); + } + } + + private final byte value; + + SzlModuleTypeClass(byte value) { + this.value = value; + } + + public byte getValue() { + return value; + } + + public static SzlModuleTypeClass enumForValue(byte value) { + return map.get(value); + } + + public static Boolean isDefined(byte value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java new file mode 100644 index 00000000000..3659cf9fa0a --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/SzlSublist.java @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum SzlSublist { + NONE((short) 0x00), + MODULE_IDENTIFICATION((short) 0x11), + CPU_FEATURES((short) 0x12), + USER_MEMORY_AREA((short) 0x13), + SYSTEM_AREAS((short) 0x14), + BLOCK_TYPES((short) 0x15), + STATUS_MODULE_LEDS((short) 0x19), + COMPONENT_IDENTIFICATION((short) 0x1C), + INTERRUPT_STATUS((short) 0x22), + ASSIGNMENT_BETWEEN_PROCESS_IMAGE_PARTITIONS_AND_OBS((short) 0x25), + COMMUNICATION_STATUS_DATA((short) 0x32), + H_CPU_GROUP_INFORMATION((short) 0x71), + STATUS_SINGLE_MODULE_LED((short) 0x74), + SWITCHED_DP_SLAVES_H_SYSTEM((short) 0x75), + DP_MASTER_SYSTEM_INFORMATION((short) 0x90), + MODULE_STATUS_INFORMATION((short) 0x91), + RACK_OR_STATION_STATUS_INFORMATION((short) 0x92), + RACK_OR_STATION_STATUS_INFORMATION_2((short) 0x94), + ADDITIONAL_DP_MASTER_SYSTEM_OR_PROFINET_IO_SYSTEM_INFORMATION((short) 0x95), + MODULE_STATUS_INFORMATION_PROFINET_IO_AND_PROFIBUS_DP((short) 0x96), + TOOL_CHANGER_INFORMATION_PROFINET((short) 0x9C), + DIAGNOSTIC_BUFFER((short) 0xA0), + MODULE_DIAGNOSTIC_INFORMATION_DR0((short) 0xB1), + MODULE_DIAGNOSTIC_INFORMATION_DR1_GI((short) 0xB2), + MODULE_DIAGNOSTIC_INFORMATION_DR1_LA((short) 0xB3), + DIAGNOSTIC_DATA_DP_SLAVE((short) 0xB4); + private static final Map map; + + static { + map = new HashMap<>(); + for (SzlSublist value : SzlSublist.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + SzlSublist(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static SzlSublist enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java new file mode 100644 index 00000000000..10eab0edc43 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TPKTPacket.java @@ -0,0 +1,193 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import static org.apache.plc4x.java.spi.codegen.fields.FieldReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.fields.FieldWriterFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataReaderFactory.*; +import static org.apache.plc4x.java.spi.codegen.io.DataWriterFactory.*; +import static org.apache.plc4x.java.spi.generation.StaticHelper.*; + +import java.time.*; +import java.util.*; +import org.apache.plc4x.java.api.exceptions.*; +import org.apache.plc4x.java.api.value.*; +import org.apache.plc4x.java.spi.codegen.*; +import org.apache.plc4x.java.spi.codegen.fields.*; +import org.apache.plc4x.java.spi.codegen.io.*; +import org.apache.plc4x.java.spi.generation.*; + +// Code generated by code-generation. DO NOT EDIT. + +public class TPKTPacket implements Message { + + // Constant values. + public static final Short PROTOCOLID = 0x03; + + // Properties. + protected final COTPPacket payload; + + public TPKTPacket(COTPPacket payload) { + super(); + this.payload = payload; + } + + public COTPPacket getPayload() { + return payload; + } + + public short getProtocolId() { + return PROTOCOLID; + } + + public void serialize(WriteBuffer writeBuffer) throws SerializationException { + PositionAware positionAware = writeBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + writeBuffer.pushContext("TPKTPacket"); + + // Const Field (protocolId) + writeConstField( + "protocolId", + PROTOCOLID, + writeUnsignedShort(writeBuffer, 8), + WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + // Reserved Field (reserved) + writeReservedField( + "reserved", + (short) 0x00, + writeUnsignedShort(writeBuffer, 8), + WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + // Implicit Field (len) (Used for parsing, but its value is not stored as it's implicitly given + // by the objects content) + int len = (int) ((getPayload().getLengthInBytes()) + (4)); + writeImplicitField( + "len", + len, + writeUnsignedInt(writeBuffer, 16), + WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + // Simple Field (payload) + writeSimpleField( + "payload", + payload, + new DataWriterComplexDefault<>(writeBuffer), + WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + writeBuffer.popContext("TPKTPacket"); + } + + @Override + public int getLengthInBytes() { + return (int) Math.ceil((float) getLengthInBits() / 8.0); + } + + @Override + public int getLengthInBits() { + int lengthInBits = 0; + TPKTPacket _value = this; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + // Const Field (protocolId) + lengthInBits += 8; + + // Reserved Field (reserved) + lengthInBits += 8; + + // Implicit Field (len) + lengthInBits += 16; + + // Simple field (payload) + lengthInBits += payload.getLengthInBits(); + + return lengthInBits; + } + + public static TPKTPacket staticParse(ReadBuffer readBuffer, Object... args) + throws ParseException { + PositionAware positionAware = readBuffer; + return staticParse(readBuffer); + } + + public static TPKTPacket staticParse(ReadBuffer readBuffer) throws ParseException { + readBuffer.pullContext("TPKTPacket"); + PositionAware positionAware = readBuffer; + boolean _lastItem = ThreadLocalHelper.lastItemThreadLocal.get(); + + short protocolId = + readConstField( + "protocolId", + readUnsignedShort(readBuffer, 8), + TPKTPacket.PROTOCOLID, + WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + Short reservedField0 = + readReservedField( + "reserved", + readUnsignedShort(readBuffer, 8), + (short) 0x00, + WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + int len = + readImplicitField( + "len", readUnsignedInt(readBuffer, 16), WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + COTPPacket payload = + readSimpleField( + "payload", + new DataReaderComplexDefault<>( + () -> COTPPacket.staticParse(readBuffer, (int) ((len) - (4))), readBuffer), + WithOption.WithByteOrder(ByteOrder.BIG_ENDIAN)); + + readBuffer.closeContext("TPKTPacket"); + // Create the instance + TPKTPacket _tPKTPacket; + _tPKTPacket = new TPKTPacket(payload); + return _tPKTPacket; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof TPKTPacket)) { + return false; + } + TPKTPacket that = (TPKTPacket) o; + return (getPayload() == that.getPayload()) && true; + } + + @Override + public int hashCode() { + return Objects.hash(getPayload()); + } + + @Override + public String toString() { + WriteBufferBoxBased writeBufferBoxBased = new WriteBufferBoxBased(true, true); + try { + writeBufferBoxBased.writeSerializable(this); + } catch (SerializationException e) { + throw new RuntimeException(e); + } + return "\n" + writeBufferBoxBased.getBox().toString() + "\n"; + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java new file mode 100644 index 00000000000..573645a8e68 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TimeBase.java @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.HashMap; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum TimeBase { + B01SEC((short) 0x00), + B1SEC((short) 0x01), + B10SEC((short) 0X02); + private static final Map map; + + static { + map = new HashMap<>(); + for (TimeBase value : TimeBase.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + + TimeBase(short value) { + this.value = value; + } + + public short getValue() { + return value; + } + + public static TimeBase enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java new file mode 100644 index 00000000000..a47b7e16497 --- /dev/null +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java @@ -0,0 +1,680 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.plc4x.java.s7.readwrite; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +// Code generated by code-generation. DO NOT EDIT. + +public enum TransportSize { + BOOL( + (short) 0x01, + (boolean) true, + (boolean) true, + (short) 0x01, + (short) 1, + (boolean) true, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.BIT, + (String) "IEC61131_BOOL", + null), + BYTE( + (short) 0x02, + (boolean) true, + (boolean) true, + (short) 0x02, + (short) 1, + (boolean) true, + (boolean) true, + (short) 'B', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_BYTE", + null), + WORD( + (short) 0x03, + (boolean) true, + (boolean) true, + (short) 0x04, + (short) 2, + (boolean) true, + (boolean) true, + (short) 'W', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_WORD", + null), + DWORD( + (short) 0x04, + (boolean) true, + (boolean) true, + (short) 0x06, + (short) 4, + (boolean) true, + (boolean) true, + (short) 'D', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_DWORD", + TransportSize.WORD), + LWORD( + (short) 0x05, + (boolean) false, + (boolean) false, + (short) 0x00, + (short) 8, + (boolean) false, + (boolean) false, + (short) 'X', + (boolean) true, + null, + (String) "IEC61131_LWORD", + null), + INT( + (short) 0x06, + (boolean) true, + (boolean) true, + (short) 0x05, + (short) 2, + (boolean) true, + (boolean) true, + (short) 'W', + (boolean) true, + DataTransportSize.INTEGER, + (String) "IEC61131_INT", + null), + UINT( + (short) 0x07, + (boolean) false, + (boolean) true, + (short) 0x05, + (short) 2, + (boolean) false, + (boolean) true, + (short) 'W', + (boolean) true, + DataTransportSize.INTEGER, + (String) "IEC61131_UINT", + TransportSize.INT), + SINT( + (short) 0x08, + (boolean) false, + (boolean) true, + (short) 0x02, + (short) 1, + (boolean) false, + (boolean) true, + (short) 'B', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_SINT", + TransportSize.INT), + USINT( + (short) 0x09, + (boolean) false, + (boolean) true, + (short) 0x02, + (short) 1, + (boolean) false, + (boolean) true, + (short) 'B', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_USINT", + TransportSize.INT), + DINT( + (short) 0x0A, + (boolean) true, + (boolean) true, + (short) 0x07, + (short) 4, + (boolean) true, + (boolean) true, + (short) 'D', + (boolean) true, + DataTransportSize.INTEGER, + (String) "IEC61131_DINT", + TransportSize.INT), + UDINT( + (short) 0x0B, + (boolean) false, + (boolean) true, + (short) 0x07, + (short) 4, + (boolean) false, + (boolean) true, + (short) 'D', + (boolean) true, + DataTransportSize.INTEGER, + (String) "IEC61131_UDINT", + TransportSize.INT), + LINT( + (short) 0x0C, + (boolean) false, + (boolean) false, + (short) 0x00, + (short) 8, + (boolean) false, + (boolean) false, + (short) 'X', + (boolean) true, + null, + (String) "IEC61131_LINT", + TransportSize.INT), + ULINT( + (short) 0x0D, + (boolean) false, + (boolean) false, + (short) 0x00, + (short) 16, + (boolean) false, + (boolean) false, + (short) 'X', + (boolean) true, + null, + (String) "IEC61131_ULINT", + TransportSize.INT), + REAL( + (short) 0x0E, + (boolean) true, + (boolean) true, + (short) 0x08, + (short) 4, + (boolean) true, + (boolean) true, + (short) 'D', + (boolean) true, + DataTransportSize.REAL, + (String) "IEC61131_REAL", + null), + LREAL( + (short) 0x0F, + (boolean) false, + (boolean) false, + (short) 0x30, + (short) 8, + (boolean) false, + (boolean) true, + (short) 'X', + (boolean) true, + null, + (String) "IEC61131_LREAL", + TransportSize.REAL), + CHAR( + (short) 0x10, + (boolean) true, + (boolean) true, + (short) 0x03, + (short) 1, + (boolean) true, + (boolean) true, + (short) 'B', + (boolean) true, + DataTransportSize.OCTET_STRING, + (String) "IEC61131_CHAR", + null), + WCHAR( + (short) 0x11, + (boolean) false, + (boolean) true, + (short) 0x13, + (short) 2, + (boolean) false, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.OCTET_STRING, + (String) "IEC61131_WCHAR", + null), + STRING( + (short) 0x12, + (boolean) true, + (boolean) true, + (short) 0x03, + (short) 1, + (boolean) true, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.OCTET_STRING, + (String) "IEC61131_STRING", + null), + WSTRING( + (short) 0x13, + (boolean) false, + (boolean) true, + (short) 0x00, + (short) 2, + (boolean) false, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.OCTET_STRING, + (String) "IEC61131_WSTRING", + null), + TIME( + (short) 0x14, + (boolean) true, + (boolean) true, + (short) 0x0B, + (short) 4, + (boolean) true, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_TIME", + null), + LTIME( + (short) 0x16, + (boolean) false, + (boolean) false, + (short) 0x00, + (short) 8, + (boolean) false, + (boolean) false, + (short) 'X', + (boolean) true, + null, + (String) "IEC61131_LTIME", + TransportSize.TIME), + DATE( + (short) 0x17, + (boolean) true, + (boolean) true, + (short) 0x09, + (short) 2, + (boolean) true, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_DATE", + null), + TIME_OF_DAY( + (short) 0x18, + (boolean) true, + (boolean) true, + (short) 0x06, + (short) 4, + (boolean) true, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_TIME_OF_DAY", + null), + TOD( + (short) 0x19, + (boolean) true, + (boolean) true, + (short) 0x06, + (short) 4, + (boolean) true, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "IEC61131_TIME_OF_DAY", + null), + DATE_AND_TIME( + (short) 0x1A, + (boolean) true, + (boolean) false, + (short) 0x0F, + (short) 12, + (boolean) true, + (boolean) false, + (short) 'X', + (boolean) true, + null, + (String) "IEC61131_DATE_AND_TIME", + null), + DT( + (short) 0x1B, + (boolean) true, + (boolean) false, + (short) 0x0F, + (short) 12, + (boolean) true, + (boolean) false, + (short) 'X', + (boolean) true, + null, + (String) "IEC61131_DATE_AND_TIME", + null); + private static final Map map; + + static { + map = new HashMap<>(); + for (TransportSize value : TransportSize.values()) { + map.put((short) value.getValue(), value); + } + } + + private final short value; + private final boolean supported_S7_300; + private final boolean supported_LOGO; + private final short code; + private final short sizeInBytes; + private final boolean supported_S7_400; + private final boolean supported_S7_1200; + private final short shortName; + private final boolean supported_S7_1500; + private final DataTransportSize dataTransportSize; + private final String dataProtocolId; + private final TransportSize baseType; + + TransportSize( + short value, + boolean supported_S7_300, + boolean supported_LOGO, + short code, + short sizeInBytes, + boolean supported_S7_400, + boolean supported_S7_1200, + short shortName, + boolean supported_S7_1500, + DataTransportSize dataTransportSize, + String dataProtocolId, + TransportSize baseType) { + this.value = value; + this.supported_S7_300 = supported_S7_300; + this.supported_LOGO = supported_LOGO; + this.code = code; + this.sizeInBytes = sizeInBytes; + this.supported_S7_400 = supported_S7_400; + this.supported_S7_1200 = supported_S7_1200; + this.shortName = shortName; + this.supported_S7_1500 = supported_S7_1500; + this.dataTransportSize = dataTransportSize; + this.dataProtocolId = dataProtocolId; + this.baseType = baseType; + } + + public short getValue() { + return value; + } + + public boolean getSupported_S7_300() { + return supported_S7_300; + } + + public static TransportSize firstEnumForFieldSupported_S7_300(boolean fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_300() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSupported_S7_300(boolean fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_300() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public boolean getSupported_LOGO() { + return supported_LOGO; + } + + public static TransportSize firstEnumForFieldSupported_LOGO(boolean fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_LOGO() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSupported_LOGO(boolean fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_LOGO() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public short getCode() { + return code; + } + + public static TransportSize firstEnumForFieldCode(short fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getCode() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldCode(short fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getCode() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public short getSizeInBytes() { + return sizeInBytes; + } + + public static TransportSize firstEnumForFieldSizeInBytes(short fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getSizeInBytes() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSizeInBytes(short fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getSizeInBytes() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public boolean getSupported_S7_400() { + return supported_S7_400; + } + + public static TransportSize firstEnumForFieldSupported_S7_400(boolean fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_400() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSupported_S7_400(boolean fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_400() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public boolean getSupported_S7_1200() { + return supported_S7_1200; + } + + public static TransportSize firstEnumForFieldSupported_S7_1200(boolean fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_1200() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSupported_S7_1200(boolean fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_1200() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public short getShortName() { + return shortName; + } + + public static TransportSize firstEnumForFieldShortName(short fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getShortName() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldShortName(short fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getShortName() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public boolean getSupported_S7_1500() { + return supported_S7_1500; + } + + public static TransportSize firstEnumForFieldSupported_S7_1500(boolean fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_1500() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldSupported_S7_1500(boolean fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getSupported_S7_1500() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public DataTransportSize getDataTransportSize() { + return dataTransportSize; + } + + public static TransportSize firstEnumForFieldDataTransportSize(DataTransportSize fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getDataTransportSize() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldDataTransportSize(DataTransportSize fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getDataTransportSize() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public String getDataProtocolId() { + return dataProtocolId; + } + + public static TransportSize firstEnumForFieldDataProtocolId(String fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getDataProtocolId().equals(fieldValue)) { + return _val; + } + } + return null; + } + + public static List enumsForFieldDataProtocolId(String fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getDataProtocolId().equals(fieldValue)) { + _values.add(_val); + } + } + return _values; + } + + public TransportSize getBaseType() { + return baseType; + } + + public static TransportSize firstEnumForFieldBaseType(TransportSize fieldValue) { + for (TransportSize _val : TransportSize.values()) { + if (_val.getBaseType() == fieldValue) { + return _val; + } + } + return null; + } + + public static List enumsForFieldBaseType(TransportSize fieldValue) { + List _values = new ArrayList<>(); + for (TransportSize _val : TransportSize.values()) { + if (_val.getBaseType() == fieldValue) { + _values.add(_val); + } + } + return _values; + } + + public static TransportSize enumForValue(short value) { + return map.get(value); + } + + public static Boolean isDefined(short value) { + return map.containsKey(value); + } +} diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java index f82ab94bbcc..62147f47342 100644 --- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java @@ -250,8 +250,9 @@ private void Write() { if (!isConnected.get()) return; try { final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) - writeRequest.addTagAddress("TAG00", "%DB400:4:DWORD",(long) 0x0001_0001); //(02) - writeRequest.addTagAddress("TAG01", "%DB400:4:TIME",Duration.ofDays(5)); //(02) + writeRequest.addTagAddress("TAG01", "%DB406:4:DWORD",(long) 0x0001_0001); //(02) + + writeRequest.addTagAddress("TAG02", "%DB406:4:TIME",(long) 0x8002_0002); //(02) final PlcWriteRequest wr = writeRequest.build(); //(03) diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec index bba452cdab7..f399ed4a502 100644 --- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec +++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec @@ -885,7 +885,7 @@ ['0x13' WSTRING ['0x00' , 'X' , '2' , 'null' , 'OCTET_STRING' , 'IEC61131_WSTRING' , 'false' , 'false' , 'true' , 'true' , 'true' ]] // Dates and time values (Please note that we seem to have to rewrite queries for these types to reading bytes or we'll get "Data type not supported" errors) - ['0x14' TIME ['0x0B' , 'X' , '4' , 'null' , 'null' , 'IEC61131_TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] + ['0x14' TIME ['0x0B' , 'X' , '4' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] //['0x15' S5TIME ['0x0C' , 'X' , '4' , 'null' , 'null' , 'S7_S5TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] ['0x16' LTIME ['0x00' , 'X' , '8' , 'TIME' , 'null' , 'IEC61131_LTIME' , 'false' , 'false' , 'false' , 'true' , 'false' ]] ['0x17' DATE ['0x09' , 'X' , '2' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_DATE' , 'true' , 'true' , 'true' , 'true' , 'true' ]] From 8239d106279e84bd88f087adf005400c2ccf7a99 Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Tue, 5 Dec 2023 07:16:34 -0400 Subject: [PATCH 16/21] Updating repo. --- .../apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java index 62147f47342..330212e7d91 100644 --- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java @@ -252,7 +252,7 @@ private void Write() { final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) writeRequest.addTagAddress("TAG01", "%DB406:4:DWORD",(long) 0x0001_0001); //(02) - writeRequest.addTagAddress("TAG02", "%DB406:4:TIME",(long) 0x8002_0002); //(02) + writeRequest.addTagAddress("TAG02", "%DB406:4:TIME", Duration.ofDays(7)); //(02) final PlcWriteRequest wr = writeRequest.build(); //(03) From 2faf2a3de55fe93728476e1a17a48b689f34f7d0 Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Tue, 5 Dec 2023 07:59:17 -0400 Subject: [PATCH 17/21] Correct reading and writing of TIME type in S7-400. --- .../org/apache/plc4x/java/s7/readwrite/DataItem.java | 8 +++++--- .../plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java | 4 ++-- protocols/s7/src/main/resources/protocols/s7/s7.mspec | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java index 8cbcc67d768..40dfd1d4d61 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -180,7 +180,8 @@ public static PlcValue staticParse( } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME // Simple Field (milliseconds) - Integer milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readInt("", 32); + Long milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ + readBuffer.readUnsignedLong("", 32); return PlcTIME.ofMilliseconds(milliseconds); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME @@ -364,9 +365,10 @@ public static void staticSerialize( writeBuffer, _value, stringLength, "UTF-16"); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME // Simple Field (milliseconds) - int milliseconds = (int) _value.getInt(); + long milliseconds = (long) _value.getLong(); /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeInt("", 32, ((Number) (milliseconds)).intValue()); + /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( + "", 32, ((Number) (milliseconds)).longValue()); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME // Simple Field (nanoseconds) BigInteger nanoseconds = (BigInteger) _value.getBigInteger(); diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java index 330212e7d91..cb08aea36de 100644 --- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java @@ -250,9 +250,9 @@ private void Write() { if (!isConnected.get()) return; try { final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) - writeRequest.addTagAddress("TAG01", "%DB406:4:DWORD",(long) 0x0001_0001); //(02) + //writeRequest.addTagAddress("TAG01", "%DB406:4:DWORD",(long) 0x0001_0001); //(02) - writeRequest.addTagAddress("TAG02", "%DB406:4:TIME", Duration.ofDays(7)); //(02) + writeRequest.addTagAddress("TAG02", "%DB406:4:TIME", Duration.ofDays(-11)); //(02) final PlcWriteRequest wr = writeRequest.build(); //(03) diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec index f399ed4a502..0d8179cd007 100644 --- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec +++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec @@ -772,7 +772,7 @@ // ----------------------------------------- // - Duration: Interpreted as "milliseconds" ['"IEC61131_TIME"' TIME - [simple int 32 milliseconds] + [simple uint 32 milliseconds] ] //['"S7_S5TIME"' TIME // [reserved uint 2 '0x00'] From 20c3a257b19057c4e99d6552818fb45603bf0466 Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Tue, 5 Dec 2023 15:56:22 -0400 Subject: [PATCH 18/21] Fix read/write S5TIME type. --- .../plc4x/java/s7/readwrite/DataItem.java | 13 ++++++ .../java/s7/readwrite/TransportSize.java | 13 ++++++ .../readwrite/protocol/S7ProtocolLogic.java | 4 +- .../plc4x/java/s7/readwrite/tag/S7Tag.java | 10 +++-- .../java/s7/readwrite/utils/StaticHelper.java | 45 +++++++++++++------ .../plc4j/s7event/PlcReadDataS7400H.java | 6 +-- .../src/main/resources/protocols/s7/s7.mspec | 12 +++-- 7 files changed, 74 insertions(+), 29 deletions(-) diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java index 40dfd1d4d61..a66b0a56d82 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -183,6 +183,13 @@ public static PlcValue staticParse( Long milliseconds = /*TODO: migrate me*/ /*TODO: migrate me*/ readBuffer.readUnsignedLong("", 32); + return PlcTIME.ofMilliseconds(milliseconds); + } else if (EvaluationHelper.equals(dataProtocolId, "S7_S5TIME")) { // TIME + + // Manual Field (milliseconds) + long milliseconds = + (long) (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseS5Time(readBuffer)); + return PlcTIME.ofMilliseconds(milliseconds); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME @@ -369,6 +376,9 @@ public static void staticSerialize( /*TODO: migrate me*/ /*TODO: migrate me*/ writeBuffer.writeUnsignedLong( "", 32, ((Number) (milliseconds)).longValue()); + } else if (EvaluationHelper.equals(dataProtocolId, "S7_S5TIME")) { // TIME + // Manual Field (milliseconds) + org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeS5Time(writeBuffer, _value); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME // Simple Field (nanoseconds) BigInteger nanoseconds = (BigInteger) _value.getBigInteger(); @@ -498,6 +508,9 @@ public static int getLengthInBits(PlcValue _value, String dataProtocolId, Intege } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME")) { // TIME // Simple Field (milliseconds) sizeInBits += 32; + } else if (EvaluationHelper.equals(dataProtocolId, "S7_S5TIME")) { // TIME + // Manual Field (milliseconds) + sizeInBits += 2; } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_LTIME")) { // LTIME // Simple Field (nanoseconds) sizeInBits += 64; diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java index a47b7e16497..7d9b946c42d 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/TransportSize.java @@ -286,6 +286,19 @@ public enum TransportSize { DataTransportSize.BYTE_WORD_DWORD, (String) "IEC61131_TIME", null), + S5TIME( + (short) 0x15, + (boolean) true, + (boolean) true, + (short) 0x04, + (short) 2, + (boolean) true, + (boolean) true, + (short) 'X', + (boolean) true, + DataTransportSize.BYTE_WORD_DWORD, + (String) "S7_S5TIME", + null), LTIME( (short) 0x16, (boolean) false, diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java index 20af57c8734..264f1cf4b2d 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java @@ -1896,7 +1896,9 @@ private S7VarPayloadDataItem serializePlcValue(S7Tag tag, PlcValue plcValue) { lengthInBits = Math.min(lengthInBits, (stringLength * 8) + 16); } else if(tag.getDataType() == TransportSize.WSTRING) { lengthInBits = Math.min(lengthInBits, (stringLength * 16) + 32); - } + } else if(tag.getDataType() == TransportSize.S5TIME) { + lengthInBits = lengthInBits * 8; + } final WriteBufferByteBased writeBuffer = new WriteBufferByteBased((int) Math.ceil(((float) lengthInBits) / 8.0f)); DataItem.staticSerialize(writeBuffer, plcValue.getIndex(i), tag.getDataType().getDataProtocolId(), stringLength); // Allocate enough space for all items. diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java index 552555e56f6..c026119fc44 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/tag/S7Tag.java @@ -43,14 +43,14 @@ public class S7Tag implements PlcTag, Serializable { //byteOffset theoretically can reach up to 2097151 ... see checkByteOffset() below --> 7digits private static final Pattern ADDRESS_PATTERN = - Pattern.compile("^%(?.)(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?[a-zA-Z_]+)(\\[(?\\d+)])?"); + Pattern.compile("^%(?.)(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?(S5)?[a-zA-Z_]+)(\\[(?\\d+)])?"); //blockNumber usually has its max hat around 64000 --> 5digits private static final Pattern DATA_BLOCK_ADDRESS_PATTERN = - Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?[a-zA-Z_]+)(\\[(?\\d+)])?"); + Pattern.compile("^%DB(?\\d{1,5}).DB(?[XBWD]?)(?\\d{1,7})(.(?[0-7]))?:(?(S5)?[a-zA-Z_]+)(\\[(?\\d+)])?"); private static final Pattern DATA_BLOCK_SHORT_PATTERN = - Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?[a-zA-Z_]+)(\\[(?\\d+)])?"); + Pattern.compile("^%DB(?\\d{1,5}):(?\\d{1,7})(.(?[0-7]))?:(?(S5)?[a-zA-Z_]+)(\\[(?\\d+)])?"); private static final Pattern PLC_PROXY_ADDRESS_PATTERN = Pattern.compile("[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}"); @@ -89,7 +89,9 @@ public String getAddressString() { @Override public PlcValueType getPlcValueType() { - return PlcValueType.valueOf(dataType.name()); + //S5TIME is a specific type of Simatic S5/S7. + String name = dataType.name().equals("S5TIME")?"TIME":dataType.name(); + return PlcValueType.valueOf(name); } @Override diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java index f57948ff65b..920c959fa33 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java @@ -53,6 +53,7 @@ import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.plc4x.java.spi.values.PlcTIME; /** * +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ @@ -1908,19 +1909,28 @@ private static short convertShortToBcd(short incomingShort) { } - public static Duration S5TimeToDuration(Short data) { +// public static Duration S5TimeToDuration(Short data) { +// Duration res; +// short t = data; +// long tv = (short) (((t & 0x000F)) + ((t & 0x00F0) >> 4) * 10 + ((t & 0x0F00) >> 8) * 100); +// long tb = (short) (10 * Math.pow(10, ((t & 0xF000) >> 12))); +// long totalms = tv * tb; +// if (totalms <= 9990000) { +// res = Duration.ofMillis(totalms); +// } else { +// res = Duration.ofMillis(9990000); +// } +// return res; +// } + + public static Long S5TimeToDuration(Short data) { Duration res; short t = data; long tv = (short) (((t & 0x000F)) + ((t & 0x00F0) >> 4) * 10 + ((t & 0x0F00) >> 8) * 100); long tb = (short) (10 * Math.pow(10, ((t & 0xF000) >> 12))); long totalms = tv * tb; - if (totalms <= 9990000) { - res = Duration.ofMillis(totalms); - } else { - res = Duration.ofMillis(9990000); - } - return res; - } + return (totalms <= 9990000)?totalms:9990000; + } public static Short DurationToS5Time(Duration duration) { short tv = 0; @@ -2586,18 +2596,25 @@ public static void serializeTiaTime(WriteBuffer io, PlcValue value) { throw new NotImplementedException("Serializing TIME not implemented"); } - public static LocalTime parseS5Time(ReadBuffer io) { + public static Long parseS5Time(ReadBuffer io) { try { - int stuff = io.readInt(16); - // TODO: Implement this correctly. - throw new NotImplementedException("S5TIME not implemented"); + short s5time = (short) io.readInt(16); + return S5TimeToDuration(s5time); } catch (ParseException e) { return null; } } - public static void serializeS5Time(WriteBuffer io, PlcValue value) { - throw new NotImplementedException("Serializing S5TIME not implemented"); + public static void serializeS5Time(final WriteBuffer io, PlcValue value) { + final PlcTIME time = (PlcTIME) value; + Short shortValue = DurationToS5Time(time.getDuration()); + System.out.println(">>>TIPO: " + value.getClass().getName() + " : " + shortValue); + try { + io.writeUnsignedInt(16,shortValue); + } catch (SerializationException ex) { + ex.printStackTrace(); + return; + } } diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java index cb08aea36de..6842f4ad4cb 100644 --- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java @@ -224,7 +224,7 @@ private void Read() { if (!isConnected.get()) return; try { final PlcReadRequest.Builder readrequest = connection.readRequestBuilder(); //(01) - readrequest.addTagAddress("TEST", "%DB406:4:TIME"); //(02) + readrequest.addTagAddress("TEST", "%DB406:0:S5TIME"); //(02) final PlcReadRequest rr = readrequest.build(); //(03) final PlcReadResponse response; //(04) @@ -252,7 +252,7 @@ private void Write() { final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) //writeRequest.addTagAddress("TAG01", "%DB406:4:DWORD",(long) 0x0001_0001); //(02) - writeRequest.addTagAddress("TAG02", "%DB406:4:TIME", Duration.ofDays(-11)); //(02) + writeRequest.addTagAddress("TAG01", "%DB406:0:S5TIME", Duration.ofMinutes(15)); //(02) final PlcWriteRequest wr = writeRequest.build(); //(03) @@ -266,7 +266,7 @@ private void Write() { } } catch (Exception ex) { //(07) - logger.info("Read: " + ex.getMessage()); + logger.info("Write: " + ex.getMessage()); }; } /*************************************************************************** diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec index 0d8179cd007..179c624776f 100644 --- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec +++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec @@ -774,11 +774,9 @@ ['"IEC61131_TIME"' TIME [simple uint 32 milliseconds] ] - //['"S7_S5TIME"' TIME - // [reserved uint 2 '0x00'] - // [uint uint 2 'base'] - // [simple uint 12 value] - //] + ['"S7_S5TIME"' TIME + [manual uint 32 milliseconds 'STATIC_CALL("parseS5Time", readBuffer)' 'STATIC_CALL("serializeS5Time", writeBuffer, _value)' '2'] + ] // - Duration: Interpreted as "number of nanoseconds" ['"IEC61131_LTIME"' LTIME [simple uint 64 nanoseconds] @@ -885,8 +883,8 @@ ['0x13' WSTRING ['0x00' , 'X' , '2' , 'null' , 'OCTET_STRING' , 'IEC61131_WSTRING' , 'false' , 'false' , 'true' , 'true' , 'true' ]] // Dates and time values (Please note that we seem to have to rewrite queries for these types to reading bytes or we'll get "Data type not supported" errors) - ['0x14' TIME ['0x0B' , 'X' , '4' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] - //['0x15' S5TIME ['0x0C' , 'X' , '4' , 'null' , 'null' , 'S7_S5TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] + ['0x14' TIME ['0x0B' , 'X' , '4' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] + ['0x15' S5TIME ['0x04' , 'X' , '2' , 'null' , 'BYTE_WORD_DWORD' , 'S7_S5TIME' , 'true' , 'true' , 'true' , 'true' , 'true' ]] ['0x16' LTIME ['0x00' , 'X' , '8' , 'TIME' , 'null' , 'IEC61131_LTIME' , 'false' , 'false' , 'false' , 'true' , 'false' ]] ['0x17' DATE ['0x09' , 'X' , '2' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_DATE' , 'true' , 'true' , 'true' , 'true' , 'true' ]] ['0x18' TIME_OF_DAY ['0x06' , 'X' , '4' , 'null' , 'BYTE_WORD_DWORD' , 'IEC61131_TIME_OF_DAY' , 'true' , 'true' , 'true' , 'true' , 'true' ]] From 67058104740f9284ea238e53a75ba1ba7fa6d6a1 Mon Sep 17 00:00:00 2001 From: Cesar Garcia Date: Tue, 5 Dec 2023 17:46:57 -0400 Subject: [PATCH 19/21] Fix date deviation for the DATE format (1 day). Need to test with S7-1200/S7-1500. --- .../plc4x/java/s7/readwrite/DataItem.java | 17 +++++++---------- .../s7/readwrite/protocol/S7ProtocolLogic.java | 3 ++- .../java/s7/readwrite/utils/StaticHelper.java | 16 ++++++++++++---- .../plc4j/s7event/PlcReadDataS7400H.java | 5 +++-- .../s7/src/main/resources/protocols/s7/s7.mspec | 7 ++++++- 5 files changed, 30 insertions(+), 18 deletions(-) diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java index a66b0a56d82..8617c595daf 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -200,9 +200,9 @@ public static PlcValue staticParse( return PlcLTIME.ofNanoseconds(nanoseconds); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Simple Field (daysSinceSiemensEpoch) - Integer daysSinceSiemensEpoch = /*TODO: migrate me*/ /*TODO: migrate me*/ - readBuffer.readUnsignedInt("", 16); + // Manual Field (daysSinceSiemensEpoch) + int daysSinceSiemensEpoch = + (int) (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseTiaDate(readBuffer)); return PlcDATE.ofDaysSinceSiemensEpoch(daysSinceSiemensEpoch); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY @@ -385,11 +385,8 @@ public static void staticSerialize( /*TODO: migrate me*/ /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (nanoseconds)); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Simple Field (daysSinceSiemensEpoch) - int daysSinceSiemensEpoch = (int) ((PlcDATE) _value).getDaysSinceSiemensEpoch(); - /*TODO: migrate me*/ - /*TODO: migrate me*/ writeBuffer.writeUnsignedInt( - "", 16, ((Number) (daysSinceSiemensEpoch)).intValue()); + // Manual Field (daysSinceSiemensEpoch) + org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeTiaDate(writeBuffer, _value); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) long millisecondsSinceMidnight = (long) _value.getLong(); @@ -515,8 +512,8 @@ public static int getLengthInBits(PlcValue _value, String dataProtocolId, Intege // Simple Field (nanoseconds) sizeInBits += 64; } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Simple Field (daysSinceSiemensEpoch) - sizeInBits += 16; + // Manual Field (daysSinceSiemensEpoch) + sizeInBits += 2; } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) sizeInBits += 32; diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java index 264f1cf4b2d..0e8dd718171 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/protocol/S7ProtocolLogic.java @@ -1896,7 +1896,8 @@ private S7VarPayloadDataItem serializePlcValue(S7Tag tag, PlcValue plcValue) { lengthInBits = Math.min(lengthInBits, (stringLength * 8) + 16); } else if(tag.getDataType() == TransportSize.WSTRING) { lengthInBits = Math.min(lengthInBits, (stringLength * 16) + 32); - } else if(tag.getDataType() == TransportSize.S5TIME) { + } else if((tag.getDataType() == TransportSize.S5TIME) || + (tag.getDataType() == TransportSize.DATE)) { lengthInBits = lengthInBits * 8; } final WriteBufferByteBased writeBuffer = new WriteBufferByteBased((int) Math.ceil(((float) lengthInBits) / 8.0f)); diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java index 920c959fa33..7d67eedef94 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java @@ -53,6 +53,7 @@ import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; +import org.apache.plc4x.java.spi.values.PlcDATE; import org.apache.plc4x.java.spi.values.PlcTIME; /** @@ -2640,17 +2641,24 @@ public static void serializeTiaTimeOfDay(WriteBuffer io, PlcValue value) { throw new NotImplementedException("Serializing TIME_OF_DAY not implemented"); } - public static LocalDate parseTiaDate(ReadBuffer io) { + public static Integer parseTiaDate(ReadBuffer io) { try { - int daysSince1990 = io.readUnsignedInt(16); - return LocalDate.now().withYear(1990).withDayOfMonth(1).withMonth(1).plus(daysSince1990, ChronoUnit.DAYS); + int daysSince1990 = io.readUnsignedInt(16) + 1; + //return LocalDate.now().withYear(1990).withDayOfMonth(1).withMonth(1).plus(daysSince1990, ChronoUnit.DAYS); + return daysSince1990; } catch (ParseException e) { return null; } } public static void serializeTiaDate(WriteBuffer io, PlcValue value) { - throw new NotImplementedException("Serializing DATE not implemented"); + final PlcDATE userDate = (PlcDATE) value; + int daysSince1990 = userDate.getDaysSinceSiemensEpoch() - 1; + try { + io.writeUnsignedInt(16, daysSince1990); + } catch (SerializationException ex) { + return; + } } //TODO: Call BCD converter diff --git a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java index 6842f4ad4cb..8ab317698c0 100644 --- a/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java +++ b/plc4j/examples/plc4j-s7event/src/main/java/org/apache/plc4x/examples/plc4j/s7event/PlcReadDataS7400H.java @@ -20,6 +20,7 @@ import java.io.IOException; import java.time.Duration; +import java.time.LocalDate; import java.util.concurrent.atomic.AtomicBoolean; import org.apache.commons.lang3.time.StopWatch; import org.apache.plc4x.java.DefaultPlcDriverManager; @@ -224,7 +225,7 @@ private void Read() { if (!isConnected.get()) return; try { final PlcReadRequest.Builder readrequest = connection.readRequestBuilder(); //(01) - readrequest.addTagAddress("TEST", "%DB406:0:S5TIME"); //(02) + readrequest.addTagAddress("TEST", "%DB406:2:DATE"); //(02) final PlcReadRequest rr = readrequest.build(); //(03) final PlcReadResponse response; //(04) @@ -252,7 +253,7 @@ private void Write() { final PlcWriteRequest.Builder writeRequest = connection.writeRequestBuilder(); //(01) //writeRequest.addTagAddress("TAG01", "%DB406:4:DWORD",(long) 0x0001_0001); //(02) - writeRequest.addTagAddress("TAG01", "%DB406:0:S5TIME", Duration.ofMinutes(15)); //(02) + writeRequest.addTagAddress("TAG01", "%DB406:2:DATE", LocalDate.now()); //(02) final PlcWriteRequest wr = writeRequest.build(); //(03) diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec index 179c624776f..eb38e1220da 100644 --- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec +++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec @@ -782,10 +782,15 @@ [simple uint 64 nanoseconds] ] // - Date: Interpreted as "number of days since 1990-01-01" + // - Range in PLC S7-300/400 Min -> D#1990-01-01 (W#16#0000) + // Max -> D#2168-12-31 (W#16#FF62) + // - 01. Serialization using PlcDATE offsets the day indication by +/- 1 day. + // - 02. Need to test with S7-1200/S7-1500. ['"IEC61131_DATE"' DATE - [simple uint 16 daysSinceSiemensEpoch] + //[simple uint 16 daysSinceSiemensEpoch] //(01) // Number of days between 1990-01-01 and 1970-01-01 according to https://www.timeanddate.com/ //[virtual uint 16 daysSinceEpoch 'daysSinceSiemensEpoch + 7305'] + [manual uint 16 daysSinceSiemensEpoch 'STATIC_CALL("parseTiaDate", readBuffer)' 'STATIC_CALL("serializeTiaDate", writeBuffer, _value)' '2'] ] //['"IEC61131_LDATE"' LDATE // [implicit uint 16 daysSinceSiemensEpoch 'daysSinceEpoch - 7305'] From a37195d77e513288b9e142f58738cca1310c9b54 Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 7 Dec 2023 17:04:14 +0100 Subject: [PATCH 20/21] chore: Updated vendor ids --- .../readwrite/model/BACnetVendorId.go | 32 +++++++++++++++++++ .../readwrite/model/KnxManufacturer.go | 26 ++++++++++++--- .../bacnetip/readwrite/BACnetVendorId.java | 2 ++ .../knxnetip/readwrite/KnxManufacturer.java | 5 +-- .../readwrite/model/KnxManufacturer.cs | 19 +++++++---- .../protocols/bacnetip/bacnet-vendorids.mspec | 2 ++ .../protocols/knxnetip/knx-master-data.mspec | 5 +-- 7 files changed, 76 insertions(+), 15 deletions(-) diff --git a/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go b/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go index fd8fa44de77..5fd5b5f5f49 100644 --- a/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go +++ b/plc4go/protocols/bacnetip/readwrite/model/BACnetVendorId.go @@ -1491,6 +1491,8 @@ const ( BACnetVendorId_GRID_CONNECT_INC BACnetVendorId = 1454 BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD BACnetVendorId = 1455 BACnetVendorId_CONTROL_TECLLC BACnetVendorId = 1456 + BACnetVendorId_AETERLINK_CORPORATION BACnetVendorId = 1457 + BACnetVendorId_ALPHA_EPSILON_AUTOMATION BACnetVendorId = 1458 BACnetVendorId_UNKNOWN_VENDOR BACnetVendorId = 0xFFFF ) @@ -2947,6 +2949,8 @@ func init() { BACnetVendorId_GRID_CONNECT_INC, BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD, BACnetVendorId_CONTROL_TECLLC, + BACnetVendorId_AETERLINK_CORPORATION, + BACnetVendorId_ALPHA_EPSILON_AUTOMATION, BACnetVendorId_UNKNOWN_VENDOR, } } @@ -4985,6 +4989,14 @@ func (e BACnetVendorId) VendorId() uint16 { { /* '1456' */ return 1456 } + case 1457: + { /* '1457' */ + return 1457 + } + case 1458: + { /* '1458' */ + return 1458 + } case 146: { /* '146' */ return 146 @@ -10799,6 +10811,14 @@ func (e BACnetVendorId) VendorName() string { { /* '1456' */ return "ControlTec, LLC" } + case 1457: + { /* '1457' */ + return "Aeterlink Corporation" + } + case 1458: + { /* '1458' */ + return "Alpha Epsilon Automation" + } case 146: { /* '146' */ return "Sanyo Electric Co., Ltd." @@ -15596,6 +15616,10 @@ func BACnetVendorIdByValue(value uint16) (enum BACnetVendorId, ok bool) { return BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD, true case 1456: return BACnetVendorId_CONTROL_TECLLC, true + case 1457: + return BACnetVendorId_AETERLINK_CORPORATION, true + case 1458: + return BACnetVendorId_ALPHA_EPSILON_AUTOMATION, true case 146: return BACnetVendorId_SANYO_ELECTRIC_CO_LTD, true case 147: @@ -18500,6 +18524,10 @@ func BACnetVendorIdByName(value string) (enum BACnetVendorId, ok bool) { return BACnetVendorId_ZIEGLER_INSTRUMENTATIONUK_LTD, true case "CONTROL_TECLLC": return BACnetVendorId_CONTROL_TECLLC, true + case "AETERLINK_CORPORATION": + return BACnetVendorId_AETERLINK_CORPORATION, true + case "ALPHA_EPSILON_AUTOMATION": + return BACnetVendorId_ALPHA_EPSILON_AUTOMATION, true case "SANYO_ELECTRIC_CO_LTD": return BACnetVendorId_SANYO_ELECTRIC_CO_LTD, true case "INTEGRATED_INFORMATION_SYSTEMS_INC": @@ -21465,6 +21493,10 @@ func (e BACnetVendorId) PLC4XEnumName() string { return "ZIEGLER_INSTRUMENTATIONUK_LTD" case BACnetVendorId_CONTROL_TECLLC: return "CONTROL_TECLLC" + case BACnetVendorId_AETERLINK_CORPORATION: + return "AETERLINK_CORPORATION" + case BACnetVendorId_ALPHA_EPSILON_AUTOMATION: + return "ALPHA_EPSILON_AUTOMATION" case BACnetVendorId_SANYO_ELECTRIC_CO_LTD: return "SANYO_ELECTRIC_CO_LTD" case BACnetVendorId_INTEGRATED_INFORMATION_SYSTEMS_INC: diff --git a/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go b/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go index 5825a6b3291..a30185f422a 100644 --- a/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go +++ b/plc4go/protocols/knxnetip/readwrite/model/KnxManufacturer.go @@ -697,8 +697,9 @@ const ( KnxManufacturer_M_ZIMMEX KnxManufacturer = 651 KnxManufacturer_M_RHOMBUS_EUROPE KnxManufacturer = 652 KnxManufacturer_M_TURING_THINK KnxManufacturer = 653 - KnxManufacturer_M_ABB___RESERVED KnxManufacturer = 654 - KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED KnxManufacturer = 655 + KnxManufacturer_M_MICHOI KnxManufacturer = 654 + KnxManufacturer_M_ABB___RESERVED KnxManufacturer = 655 + KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED KnxManufacturer = 656 ) var KnxManufacturerValues []KnxManufacturer @@ -1360,6 +1361,7 @@ func init() { KnxManufacturer_M_ZIMMEX, KnxManufacturer_M_RHOMBUS_EUROPE, KnxManufacturer_M_TURING_THINK, + KnxManufacturer_M_MICHOI, KnxManufacturer_M_ABB___RESERVED, KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED, } @@ -3837,10 +3839,14 @@ func (e KnxManufacturer) Number() uint16 { } case 654: { /* '654' */ - return 43954 + return 712 } case 655: { /* '655' */ + return 43954 + } + case 656: + { /* '656' */ return 43959 } case 66: @@ -6479,10 +6485,14 @@ func (e KnxManufacturer) Name() string { } case 654: { /* '654' */ - return "ABB - reserved" + return "Michoi" } case 655: { /* '655' */ + return "ABB - reserved" + } + case 656: + { /* '656' */ return "Busch-Jaeger Elektro - reserved" } case 66: @@ -7885,8 +7895,10 @@ func KnxManufacturerByValue(value uint16) (enum KnxManufacturer, ok bool) { case 653: return KnxManufacturer_M_TURING_THINK, true case 654: - return KnxManufacturer_M_ABB___RESERVED, true + return KnxManufacturer_M_MICHOI, true case 655: + return KnxManufacturer_M_ABB___RESERVED, true + case 656: return KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED, true case 66: return KnxManufacturer_M_RTS_AUTOMATION, true @@ -9202,6 +9214,8 @@ func KnxManufacturerByName(value string) (enum KnxManufacturer, ok bool) { return KnxManufacturer_M_RHOMBUS_EUROPE, true case "M_TURING_THINK": return KnxManufacturer_M_TURING_THINK, true + case "M_MICHOI": + return KnxManufacturer_M_MICHOI, true case "M_ABB___RESERVED": return KnxManufacturer_M_ABB___RESERVED, true case "M_BUSCH_JAEGER_ELEKTRO___RESERVED": @@ -10581,6 +10595,8 @@ func (e KnxManufacturer) PLC4XEnumName() string { return "M_RHOMBUS_EUROPE" case KnxManufacturer_M_TURING_THINK: return "M_TURING_THINK" + case KnxManufacturer_M_MICHOI: + return "M_MICHOI" case KnxManufacturer_M_ABB___RESERVED: return "M_ABB___RESERVED" case KnxManufacturer_M_BUSCH_JAEGER_ELEKTRO___RESERVED: diff --git a/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java b/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java index 2c30a51b67f..a6bfd302146 100644 --- a/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java +++ b/plc4j/drivers/bacnet/src/main/generated/org/apache/plc4x/java/bacnetip/readwrite/BACnetVendorId.java @@ -1670,6 +1670,8 @@ public enum BACnetVendorId { GRID_CONNECT_INC((int) 1454, (int) 1454, (String) "Grid Connect Inc."), ZIEGLER_INSTRUMENTATIONUK_LTD((int) 1455, (int) 1455, (String) "Ziegler Instrumentation UK Ltd"), CONTROL_TECLLC((int) 1456, (int) 1456, (String) "ControlTec, LLC"), + AETERLINK_CORPORATION((int) 1457, (int) 1457, (String) "Aeterlink Corporation"), + ALPHA_EPSILON_AUTOMATION((int) 1458, (int) 1458, (String) "Alpha Epsilon Automation"), UNKNOWN_VENDOR((int) 0xFFFF, (int) 0xFFFF, (String) "Unknown"); private static final Map map; diff --git a/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java b/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java index f3a424a3f27..a59fef67036 100644 --- a/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java +++ b/plc4j/drivers/knxnetip/src/main/generated/org/apache/plc4x/java/knxnetip/readwrite/KnxManufacturer.java @@ -751,9 +751,10 @@ public enum KnxManufacturer { M_ZIMMEX((int) 651, (int) 709, (String) "Zimmex"), M_RHOMBUS_EUROPE((int) 652, (int) 710, (String) "Rhombus Europe"), M_TURING_THINK((int) 653, (int) 711, (String) "Turing-Think"), - M_ABB___RESERVED((int) 654, (int) 43954, (String) "ABB - reserved"), + M_MICHOI((int) 654, (int) 712, (String) "Michoi"), + M_ABB___RESERVED((int) 655, (int) 43954, (String) "ABB - reserved"), M_BUSCH_JAEGER_ELEKTRO___RESERVED( - (int) 655, (int) 43959, (String) "Busch-Jaeger Elektro - reserved"); + (int) 656, (int) 43959, (String) "Busch-Jaeger Elektro - reserved"); private static final Map map; static { diff --git a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs index cef84d68cb6..6ca79c95bf3 100644 --- a/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs +++ b/plc4net/drivers/knxnetip/src/drivers/knxnetip/readwrite/model/KnxManufacturer.cs @@ -678,8 +678,9 @@ public enum KnxManufacturer M_ZIMMEX = 651, M_RHOMBUS_EUROPE = 652, M_TURING_THINK = 653, - M_ABB___RESERVED = 654, - M_BUSCH_JAEGER_ELEKTRO___RESERVED = 655, + M_MICHOI = 654, + M_ABB___RESERVED = 655, + M_BUSCH_JAEGER_ELEKTRO___RESERVED = 656, } public static class KnxManufacturerInfo @@ -2540,10 +2541,13 @@ public static class KnxManufacturerInfo case KnxManufacturer.M_TURING_THINK: { /* '653' */ return 711; } - case KnxManufacturer.M_ABB___RESERVED: { /* '654' */ + case KnxManufacturer.M_MICHOI: { /* '654' */ + return 712; + } + case KnxManufacturer.M_ABB___RESERVED: { /* '655' */ return 43954; } - case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '655' */ + case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '656' */ return 43959; } case KnxManufacturer.M_RTS_AUTOMATION: { /* '66' */ @@ -4518,10 +4522,13 @@ public static string Name(this KnxManufacturer value) case KnxManufacturer.M_TURING_THINK: { /* '653' */ return "Turing-Think"; } - case KnxManufacturer.M_ABB___RESERVED: { /* '654' */ + case KnxManufacturer.M_MICHOI: { /* '654' */ + return "Michoi"; + } + case KnxManufacturer.M_ABB___RESERVED: { /* '655' */ return "ABB - reserved"; } - case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '655' */ + case KnxManufacturer.M_BUSCH_JAEGER_ELEKTRO___RESERVED: { /* '656' */ return "Busch-Jaeger Elektro - reserved"; } case KnxManufacturer.M_RTS_AUTOMATION: { /* '66' */ diff --git a/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec b/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec index 60c5013226b..8c1967d3aa6 100644 --- a/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec +++ b/protocols/bacnetip/src/main/generated/protocols/bacnetip/bacnet-vendorids.mspec @@ -1469,6 +1469,8 @@ ['1454' GRID_CONNECT_INC ['1454', '"Grid Connect Inc."']] ['1455' ZIEGLER_INSTRUMENTATIONUK_LTD ['1455', '"Ziegler Instrumentation UK Ltd"']] ['1456' CONTROL_TECLLC ['1456', '"ControlTec, LLC"']] + ['1457' AETERLINK_CORPORATION ['1457', '"Aeterlink Corporation"']] + ['1458' ALPHA_EPSILON_AUTOMATION ['1458', '"Alpha Epsilon Automation"']] ['0xFFFF' UNKNOWN_VENDOR ['0xFFFF', '"Unknown"']] ] diff --git a/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec b/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec index ec189777225..ba87b4e6619 100644 --- a/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec +++ b/protocols/knxnetip/src/main/generated/protocols/knxnetip/knx-master-data.mspec @@ -1402,8 +1402,9 @@ ['651' M_ZIMMEX ['709', '"Zimmex"']] ['652' M_RHOMBUS_EUROPE ['710', '"Rhombus Europe"']] ['653' M_TURING_THINK ['711', '"Turing-Think"']] - ['654' M_ABB___RESERVED ['43954', '"ABB - reserved"']] - ['655' M_BUSCH_JAEGER_ELEKTRO___RESERVED ['43959', '"Busch-Jaeger Elektro - reserved"']] + ['654' M_MICHOI ['712', '"Michoi"']] + ['655' M_ABB___RESERVED ['43954', '"ABB - reserved"']] + ['656' M_BUSCH_JAEGER_ELEKTRO___RESERVED ['43959', '"Busch-Jaeger Elektro - reserved"']] ] From 4aa7d3d2c057105a02237fbd083c93985c36447d Mon Sep 17 00:00:00 2001 From: Christofer Dutz Date: Thu, 7 Dec 2023 17:05:36 +0100 Subject: [PATCH 21/21] fix: Made all dates and times use UTC, as we were having issues with timezones behind the UTC timezone. --- .../s7/include/transport_size.h | 1 + plc4c/generated-sources/s7/src/data_item.c | 40 +++++++------ .../generated-sources/s7/src/transport_size.c | 56 ++++++++++++++++--- .../protocols/s7/readwrite/model/DataItem.go | 35 ++++++++---- .../s7/readwrite/model/StaticHelper.go | 12 +++- .../s7/readwrite/model/TransportSize.go | 54 +++++++++++++++++- plc4go/spi/values/PlcDATE.go | 10 ---- plc4go/spi/values/value_combination_test.go | 3 - .../plc4x/java/s7/readwrite/DataItem.java | 10 ++-- .../java/s7/readwrite/utils/StaticHelper.java | 11 ++-- .../java/s7/readwrite/ManualS7DriverTest.java | 1 - .../apache/plc4x/java/spi/values/PlcDATE.java | 30 +++------- .../java/spi/values/PlcDATE_AND_TIME.java | 4 +- .../plc4x/java/spi/values/PlcLDATE.java | 4 +- .../java/spi/values/PlcLDATE_AND_TIME.java | 4 +- .../src/main/resources/protocols/s7/s7.mspec | 5 +- 16 files changed, 189 insertions(+), 91 deletions(-) diff --git a/plc4c/generated-sources/s7/include/transport_size.h b/plc4c/generated-sources/s7/include/transport_size.h index 636bdfe63c1..56bd339f819 100644 --- a/plc4c/generated-sources/s7/include/transport_size.h +++ b/plc4c/generated-sources/s7/include/transport_size.h @@ -51,6 +51,7 @@ enum plc4c_s7_read_write_transport_size { plc4c_s7_read_write_transport_size_STRING = 0x12, plc4c_s7_read_write_transport_size_WSTRING = 0x13, plc4c_s7_read_write_transport_size_TIME = 0x14, + plc4c_s7_read_write_transport_size_S5TIME = 0x15, plc4c_s7_read_write_transport_size_LTIME = 0x16, plc4c_s7_read_write_transport_size_DATE = 0x17, plc4c_s7_read_write_transport_size_TIME_OF_DAY = 0x18, diff --git a/plc4c/generated-sources/s7/src/data_item.c b/plc4c/generated-sources/s7/src/data_item.c index 15906468242..4e8521aea2d 100644 --- a/plc4c/generated-sources/s7/src/data_item.c +++ b/plc4c/generated-sources/s7/src/data_item.c @@ -252,14 +252,21 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4x_spi_context ctx, plc } else if(strcmp(dataProtocolId, "IEC61131_TIME") == 0) { /* TIME */ // Simple Field (milliseconds) - int32_t milliseconds = 0; - _res = plc4c_spi_read_signed_int(readBuffer, 32, (int32_t*) &milliseconds); + uint32_t milliseconds = 0; + _res = plc4c_spi_read_unsigned_int(readBuffer, 32, (uint32_t*) &milliseconds); if(_res != OK) { return _res; } *data_item = plc4c_data_create_time_data(milliseconds); + } else if(strcmp(dataProtocolId, "S7_S5TIME") == 0) { /* TIME */ + + // Manual Field (milliseconds) + uint32_t milliseconds = (uint32_t) (plc4c_s7_read_write_parse_s5_time(readBuffer)); + + *data_item = plc4c_data_create_time_data(milliseconds); + } else if(strcmp(dataProtocolId, "IEC61131_LTIME") == 0) { /* LTIME */ // Simple Field (nanoseconds) @@ -273,14 +280,10 @@ plc4c_return_code plc4c_s7_read_write_data_item_parse(plc4x_spi_context ctx, plc } else if(strcmp(dataProtocolId, "IEC61131_DATE") == 0) { /* DATE */ - // Simple Field (daysSinceSiemensEpoch) - uint16_t daysSinceSiemensEpoch = 0; - _res = plc4c_spi_read_unsigned_short(readBuffer, 16, (uint16_t*) &daysSinceSiemensEpoch); - if(_res != OK) { - return _res; - } + // Manual Field (daysSinceEpoch) + uint16_t daysSinceEpoch = (uint16_t) (plc4c_s7_read_write_parse_tia_date(readBuffer)); - *data_item = plc4c_data_create_date_data(daysSinceSiemensEpoch); + *data_item = plc4c_data_create_date_data(daysSinceEpoch); } else if(strcmp(dataProtocolId, "IEC61131_TIME_OF_DAY") == 0) { /* TIME_OF_DAY */ @@ -522,10 +525,13 @@ plc4c_return_code plc4c_s7_read_write_data_item_serialize(plc4x_spi_context ctx, } else if(strcmp(dataProtocolId, "IEC61131_TIME") == 0) { /* TIME */ // Simple field (milliseconds) - _res = plc4c_spi_write_signed_int(writeBuffer, 32, (*data_item)->data.time_value); + _res = plc4c_spi_write_unsigned_int(writeBuffer, 32, (*data_item)->data.time_value); if(_res != OK) { return _res; } + } else if(strcmp(dataProtocolId, "S7_S5TIME") == 0) { /* TIME */ + + // Manual Field (milliseconds) } else if(strcmp(dataProtocolId, "IEC61131_LTIME") == 0) { /* LTIME */ // Simple field (nanoseconds) @@ -535,11 +541,7 @@ plc4c_return_code plc4c_s7_read_write_data_item_serialize(plc4x_spi_context ctx, } } else if(strcmp(dataProtocolId, "IEC61131_DATE") == 0) { /* DATE */ - // Simple field (daysSinceSiemensEpoch) - _res = plc4c_spi_write_unsigned_short(writeBuffer, 16, (*data_item)->data.date_value); - if(_res != OK) { - return _res; - } + // Manual Field (daysSinceEpoch) } else if(strcmp(dataProtocolId, "IEC61131_TIME_OF_DAY") == 0) { /* TIME_OF_DAY */ // Simple field (millisecondsSinceMidnight) @@ -696,14 +698,18 @@ uint16_t plc4c_s7_read_write_data_item_length_in_bits(plc4x_spi_context ctx, plc // Simple field (milliseconds) lengthInBits += 32; + } else if(strcmp(dataProtocolId, "S7_S5TIME") == 0) { /* TIME */ + + // Manual Field (milliseconds) + lengthInBits += 2; } else if(strcmp(dataProtocolId, "IEC61131_LTIME") == 0) { /* LTIME */ // Simple field (nanoseconds) lengthInBits += 64; } else if(strcmp(dataProtocolId, "IEC61131_DATE") == 0) { /* DATE */ - // Simple field (daysSinceSiemensEpoch) - lengthInBits += 16; + // Manual Field (daysSinceEpoch) + lengthInBits += 2; } else if(strcmp(dataProtocolId, "IEC61131_TIME_OF_DAY") == 0) { /* TIME_OF_DAY */ // Simple field (millisecondsSinceMidnight) diff --git a/plc4c/generated-sources/s7/src/transport_size.c b/plc4c/generated-sources/s7/src/transport_size.c index adffef17cc5..6b7d7d001de 100644 --- a/plc4c/generated-sources/s7/src/transport_size.c +++ b/plc4c/generated-sources/s7/src/transport_size.c @@ -122,6 +122,9 @@ plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_value_of(c if(strcmp(value_string, "TIME") == 0) { return plc4c_s7_read_write_transport_size_TIME; } + if(strcmp(value_string, "S5TIME") == 0) { + return plc4c_s7_read_write_transport_size_S5TIME; + } if(strcmp(value_string, "LTIME") == 0) { return plc4c_s7_read_write_transport_size_LTIME; } @@ -144,7 +147,7 @@ plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_value_of(c } int plc4c_s7_read_write_transport_size_num_values() { - return 26; + return 27; } plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_value_for_index(int index) { @@ -210,21 +213,24 @@ plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_value_for_ return plc4c_s7_read_write_transport_size_TIME; } case 20: { - return plc4c_s7_read_write_transport_size_LTIME; + return plc4c_s7_read_write_transport_size_S5TIME; } case 21: { - return plc4c_s7_read_write_transport_size_DATE; + return plc4c_s7_read_write_transport_size_LTIME; } case 22: { - return plc4c_s7_read_write_transport_size_TIME_OF_DAY; + return plc4c_s7_read_write_transport_size_DATE; } case 23: { - return plc4c_s7_read_write_transport_size_TOD; + return plc4c_s7_read_write_transport_size_TIME_OF_DAY; } case 24: { - return plc4c_s7_read_write_transport_size_DATE_AND_TIME; + return plc4c_s7_read_write_transport_size_TOD; } case 25: { + return plc4c_s7_read_write_transport_size_DATE_AND_TIME; + } + case 26: { return plc4c_s7_read_write_transport_size_DT; } default: { @@ -295,6 +301,9 @@ bool plc4c_s7_read_write_transport_size_get_supported__s7_300(plc4c_s7_read_writ case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return true; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return true; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return false; } @@ -389,6 +398,9 @@ bool plc4c_s7_read_write_transport_size_get_supported__logo(plc4c_s7_read_write_ case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return true; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return true; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return false; } @@ -483,6 +495,9 @@ uint8_t plc4c_s7_read_write_transport_size_get_code(plc4c_s7_read_write_transpor case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return 11; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return 4; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return 0; } @@ -619,6 +634,9 @@ uint8_t plc4c_s7_read_write_transport_size_get_size_in_bytes(plc4c_s7_read_write case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return 4; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return 2; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return 8; } @@ -731,6 +749,9 @@ bool plc4c_s7_read_write_transport_size_get_supported__s7_400(plc4c_s7_read_writ case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return true; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return true; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return false; } @@ -825,6 +846,9 @@ bool plc4c_s7_read_write_transport_size_get_supported__s7_1200(plc4c_s7_read_wri case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return true; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return true; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return false; } @@ -919,6 +943,9 @@ uint8_t plc4c_s7_read_write_transport_size_get_short_name(plc4c_s7_read_write_tr case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return 'X'; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return 'X'; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return 'X'; } @@ -1025,6 +1052,9 @@ bool plc4c_s7_read_write_transport_size_get_supported__s7_1500(plc4c_s7_read_wri case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return true; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return true; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return true; } @@ -1117,7 +1147,10 @@ plc4c_s7_read_write_data_transport_size plc4c_s7_read_write_transport_size_get_d return plc4c_s7_read_write_data_transport_size_OCTET_STRING; } case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ - return -1; + return plc4c_s7_read_write_data_transport_size_BYTE_WORD_DWORD; + } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return plc4c_s7_read_write_data_transport_size_BYTE_WORD_DWORD; } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return -1; @@ -1231,6 +1264,9 @@ char* plc4c_s7_read_write_transport_size_get_data_protocol_id(plc4c_s7_read_writ case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return "IEC61131_TIME"; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return "S7_S5TIME"; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return "IEC61131_LTIME"; } @@ -1328,6 +1364,9 @@ plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_get_first_ if (strcmp(value, "IEC61131_WSTRING") == 0) { return plc4c_s7_read_write_transport_size_WSTRING; } + if (strcmp(value, "S7_S5TIME") == 0) { + return plc4c_s7_read_write_transport_size_S5TIME; + } } plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_get_base_type(plc4c_s7_read_write_transport_size value) { @@ -1392,6 +1431,9 @@ plc4c_s7_read_write_transport_size plc4c_s7_read_write_transport_size_get_base_t case plc4c_s7_read_write_transport_size_TIME: { /* '0x14' */ return -1; } + case plc4c_s7_read_write_transport_size_S5TIME: { /* '0x15' */ + return -1; + } case plc4c_s7_read_write_transport_size_LTIME: { /* '0x16' */ return plc4c_s7_read_write_transport_size_TIME; } diff --git a/plc4go/protocols/s7/readwrite/model/DataItem.go b/plc4go/protocols/s7/readwrite/model/DataItem.go index 89d76dade78..87f5427fbc8 100644 --- a/plc4go/protocols/s7/readwrite/model/DataItem.go +++ b/plc4go/protocols/s7/readwrite/model/DataItem.go @@ -198,7 +198,15 @@ func DataItemParseWithBuffer(ctx context.Context, readBuffer utils.ReadBuffer, d return values.NewPlcSTRING(value), nil case dataProtocolId == "IEC61131_TIME": // TIME // Simple Field (milliseconds) - milliseconds, _millisecondsErr := readBuffer.ReadInt32("milliseconds", 32) + milliseconds, _millisecondsErr := readBuffer.ReadUint32("milliseconds", 32) + if _millisecondsErr != nil { + return nil, errors.Wrap(_millisecondsErr, "Error parsing 'milliseconds' field") + } + readBuffer.CloseContext("DataItem") + return values.NewPlcTIMEFromMilliseconds(int64(milliseconds)), nil + case dataProtocolId == "S7_S5TIME": // TIME + // Manual Field (milliseconds) + milliseconds, _millisecondsErr := ParseS5Time(ctx, readBuffer) if _millisecondsErr != nil { return nil, errors.Wrap(_millisecondsErr, "Error parsing 'milliseconds' field") } @@ -213,13 +221,13 @@ func DataItemParseWithBuffer(ctx context.Context, readBuffer utils.ReadBuffer, d readBuffer.CloseContext("DataItem") return values.NewPlcLTIMEFromNanoseconds(nanoseconds), nil case dataProtocolId == "IEC61131_DATE": // DATE - // Simple Field (daysSinceSiemensEpoch) - daysSinceSiemensEpoch, _daysSinceSiemensEpochErr := readBuffer.ReadUint16("daysSinceSiemensEpoch", 16) - if _daysSinceSiemensEpochErr != nil { - return nil, errors.Wrap(_daysSinceSiemensEpochErr, "Error parsing 'daysSinceSiemensEpoch' field") + // Manual Field (daysSinceEpoch) + daysSinceEpoch, _daysSinceEpochErr := ParseTiaDate(ctx, readBuffer) + if _daysSinceEpochErr != nil { + return nil, errors.Wrap(_daysSinceEpochErr, "Error parsing 'daysSinceEpoch' field") } readBuffer.CloseContext("DataItem") - return values.NewPlcDATEFromDaysSinceSiemensEpoch(daysSinceSiemensEpoch), nil + return values.NewPlcDATEFromDaysSinceEpoch(daysSinceEpoch), nil case dataProtocolId == "IEC61131_TIME_OF_DAY": // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) millisecondsSinceMidnight, _millisecondsSinceMidnightErr := readBuffer.ReadUint32("millisecondsSinceMidnight", 32) @@ -416,18 +424,25 @@ func DataItemSerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.Wri } case dataProtocolId == "IEC61131_TIME": // TIME // Simple Field (milliseconds) - if _err := writeBuffer.WriteInt32("milliseconds", 32, int32(value.(values.PlcTIME).GetMilliseconds())); _err != nil { + if _err := writeBuffer.WriteUint32("milliseconds", 32, uint32(value.(values.PlcTIME).GetMilliseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'milliseconds' field") } + case dataProtocolId == "S7_S5TIME": // TIME + // Manual Field (milliseconds) + _millisecondsErr := SerializeS5Time(ctx, writeBuffer, value) + if _millisecondsErr != nil { + return errors.Wrap(_millisecondsErr, "Error serializing 'milliseconds' field") + } case dataProtocolId == "IEC61131_LTIME": // LTIME // Simple Field (nanoseconds) if _err := writeBuffer.WriteUint64("nanoseconds", 64, uint64(value.(values.PlcLTIME).GetNanoseconds())); _err != nil { return errors.Wrap(_err, "Error serializing 'nanoseconds' field") } case dataProtocolId == "IEC61131_DATE": // DATE - // Simple Field (daysSinceSiemensEpoch) - if _err := writeBuffer.WriteUint16("daysSinceSiemensEpoch", 16, uint16(value.(values.PlcDATE).GetDaysSinceSiemensEpoch())); _err != nil { - return errors.Wrap(_err, "Error serializing 'daysSinceSiemensEpoch' field") + // Manual Field (daysSinceEpoch) + _daysSinceEpochErr := SerializeTiaDate(ctx, writeBuffer, value) + if _daysSinceEpochErr != nil { + return errors.Wrap(_daysSinceEpochErr, "Error serializing 'daysSinceEpoch' field") } case dataProtocolId == "IEC61131_TIME_OF_DAY": // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) diff --git a/plc4go/protocols/s7/readwrite/model/StaticHelper.go b/plc4go/protocols/s7/readwrite/model/StaticHelper.go index a8fd8d84011..ed9bebb181c 100644 --- a/plc4go/protocols/s7/readwrite/model/StaticHelper.go +++ b/plc4go/protocols/s7/readwrite/model/StaticHelper.go @@ -84,14 +84,14 @@ func SerializeTiaTimeOfDay(ctx context.Context, io utils.WriteBuffer, value valu return nil } -func ParseTiaDate(ctx context.Context, io utils.ReadBuffer) (time.Time, error) { +func ParseTiaDate(ctx context.Context, io utils.ReadBuffer) (uint16, error) { /*try { int daysSince1990 = io.readUnsignedInt(16); return LocalDate.now().withYear(1990).withDayOfMonth(1).withMonth(1).plus(daysSince1990, ChronoUnit.DAYS); } catch (ParseException e) { return null; }*/ - return time.Time{}, nil + return 0, nil } func SerializeTiaDate(ctx context.Context, io utils.WriteBuffer, value values.PlcValue) error { @@ -123,6 +123,14 @@ func SerializeTiaDateTime(ctx context.Context, io utils.WriteBuffer, value value return nil } +func parseTiaDate(ctx context.Context, io utils.ReadBuffer) (time.Time, error) { + return time.Time{}, nil +} + +func serializeTiaDate(ctx context.Context, io utils.WriteBuffer, value values.PlcValue) error { + return nil +} + func ParseS7String(ctx context.Context, io utils.ReadBuffer, stringLength int32, encoding string) (string, error) { var multiplier int32 switch encoding { diff --git a/plc4go/protocols/s7/readwrite/model/TransportSize.go b/plc4go/protocols/s7/readwrite/model/TransportSize.go index f277353ee5b..a799544fa99 100644 --- a/plc4go/protocols/s7/readwrite/model/TransportSize.go +++ b/plc4go/protocols/s7/readwrite/model/TransportSize.go @@ -72,6 +72,7 @@ const ( TransportSize_STRING TransportSize = 0x12 TransportSize_WSTRING TransportSize = 0x13 TransportSize_TIME TransportSize = 0x14 + TransportSize_S5TIME TransportSize = 0x15 TransportSize_LTIME TransportSize = 0x16 TransportSize_DATE TransportSize = 0x17 TransportSize_TIME_OF_DAY TransportSize = 0x18 @@ -105,6 +106,7 @@ func init() { TransportSize_STRING, TransportSize_WSTRING, TransportSize_TIME, + TransportSize_S5TIME, TransportSize_LTIME, TransportSize_DATE, TransportSize_TIME_OF_DAY, @@ -196,6 +198,10 @@ func (e TransportSize) Supported_S7_300() bool { { /* '0x14' */ return true } + case 0x15: + { /* '0x15' */ + return true + } case 0x16: { /* '0x16' */ return false @@ -318,6 +324,10 @@ func (e TransportSize) Supported_LOGO() bool { { /* '0x14' */ return true } + case 0x15: + { /* '0x15' */ + return true + } case 0x16: { /* '0x16' */ return false @@ -440,6 +450,10 @@ func (e TransportSize) Code() uint8 { { /* '0x14' */ return 0x0B } + case 0x15: + { /* '0x15' */ + return 0x04 + } case 0x16: { /* '0x16' */ return 0x00 @@ -562,6 +576,10 @@ func (e TransportSize) SizeInBytes() uint8 { { /* '0x14' */ return 4 } + case 0x15: + { /* '0x15' */ + return 2 + } case 0x16: { /* '0x16' */ return 8 @@ -684,6 +702,10 @@ func (e TransportSize) Supported_S7_400() bool { { /* '0x14' */ return true } + case 0x15: + { /* '0x15' */ + return true + } case 0x16: { /* '0x16' */ return false @@ -806,6 +828,10 @@ func (e TransportSize) Supported_S7_1200() bool { { /* '0x14' */ return true } + case 0x15: + { /* '0x15' */ + return true + } case 0x16: { /* '0x16' */ return false @@ -928,6 +954,10 @@ func (e TransportSize) ShortName() uint8 { { /* '0x14' */ return 'X' } + case 0x15: + { /* '0x15' */ + return 'X' + } case 0x16: { /* '0x16' */ return 'X' @@ -1050,6 +1080,10 @@ func (e TransportSize) Supported_S7_1500() bool { { /* '0x14' */ return true } + case 0x15: + { /* '0x15' */ + return true + } case 0x16: { /* '0x16' */ return true @@ -1170,7 +1204,11 @@ func (e TransportSize) DataTransportSize() DataTransportSize { } case 0x14: { /* '0x14' */ - return 0 + return DataTransportSize_BYTE_WORD_DWORD + } + case 0x15: + { /* '0x15' */ + return DataTransportSize_BYTE_WORD_DWORD } case 0x16: { /* '0x16' */ @@ -1294,6 +1332,10 @@ func (e TransportSize) DataProtocolId() string { { /* '0x14' */ return "IEC61131_TIME" } + case 0x15: + { /* '0x15' */ + return "S7_S5TIME" + } case 0x16: { /* '0x16' */ return "IEC61131_LTIME" @@ -1416,6 +1458,10 @@ func (e TransportSize) BaseType() TransportSize { { /* '0x14' */ return 0 } + case 0x15: + { /* '0x15' */ + return 0 + } case 0x16: { /* '0x16' */ return TransportSize_TIME @@ -1497,6 +1543,8 @@ func TransportSizeByValue(value uint8) (enum TransportSize, ok bool) { return TransportSize_WSTRING, true case 0x14: return TransportSize_TIME, true + case 0x15: + return TransportSize_S5TIME, true case 0x16: return TransportSize_LTIME, true case 0x17: @@ -1555,6 +1603,8 @@ func TransportSizeByName(value string) (enum TransportSize, ok bool) { return TransportSize_WSTRING, true case "TIME": return TransportSize_TIME, true + case "S5TIME": + return TransportSize_S5TIME, true case "LTIME": return TransportSize_LTIME, true case "DATE": @@ -1674,6 +1724,8 @@ func (e TransportSize) PLC4XEnumName() string { return "WSTRING" case TransportSize_TIME: return "TIME" + case TransportSize_S5TIME: + return "S5TIME" case TransportSize_LTIME: return "LTIME" case TransportSize_DATE: diff --git a/plc4go/spi/values/PlcDATE.go b/plc4go/spi/values/PlcDATE.go index 50c2e826da4..75a16f5b448 100644 --- a/plc4go/spi/values/PlcDATE.go +++ b/plc4go/spi/values/PlcDATE.go @@ -39,11 +39,6 @@ func NewPlcDATE(value any) PlcDATE { switch value.(type) { case time.Time: timeValue = value.(time.Time) - case uint16: - // In this case the date is the number of days since 1990-01-01 - // So we gotta add 7305 days to the value to have it relative to epoch - // Then we also need to transform it from days to seconds by multiplying by 86400 - timeValue = time.Unix((int64(value.(uint16))+7305)*86400, 0) case uint32: // Interpreted as "seconds since epoch" timeValue = time.Unix(int64(value.(uint32)), 0) @@ -63,11 +58,6 @@ func NewPlcDATEFromDaysSinceEpoch(daysSinceEpoch uint16) PlcDATE { return NewPlcDATE(time.Unix(int64(daysSinceEpoch)*86400, 0)) } -func NewPlcDATEFromDaysSinceSiemensEpoch(daysSinceSiemensEpoch uint16) PlcDATE { - // 86400 = 24 hours x 60 Minutes x 60 Seconds - return NewPlcDATEFromDaysSinceEpoch(daysSinceSiemensEpoch + 7305) -} - func (m PlcDATE) IsRaw() bool { return true } diff --git a/plc4go/spi/values/value_combination_test.go b/plc4go/spi/values/value_combination_test.go index 0a69d0a159e..e3b33cf84fe 100644 --- a/plc4go/spi/values/value_combination_test.go +++ b/plc4go/spi/values/value_combination_test.go @@ -522,9 +522,6 @@ func TestExtraTests(t *testing.T) { t.Run("FromDaysSinceEpoch", func(t *testing.T) { assert.NotNil(t, NewPlcDATEFromDaysSinceEpoch(1)) }) - t.Run("FromDaysSinceSiemensEpoch", func(t *testing.T) { - assert.NotNil(t, NewPlcDATEFromDaysSinceSiemensEpoch(1)) - }) }) t.Run("GetSecondsSinceEpoch", func(t *testing.T) { NewPlcDATE(time.Now()).GetSecondsSinceEpoch() diff --git a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java index 8617c595daf..0128b57c8ae 100644 --- a/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java +++ b/plc4j/drivers/s7/src/main/generated/org/apache/plc4x/java/s7/readwrite/DataItem.java @@ -200,11 +200,11 @@ public static PlcValue staticParse( return PlcLTIME.ofNanoseconds(nanoseconds); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Manual Field (daysSinceSiemensEpoch) - int daysSinceSiemensEpoch = + // Manual Field (daysSinceEpoch) + int daysSinceEpoch = (int) (org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseTiaDate(readBuffer)); - return PlcDATE.ofDaysSinceSiemensEpoch(daysSinceSiemensEpoch); + return PlcDATE.ofDaysSinceEpoch(daysSinceEpoch); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) @@ -385,7 +385,7 @@ public static void staticSerialize( /*TODO: migrate me*/ /*TODO: migrate me*/ writeBuffer.writeUnsignedBigInteger("", 64, (BigInteger) (nanoseconds)); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Manual Field (daysSinceSiemensEpoch) + // Manual Field (daysSinceEpoch) org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeTiaDate(writeBuffer, _value); } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) @@ -512,7 +512,7 @@ public static int getLengthInBits(PlcValue _value, String dataProtocolId, Intege // Simple Field (nanoseconds) sizeInBits += 64; } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_DATE")) { // DATE - // Manual Field (daysSinceSiemensEpoch) + // Manual Field (daysSinceEpoch) sizeInBits += 2; } else if (EvaluationHelper.equals(dataProtocolId, "IEC61131_TIME_OF_DAY")) { // TIME_OF_DAY // Simple Field (millisecondsSinceMidnight) diff --git a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java index 7d67eedef94..3bd70e694eb 100644 --- a/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java +++ b/plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/utils/StaticHelper.java @@ -2641,11 +2641,13 @@ public static void serializeTiaTimeOfDay(WriteBuffer io, PlcValue value) { throw new NotImplementedException("Serializing TIME_OF_DAY not implemented"); } + private static final LocalDate siemensEpoch = LocalDate.of(1990, 1, 1); + private static final int daysBetweenUnixAndSiemensEpoch = (int) ChronoUnit.DAYS.between(LocalDate.EPOCH, siemensEpoch); public static Integer parseTiaDate(ReadBuffer io) { try { - int daysSince1990 = io.readUnsignedInt(16) + 1; - //return LocalDate.now().withYear(1990).withDayOfMonth(1).withMonth(1).plus(daysSince1990, ChronoUnit.DAYS); - return daysSince1990; + // Dates in Siemens PLCs are stored relative to "Siemens Epoch", which is 1990-01-01 + int daysSinceSiemensEpoch = io.readUnsignedInt(16); + return daysSinceSiemensEpoch + daysBetweenUnixAndSiemensEpoch; } catch (ParseException e) { return null; } @@ -2653,7 +2655,8 @@ public static Integer parseTiaDate(ReadBuffer io) { public static void serializeTiaDate(WriteBuffer io, PlcValue value) { final PlcDATE userDate = (PlcDATE) value; - int daysSince1990 = userDate.getDaysSinceSiemensEpoch() - 1; + + int daysSince1990 = userDate.getDaysSinceEpoch() - daysBetweenUnixAndSiemensEpoch; try { io.writeUnsignedInt(16, daysSince1990); } catch (SerializationException ex) { diff --git a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java index 8d8c5e11faa..9d00548c0cc 100644 --- a/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java +++ b/plc4j/drivers/s7/src/test/java/org/apache/plc4x/java/s7/readwrite/ManualS7DriverTest.java @@ -21,7 +21,6 @@ import org.apache.plc4x.java.spi.values.*; import org.apache.plc4x.test.manual.ManualTest; -import java.time.Duration; import java.time.LocalDate; import java.time.LocalTime; diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE.java index 4e87e2fc4dd..572c93611ed 100644 --- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE.java +++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE.java @@ -25,10 +25,7 @@ import org.apache.plc4x.java.spi.generation.WriteBuffer; import java.nio.charset.StandardCharsets; -import java.time.Instant; -import java.time.LocalDate; -import java.time.LocalDateTime; -import java.time.ZoneId; +import java.time.*; public class PlcDATE extends PlcSimpleValue { @@ -37,24 +34,20 @@ public static PlcDATE of(Object value) { return new PlcDATE((LocalDate) value); } else if (value instanceof Long) { return new PlcDATE(LocalDateTime.ofInstant( - Instant.ofEpochSecond((long) value), ZoneId.systemDefault()).toLocalDate()); + Instant.ofEpochSecond((long) value), ZoneOffset.UTC).toLocalDate()); } throw new PlcRuntimeException("Invalid value type"); } public static PlcDATE ofSecondsSinceEpoch(long secondsSinceEpoch) { return new PlcDATE(LocalDateTime.ofInstant( - Instant.ofEpochSecond(secondsSinceEpoch), ZoneId.systemDefault()).toLocalDate()); + Instant.ofEpochSecond(secondsSinceEpoch), ZoneOffset.UTC).toLocalDate()); } public static PlcDATE ofDaysSinceEpoch(int daysSinceEpoch) { // 86400 = 24 hours x 60 Minutes x 60 Seconds return new PlcDATE(LocalDateTime.ofInstant( - Instant.ofEpochSecond(((long) daysSinceEpoch) * 86400), ZoneId.systemDefault()).toLocalDate()); - } - - public static PlcDATE ofDaysSinceSiemensEpoch(int daysSinceSiemensEpoch) { - return ofDaysSinceEpoch(daysSinceSiemensEpoch + 7305); + Instant.ofEpochSecond(((long) daysSinceEpoch) * 86400), ZoneOffset.UTC).toLocalDate()); } public PlcDATE(LocalDate value) { @@ -64,13 +57,13 @@ public PlcDATE(LocalDate value) { public PlcDATE(int daysSinceEpoch) { // REMARK: Yes, I'm using LocalDataTime.ofInstant as LocalDate.ofInstant is marked "JDK 1.9" super(LocalDateTime.ofInstant( - Instant.ofEpochSecond(((long) daysSinceEpoch) * 86400), ZoneId.systemDefault()).toLocalDate(), true); + Instant.ofEpochSecond(((long) daysSinceEpoch) * 86400), ZoneOffset.UTC).toLocalDate(), true); } public PlcDATE(long secondsSinceEpoch) { // REMARK: Yes, I'm using LocalDataTime.ofInstant as LocalDate.ofInstant is marked "JDK 1.9" super(LocalDateTime.ofInstant( - Instant.ofEpochSecond(secondsSinceEpoch), ZoneId.systemDefault()).toLocalDate(), true); + Instant.ofEpochSecond(secondsSinceEpoch), ZoneOffset.UTC).toLocalDate(), true); } @Override @@ -79,16 +72,11 @@ public PlcValueType getPlcValueType() { } public long getSecondsSinceEpoch() { - return value.atStartOfDay(ZoneId.systemDefault()).toEpochSecond(); + return value.atStartOfDay(ZoneOffset.UTC).toEpochSecond(); } public int getDaysSinceEpoch() { - return (int) (value.atStartOfDay(ZoneId.systemDefault()).toEpochSecond() / 86400); - } - - public int getDaysSinceSiemensEpoch() { - // For some reason we need to subtract one day less (guess because of the "start of day"). - return ((int) (value.atStartOfDay(ZoneId.systemDefault()).toEpochSecond() / 86400)) - 7304; + return (int) (value.atStartOfDay(ZoneOffset.UTC).toEpochSecond() / 86400); } @Override @@ -98,7 +86,7 @@ public boolean isLong() { @Override public long getLong() { - Instant instant = value.atStartOfDay(ZoneId.systemDefault()).toInstant(); + Instant instant = value.atStartOfDay(ZoneOffset.UTC).toInstant(); return (instant.toEpochMilli() / 1000); } diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE_AND_TIME.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE_AND_TIME.java index 500978f1b96..71ebb499cc7 100644 --- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE_AND_TIME.java +++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcDATE_AND_TIME.java @@ -34,7 +34,7 @@ public static PlcDATE_AND_TIME of(Object value) { return new PlcDATE_AND_TIME((LocalDateTime) value); } else if (value instanceof Long) { return new PlcDATE_AND_TIME(LocalDateTime.ofInstant( - Instant.ofEpochSecond((long) value), ZoneId.systemDefault())); + Instant.ofEpochSecond((long) value), ZoneOffset.UTC)); } throw new PlcRuntimeException("Invalid value type"); } @@ -110,7 +110,7 @@ public boolean isLong() { @Override public long getLong() { - Instant instant = value.atZone(ZoneId.systemDefault()).toInstant(); + Instant instant = value.atZone(ZoneOffset.UTC).toInstant(); return instant.getEpochSecond(); } diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE.java index 912f64d69e8..41258e412ec 100644 --- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE.java +++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE.java @@ -35,7 +35,7 @@ public static PlcLDATE of(Object value) { return new PlcLDATE((LocalDate) value); } else if (value instanceof Long) { return new PlcLDATE(LocalDateTime.ofInstant( - Instant.ofEpochSecond((long) value), ZoneId.systemDefault()).toLocalDate()); + Instant.ofEpochSecond((long) value), ZoneOffset.UTC).toLocalDate()); } throw new PlcRuntimeException("Invalid value type"); } @@ -74,7 +74,7 @@ public boolean isLong() { @Override public long getLong() { - Instant instant = value.atStartOfDay(ZoneId.systemDefault()).toInstant(); + Instant instant = value.atStartOfDay(ZoneOffset.UTC).toInstant(); return (instant.toEpochMilli() / 1000); } diff --git a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE_AND_TIME.java b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE_AND_TIME.java index 2886a8c74b4..bc6dbbfa069 100644 --- a/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE_AND_TIME.java +++ b/plc4j/spi/src/main/java/org/apache/plc4x/java/spi/values/PlcLDATE_AND_TIME.java @@ -35,7 +35,7 @@ public static PlcLDATE_AND_TIME of(Object value) { return new PlcLDATE_AND_TIME((LocalDateTime) value); } else if (value instanceof Long) { return new PlcLDATE_AND_TIME(LocalDateTime.ofInstant( - Instant.ofEpochSecond((long) value), ZoneId.systemDefault())); + Instant.ofEpochSecond((long) value), ZoneOffset.UTC)); } throw new PlcRuntimeException("Invalid value type"); } @@ -74,7 +74,7 @@ public boolean isLong() { @Override public long getLong() { - Instant instant = value.atZone(ZoneId.systemDefault()).toInstant(); + Instant instant = value.atZone(ZoneOffset.UTC).toInstant(); return instant.getEpochSecond(); } diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec index eb38e1220da..89c4fbaafe3 100644 --- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec +++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec @@ -787,10 +787,7 @@ // - 01. Serialization using PlcDATE offsets the day indication by +/- 1 day. // - 02. Need to test with S7-1200/S7-1500. ['"IEC61131_DATE"' DATE - //[simple uint 16 daysSinceSiemensEpoch] //(01) - // Number of days between 1990-01-01 and 1970-01-01 according to https://www.timeanddate.com/ - //[virtual uint 16 daysSinceEpoch 'daysSinceSiemensEpoch + 7305'] - [manual uint 16 daysSinceSiemensEpoch 'STATIC_CALL("parseTiaDate", readBuffer)' 'STATIC_CALL("serializeTiaDate", writeBuffer, _value)' '2'] + [manual uint 16 daysSinceEpoch 'STATIC_CALL("parseTiaDate", readBuffer)' 'STATIC_CALL("serializeTiaDate", writeBuffer, _value)' '2'] ] //['"IEC61131_LDATE"' LDATE // [implicit uint 16 daysSinceSiemensEpoch 'daysSinceEpoch - 7305']