You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2023/01/26 17:50:27 UTC
[plc4x] branch develop updated: refactor(plc4j/driver/ads): added the discovery types to the generated code
This is an automated email from the ASF dual-hosted git repository.
cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git
The following commit(s) were added to refs/heads/develop by this push:
new 9e57f6fbd0 refactor(plc4j/driver/ads): added the discovery types to the generated code
9e57f6fbd0 is described below
commit 9e57f6fbd0f3d19003587b675e3882bb51374ae8
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Jan 26 18:50:19 2023 +0100
refactor(plc4j/driver/ads): added the discovery types to the generated code
---
.../protocols/ads/readwrite/model/ErrorResponse.go | 179 +++++++++++++
.../java/ads/discovery/readwrite/AdsDiscovery.java | 288 +++++++++++++++++++++
.../ads/discovery/readwrite/AdsDiscoveryBlock.java | 174 +++++++++++++
.../readwrite/AdsDiscoveryBlockAmsNetId.java | 164 ++++++++++++
.../readwrite/AdsDiscoveryBlockFingerprint.java | 155 +++++++++++
.../readwrite/AdsDiscoveryBlockHostName.java | 145 +++++++++++
.../readwrite/AdsDiscoveryBlockOsData.java | 154 +++++++++++
.../readwrite/AdsDiscoveryBlockPassword.java | 145 +++++++++++
.../readwrite/AdsDiscoveryBlockRouteName.java | 146 +++++++++++
.../readwrite/AdsDiscoveryBlockStatus.java | 168 ++++++++++++
.../discovery/readwrite/AdsDiscoveryBlockType.java | 62 +++++
.../readwrite/AdsDiscoveryBlockUserName.java | 145 +++++++++++
.../readwrite/AdsDiscoveryBlockVersion.java | 154 +++++++++++
.../discovery/readwrite/AdsDiscoveryConstants.java | 133 ++++++++++
.../ads/discovery/readwrite/AdsPortNumbers.java | 66 +++++
.../java/ads/discovery/readwrite/AmsNetId.java | 204 +++++++++++++++
.../java/ads/discovery/readwrite/AmsString.java | 159 ++++++++++++
.../java/ads/discovery/readwrite/Operation.java | 61 +++++
.../plc4x/java/ads/discovery/readwrite/Status.java | 56 ++++
19 files changed, 2758 insertions(+)
diff --git a/plc4go/protocols/ads/readwrite/model/ErrorResponse.go b/plc4go/protocols/ads/readwrite/model/ErrorResponse.go
new file mode 100644
index 0000000000..b6b559ab5d
--- /dev/null
+++ b/plc4go/protocols/ads/readwrite/model/ErrorResponse.go
@@ -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 model
+
+import (
+ "github.com/apache/plc4x/plc4go/spi/utils"
+ "github.com/pkg/errors"
+)
+
+// Code generated by code-generation. DO NOT EDIT.
+
+// ErrorResponse is the corresponding interface of ErrorResponse
+type ErrorResponse interface {
+ utils.LengthAware
+ utils.Serializable
+ AmsPacket
+}
+
+// ErrorResponseExactly can be used when we want exactly this type and not a type which fulfills ErrorResponse.
+// This is useful for switch cases.
+type ErrorResponseExactly interface {
+ ErrorResponse
+ isErrorResponse() bool
+}
+
+// _ErrorResponse is the data-structure of this message
+type _ErrorResponse struct {
+ *_AmsPacket
+}
+
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+/////////////////////// Accessors for discriminator values.
+///////////////////////
+
+func (m *_ErrorResponse) GetCommandId() CommandId {
+ return 0
+}
+
+func (m *_ErrorResponse) GetResponse() bool {
+ return false
+}
+
+///////////////////////
+///////////////////////
+///////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////
+
+func (m *_ErrorResponse) InitializeParent(parent AmsPacket, targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) {
+ m.TargetAmsNetId = targetAmsNetId
+ m.TargetAmsPort = targetAmsPort
+ m.SourceAmsNetId = sourceAmsNetId
+ m.SourceAmsPort = sourceAmsPort
+ m.ErrorCode = errorCode
+ m.InvokeId = invokeId
+}
+
+func (m *_ErrorResponse) GetParent() AmsPacket {
+ return m._AmsPacket
+}
+
+// NewErrorResponse factory function for _ErrorResponse
+func NewErrorResponse(targetAmsNetId AmsNetId, targetAmsPort uint16, sourceAmsNetId AmsNetId, sourceAmsPort uint16, errorCode uint32, invokeId uint32) *_ErrorResponse {
+ _result := &_ErrorResponse{
+ _AmsPacket: NewAmsPacket(targetAmsNetId, targetAmsPort, sourceAmsNetId, sourceAmsPort, errorCode, invokeId),
+ }
+ _result._AmsPacket._AmsPacketChildRequirements = _result
+ return _result
+}
+
+// Deprecated: use the interface for direct cast
+func CastErrorResponse(structType interface{}) ErrorResponse {
+ if casted, ok := structType.(ErrorResponse); ok {
+ return casted
+ }
+ if casted, ok := structType.(*ErrorResponse); ok {
+ return *casted
+ }
+ return nil
+}
+
+func (m *_ErrorResponse) GetTypeName() string {
+ return "ErrorResponse"
+}
+
+func (m *_ErrorResponse) GetLengthInBits() uint16 {
+ return m.GetLengthInBitsConditional(false)
+}
+
+func (m *_ErrorResponse) GetLengthInBitsConditional(lastItem bool) uint16 {
+ lengthInBits := uint16(m.GetParentLengthInBits())
+
+ return lengthInBits
+}
+
+func (m *_ErrorResponse) GetLengthInBytes() uint16 {
+ return m.GetLengthInBits() / 8
+}
+
+func ErrorResponseParse(theBytes []byte) (ErrorResponse, error) {
+ return ErrorResponseParseWithBuffer(utils.NewReadBufferByteBased(theBytes))
+}
+
+func ErrorResponseParseWithBuffer(readBuffer utils.ReadBuffer) (ErrorResponse, error) {
+ positionAware := readBuffer
+ _ = positionAware
+ if pullErr := readBuffer.PullContext("ErrorResponse"); pullErr != nil {
+ return nil, errors.Wrap(pullErr, "Error pulling for ErrorResponse")
+ }
+ currentPos := positionAware.GetPos()
+ _ = currentPos
+
+ if closeErr := readBuffer.CloseContext("ErrorResponse"); closeErr != nil {
+ return nil, errors.Wrap(closeErr, "Error closing for ErrorResponse")
+ }
+
+ // Create a partially initialized instance
+ _child := &_ErrorResponse{
+ _AmsPacket: &_AmsPacket{},
+ }
+ _child._AmsPacket._AmsPacketChildRequirements = _child
+ return _child, nil
+}
+
+func (m *_ErrorResponse) Serialize() ([]byte, error) {
+ wb := utils.NewWriteBufferByteBased(utils.WithInitialSizeForByteBasedBuffer(int(m.GetLengthInBytes())))
+ if err := m.SerializeWithWriteBuffer(wb); err != nil {
+ return nil, err
+ }
+ return wb.GetBytes(), nil
+}
+
+func (m *_ErrorResponse) SerializeWithWriteBuffer(writeBuffer utils.WriteBuffer) error {
+ positionAware := writeBuffer
+ _ = positionAware
+ ser := func() error {
+ if pushErr := writeBuffer.PushContext("ErrorResponse"); pushErr != nil {
+ return errors.Wrap(pushErr, "Error pushing for ErrorResponse")
+ }
+
+ if popErr := writeBuffer.PopContext("ErrorResponse"); popErr != nil {
+ return errors.Wrap(popErr, "Error popping for ErrorResponse")
+ }
+ return nil
+ }
+ return m.SerializeParent(writeBuffer, m, ser)
+}
+
+func (m *_ErrorResponse) isErrorResponse() bool {
+ return true
+}
+
+func (m *_ErrorResponse) String() string {
+ if m == nil {
+ return "<nil>"
+ }
+ writeBuffer := utils.NewWriteBufferBoxBasedWithOptions(true, true)
+ if err := writeBuffer.WriteSerializable(m); err != nil {
+ return err.Error()
+ }
+ return writeBuffer.GetBox().String()
+}
diff --git a/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscovery.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscovery.java
new file mode 100644
index 0000000000..ff9e9f7464
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscovery.java
@@ -0,0 +1,288 @@
+/*
+ * 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.ads.discovery.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 AdsDiscovery implements Message {
+
+ // Constant values.
+ public static final Long HEADER = 0x71146603L;
+
+ // Properties.
+ protected final long requestId;
+ protected final Operation operation;
+ protected final AmsNetId amsNetId;
+ protected final AdsPortNumbers portNumber;
+ protected final List<AdsDiscoveryBlock> blocks;
+
+ public AdsDiscovery(
+ long requestId,
+ Operation operation,
+ AmsNetId amsNetId,
+ AdsPortNumbers portNumber,
+ List<AdsDiscoveryBlock> blocks) {
+ super();
+ this.requestId = requestId;
+ this.operation = operation;
+ this.amsNetId = amsNetId;
+ this.portNumber = portNumber;
+ this.blocks = blocks;
+ }
+
+ public long getRequestId() {
+ return requestId;
+ }
+
+ public Operation getOperation() {
+ return operation;
+ }
+
+ public AmsNetId getAmsNetId() {
+ return amsNetId;
+ }
+
+ public AdsPortNumbers getPortNumber() {
+ return portNumber;
+ }
+
+ public List<AdsDiscoveryBlock> getBlocks() {
+ return blocks;
+ }
+
+ public long getHeader() {
+ return HEADER;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscovery");
+
+ // Const Field (header)
+ writeConstField(
+ "header",
+ HEADER,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ // Simple Field (requestId)
+ writeSimpleField(
+ "requestId",
+ requestId,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ // Simple Field (operation)
+ writeSimpleEnumField(
+ "operation",
+ "Operation",
+ operation,
+ new DataWriterEnumDefault<>(
+ Operation::getValue, Operation::name, writeUnsignedLong(writeBuffer, 32)),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ // Simple Field (amsNetId)
+ writeSimpleField(
+ "amsNetId",
+ amsNetId,
+ new DataWriterComplexDefault<>(writeBuffer),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ // Simple Field (portNumber)
+ writeSimpleEnumField(
+ "portNumber",
+ "AdsPortNumbers",
+ portNumber,
+ new DataWriterEnumDefault<>(
+ AdsPortNumbers::getValue, AdsPortNumbers::name, writeUnsignedInt(writeBuffer, 16)),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ // Implicit Field (numBlocks) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ long numBlocks = (long) (COUNT(getBlocks()));
+ writeImplicitField(
+ "numBlocks",
+ numBlocks,
+ writeUnsignedLong(writeBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ // Array Field (blocks)
+ writeComplexTypeArrayField(
+ "blocks", blocks, writeBuffer, WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ writeBuffer.popContext("AdsDiscovery");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ AdsDiscovery _value = this;
+
+ // Const Field (header)
+ lengthInBits += 32;
+
+ // Simple field (requestId)
+ lengthInBits += 32;
+
+ // Simple field (operation)
+ lengthInBits += 32;
+
+ // Simple field (amsNetId)
+ lengthInBits += amsNetId.getLengthInBits();
+
+ // Simple field (portNumber)
+ lengthInBits += 16;
+
+ // Implicit Field (numBlocks)
+ lengthInBits += 32;
+
+ // Array field
+ if (blocks != null) {
+ int i = 0;
+ for (AdsDiscoveryBlock element : blocks) {
+ boolean last = ++i >= blocks.size();
+ lengthInBits += element.getLengthInBits();
+ }
+ }
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscovery staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static AdsDiscovery staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("AdsDiscovery");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ long header =
+ readConstField(
+ "header",
+ readUnsignedLong(readBuffer, 32),
+ AdsDiscovery.HEADER,
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ long requestId =
+ readSimpleField(
+ "requestId",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ Operation operation =
+ readEnumField(
+ "operation",
+ "Operation",
+ new DataReaderEnumDefault<>(Operation::enumForValue, readUnsignedLong(readBuffer, 32)),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ AmsNetId amsNetId =
+ readSimpleField(
+ "amsNetId",
+ new DataReaderComplexDefault<>(() -> AmsNetId.staticParse(readBuffer), readBuffer),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ AdsPortNumbers portNumber =
+ readEnumField(
+ "portNumber",
+ "AdsPortNumbers",
+ new DataReaderEnumDefault<>(
+ AdsPortNumbers::enumForValue, readUnsignedInt(readBuffer, 16)),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ long numBlocks =
+ readImplicitField(
+ "numBlocks",
+ readUnsignedLong(readBuffer, 32),
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ List<AdsDiscoveryBlock> blocks =
+ readCountArrayField(
+ "blocks",
+ new DataReaderComplexDefault<>(
+ () -> AdsDiscoveryBlock.staticParse(readBuffer), readBuffer),
+ numBlocks,
+ WithOption.WithByteOrder(ByteOrder.LITTLE_ENDIAN));
+
+ readBuffer.closeContext("AdsDiscovery");
+ // Create the instance
+ AdsDiscovery _adsDiscovery;
+ _adsDiscovery = new AdsDiscovery(requestId, operation, amsNetId, portNumber, blocks);
+ return _adsDiscovery;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscovery)) {
+ return false;
+ }
+ AdsDiscovery that = (AdsDiscovery) o;
+ return (getRequestId() == that.getRequestId())
+ && (getOperation() == that.getOperation())
+ && (getAmsNetId() == that.getAmsNetId())
+ && (getPortNumber() == that.getPortNumber())
+ && (getBlocks() == that.getBlocks())
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ getRequestId(), getOperation(), getAmsNetId(), getPortNumber(), getBlocks());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlock.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlock.java
new file mode 100644
index 0000000000..f18d683201
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlock.java
@@ -0,0 +1,174 @@
+/*
+ * 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.ads.discovery.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 AdsDiscoveryBlock implements Message {
+
+ // Abstract accessors for discriminator values.
+ public abstract AdsDiscoveryBlockType getBlockType();
+
+ public AdsDiscoveryBlock() {
+ super();
+ }
+
+ protected abstract void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException;
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlock");
+
+ // Discriminator Field (blockType) (Used as input to a switch field)
+ writeDiscriminatorEnumField(
+ "blockType",
+ "AdsDiscoveryBlockType",
+ getBlockType(),
+ new DataWriterEnumDefault<>(
+ AdsDiscoveryBlockType::getValue,
+ AdsDiscoveryBlockType::name,
+ writeUnsignedInt(writeBuffer, 16)));
+
+ // Switch field (Serialize the sub-type)
+ serializeAdsDiscoveryBlockChild(writeBuffer);
+
+ writeBuffer.popContext("AdsDiscoveryBlock");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ AdsDiscoveryBlock _value = this;
+
+ // Discriminator Field (blockType)
+ lengthInBits += 16;
+
+ // Length of sub-type elements will be added by sub-type...
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlock staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static AdsDiscoveryBlock staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlock");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ AdsDiscoveryBlockType blockType =
+ readDiscriminatorField(
+ "blockType",
+ new DataReaderEnumDefault<>(
+ AdsDiscoveryBlockType::enumForValue, readUnsignedInt(readBuffer, 16)));
+
+ // Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
+ AdsDiscoveryBlockBuilder builder = null;
+ if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.STATUS)) {
+ builder = AdsDiscoveryBlockStatus.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.PASSWORD)) {
+ builder = AdsDiscoveryBlockPassword.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.VERSION)) {
+ builder = AdsDiscoveryBlockVersion.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.OS_DATA)) {
+ builder = AdsDiscoveryBlockOsData.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.HOST_NAME)) {
+ builder = AdsDiscoveryBlockHostName.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.AMS_NET_ID)) {
+ builder = AdsDiscoveryBlockAmsNetId.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.ROUTE_NAME)) {
+ builder = AdsDiscoveryBlockRouteName.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.USER_NAME)) {
+ builder = AdsDiscoveryBlockUserName.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ } else if (EvaluationHelper.equals(blockType, AdsDiscoveryBlockType.FINGERPRINT)) {
+ builder = AdsDiscoveryBlockFingerprint.staticParseAdsDiscoveryBlockBuilder(readBuffer);
+ }
+ if (builder == null) {
+ throw new ParseException(
+ "Unsupported case for discriminated type"
+ + " parameters ["
+ + "blockType="
+ + blockType
+ + "]");
+ }
+
+ readBuffer.closeContext("AdsDiscoveryBlock");
+ // Create the instance
+ AdsDiscoveryBlock _adsDiscoveryBlock = builder.build();
+ return _adsDiscoveryBlock;
+ }
+
+ public interface AdsDiscoveryBlockBuilder {
+ AdsDiscoveryBlock build();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlock)) {
+ return false;
+ }
+ AdsDiscoveryBlock that = (AdsDiscoveryBlock) 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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockAmsNetId.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockAmsNetId.java
new file mode 100644
index 0000000000..e34c4dd6cb
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockAmsNetId.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.ads.discovery.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 AdsDiscoveryBlockAmsNetId extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.AMS_NET_ID;
+ }
+
+ // Constant values.
+ public static final Integer AMSNETIDLENGTH = 0x0006;
+
+ // Properties.
+ protected final AmsNetId amsNetId;
+
+ public AdsDiscoveryBlockAmsNetId(AmsNetId amsNetId) {
+ super();
+ this.amsNetId = amsNetId;
+ }
+
+ public AmsNetId getAmsNetId() {
+ return amsNetId;
+ }
+
+ public int getAmsNetIdLength() {
+ return AMSNETIDLENGTH;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockAmsNetId");
+
+ // Const Field (amsNetIdLength)
+ writeConstField("amsNetIdLength", AMSNETIDLENGTH, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (amsNetId)
+ writeSimpleField("amsNetId", amsNetId, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("AdsDiscoveryBlockAmsNetId");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockAmsNetId _value = this;
+
+ // Const Field (amsNetIdLength)
+ lengthInBits += 16;
+
+ // Simple field (amsNetId)
+ lengthInBits += amsNetId.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockAmsNetId");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int amsNetIdLength =
+ readConstField(
+ "amsNetIdLength",
+ readUnsignedInt(readBuffer, 16),
+ AdsDiscoveryBlockAmsNetId.AMSNETIDLENGTH);
+
+ AmsNetId amsNetId =
+ readSimpleField(
+ "amsNetId",
+ new DataReaderComplexDefault<>(() -> AmsNetId.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("AdsDiscoveryBlockAmsNetId");
+ // Create the instance
+ return new AdsDiscoveryBlockAmsNetIdBuilderImpl(amsNetId);
+ }
+
+ public static class AdsDiscoveryBlockAmsNetIdBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final AmsNetId amsNetId;
+
+ public AdsDiscoveryBlockAmsNetIdBuilderImpl(AmsNetId amsNetId) {
+
+ this.amsNetId = amsNetId;
+ }
+
+ public AdsDiscoveryBlockAmsNetId build() {
+ AdsDiscoveryBlockAmsNetId adsDiscoveryBlockAmsNetId = new AdsDiscoveryBlockAmsNetId(amsNetId);
+ return adsDiscoveryBlockAmsNetId;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockAmsNetId)) {
+ return false;
+ }
+ AdsDiscoveryBlockAmsNetId that = (AdsDiscoveryBlockAmsNetId) o;
+ return (getAmsNetId() == that.getAmsNetId()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getAmsNetId());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockFingerprint.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockFingerprint.java
new file mode 100644
index 0000000000..585986556c
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockFingerprint.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.ads.discovery.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 AdsDiscoveryBlockFingerprint extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.FINGERPRINT;
+ }
+
+ // Properties.
+ protected final byte[] data;
+
+ public AdsDiscoveryBlockFingerprint(byte[] data) {
+ super();
+ this.data = data;
+ }
+
+ public byte[] getData() {
+ return data;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockFingerprint");
+
+ // Implicit Field (dataLen) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ int dataLen = (int) (COUNT(getData()));
+ writeImplicitField("dataLen", dataLen, writeUnsignedInt(writeBuffer, 16));
+
+ // Array Field (data)
+ writeByteArrayField("data", data, writeByteArray(writeBuffer, 8));
+
+ writeBuffer.popContext("AdsDiscoveryBlockFingerprint");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockFingerprint _value = this;
+
+ // Implicit Field (dataLen)
+ lengthInBits += 16;
+
+ // Array field
+ if (data != null) {
+ lengthInBits += 8 * data.length;
+ }
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockFingerprint");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int dataLen = readImplicitField("dataLen", readUnsignedInt(readBuffer, 16));
+
+ byte[] data = readBuffer.readByteArray("data", Math.toIntExact(dataLen));
+
+ readBuffer.closeContext("AdsDiscoveryBlockFingerprint");
+ // Create the instance
+ return new AdsDiscoveryBlockFingerprintBuilderImpl(data);
+ }
+
+ public static class AdsDiscoveryBlockFingerprintBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final byte[] data;
+
+ public AdsDiscoveryBlockFingerprintBuilderImpl(byte[] data) {
+
+ this.data = data;
+ }
+
+ public AdsDiscoveryBlockFingerprint build() {
+ AdsDiscoveryBlockFingerprint adsDiscoveryBlockFingerprint =
+ new AdsDiscoveryBlockFingerprint(data);
+ return adsDiscoveryBlockFingerprint;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockFingerprint)) {
+ return false;
+ }
+ AdsDiscoveryBlockFingerprint that = (AdsDiscoveryBlockFingerprint) 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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockHostName.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockHostName.java
new file mode 100644
index 0000000000..62e76d9ddb
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockHostName.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.ads.discovery.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 AdsDiscoveryBlockHostName extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.HOST_NAME;
+ }
+
+ // Properties.
+ protected final AmsString hostName;
+
+ public AdsDiscoveryBlockHostName(AmsString hostName) {
+ super();
+ this.hostName = hostName;
+ }
+
+ public AmsString getHostName() {
+ return hostName;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockHostName");
+
+ // Simple Field (hostName)
+ writeSimpleField("hostName", hostName, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("AdsDiscoveryBlockHostName");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockHostName _value = this;
+
+ // Simple field (hostName)
+ lengthInBits += hostName.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockHostName");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ AmsString hostName =
+ readSimpleField(
+ "hostName",
+ new DataReaderComplexDefault<>(() -> AmsString.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("AdsDiscoveryBlockHostName");
+ // Create the instance
+ return new AdsDiscoveryBlockHostNameBuilderImpl(hostName);
+ }
+
+ public static class AdsDiscoveryBlockHostNameBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final AmsString hostName;
+
+ public AdsDiscoveryBlockHostNameBuilderImpl(AmsString hostName) {
+
+ this.hostName = hostName;
+ }
+
+ public AdsDiscoveryBlockHostName build() {
+ AdsDiscoveryBlockHostName adsDiscoveryBlockHostName = new AdsDiscoveryBlockHostName(hostName);
+ return adsDiscoveryBlockHostName;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockHostName)) {
+ return false;
+ }
+ AdsDiscoveryBlockHostName that = (AdsDiscoveryBlockHostName) o;
+ return (getHostName() == that.getHostName()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getHostName());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockOsData.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockOsData.java
new file mode 100644
index 0000000000..04eb9c351a
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockOsData.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.ads.discovery.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 AdsDiscoveryBlockOsData extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.OS_DATA;
+ }
+
+ // Properties.
+ protected final byte[] osData;
+
+ public AdsDiscoveryBlockOsData(byte[] osData) {
+ super();
+ this.osData = osData;
+ }
+
+ public byte[] getOsData() {
+ return osData;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockOsData");
+
+ // Implicit Field (osDataLen) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ int osDataLen = (int) (COUNT(getOsData()));
+ writeImplicitField("osDataLen", osDataLen, writeUnsignedInt(writeBuffer, 16));
+
+ // Array Field (osData)
+ writeByteArrayField("osData", osData, writeByteArray(writeBuffer, 8));
+
+ writeBuffer.popContext("AdsDiscoveryBlockOsData");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockOsData _value = this;
+
+ // Implicit Field (osDataLen)
+ lengthInBits += 16;
+
+ // Array field
+ if (osData != null) {
+ lengthInBits += 8 * osData.length;
+ }
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockOsData");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int osDataLen = readImplicitField("osDataLen", readUnsignedInt(readBuffer, 16));
+
+ byte[] osData = readBuffer.readByteArray("osData", Math.toIntExact(osDataLen));
+
+ readBuffer.closeContext("AdsDiscoveryBlockOsData");
+ // Create the instance
+ return new AdsDiscoveryBlockOsDataBuilderImpl(osData);
+ }
+
+ public static class AdsDiscoveryBlockOsDataBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final byte[] osData;
+
+ public AdsDiscoveryBlockOsDataBuilderImpl(byte[] osData) {
+
+ this.osData = osData;
+ }
+
+ public AdsDiscoveryBlockOsData build() {
+ AdsDiscoveryBlockOsData adsDiscoveryBlockOsData = new AdsDiscoveryBlockOsData(osData);
+ return adsDiscoveryBlockOsData;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockOsData)) {
+ return false;
+ }
+ AdsDiscoveryBlockOsData that = (AdsDiscoveryBlockOsData) o;
+ return (getOsData() == that.getOsData()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getOsData());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockPassword.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockPassword.java
new file mode 100644
index 0000000000..07a7381bec
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockPassword.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.ads.discovery.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 AdsDiscoveryBlockPassword extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.PASSWORD;
+ }
+
+ // Properties.
+ protected final AmsString password;
+
+ public AdsDiscoveryBlockPassword(AmsString password) {
+ super();
+ this.password = password;
+ }
+
+ public AmsString getPassword() {
+ return password;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockPassword");
+
+ // Simple Field (password)
+ writeSimpleField("password", password, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("AdsDiscoveryBlockPassword");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockPassword _value = this;
+
+ // Simple field (password)
+ lengthInBits += password.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockPassword");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ AmsString password =
+ readSimpleField(
+ "password",
+ new DataReaderComplexDefault<>(() -> AmsString.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("AdsDiscoveryBlockPassword");
+ // Create the instance
+ return new AdsDiscoveryBlockPasswordBuilderImpl(password);
+ }
+
+ public static class AdsDiscoveryBlockPasswordBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final AmsString password;
+
+ public AdsDiscoveryBlockPasswordBuilderImpl(AmsString password) {
+
+ this.password = password;
+ }
+
+ public AdsDiscoveryBlockPassword build() {
+ AdsDiscoveryBlockPassword adsDiscoveryBlockPassword = new AdsDiscoveryBlockPassword(password);
+ return adsDiscoveryBlockPassword;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockPassword)) {
+ return false;
+ }
+ AdsDiscoveryBlockPassword that = (AdsDiscoveryBlockPassword) o;
+ return (getPassword() == that.getPassword()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getPassword());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockRouteName.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockRouteName.java
new file mode 100644
index 0000000000..e7dfa2975d
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockRouteName.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.ads.discovery.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 AdsDiscoveryBlockRouteName extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.ROUTE_NAME;
+ }
+
+ // Properties.
+ protected final AmsString routeName;
+
+ public AdsDiscoveryBlockRouteName(AmsString routeName) {
+ super();
+ this.routeName = routeName;
+ }
+
+ public AmsString getRouteName() {
+ return routeName;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockRouteName");
+
+ // Simple Field (routeName)
+ writeSimpleField("routeName", routeName, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("AdsDiscoveryBlockRouteName");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockRouteName _value = this;
+
+ // Simple field (routeName)
+ lengthInBits += routeName.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockRouteName");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ AmsString routeName =
+ readSimpleField(
+ "routeName",
+ new DataReaderComplexDefault<>(() -> AmsString.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("AdsDiscoveryBlockRouteName");
+ // Create the instance
+ return new AdsDiscoveryBlockRouteNameBuilderImpl(routeName);
+ }
+
+ public static class AdsDiscoveryBlockRouteNameBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final AmsString routeName;
+
+ public AdsDiscoveryBlockRouteNameBuilderImpl(AmsString routeName) {
+
+ this.routeName = routeName;
+ }
+
+ public AdsDiscoveryBlockRouteName build() {
+ AdsDiscoveryBlockRouteName adsDiscoveryBlockRouteName =
+ new AdsDiscoveryBlockRouteName(routeName);
+ return adsDiscoveryBlockRouteName;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockRouteName)) {
+ return false;
+ }
+ AdsDiscoveryBlockRouteName that = (AdsDiscoveryBlockRouteName) o;
+ return (getRouteName() == that.getRouteName()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getRouteName());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockStatus.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockStatus.java
new file mode 100644
index 0000000000..c627c417c7
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockStatus.java
@@ -0,0 +1,168 @@
+/*
+ * 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.ads.discovery.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 AdsDiscoveryBlockStatus extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.STATUS;
+ }
+
+ // Constant values.
+ public static final Integer STATUSLENGTH = 0x0004;
+
+ // Properties.
+ protected final Status status;
+
+ public AdsDiscoveryBlockStatus(Status status) {
+ super();
+ this.status = status;
+ }
+
+ public Status getStatus() {
+ return status;
+ }
+
+ public int getStatusLength() {
+ return STATUSLENGTH;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockStatus");
+
+ // Const Field (statusLength)
+ writeConstField("statusLength", STATUSLENGTH, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (status)
+ writeSimpleEnumField(
+ "status",
+ "Status",
+ status,
+ new DataWriterEnumDefault<>(
+ Status::getValue, Status::name, writeUnsignedLong(writeBuffer, 32)));
+
+ writeBuffer.popContext("AdsDiscoveryBlockStatus");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockStatus _value = this;
+
+ // Const Field (statusLength)
+ lengthInBits += 16;
+
+ // Simple field (status)
+ lengthInBits += 32;
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockStatus");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int statusLength =
+ readConstField(
+ "statusLength", readUnsignedInt(readBuffer, 16), AdsDiscoveryBlockStatus.STATUSLENGTH);
+
+ Status status =
+ readEnumField(
+ "status",
+ "Status",
+ new DataReaderEnumDefault<>(Status::enumForValue, readUnsignedLong(readBuffer, 32)));
+
+ readBuffer.closeContext("AdsDiscoveryBlockStatus");
+ // Create the instance
+ return new AdsDiscoveryBlockStatusBuilderImpl(status);
+ }
+
+ public static class AdsDiscoveryBlockStatusBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final Status status;
+
+ public AdsDiscoveryBlockStatusBuilderImpl(Status status) {
+
+ this.status = status;
+ }
+
+ public AdsDiscoveryBlockStatus build() {
+ AdsDiscoveryBlockStatus adsDiscoveryBlockStatus = new AdsDiscoveryBlockStatus(status);
+ return adsDiscoveryBlockStatus;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockStatus)) {
+ return false;
+ }
+ AdsDiscoveryBlockStatus that = (AdsDiscoveryBlockStatus) o;
+ return (getStatus() == that.getStatus()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getStatus());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockType.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockType.java
new file mode 100644
index 0000000000..86151615ca
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockType.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.ads.discovery.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum AdsDiscoveryBlockType {
+ STATUS((int) 0x0001),
+ PASSWORD((int) 0x0002),
+ VERSION((int) 0x0003),
+ OS_DATA((int) 0x0004),
+ HOST_NAME((int) 0x0005),
+ AMS_NET_ID((int) 0x0007),
+ ROUTE_NAME((int) 0x000C),
+ USER_NAME((int) 0x000D),
+ FINGERPRINT((int) 0x0012);
+ private static final Map<Integer, AdsDiscoveryBlockType> map;
+
+ static {
+ map = new HashMap<>();
+ for (AdsDiscoveryBlockType value : AdsDiscoveryBlockType.values()) {
+ map.put((int) value.getValue(), value);
+ }
+ }
+
+ private int value;
+
+ AdsDiscoveryBlockType(int value) {
+ this.value = value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public static AdsDiscoveryBlockType enumForValue(int value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(int value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockUserName.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockUserName.java
new file mode 100644
index 0000000000..484b670306
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockUserName.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.ads.discovery.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 AdsDiscoveryBlockUserName extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.USER_NAME;
+ }
+
+ // Properties.
+ protected final AmsString userName;
+
+ public AdsDiscoveryBlockUserName(AmsString userName) {
+ super();
+ this.userName = userName;
+ }
+
+ public AmsString getUserName() {
+ return userName;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockUserName");
+
+ // Simple Field (userName)
+ writeSimpleField("userName", userName, new DataWriterComplexDefault<>(writeBuffer));
+
+ writeBuffer.popContext("AdsDiscoveryBlockUserName");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockUserName _value = this;
+
+ // Simple field (userName)
+ lengthInBits += userName.getLengthInBits();
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockUserName");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ AmsString userName =
+ readSimpleField(
+ "userName",
+ new DataReaderComplexDefault<>(() -> AmsString.staticParse(readBuffer), readBuffer));
+
+ readBuffer.closeContext("AdsDiscoveryBlockUserName");
+ // Create the instance
+ return new AdsDiscoveryBlockUserNameBuilderImpl(userName);
+ }
+
+ public static class AdsDiscoveryBlockUserNameBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final AmsString userName;
+
+ public AdsDiscoveryBlockUserNameBuilderImpl(AmsString userName) {
+
+ this.userName = userName;
+ }
+
+ public AdsDiscoveryBlockUserName build() {
+ AdsDiscoveryBlockUserName adsDiscoveryBlockUserName = new AdsDiscoveryBlockUserName(userName);
+ return adsDiscoveryBlockUserName;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockUserName)) {
+ return false;
+ }
+ AdsDiscoveryBlockUserName that = (AdsDiscoveryBlockUserName) o;
+ return (getUserName() == that.getUserName()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getUserName());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockVersion.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockVersion.java
new file mode 100644
index 0000000000..9f63757c86
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryBlockVersion.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.ads.discovery.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 AdsDiscoveryBlockVersion extends AdsDiscoveryBlock implements Message {
+
+ // Accessors for discriminator values.
+ public AdsDiscoveryBlockType getBlockType() {
+ return AdsDiscoveryBlockType.VERSION;
+ }
+
+ // Properties.
+ protected final byte[] versionData;
+
+ public AdsDiscoveryBlockVersion(byte[] versionData) {
+ super();
+ this.versionData = versionData;
+ }
+
+ public byte[] getVersionData() {
+ return versionData;
+ }
+
+ @Override
+ protected void serializeAdsDiscoveryBlockChild(WriteBuffer writeBuffer)
+ throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryBlockVersion");
+
+ // Implicit Field (versionDataLen) (Used for parsing, but its value is not stored as it's
+ // implicitly given by the objects content)
+ int versionDataLen = (int) (COUNT(getVersionData()));
+ writeImplicitField("versionDataLen", versionDataLen, writeUnsignedInt(writeBuffer, 16));
+
+ // Array Field (versionData)
+ writeByteArrayField("versionData", versionData, writeByteArray(writeBuffer, 8));
+
+ writeBuffer.popContext("AdsDiscoveryBlockVersion");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = super.getLengthInBits();
+ AdsDiscoveryBlockVersion _value = this;
+
+ // Implicit Field (versionDataLen)
+ lengthInBits += 16;
+
+ // Array field
+ if (versionData != null) {
+ lengthInBits += 8 * versionData.length;
+ }
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryBlockBuilder staticParseAdsDiscoveryBlockBuilder(ReadBuffer readBuffer)
+ throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryBlockVersion");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int versionDataLen = readImplicitField("versionDataLen", readUnsignedInt(readBuffer, 16));
+
+ byte[] versionData = readBuffer.readByteArray("versionData", Math.toIntExact(versionDataLen));
+
+ readBuffer.closeContext("AdsDiscoveryBlockVersion");
+ // Create the instance
+ return new AdsDiscoveryBlockVersionBuilderImpl(versionData);
+ }
+
+ public static class AdsDiscoveryBlockVersionBuilderImpl
+ implements AdsDiscoveryBlock.AdsDiscoveryBlockBuilder {
+ private final byte[] versionData;
+
+ public AdsDiscoveryBlockVersionBuilderImpl(byte[] versionData) {
+
+ this.versionData = versionData;
+ }
+
+ public AdsDiscoveryBlockVersion build() {
+ AdsDiscoveryBlockVersion adsDiscoveryBlockVersion = new AdsDiscoveryBlockVersion(versionData);
+ return adsDiscoveryBlockVersion;
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryBlockVersion)) {
+ return false;
+ }
+ AdsDiscoveryBlockVersion that = (AdsDiscoveryBlockVersion) o;
+ return (getVersionData() == that.getVersionData()) && super.equals(that) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(super.hashCode(), getVersionData());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryConstants.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryConstants.java
new file mode 100644
index 0000000000..731e7ec9d8
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsDiscoveryConstants.java
@@ -0,0 +1,133 @@
+/*
+ * 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.ads.discovery.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 AdsDiscoveryConstants implements Message {
+
+ // Constant values.
+ public static final Integer ADSDISCOVERYUDPDEFAULTPORT = 48899;
+
+ public AdsDiscoveryConstants() {
+ super();
+ }
+
+ public int getAdsDiscoveryUdpDefaultPort() {
+ return ADSDISCOVERYUDPDEFAULTPORT;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AdsDiscoveryConstants");
+
+ // Const Field (adsDiscoveryUdpDefaultPort)
+ writeConstField(
+ "adsDiscoveryUdpDefaultPort",
+ ADSDISCOVERYUDPDEFAULTPORT,
+ writeUnsignedInt(writeBuffer, 16));
+
+ writeBuffer.popContext("AdsDiscoveryConstants");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ AdsDiscoveryConstants _value = this;
+
+ // Const Field (adsDiscoveryUdpDefaultPort)
+ lengthInBits += 16;
+
+ return lengthInBits;
+ }
+
+ public static AdsDiscoveryConstants staticParse(ReadBuffer readBuffer, Object... args)
+ throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static AdsDiscoveryConstants staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("AdsDiscoveryConstants");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int adsDiscoveryUdpDefaultPort =
+ readConstField(
+ "adsDiscoveryUdpDefaultPort",
+ readUnsignedInt(readBuffer, 16),
+ AdsDiscoveryConstants.ADSDISCOVERYUDPDEFAULTPORT);
+
+ readBuffer.closeContext("AdsDiscoveryConstants");
+ // Create the instance
+ AdsDiscoveryConstants _adsDiscoveryConstants;
+ _adsDiscoveryConstants = new AdsDiscoveryConstants();
+ return _adsDiscoveryConstants;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AdsDiscoveryConstants)) {
+ return false;
+ }
+ AdsDiscoveryConstants that = (AdsDiscoveryConstants) 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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsPortNumbers.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsPortNumbers.java
new file mode 100644
index 0000000000..487d78819e
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AdsPortNumbers.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.ads.discovery.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum AdsPortNumbers {
+ LOGGER((int) 100),
+ EVENT_LOGGER((int) 110),
+ IO((int) 300),
+ ADDITIONAL_TASK_1((int) 301),
+ ADDITIONAL_TASK_2((int) 302),
+ NC((int) 500),
+ PLC_RUNTIME_SYSTEM_1((int) 801),
+ PLC_RUNTIME_SYSTEM_2((int) 811),
+ PLC_RUNTIME_SYSTEM_3((int) 821),
+ PLC_RUNTIME_SYSTEM_4((int) 831),
+ CAM_SWITCH((int) 900),
+ SYSTEM_SERVICE((int) 10000),
+ SCOPE((int) 14000);
+ private static final Map<Integer, AdsPortNumbers> map;
+
+ static {
+ map = new HashMap<>();
+ for (AdsPortNumbers value : AdsPortNumbers.values()) {
+ map.put((int) value.getValue(), value);
+ }
+ }
+
+ private int value;
+
+ AdsPortNumbers(int value) {
+ this.value = value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public static AdsPortNumbers enumForValue(int value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(int value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AmsNetId.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AmsNetId.java
new file mode 100644
index 0000000000..4409b5212a
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AmsNetId.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.ads.discovery.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 AmsNetId implements Message {
+
+ // Properties.
+ protected final short octet1;
+ protected final short octet2;
+ protected final short octet3;
+ protected final short octet4;
+ protected final short octet5;
+ protected final short octet6;
+
+ public AmsNetId(
+ short octet1, short octet2, short octet3, short octet4, short octet5, short octet6) {
+ super();
+ this.octet1 = octet1;
+ this.octet2 = octet2;
+ this.octet3 = octet3;
+ this.octet4 = octet4;
+ this.octet5 = octet5;
+ this.octet6 = octet6;
+ }
+
+ public short getOctet1() {
+ return octet1;
+ }
+
+ public short getOctet2() {
+ return octet2;
+ }
+
+ public short getOctet3() {
+ return octet3;
+ }
+
+ public short getOctet4() {
+ return octet4;
+ }
+
+ public short getOctet5() {
+ return octet5;
+ }
+
+ public short getOctet6() {
+ return octet6;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AmsNetId");
+
+ // Simple Field (octet1)
+ writeSimpleField("octet1", octet1, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (octet2)
+ writeSimpleField("octet2", octet2, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (octet3)
+ writeSimpleField("octet3", octet3, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (octet4)
+ writeSimpleField("octet4", octet4, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (octet5)
+ writeSimpleField("octet5", octet5, writeUnsignedShort(writeBuffer, 8));
+
+ // Simple Field (octet6)
+ writeSimpleField("octet6", octet6, writeUnsignedShort(writeBuffer, 8));
+
+ writeBuffer.popContext("AmsNetId");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ AmsNetId _value = this;
+
+ // Simple field (octet1)
+ lengthInBits += 8;
+
+ // Simple field (octet2)
+ lengthInBits += 8;
+
+ // Simple field (octet3)
+ lengthInBits += 8;
+
+ // Simple field (octet4)
+ lengthInBits += 8;
+
+ // Simple field (octet5)
+ lengthInBits += 8;
+
+ // Simple field (octet6)
+ lengthInBits += 8;
+
+ return lengthInBits;
+ }
+
+ public static AmsNetId staticParse(ReadBuffer readBuffer, Object... args) throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static AmsNetId staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("AmsNetId");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ short octet1 = readSimpleField("octet1", readUnsignedShort(readBuffer, 8));
+
+ short octet2 = readSimpleField("octet2", readUnsignedShort(readBuffer, 8));
+
+ short octet3 = readSimpleField("octet3", readUnsignedShort(readBuffer, 8));
+
+ short octet4 = readSimpleField("octet4", readUnsignedShort(readBuffer, 8));
+
+ short octet5 = readSimpleField("octet5", readUnsignedShort(readBuffer, 8));
+
+ short octet6 = readSimpleField("octet6", readUnsignedShort(readBuffer, 8));
+
+ readBuffer.closeContext("AmsNetId");
+ // Create the instance
+ AmsNetId _amsNetId;
+ _amsNetId = new AmsNetId(octet1, octet2, octet3, octet4, octet5, octet6);
+ return _amsNetId;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AmsNetId)) {
+ return false;
+ }
+ AmsNetId that = (AmsNetId) o;
+ return (getOctet1() == that.getOctet1())
+ && (getOctet2() == that.getOctet2())
+ && (getOctet3() == that.getOctet3())
+ && (getOctet4() == that.getOctet4())
+ && (getOctet5() == that.getOctet5())
+ && (getOctet6() == that.getOctet6())
+ && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(
+ getOctet1(), getOctet2(), getOctet3(), getOctet4(), getOctet5(), getOctet6());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AmsString.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AmsString.java
new file mode 100644
index 0000000000..d6e3464bfc
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/AmsString.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.ads.discovery.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 AmsString implements Message {
+
+ // Properties.
+ protected final String text;
+ // Reserved Fields
+ private Short reservedField0;
+
+ public AmsString(String text) {
+ super();
+ this.text = text;
+ }
+
+ public String getText() {
+ return text;
+ }
+
+ public void serialize(WriteBuffer writeBuffer) throws SerializationException {
+ PositionAware positionAware = writeBuffer;
+ int startPos = positionAware.getPos();
+ writeBuffer.pushContext("AmsString");
+
+ // Implicit Field (strLen) (Used for parsing, but its value is not stored as it's implicitly
+ // given by the objects content)
+ int strLen = (int) ((STR_LEN(getText())) + (1));
+ writeImplicitField("strLen", strLen, writeUnsignedInt(writeBuffer, 16));
+
+ // Simple Field (text)
+ writeSimpleField(
+ "text",
+ text,
+ writeString(writeBuffer, (8) * (((strLen) - (1)))),
+ WithOption.WithEncoding("UTF-8"));
+
+ // Reserved Field (reserved)
+ writeReservedField(
+ "reserved",
+ reservedField0 != null ? reservedField0 : (short) 0x00,
+ writeUnsignedShort(writeBuffer, 8));
+
+ writeBuffer.popContext("AmsString");
+ }
+
+ @Override
+ public int getLengthInBytes() {
+ return (int) Math.ceil((float) getLengthInBits() / 8.0);
+ }
+
+ @Override
+ public int getLengthInBits() {
+ int lengthInBits = 0;
+ AmsString _value = this;
+
+ // Implicit Field (strLen)
+ lengthInBits += 16;
+
+ // Simple field (text)
+ lengthInBits += (8) * ((((STR_LEN(getText())) + (1)) - (1)));
+
+ // Reserved Field (reserved)
+ lengthInBits += 8;
+
+ return lengthInBits;
+ }
+
+ public static AmsString staticParse(ReadBuffer readBuffer, Object... args) throws ParseException {
+ PositionAware positionAware = readBuffer;
+ return staticParse(readBuffer);
+ }
+
+ public static AmsString staticParse(ReadBuffer readBuffer) throws ParseException {
+ readBuffer.pullContext("AmsString");
+ PositionAware positionAware = readBuffer;
+ int startPos = positionAware.getPos();
+ int curPos;
+
+ int strLen = readImplicitField("strLen", readUnsignedInt(readBuffer, 16));
+
+ String text =
+ readSimpleField(
+ "text",
+ readString(readBuffer, (8) * (((strLen) - (1)))),
+ WithOption.WithEncoding("UTF-8"));
+
+ Short reservedField0 =
+ readReservedField("reserved", readUnsignedShort(readBuffer, 8), (short) 0x00);
+
+ readBuffer.closeContext("AmsString");
+ // Create the instance
+ AmsString _amsString;
+ _amsString = new AmsString(text);
+ _amsString.reservedField0 = reservedField0;
+ return _amsString;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ return true;
+ }
+ if (!(o instanceof AmsString)) {
+ return false;
+ }
+ AmsString that = (AmsString) o;
+ return (getText() == that.getText()) && true;
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(getText());
+ }
+
+ @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/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/Operation.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/Operation.java
new file mode 100644
index 0000000000..115f003d4e
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/Operation.java
@@ -0,0 +1,61 @@
+/*
+ * 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.ads.discovery.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum Operation {
+ DISCOVERY_REQUEST((long) 0x00000001L),
+ DISCOVERY_RESPONSE((long) 0x80000001L),
+ ADD_OR_UPDATE_ROUTE_REQUEST((long) 0x00000006L),
+ ADD_OR_UPDATE_ROUTE_RESPONSE((long) 0x80000006L),
+ DEL_ROUTE_REQUEST((long) 0x00000007L),
+ DEL_ROUTE_RESPONSE((long) 0x80000007L),
+ UNKNOWN_REQUEST((long) 0x00000008L),
+ UNKNOWN_RESPONSE((long) 0x80000008L);
+ private static final Map<Long, Operation> map;
+
+ static {
+ map = new HashMap<>();
+ for (Operation value : Operation.values()) {
+ map.put((long) value.getValue(), value);
+ }
+ }
+
+ private long value;
+
+ Operation(long value) {
+ this.value = value;
+ }
+
+ public long getValue() {
+ return value;
+ }
+
+ public static Operation enumForValue(long value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(long value) {
+ return map.containsKey(value);
+ }
+}
diff --git a/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/Status.java b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/Status.java
new file mode 100644
index 0000000000..d8b14c7278
--- /dev/null
+++ b/plc4j/drivers/ads/src/main/generated/org/apache/plc4x/java/ads/discovery/readwrite/Status.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.ads.discovery.readwrite;
+
+import java.util.HashMap;
+import java.util.Map;
+
+// Code generated by code-generation. DO NOT EDIT.
+
+public enum Status {
+ SUCCESS((long) 0x00000000L),
+ FAILURE_INVALID_DATA((long) 0x00000704L),
+ FAILURE_MISSING_DATA((long) 0x00000706L);
+ private static final Map<Long, Status> map;
+
+ static {
+ map = new HashMap<>();
+ for (Status value : Status.values()) {
+ map.put((long) value.getValue(), value);
+ }
+ }
+
+ private long value;
+
+ Status(long value) {
+ this.value = value;
+ }
+
+ public long getValue() {
+ return value;
+ }
+
+ public static Status enumForValue(long value) {
+ return map.get(value);
+ }
+
+ public static Boolean isDefined(long value) {
+ return map.containsKey(value);
+ }
+}