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 2022/08/25 08:32:22 UTC

[plc4x] branch feature/ads-symbol-discovery updated (c6d24a196 -> b288883be)

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a change to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git


    from c6d24a196 chore(plc4net/knx):  Added new manufacturers
     new 42387ce05 chore(protocols/ads):  Added some comments on my recent changes
     new 0cd8dc52c chore(code-gen):  Added support for STR_LEN to the go code-generation.
     new e2c2a90cd chore(code-gen):  Fixed some problems related to using startPos and curPos in expressions
     new d04f12f8a chore(plc4go): Renamed multiple elements: - PLCValueType -> PlcValueType - PlcDiscoveryEvent -> PlcDiscoveryItem
     new b288883be chore(plc4go): Updated the ADS code to match the latest mspec changes

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../language/go/GoLanguageTemplateHelper.java      |  30 +-
 .../templates/go/complex-type-template.go.ftlh     |   7 +-
 plc4go/internal/ads/Reader.go                      |  92 +++--
 plc4go/internal/ads/Writer.go                      |  35 +-
 plc4go/internal/bacnetip/Driver.go                 |   2 +-
 plc4go/internal/cbus/Discoverer.go                 |   2 +-
 plc4go/internal/cbus/Driver.go                     |   4 +-
 plc4go/internal/knxnetip/Driver.go                 |   2 +-
 plc4go/internal/simulated/Driver.go                |   3 +
 plc4go/internal/simulated/Driver_test.go           |   5 +-
 plc4go/pkg/api/driver.go                           |   4 +-
 plc4go/pkg/api/driverManager.go                    |   4 +-
 plc4go/pkg/api/values/plc_value.go                 |   8 +-
 plc4go/protocols/ads/readwrite/model/AdsData.go    | 213 -----------
 .../readwrite/model/AdsDataTypeTableChildEntry.go  |  19 +-
 .../ads/readwrite/model/AdsDataTypeTableEntry.go   |  19 +-
 .../model/AdsSignificantGroupAddresses.go          | 137 -------
 .../ads/readwrite/model/AdsSymbolTableEntry.go     |  19 +-
 plc4go/protocols/ads/readwrite/model/AmsPacket.go  |  16 +-
 plc4go/protocols/ads/readwrite/model/State.go      | 399 ---------------------
 plc4go/protocols/s7/readwrite/model/COTPPacket.go  |   1 +
 plc4go/spi/PlcDiscoverer.go                        |   2 +-
 plc4go/spi/default/DefaultDriver.go                |   2 +-
 plc4go/spi/values/BINT.go                          |   4 +-
 plc4go/spi/values/BOOL.go                          |   4 +-
 plc4go/spi/values/BREAL.go                         |   4 +-
 plc4go/spi/values/BYTE.go                          |   4 +-
 plc4go/spi/values/CHAR.go                          |   4 +-
 plc4go/spi/values/DATE.go                          |   4 +-
 plc4go/spi/values/DATE_AND_TIME.go                 |   4 +-
 plc4go/spi/values/DINT.go                          |   4 +-
 plc4go/spi/values/DWORD.go                         |   4 +-
 plc4go/spi/values/INT.go                           |   4 +-
 plc4go/spi/values/LINT.go                          |   4 +-
 plc4go/spi/values/LREAL.go                         |   4 +-
 plc4go/spi/values/LTIME.go                         |   4 +-
 plc4go/spi/values/LWORD.go                         |   4 +-
 plc4go/spi/values/NULL.go                          |   4 +-
 plc4go/spi/values/PlcBitString.go                  |   2 +-
 plc4go/spi/values/PlcByteArray.go                  |   2 +-
 plc4go/spi/values/PlcList.go                       |   4 +-
 plc4go/spi/values/PlcStruct.go                     |   4 +-
 plc4go/spi/values/PlcValueAdapter.go               |   4 +-
 plc4go/spi/values/REAL.go                          |   4 +-
 plc4go/spi/values/RawPlcValue.go                   |   4 +-
 plc4go/spi/values/SINT.go                          |   4 +-
 plc4go/spi/values/STRING.go                        |   4 +-
 plc4go/spi/values/TIME.go                          |   4 +-
 plc4go/spi/values/TIME_OF_DAY.go                   |   4 +-
 plc4go/spi/values/UDINT.go                         |   4 +-
 plc4go/spi/values/UINT.go                          |   4 +-
 plc4go/spi/values/ULINT.go                         |   4 +-
 plc4go/spi/values/USINT.go                         |   4 +-
 plc4go/spi/values/WCHAR.go                         |   4 +-
 plc4go/spi/values/WORD.go                          |   4 +-
 plc4go/spi/values/WSTRING.go                       |   4 +-
 plc4go/spi/values/value_combination_test.go        |   8 +-
 .../tests/drivers/tests/manual_cbus_driver_test.go |   2 +-
 plc4go/tools/plc4xbrowser/ui/commands.go           |   2 +-
 .../ads/src/main/resources/protocols/ads/ads.mspec |   2 +-
 60 files changed, 224 insertions(+), 943 deletions(-)
 delete mode 100644 plc4go/protocols/ads/readwrite/model/AdsData.go
 delete mode 100644 plc4go/protocols/ads/readwrite/model/AdsSignificantGroupAddresses.go
 delete mode 100644 plc4go/protocols/ads/readwrite/model/State.go


[plc4x] 05/05: chore(plc4go): Updated the ADS code to match the latest mspec changes

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit b288883beb6f40cf034fc4b4ca00a3532036b9b2
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 25 10:32:13 2022 +0200

    chore(plc4go): Updated the ADS code to match the latest mspec changes
---
 plc4go/internal/ads/Reader.go                      |  92 +++--
 plc4go/internal/ads/Writer.go                      |  35 +-
 plc4go/internal/bacnetip/Driver.go                 |   2 +-
 plc4go/internal/cbus/Discoverer.go                 |   2 +-
 plc4go/internal/cbus/Driver.go                     |   4 +-
 plc4go/internal/knxnetip/Driver.go                 |   2 +-
 plc4go/internal/simulated/Driver.go                |   3 +
 plc4go/internal/simulated/Driver_test.go           |   5 +-
 plc4go/protocols/ads/readwrite/model/AdsData.go    | 213 -----------
 .../readwrite/model/AdsDataTypeTableChildEntry.go  |  19 +-
 .../ads/readwrite/model/AdsDataTypeTableEntry.go   |  19 +-
 .../model/AdsSignificantGroupAddresses.go          | 137 -------
 .../ads/readwrite/model/AdsSymbolTableEntry.go     |  19 +-
 plc4go/protocols/ads/readwrite/model/AmsPacket.go  |  16 +-
 plc4go/protocols/ads/readwrite/model/State.go      | 399 ---------------------
 15 files changed, 108 insertions(+), 859 deletions(-)

diff --git a/plc4go/internal/ads/Reader.go b/plc4go/internal/ads/Reader.go
index bc0c0e652..34219d6a1 100644
--- a/plc4go/internal/ads/Reader.go
+++ b/plc4go/internal/ads/Reader.go
@@ -117,17 +117,6 @@ func (m *Reader) singleRead(ctx context.Context, readRequest model.PlcReadReques
 		log.Debug().Msgf("Invalid field item type %T", field)
 		return
 	}
-	userdata := readWriteModel.NewAmsPacket(
-		m.targetAmsNetId,
-		m.targetAmsPort,
-		m.sourceAmsNetId,
-		m.sourceAmsPort,
-		readWriteModel.CommandId_ADS_READ,
-		readWriteModel.NewState(false, false, false, false, false, true, false, false, false),
-		0,
-		0,
-		nil,
-	)
 
 	readLength := uint32(adsField.Datatype.NumBytes())
 	switch {
@@ -148,7 +137,16 @@ func (m *Reader) singleRead(ctx context.Context, readRequest model.PlcReadReques
 	default:
 		readLength = uint32(adsField.Datatype.NumBytes())
 	}
-	userdata.Data = readWriteModel.NewAdsReadRequest(adsField.IndexGroup, adsField.IndexOffset, readLength)
+	userdata := readWriteModel.NewAdsReadRequest(
+		adsField.IndexGroup,
+		adsField.IndexOffset,
+		readLength,
+		m.targetAmsNetId,
+		m.targetAmsPort,
+		m.sourceAmsNetId,
+		m.sourceAmsPort,
+		0,
+		m.getInvokeId())
 
 	m.sendOverTheWire(ctx, userdata, readRequest, result)
 }
@@ -190,18 +188,6 @@ func (m *Reader) multiRead(ctx context.Context, readRequest model.PlcReadRequest
 		expectedResponseDataSize += 4 + (size * field.GetNumberOfElements())
 	}
 
-	userdata := readWriteModel.NewAmsPacket(
-		m.targetAmsNetId,
-		m.targetAmsPort,
-		m.sourceAmsNetId,
-		m.sourceAmsPort,
-		readWriteModel.CommandId_ADS_READ_WRITE,
-		readWriteModel.NewState(false, false, false, false, false, true, false, false, false),
-		0,
-		0,
-		nil,
-	)
-
 	items := make([]readWriteModel.AdsMultiRequestItem, len(readRequest.GetFieldNames()))
 	for i, fieldName := range readRequest.GetFieldNames() {
 		field := readRequest.GetField(fieldName)
@@ -240,7 +226,18 @@ func (m *Reader) multiRead(ctx context.Context, readRequest model.PlcReadRequest
 		// With multi-requests, the index-group is fixed and the index offset indicates the number of elements.
 		items[i] = readWriteModel.NewAdsMultiRequestItemRead(adsField.IndexGroup, adsField.IndexOffset, uint32(adsField.GetDatatype().NumBytes())*adsField.NumberOfElements)
 	}
-	userdata.Data = readWriteModel.NewAdsReadWriteRequest(uint32(readWriteModel.ReservedIndexGroups_ADSIGRP_MULTIPLE_READ), uint32(len(readRequest.GetFieldNames())), expectedResponseDataSize, items, nil)
+	userdata := readWriteModel.NewAdsReadWriteRequest(
+		uint32(readWriteModel.ReservedIndexGroups_ADSIGRP_MULTIPLE_READ),
+		uint32(len(readRequest.GetFieldNames())),
+		expectedResponseDataSize,
+		items,
+		nil,
+		m.targetAmsNetId,
+		m.targetAmsPort,
+		m.sourceAmsNetId,
+		m.sourceAmsPort,
+		0,
+		m.getInvokeId())
 
 	m.sendOverTheWire(ctx, userdata, readRequest, result)
 }
@@ -253,17 +250,6 @@ func (m *Reader) sendOverTheWire(ctx context.Context, userdata readWriteModel.Am
 		atomic.StoreUint32(&m.transactionIdentifier, 1)
 	}
 	log.Debug().Msgf("Calculated transaction identifier %x", transactionIdentifier)
-	userdata = readWriteModel.NewAmsPacket(
-		userdata.GetTargetAmsNetId(),
-		userdata.GetTargetAmsPort(),
-		userdata.GetSourceAmsNetId(),
-		userdata.GetSourceAmsPort(),
-		userdata.GetCommandId(),
-		userdata.GetState(),
-		userdata.GetErrorCode(),
-		transactionIdentifier,
-		userdata.GetData(),
-	)
 
 	// Assemble the finished tcp paket
 	log.Trace().Msg("Assemble tcp paket")
@@ -320,24 +306,18 @@ func (m *Reader) resolveField(ctx context.Context, symbolicField SymbolicPlcFiel
 	if directPlcField, ok := m.fieldMapping[symbolicField]; ok {
 		return directPlcField, nil
 	}
-	userdata := readWriteModel.NewAmsPacket(
-		m.targetAmsNetId,
-		m.targetAmsPort,
-		m.sourceAmsNetId,
-		m.sourceAmsPort,
-		readWriteModel.CommandId_ADS_READ_WRITE,
-		readWriteModel.NewState(false, false, false, false, false, true, false, false, false),
-		0,
-		0,
-		nil,
-	)
-	userdata.Data = readWriteModel.NewAdsReadWriteRequest(
+	userdata := readWriteModel.NewAdsReadWriteRequest(
 		uint32(readWriteModel.ReservedIndexGroups_ADSIGRP_SYM_HNDBYNAME),
 		0,
 		4,
 		nil,
 		[]byte(symbolicField.SymbolicAddress+"\000"),
-	)
+		m.targetAmsNetId,
+		m.targetAmsPort,
+		m.sourceAmsNetId,
+		m.sourceAmsPort,
+		0,
+		m.getInvokeId())
 	result := make(chan model.PlcReadRequestResult)
 	go func() {
 		dummyRequest := plc4goModel.NewDefaultPlcReadRequest(map[string]model.PlcField{"dummy": DirectPlcField{PlcField: PlcField{Datatype: readWriteModel.AdsDataType_UINT32}}}, []string{"dummy"}, nil, nil)
@@ -372,7 +352,7 @@ func (m *Reader) resolveField(ctx context.Context, symbolicField SymbolicPlcFiel
 func (m *Reader) ToPlc4xReadResponse(amsTcpPaket readWriteModel.AmsTCPPacket, readRequest model.PlcReadRequest) (model.PlcReadResponse, error) {
 	var rb utils.ReadBuffer
 	responseCodes := map[string]model.PlcResponseCode{}
-	switch data := amsTcpPaket.GetUserdata().GetData().(type) {
+	switch data := amsTcpPaket.GetUserdata().(type) {
 	case readWriteModel.AdsReadResponse:
 		rb = utils.NewLittleEndianReadBufferByteBased(data.GetData())
 		for _, fieldName := range readRequest.GetFieldNames() {
@@ -418,7 +398,7 @@ func (m *Reader) ToPlc4xReadResponse(amsTcpPaket readWriteModel.AmsTCPPacket, re
 
 		// Decode the data according to the information from the request
 		log.Trace().Msg("decode data")
-		value, err := readWriteModel.DataItemParse(rb, field.GetDatatype().DataFormatName(), field.GetStringLength())
+		value, err := readWriteModel.DataItemParse(rb, field.GetDatatype().PlcValueType(), field.GetStringLength())
 		if err != nil {
 			log.Error().Err(err).Msg("Error parsing data item")
 			responseCodes[fieldName] = model.PlcResponseCode_INTERNAL_ERROR
@@ -432,3 +412,13 @@ func (m *Reader) ToPlc4xReadResponse(amsTcpPaket readWriteModel.AmsTCPPacket, re
 	log.Trace().Msg("Returning the response")
 	return plc4goModel.NewDefaultPlcReadResponse(readRequest, responseCodes, plcValues), nil
 }
+
+func (m *Reader) getInvokeId() uint32 {
+	// Calculate a new transaction identifier
+	transactionIdentifier := atomic.AddUint32(&m.transactionIdentifier, 1)
+	if transactionIdentifier > math.MaxUint8 {
+		transactionIdentifier = 1
+		atomic.StoreUint32(&m.transactionIdentifier, 1)
+	}
+	return transactionIdentifier
+}
diff --git a/plc4go/internal/ads/Writer.go b/plc4go/internal/ads/Writer.go
index a6f5ba200..7e8ea5d4c 100644
--- a/plc4go/internal/ads/Writer.go
+++ b/plc4go/internal/ads/Writer.go
@@ -30,7 +30,6 @@ import (
 	"github.com/rs/zerolog/log"
 	"math"
 	"sync/atomic"
-	"time"
 )
 
 type Writer struct {
@@ -107,7 +106,7 @@ func (m *Writer) Write(ctx context.Context, writeRequest model.PlcWriteRequest)
 		// Get the value from the request and serialize it to a byte array
 		value := writeRequest.GetValue(fieldName)
 		io := utils.NewLittleEndianWriteBufferByteBased()
-		if err := readWriteModel.DataItemSerialize(io, value, adsField.Datatype.DataFormatName(), adsField.StringLength); err != nil {
+		if err := readWriteModel.DataItemSerialize(io, value, adsField.Datatype.PlcValueType(), adsField.StringLength); err != nil {
 			result <- &plc4goModel.DefaultPlcWriteRequestResult{
 				Request:  writeRequest,
 				Response: nil,
@@ -115,7 +114,7 @@ func (m *Writer) Write(ctx context.Context, writeRequest model.PlcWriteRequest)
 			}
 			return
 		}
-		data := io.GetBytes()
+		/*data := io.GetBytes()
 
 		userdata := readWriteModel.NewAmsPacket(
 			m.targetAmsNetId,
@@ -127,10 +126,10 @@ func (m *Writer) Write(ctx context.Context, writeRequest model.PlcWriteRequest)
 			0,
 			0,
 			nil,
-		)
+		)*/
 		switch adsField.FieldType {
 		case DirectAdsStringField:
-			userdata.Data = readWriteModel.NewAdsWriteRequest(adsField.IndexGroup, adsField.IndexOffset, data)
+			//userdata.Data = readWriteModel.NewAdsWriteRequest(adsField.IndexGroup, adsField.IndexOffset, data)
 			panic("implement me")
 		case DirectAdsField:
 			panic("implement me")
@@ -146,13 +145,7 @@ func (m *Writer) Write(ctx context.Context, writeRequest model.PlcWriteRequest)
 		}
 
 		// Calculate a new unit identifier
-		// TODO: this is not threadsafe as the whole operation is not atomic
-		transactionIdentifier := atomic.AddUint32(&m.transactionIdentifier, 1)
-		if transactionIdentifier > math.MaxUint8 {
-			transactionIdentifier = 0
-			atomic.StoreUint32(&m.transactionIdentifier, 0)
-		}
-		userdata.InvokeId = transactionIdentifier
+		/*userdata.InvokeId = m.getInvokeId()
 
 		// Assemble the finished amsTcpPaket
 		log.Trace().Msg("Assemble amsTcpPaket")
@@ -186,7 +179,7 @@ func (m *Writer) Write(ctx context.Context, writeRequest model.PlcWriteRequest)
 				Err:     errors.New("got timeout while waiting for response"),
 			}
 			return nil
-		}, time.Second*1)
+		}, time.Second*1)*/
 	}()
 	return result
 }
@@ -197,15 +190,25 @@ func (m *Writer) ToPlc4xWriteResponse(requestTcpPaket readWriteModel.AmsTCPPacke
 
 	// we default to an error until its proven wrong
 	responseCodes[fieldName] = model.PlcResponseCode_INTERNAL_ERROR
-	switch responseTcpPaket.GetUserdata().GetData().(type) {
+	switch responseTcpPaket.GetUserdata().(type) {
 	case readWriteModel.AdsWriteResponse:
-		resp := readWriteModel.CastAdsWriteResponse(responseTcpPaket.GetUserdata().GetData())
+		resp := readWriteModel.CastAdsWriteResponse(responseTcpPaket.GetUserdata())
 		responseCodes[fieldName] = model.PlcResponseCode(resp.GetResult())
 	default:
-		return nil, errors.Errorf("unsupported response type %T", responseTcpPaket.GetUserdata().GetData())
+		return nil, errors.Errorf("unsupported response type %T", responseTcpPaket.GetUserdata())
 	}
 
 	// Return the response
 	log.Trace().Msg("Returning the response")
 	return plc4goModel.NewDefaultPlcWriteResponse(writeRequest, responseCodes), nil
 }
+
+func (m *Writer) getInvokeId() uint32 {
+	// Calculate a new transaction identifier
+	transactionIdentifier := atomic.AddUint32(&m.transactionIdentifier, 1)
+	if transactionIdentifier > math.MaxUint8 {
+		transactionIdentifier = 1
+		atomic.StoreUint32(&m.transactionIdentifier, 1)
+	}
+	return transactionIdentifier
+}
diff --git a/plc4go/internal/bacnetip/Driver.go b/plc4go/internal/bacnetip/Driver.go
index f9d40dd7e..33c9d5e24 100644
--- a/plc4go/internal/bacnetip/Driver.go
+++ b/plc4go/internal/bacnetip/Driver.go
@@ -138,6 +138,6 @@ func (m *Driver) Discover(callback func(event apiModel.PlcDiscoveryItem), discov
 	return m.DiscoverWithContext(context.TODO(), callback, discoveryOptions...)
 }
 
-func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error {
+func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error {
 	return NewDiscoverer().Discover(ctx, callback, discoveryOptions...)
 }
diff --git a/plc4go/internal/cbus/Discoverer.go b/plc4go/internal/cbus/Discoverer.go
index 3ef576304..a3826fcbb 100644
--- a/plc4go/internal/cbus/Discoverer.go
+++ b/plc4go/internal/cbus/Discoverer.go
@@ -47,7 +47,7 @@ func NewDiscoverer() *Discoverer {
 	return &Discoverer{}
 }
 
-func (d *Discoverer) Discover(ctx context.Context, callback func(event apiModel.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error {
+func (d *Discoverer) Discover(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error {
 	tcpTransport := tcp.NewTransport()
 
 	allInterfaces, err := net.Interfaces()
diff --git a/plc4go/internal/cbus/Driver.go b/plc4go/internal/cbus/Driver.go
index 1e7786905..97cb28f77 100644
--- a/plc4go/internal/cbus/Driver.go
+++ b/plc4go/internal/cbus/Driver.go
@@ -118,10 +118,10 @@ func (m *Driver) SupportsDiscovery() bool {
 	return true
 }
 
-func (m *Driver) Discover(callback func(event apiModel.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error {
+func (m *Driver) Discover(callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error {
 	return m.DiscoverWithContext(context.TODO(), callback, discoveryOptions...)
 }
 
-func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error {
+func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error {
 	return NewDiscoverer().Discover(ctx, callback, discoveryOptions...)
 }
diff --git a/plc4go/internal/knxnetip/Driver.go b/plc4go/internal/knxnetip/Driver.go
index 60deb4fb9..f4405e80b 100644
--- a/plc4go/internal/knxnetip/Driver.go
+++ b/plc4go/internal/knxnetip/Driver.go
@@ -82,6 +82,6 @@ func (m *Driver) Discover(callback func(event apiModel.PlcDiscoveryItem), discov
 	return m.DiscoverWithContext(context.TODO(), callback, discoveryOptions...)
 }
 
-func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error {
+func (m *Driver) DiscoverWithContext(ctx context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error {
 	return NewDiscoverer().Discover(ctx, callback, discoveryOptions...)
 }
diff --git a/plc4go/internal/simulated/Driver.go b/plc4go/internal/simulated/Driver.go
index 2026bbc35..b5f91e8ed 100644
--- a/plc4go/internal/simulated/Driver.go
+++ b/plc4go/internal/simulated/Driver.go
@@ -21,8 +21,11 @@ package simulated
 
 import (
 	"github.com/apache/plc4x/plc4go/pkg/api"
+	"github.com/apache/plc4x/plc4go/pkg/api/model"
 	_default "github.com/apache/plc4x/plc4go/spi/default"
+	"github.com/apache/plc4x/plc4go/spi/options"
 	"github.com/apache/plc4x/plc4go/spi/transports"
+	"github.com/pkg/errors"
 	"net/url"
 )
 
diff --git a/plc4go/internal/simulated/Driver_test.go b/plc4go/internal/simulated/Driver_test.go
index 87f5aa4b1..c23404084 100644
--- a/plc4go/internal/simulated/Driver_test.go
+++ b/plc4go/internal/simulated/Driver_test.go
@@ -20,6 +20,8 @@
 package simulated
 
 import (
+	"github.com/apache/plc4x/plc4go/pkg/api/model"
+	"github.com/apache/plc4x/plc4go/spi/options"
 	"github.com/apache/plc4x/plc4go/spi/transports"
 	"github.com/apache/plc4x/plc4go/spi/utils"
 	"net/url"
@@ -56,7 +58,6 @@ func TestDriver_CheckQuery(t *testing.T) {
 
 func TestDriver_Discover(t *testing.T) {
 	type fields struct {
-		fieldHandler FieldHandler
 		valueHandler ValueHandler
 	}
 	type args struct {
@@ -72,7 +73,6 @@ func TestDriver_Discover(t *testing.T) {
 		{
 			name: "discovery fails",
 			fields: fields{
-				fieldHandler: NewFieldHandler(),
 				valueHandler: NewValueHandler(),
 			},
 			args: args{
@@ -86,7 +86,6 @@ func TestDriver_Discover(t *testing.T) {
 	for _, tt := range tests {
 		t.Run(tt.name, func(t *testing.T) {
 			d := &Driver{
-				fieldHandler: tt.fields.fieldHandler,
 				valueHandler: tt.fields.valueHandler,
 			}
 			if err := d.Discover(tt.args.callback, tt.args.discoveryOptions...); (err != nil) != tt.wantErr {
diff --git a/plc4go/protocols/ads/readwrite/model/AdsData.go b/plc4go/protocols/ads/readwrite/model/AdsData.go
deleted file mode 100644
index f0217f62f..000000000
--- a/plc4go/protocols/ads/readwrite/model/AdsData.go
+++ /dev/null
@@ -1,213 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package model
-
-import (
-	"github.com/apache/plc4x/plc4go/spi/utils"
-	"github.com/pkg/errors"
-)
-
-// Code generated by code-generation. DO NOT EDIT.
-
-// AdsData is the corresponding interface of AdsData
-type AdsData interface {
-	utils.LengthAware
-	utils.Serializable
-	// GetCommandId returns CommandId (discriminator field)
-	GetCommandId() CommandId
-	// GetResponse returns Response (discriminator field)
-	GetResponse() bool
-}
-
-// AdsDataExactly can be used when we want exactly this type and not a type which fulfills AdsData.
-// This is useful for switch cases.
-type AdsDataExactly interface {
-	AdsData
-	isAdsData() bool
-}
-
-// _AdsData is the data-structure of this message
-type _AdsData struct {
-	_AdsDataChildRequirements
-}
-
-type _AdsDataChildRequirements interface {
-	utils.Serializable
-	GetLengthInBits() uint16
-	GetLengthInBitsConditional(lastItem bool) uint16
-	GetCommandId() CommandId
-	GetResponse() bool
-}
-
-type AdsDataParent interface {
-	SerializeParent(writeBuffer utils.WriteBuffer, child AdsData, serializeChildFunction func() error) error
-	GetTypeName() string
-}
-
-type AdsDataChild interface {
-	utils.Serializable
-	InitializeParent(parent AdsData)
-	GetParent() *AdsData
-
-	GetTypeName() string
-	AdsData
-}
-
-// NewAdsData factory function for _AdsData
-func NewAdsData() *_AdsData {
-	return &_AdsData{}
-}
-
-// Deprecated: use the interface for direct cast
-func CastAdsData(structType interface{}) AdsData {
-	if casted, ok := structType.(AdsData); ok {
-		return casted
-	}
-	if casted, ok := structType.(*AdsData); ok {
-		return *casted
-	}
-	return nil
-}
-
-func (m *_AdsData) GetTypeName() string {
-	return "AdsData"
-}
-
-func (m *_AdsData) GetParentLengthInBits() uint16 {
-	lengthInBits := uint16(0)
-
-	return lengthInBits
-}
-
-func (m *_AdsData) GetLengthInBytes() uint16 {
-	return m.GetLengthInBits() / 8
-}
-
-func AdsDataParse(readBuffer utils.ReadBuffer, commandId CommandId, response bool) (AdsData, error) {
-	positionAware := readBuffer
-	_ = positionAware
-	if pullErr := readBuffer.PullContext("AdsData"); pullErr != nil {
-		return nil, errors.Wrap(pullErr, "Error pulling for AdsData")
-	}
-	currentPos := positionAware.GetPos()
-	_ = currentPos
-
-	// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
-	type AdsDataChildSerializeRequirement interface {
-		AdsData
-		InitializeParent(AdsData)
-		GetParent() AdsData
-	}
-	var _childTemp interface{}
-	var _child AdsDataChildSerializeRequirement
-	var typeSwitchError error
-	switch {
-	case commandId == CommandId_INVALID && response == bool(false): // AdsInvalidRequest
-		_childTemp, typeSwitchError = AdsInvalidRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_INVALID && response == bool(true): // AdsInvalidResponse
-		_childTemp, typeSwitchError = AdsInvalidResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ_DEVICE_INFO && response == bool(false): // AdsReadDeviceInfoRequest
-		_childTemp, typeSwitchError = AdsReadDeviceInfoRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ_DEVICE_INFO && response == bool(true): // AdsReadDeviceInfoResponse
-		_childTemp, typeSwitchError = AdsReadDeviceInfoResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ && response == bool(false): // AdsReadRequest
-		_childTemp, typeSwitchError = AdsReadRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ && response == bool(true): // AdsReadResponse
-		_childTemp, typeSwitchError = AdsReadResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_WRITE && response == bool(false): // AdsWriteRequest
-		_childTemp, typeSwitchError = AdsWriteRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_WRITE && response == bool(true): // AdsWriteResponse
-		_childTemp, typeSwitchError = AdsWriteResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ_STATE && response == bool(false): // AdsReadStateRequest
-		_childTemp, typeSwitchError = AdsReadStateRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ_STATE && response == bool(true): // AdsReadStateResponse
-		_childTemp, typeSwitchError = AdsReadStateResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_WRITE_CONTROL && response == bool(false): // AdsWriteControlRequest
-		_childTemp, typeSwitchError = AdsWriteControlRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_WRITE_CONTROL && response == bool(true): // AdsWriteControlResponse
-		_childTemp, typeSwitchError = AdsWriteControlResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_ADD_DEVICE_NOTIFICATION && response == bool(false): // AdsAddDeviceNotificationRequest
-		_childTemp, typeSwitchError = AdsAddDeviceNotificationRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_ADD_DEVICE_NOTIFICATION && response == bool(true): // AdsAddDeviceNotificationResponse
-		_childTemp, typeSwitchError = AdsAddDeviceNotificationResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_DELETE_DEVICE_NOTIFICATION && response == bool(false): // AdsDeleteDeviceNotificationRequest
-		_childTemp, typeSwitchError = AdsDeleteDeviceNotificationRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_DELETE_DEVICE_NOTIFICATION && response == bool(true): // AdsDeleteDeviceNotificationResponse
-		_childTemp, typeSwitchError = AdsDeleteDeviceNotificationResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_DEVICE_NOTIFICATION && response == bool(false): // AdsDeviceNotificationRequest
-		_childTemp, typeSwitchError = AdsDeviceNotificationRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_DEVICE_NOTIFICATION && response == bool(true): // AdsDeviceNotificationResponse
-		_childTemp, typeSwitchError = AdsDeviceNotificationResponseParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ_WRITE && response == bool(false): // AdsReadWriteRequest
-		_childTemp, typeSwitchError = AdsReadWriteRequestParse(readBuffer, commandId, response)
-	case commandId == CommandId_ADS_READ_WRITE && response == bool(true): // AdsReadWriteResponse
-		_childTemp, typeSwitchError = AdsReadWriteResponseParse(readBuffer, commandId, response)
-	default:
-		typeSwitchError = errors.Errorf("Unmapped type for parameters [commandId=%v, response=%v]", commandId, response)
-	}
-	if typeSwitchError != nil {
-		return nil, errors.Wrap(typeSwitchError, "Error parsing sub-type for type-switch of AdsData")
-	}
-	_child = _childTemp.(AdsDataChildSerializeRequirement)
-
-	if closeErr := readBuffer.CloseContext("AdsData"); closeErr != nil {
-		return nil, errors.Wrap(closeErr, "Error closing for AdsData")
-	}
-
-	// Finish initializing
-	_child.InitializeParent(_child)
-	return _child, nil
-}
-
-func (pm *_AdsData) SerializeParent(writeBuffer utils.WriteBuffer, child AdsData, serializeChildFunction func() error) error {
-	// We redirect all calls through client as some methods are only implemented there
-	m := child
-	_ = m
-	positionAware := writeBuffer
-	_ = positionAware
-	if pushErr := writeBuffer.PushContext("AdsData"); pushErr != nil {
-		return errors.Wrap(pushErr, "Error pushing for AdsData")
-	}
-
-	// Switch field (Depending on the discriminator values, passes the serialization to a sub-type)
-	if _typeSwitchErr := serializeChildFunction(); _typeSwitchErr != nil {
-		return errors.Wrap(_typeSwitchErr, "Error serializing sub-type field")
-	}
-
-	if popErr := writeBuffer.PopContext("AdsData"); popErr != nil {
-		return errors.Wrap(popErr, "Error popping for AdsData")
-	}
-	return nil
-}
-
-func (m *_AdsData) isAdsData() bool {
-	return true
-}
-
-func (m *_AdsData) 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/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go
index 7027cfe57..56b52de22 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableChildEntry.go
@@ -259,19 +259,19 @@ func (m *_AdsDataTypeTableChildEntry) GetLengthInBitsConditional(lastItem bool)
 	lengthInBits += 16
 
 	// Simple field (propertyName)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetPropertyName())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetPropertyName()))) * int32(int32(8)))
 
 	// Const Field (propertyNameTerminator)
 	lengthInBits += 8
 
 	// Simple field (dataTypeName)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetDataTypeName())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetDataTypeName()))) * int32(int32(8)))
 
 	// Const Field (dataTypeNameTerminator)
 	lengthInBits += 8
 
 	// Simple field (comment)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetComment())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetComment()))) * int32(int32(8)))
 
 	// Const Field (commentTerminator)
 	lengthInBits += 8
@@ -313,6 +313,7 @@ func AdsDataTypeTableChildEntryParse(readBuffer utils.ReadBuffer) (AdsDataTypeTa
 	currentPos := positionAware.GetPos()
 	_ = currentPos
 	var startPos = positionAware.GetPos()
+	_ = startPos
 	var curPos uint16
 
 	// Simple Field (entryLength)
@@ -595,21 +596,21 @@ func (m *_AdsDataTypeTableChildEntry) Serialize(writeBuffer utils.WriteBuffer) e
 	}
 
 	// Implicit Field (propertyNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	propertyNameLength := uint16(GetSTR_LEN()(m.GetPropertyName()))
+	propertyNameLength := uint16(uint16(len(m.GetPropertyName())))
 	_propertyNameLengthErr := writeBuffer.WriteUint16("propertyNameLength", 16, (propertyNameLength))
 	if _propertyNameLengthErr != nil {
 		return errors.Wrap(_propertyNameLengthErr, "Error serializing 'propertyNameLength' field")
 	}
 
 	// Implicit Field (dataTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	dataTypeNameLength := uint16(GetSTR_LEN()(m.GetDataTypeName()))
+	dataTypeNameLength := uint16(uint16(len(m.GetDataTypeName())))
 	_dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, (dataTypeNameLength))
 	if _dataTypeNameLengthErr != nil {
 		return errors.Wrap(_dataTypeNameLengthErr, "Error serializing 'dataTypeNameLength' field")
 	}
 
 	// Implicit Field (commentLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	commentLength := uint16(GetSTR_LEN()(m.GetComment()))
+	commentLength := uint16(uint16(len(m.GetComment())))
 	_commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, (commentLength))
 	if _commentLengthErr != nil {
 		return errors.Wrap(_commentLengthErr, "Error serializing 'commentLength' field")
@@ -631,7 +632,7 @@ func (m *_AdsDataTypeTableChildEntry) Serialize(writeBuffer utils.WriteBuffer) e
 
 	// Simple Field (propertyName)
 	propertyName := string(m.GetPropertyName())
-	_propertyNameErr := writeBuffer.WriteString("propertyName", uint32((GetSTR_LEN()(m.GetPropertyName()))*(8)), "UTF-8", (propertyName))
+	_propertyNameErr := writeBuffer.WriteString("propertyName", uint32((uint16(len(m.GetPropertyName())))*(8)), "UTF-8", (propertyName))
 	if _propertyNameErr != nil {
 		return errors.Wrap(_propertyNameErr, "Error serializing 'propertyName' field")
 	}
@@ -644,7 +645,7 @@ func (m *_AdsDataTypeTableChildEntry) Serialize(writeBuffer utils.WriteBuffer) e
 
 	// Simple Field (dataTypeName)
 	dataTypeName := string(m.GetDataTypeName())
-	_dataTypeNameErr := writeBuffer.WriteString("dataTypeName", uint32((GetSTR_LEN()(m.GetDataTypeName()))*(8)), "UTF-8", (dataTypeName))
+	_dataTypeNameErr := writeBuffer.WriteString("dataTypeName", uint32((uint16(len(m.GetDataTypeName())))*(8)), "UTF-8", (dataTypeName))
 	if _dataTypeNameErr != nil {
 		return errors.Wrap(_dataTypeNameErr, "Error serializing 'dataTypeName' field")
 	}
@@ -657,7 +658,7 @@ func (m *_AdsDataTypeTableChildEntry) Serialize(writeBuffer utils.WriteBuffer) e
 
 	// Simple Field (comment)
 	comment := string(m.GetComment())
-	_commentErr := writeBuffer.WriteString("comment", uint32((GetSTR_LEN()(m.GetComment()))*(8)), "UTF-8", (comment))
+	_commentErr := writeBuffer.WriteString("comment", uint32((uint16(len(m.GetComment())))*(8)), "UTF-8", (comment))
 	if _commentErr != nil {
 		return errors.Wrap(_commentErr, "Error serializing 'comment' field")
 	}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go
index 173141ed8..2f3dae2bc 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsDataTypeTableEntry.go
@@ -259,19 +259,19 @@ func (m *_AdsDataTypeTableEntry) GetLengthInBitsConditional(lastItem bool) uint1
 	lengthInBits += 16
 
 	// Simple field (dataTypeName)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetDataTypeName())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetDataTypeName()))) * int32(int32(8)))
 
 	// Const Field (dataTypeNameTerminator)
 	lengthInBits += 8
 
 	// Simple field (simpleTypeName)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetSimpleTypeName())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetSimpleTypeName()))) * int32(int32(8)))
 
 	// Const Field (simpleTypeNameTerminator)
 	lengthInBits += 8
 
 	// Simple field (comment)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetComment())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetComment()))) * int32(int32(8)))
 
 	// Const Field (commentTerminator)
 	lengthInBits += 8
@@ -313,6 +313,7 @@ func AdsDataTypeTableEntryParse(readBuffer utils.ReadBuffer) (AdsDataTypeTableEn
 	currentPos := positionAware.GetPos()
 	_ = currentPos
 	var startPos = positionAware.GetPos()
+	_ = startPos
 	var curPos uint16
 
 	// Simple Field (entryLength)
@@ -595,21 +596,21 @@ func (m *_AdsDataTypeTableEntry) Serialize(writeBuffer utils.WriteBuffer) error
 	}
 
 	// Implicit Field (dataTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	dataTypeNameLength := uint16(GetSTR_LEN()(m.GetDataTypeName()))
+	dataTypeNameLength := uint16(uint16(len(m.GetDataTypeName())))
 	_dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, (dataTypeNameLength))
 	if _dataTypeNameLengthErr != nil {
 		return errors.Wrap(_dataTypeNameLengthErr, "Error serializing 'dataTypeNameLength' field")
 	}
 
 	// Implicit Field (simpleTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	simpleTypeNameLength := uint16(GetSTR_LEN()(m.GetSimpleTypeName()))
+	simpleTypeNameLength := uint16(uint16(len(m.GetSimpleTypeName())))
 	_simpleTypeNameLengthErr := writeBuffer.WriteUint16("simpleTypeNameLength", 16, (simpleTypeNameLength))
 	if _simpleTypeNameLengthErr != nil {
 		return errors.Wrap(_simpleTypeNameLengthErr, "Error serializing 'simpleTypeNameLength' field")
 	}
 
 	// Implicit Field (commentLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	commentLength := uint16(GetSTR_LEN()(m.GetComment()))
+	commentLength := uint16(uint16(len(m.GetComment())))
 	_commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, (commentLength))
 	if _commentLengthErr != nil {
 		return errors.Wrap(_commentLengthErr, "Error serializing 'commentLength' field")
@@ -631,7 +632,7 @@ func (m *_AdsDataTypeTableEntry) Serialize(writeBuffer utils.WriteBuffer) error
 
 	// Simple Field (dataTypeName)
 	dataTypeName := string(m.GetDataTypeName())
-	_dataTypeNameErr := writeBuffer.WriteString("dataTypeName", uint32((GetSTR_LEN()(m.GetDataTypeName()))*(8)), "UTF-8", (dataTypeName))
+	_dataTypeNameErr := writeBuffer.WriteString("dataTypeName", uint32((uint16(len(m.GetDataTypeName())))*(8)), "UTF-8", (dataTypeName))
 	if _dataTypeNameErr != nil {
 		return errors.Wrap(_dataTypeNameErr, "Error serializing 'dataTypeName' field")
 	}
@@ -644,7 +645,7 @@ func (m *_AdsDataTypeTableEntry) Serialize(writeBuffer utils.WriteBuffer) error
 
 	// Simple Field (simpleTypeName)
 	simpleTypeName := string(m.GetSimpleTypeName())
-	_simpleTypeNameErr := writeBuffer.WriteString("simpleTypeName", uint32((GetSTR_LEN()(m.GetSimpleTypeName()))*(8)), "UTF-8", (simpleTypeName))
+	_simpleTypeNameErr := writeBuffer.WriteString("simpleTypeName", uint32((uint16(len(m.GetSimpleTypeName())))*(8)), "UTF-8", (simpleTypeName))
 	if _simpleTypeNameErr != nil {
 		return errors.Wrap(_simpleTypeNameErr, "Error serializing 'simpleTypeName' field")
 	}
@@ -657,7 +658,7 @@ func (m *_AdsDataTypeTableEntry) Serialize(writeBuffer utils.WriteBuffer) error
 
 	// Simple Field (comment)
 	comment := string(m.GetComment())
-	_commentErr := writeBuffer.WriteString("comment", uint32((GetSTR_LEN()(m.GetComment()))*(8)), "UTF-8", (comment))
+	_commentErr := writeBuffer.WriteString("comment", uint32((uint16(len(m.GetComment())))*(8)), "UTF-8", (comment))
 	if _commentErr != nil {
 		return errors.Wrap(_commentErr, "Error serializing 'comment' field")
 	}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsSignificantGroupAddresses.go b/plc4go/protocols/ads/readwrite/model/AdsSignificantGroupAddresses.go
deleted file mode 100644
index d4ef38d20..000000000
--- a/plc4go/protocols/ads/readwrite/model/AdsSignificantGroupAddresses.go
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package model
-
-import (
-	"github.com/apache/plc4x/plc4go/spi/utils"
-	"github.com/pkg/errors"
-	"github.com/rs/zerolog/log"
-)
-
-// Code generated by code-generation. DO NOT EDIT.
-
-// AdsSignificantGroupAddresses is an enum
-type AdsSignificantGroupAddresses uint32
-
-type IAdsSignificantGroupAddresses interface {
-	Serialize(writeBuffer utils.WriteBuffer) error
-}
-
-const (
-	AdsSignificantGroupAddresses_SYMBOL_TABLE    AdsSignificantGroupAddresses = 0x0000F00B
-	AdsSignificantGroupAddresses_DATA_TYPE_TABLE AdsSignificantGroupAddresses = 0x0000F00E
-	AdsSignificantGroupAddresses_TABLE_SIZES     AdsSignificantGroupAddresses = 0x0000F00F
-)
-
-var AdsSignificantGroupAddressesValues []AdsSignificantGroupAddresses
-
-func init() {
-	_ = errors.New
-	AdsSignificantGroupAddressesValues = []AdsSignificantGroupAddresses{
-		AdsSignificantGroupAddresses_SYMBOL_TABLE,
-		AdsSignificantGroupAddresses_DATA_TYPE_TABLE,
-		AdsSignificantGroupAddresses_TABLE_SIZES,
-	}
-}
-
-func AdsSignificantGroupAddressesByValue(value uint32) (enum AdsSignificantGroupAddresses, ok bool) {
-	switch value {
-	case 0x0000F00B:
-		return AdsSignificantGroupAddresses_SYMBOL_TABLE, true
-	case 0x0000F00E:
-		return AdsSignificantGroupAddresses_DATA_TYPE_TABLE, true
-	case 0x0000F00F:
-		return AdsSignificantGroupAddresses_TABLE_SIZES, true
-	}
-	return 0, false
-}
-
-func AdsSignificantGroupAddressesByName(value string) (enum AdsSignificantGroupAddresses, ok bool) {
-	switch value {
-	case "SYMBOL_TABLE":
-		return AdsSignificantGroupAddresses_SYMBOL_TABLE, true
-	case "DATA_TYPE_TABLE":
-		return AdsSignificantGroupAddresses_DATA_TYPE_TABLE, true
-	case "TABLE_SIZES":
-		return AdsSignificantGroupAddresses_TABLE_SIZES, true
-	}
-	return 0, false
-}
-
-func AdsSignificantGroupAddressesKnows(value uint32) bool {
-	for _, typeValue := range AdsSignificantGroupAddressesValues {
-		if uint32(typeValue) == value {
-			return true
-		}
-	}
-	return false
-}
-
-func CastAdsSignificantGroupAddresses(structType interface{}) AdsSignificantGroupAddresses {
-	castFunc := func(typ interface{}) AdsSignificantGroupAddresses {
-		if sAdsSignificantGroupAddresses, ok := typ.(AdsSignificantGroupAddresses); ok {
-			return sAdsSignificantGroupAddresses
-		}
-		return 0
-	}
-	return castFunc(structType)
-}
-
-func (m AdsSignificantGroupAddresses) GetLengthInBits() uint16 {
-	return 32
-}
-
-func (m AdsSignificantGroupAddresses) GetLengthInBytes() uint16 {
-	return m.GetLengthInBits() / 8
-}
-
-func AdsSignificantGroupAddressesParse(readBuffer utils.ReadBuffer) (AdsSignificantGroupAddresses, error) {
-	val, err := readBuffer.ReadUint32("AdsSignificantGroupAddresses", 32)
-	if err != nil {
-		return 0, errors.Wrap(err, "error reading AdsSignificantGroupAddresses")
-	}
-	if enum, ok := AdsSignificantGroupAddressesByValue(val); !ok {
-		log.Debug().Msgf("no value %x found for RequestType", val)
-		return AdsSignificantGroupAddresses(val), nil
-	} else {
-		return enum, nil
-	}
-}
-
-func (e AdsSignificantGroupAddresses) Serialize(writeBuffer utils.WriteBuffer) error {
-	return writeBuffer.WriteUint32("AdsSignificantGroupAddresses", 32, uint32(e), utils.WithAdditionalStringRepresentation(e.PLC4XEnumName()))
-}
-
-// PLC4XEnumName returns the name that is used in code to identify this enum
-func (e AdsSignificantGroupAddresses) PLC4XEnumName() string {
-	switch e {
-	case AdsSignificantGroupAddresses_SYMBOL_TABLE:
-		return "SYMBOL_TABLE"
-	case AdsSignificantGroupAddresses_DATA_TYPE_TABLE:
-		return "DATA_TYPE_TABLE"
-	case AdsSignificantGroupAddresses_TABLE_SIZES:
-		return "TABLE_SIZES"
-	}
-	return ""
-}
-
-func (e AdsSignificantGroupAddresses) String() string {
-	return e.PLC4XEnumName()
-}
diff --git a/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go b/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go
index 3e283f1f1..08428a455 100644
--- a/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go
+++ b/plc4go/protocols/ads/readwrite/model/AdsSymbolTableEntry.go
@@ -335,19 +335,19 @@ func (m *_AdsSymbolTableEntry) GetLengthInBitsConditional(lastItem bool) uint16
 	lengthInBits += 16
 
 	// Simple field (name)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetName())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetName()))) * int32(int32(8)))
 
 	// Const Field (nameTerminator)
 	lengthInBits += 8
 
 	// Simple field (dataTypeName)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetDataTypeName())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetDataTypeName()))) * int32(int32(8)))
 
 	// Const Field (dataTypeNameTerminator)
 	lengthInBits += 8
 
 	// Simple field (comment)
-	lengthInBits += uint16(int32(GetSTR_LEN()(m.GetComment())) * int32(int32(8)))
+	lengthInBits += uint16(int32(uint16(len(m.GetComment()))) * int32(int32(8)))
 
 	// Const Field (commentTerminator)
 	lengthInBits += 8
@@ -373,6 +373,7 @@ func AdsSymbolTableEntryParse(readBuffer utils.ReadBuffer) (AdsSymbolTableEntry,
 	currentPos := positionAware.GetPos()
 	_ = currentPos
 	var startPos = positionAware.GetPos()
+	_ = startPos
 	var curPos uint16
 
 	// Simple Field (entryLength)
@@ -809,21 +810,21 @@ func (m *_AdsSymbolTableEntry) Serialize(writeBuffer utils.WriteBuffer) error {
 	}
 
 	// Implicit Field (nameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	nameLength := uint16(GetSTR_LEN()(m.GetName()))
+	nameLength := uint16(uint16(len(m.GetName())))
 	_nameLengthErr := writeBuffer.WriteUint16("nameLength", 16, (nameLength))
 	if _nameLengthErr != nil {
 		return errors.Wrap(_nameLengthErr, "Error serializing 'nameLength' field")
 	}
 
 	// Implicit Field (dataTypeNameLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	dataTypeNameLength := uint16(GetSTR_LEN()(m.GetDataTypeName()))
+	dataTypeNameLength := uint16(uint16(len(m.GetDataTypeName())))
 	_dataTypeNameLengthErr := writeBuffer.WriteUint16("dataTypeNameLength", 16, (dataTypeNameLength))
 	if _dataTypeNameLengthErr != nil {
 		return errors.Wrap(_dataTypeNameLengthErr, "Error serializing 'dataTypeNameLength' field")
 	}
 
 	// Implicit Field (commentLength) (Used for parsing, but it's value is not stored as it's implicitly given by the objects content)
-	commentLength := uint16(GetSTR_LEN()(m.GetComment()))
+	commentLength := uint16(uint16(len(m.GetComment())))
 	_commentLengthErr := writeBuffer.WriteUint16("commentLength", 16, (commentLength))
 	if _commentLengthErr != nil {
 		return errors.Wrap(_commentLengthErr, "Error serializing 'commentLength' field")
@@ -831,7 +832,7 @@ func (m *_AdsSymbolTableEntry) Serialize(writeBuffer utils.WriteBuffer) error {
 
 	// Simple Field (name)
 	name := string(m.GetName())
-	_nameErr := writeBuffer.WriteString("name", uint32((GetSTR_LEN()(m.GetName()))*(8)), "UTF-8", (name))
+	_nameErr := writeBuffer.WriteString("name", uint32((uint16(len(m.GetName())))*(8)), "UTF-8", (name))
 	if _nameErr != nil {
 		return errors.Wrap(_nameErr, "Error serializing 'name' field")
 	}
@@ -844,7 +845,7 @@ func (m *_AdsSymbolTableEntry) Serialize(writeBuffer utils.WriteBuffer) error {
 
 	// Simple Field (dataTypeName)
 	dataTypeName := string(m.GetDataTypeName())
-	_dataTypeNameErr := writeBuffer.WriteString("dataTypeName", uint32((GetSTR_LEN()(m.GetDataTypeName()))*(8)), "UTF-8", (dataTypeName))
+	_dataTypeNameErr := writeBuffer.WriteString("dataTypeName", uint32((uint16(len(m.GetDataTypeName())))*(8)), "UTF-8", (dataTypeName))
 	if _dataTypeNameErr != nil {
 		return errors.Wrap(_dataTypeNameErr, "Error serializing 'dataTypeName' field")
 	}
@@ -857,7 +858,7 @@ func (m *_AdsSymbolTableEntry) Serialize(writeBuffer utils.WriteBuffer) error {
 
 	// Simple Field (comment)
 	comment := string(m.GetComment())
-	_commentErr := writeBuffer.WriteString("comment", uint32((GetSTR_LEN()(m.GetComment()))*(8)), "UTF-8", (comment))
+	_commentErr := writeBuffer.WriteString("comment", uint32((uint16(len(m.GetComment())))*(8)), "UTF-8", (comment))
 	if _commentErr != nil {
 		return errors.Wrap(_commentErr, "Error serializing 'comment' field")
 	}
diff --git a/plc4go/protocols/ads/readwrite/model/AmsPacket.go b/plc4go/protocols/ads/readwrite/model/AmsPacket.go
index 371900c3d..e5daa7211 100644
--- a/plc4go/protocols/ads/readwrite/model/AmsPacket.go
+++ b/plc4go/protocols/ads/readwrite/model/AmsPacket.go
@@ -327,7 +327,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_initCommandErr, "Error parsing 'initCommand' field of AmsPacket")
 	}
 	if initCommand != AmsPacket_INITCOMMAND {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_INITCOMMAND) + " but got " + fmt.Sprintf("%d", initCommand))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_INITCOMMAND) + " but got " + fmt.Sprintf("%t", initCommand))
 	}
 
 	// Const Field (updCommand)
@@ -336,7 +336,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_updCommandErr, "Error parsing 'updCommand' field of AmsPacket")
 	}
 	if updCommand != AmsPacket_UPDCOMMAND {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_UPDCOMMAND) + " but got " + fmt.Sprintf("%d", updCommand))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_UPDCOMMAND) + " but got " + fmt.Sprintf("%t", updCommand))
 	}
 
 	// Const Field (timestampAdded)
@@ -345,7 +345,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_timestampAddedErr, "Error parsing 'timestampAdded' field of AmsPacket")
 	}
 	if timestampAdded != AmsPacket_TIMESTAMPADDED {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_TIMESTAMPADDED) + " but got " + fmt.Sprintf("%d", timestampAdded))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_TIMESTAMPADDED) + " but got " + fmt.Sprintf("%t", timestampAdded))
 	}
 
 	// Const Field (highPriorityCommand)
@@ -354,7 +354,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_highPriorityCommandErr, "Error parsing 'highPriorityCommand' field of AmsPacket")
 	}
 	if highPriorityCommand != AmsPacket_HIGHPRIORITYCOMMAND {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_HIGHPRIORITYCOMMAND) + " but got " + fmt.Sprintf("%d", highPriorityCommand))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_HIGHPRIORITYCOMMAND) + " but got " + fmt.Sprintf("%t", highPriorityCommand))
 	}
 
 	// Const Field (systemCommand)
@@ -363,7 +363,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_systemCommandErr, "Error parsing 'systemCommand' field of AmsPacket")
 	}
 	if systemCommand != AmsPacket_SYSTEMCOMMAND {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_SYSTEMCOMMAND) + " but got " + fmt.Sprintf("%d", systemCommand))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_SYSTEMCOMMAND) + " but got " + fmt.Sprintf("%t", systemCommand))
 	}
 
 	// Const Field (adsCommand)
@@ -372,7 +372,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_adsCommandErr, "Error parsing 'adsCommand' field of AmsPacket")
 	}
 	if adsCommand != AmsPacket_ADSCOMMAND {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_ADSCOMMAND) + " but got " + fmt.Sprintf("%d", adsCommand))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_ADSCOMMAND) + " but got " + fmt.Sprintf("%t", adsCommand))
 	}
 
 	// Const Field (noReturn)
@@ -381,7 +381,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_noReturnErr, "Error parsing 'noReturn' field of AmsPacket")
 	}
 	if noReturn != AmsPacket_NORETURN {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_NORETURN) + " but got " + fmt.Sprintf("%d", noReturn))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_NORETURN) + " but got " + fmt.Sprintf("%t", noReturn))
 	}
 
 	// Discriminator Field (response) (Used as input to a switch field)
@@ -396,7 +396,7 @@ func AmsPacketParse(readBuffer utils.ReadBuffer) (AmsPacket, error) {
 		return nil, errors.Wrap(_broadcastErr, "Error parsing 'broadcast' field of AmsPacket")
 	}
 	if broadcast != AmsPacket_BROADCAST {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", AmsPacket_BROADCAST) + " but got " + fmt.Sprintf("%d", broadcast))
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%t", AmsPacket_BROADCAST) + " but got " + fmt.Sprintf("%t", broadcast))
 	}
 
 	var reservedField0 *int8
diff --git a/plc4go/protocols/ads/readwrite/model/State.go b/plc4go/protocols/ads/readwrite/model/State.go
deleted file mode 100644
index 2cfc91038..000000000
--- a/plc4go/protocols/ads/readwrite/model/State.go
+++ /dev/null
@@ -1,399 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package model
-
-import (
-	"github.com/apache/plc4x/plc4go/spi/utils"
-	"github.com/pkg/errors"
-	"github.com/rs/zerolog/log"
-)
-
-// Code generated by code-generation. DO NOT EDIT.
-
-// State is the corresponding interface of State
-type State interface {
-	utils.LengthAware
-	utils.Serializable
-	// GetInitCommand returns InitCommand (property field)
-	GetInitCommand() bool
-	// GetUpdCommand returns UpdCommand (property field)
-	GetUpdCommand() bool
-	// GetTimestampAdded returns TimestampAdded (property field)
-	GetTimestampAdded() bool
-	// GetHighPriorityCommand returns HighPriorityCommand (property field)
-	GetHighPriorityCommand() bool
-	// GetSystemCommand returns SystemCommand (property field)
-	GetSystemCommand() bool
-	// GetAdsCommand returns AdsCommand (property field)
-	GetAdsCommand() bool
-	// GetNoReturn returns NoReturn (property field)
-	GetNoReturn() bool
-	// GetResponse returns Response (property field)
-	GetResponse() bool
-	// GetBroadcast returns Broadcast (property field)
-	GetBroadcast() bool
-}
-
-// StateExactly can be used when we want exactly this type and not a type which fulfills State.
-// This is useful for switch cases.
-type StateExactly interface {
-	State
-	isState() bool
-}
-
-// _State is the data-structure of this message
-type _State struct {
-	InitCommand         bool
-	UpdCommand          bool
-	TimestampAdded      bool
-	HighPriorityCommand bool
-	SystemCommand       bool
-	AdsCommand          bool
-	NoReturn            bool
-	Response            bool
-	Broadcast           bool
-	// Reserved Fields
-	reservedField0 *int8
-}
-
-///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////
-/////////////////////// Accessors for property fields.
-///////////////////////
-
-func (m *_State) GetInitCommand() bool {
-	return m.InitCommand
-}
-
-func (m *_State) GetUpdCommand() bool {
-	return m.UpdCommand
-}
-
-func (m *_State) GetTimestampAdded() bool {
-	return m.TimestampAdded
-}
-
-func (m *_State) GetHighPriorityCommand() bool {
-	return m.HighPriorityCommand
-}
-
-func (m *_State) GetSystemCommand() bool {
-	return m.SystemCommand
-}
-
-func (m *_State) GetAdsCommand() bool {
-	return m.AdsCommand
-}
-
-func (m *_State) GetNoReturn() bool {
-	return m.NoReturn
-}
-
-func (m *_State) GetResponse() bool {
-	return m.Response
-}
-
-func (m *_State) GetBroadcast() bool {
-	return m.Broadcast
-}
-
-///////////////////////
-///////////////////////
-///////////////////////////////////////////////////////////
-///////////////////////////////////////////////////////////
-
-// NewState factory function for _State
-func NewState(initCommand bool, updCommand bool, timestampAdded bool, highPriorityCommand bool, systemCommand bool, adsCommand bool, noReturn bool, response bool, broadcast bool) *_State {
-	return &_State{InitCommand: initCommand, UpdCommand: updCommand, TimestampAdded: timestampAdded, HighPriorityCommand: highPriorityCommand, SystemCommand: systemCommand, AdsCommand: adsCommand, NoReturn: noReturn, Response: response, Broadcast: broadcast}
-}
-
-// Deprecated: use the interface for direct cast
-func CastState(structType interface{}) State {
-	if casted, ok := structType.(State); ok {
-		return casted
-	}
-	if casted, ok := structType.(*State); ok {
-		return *casted
-	}
-	return nil
-}
-
-func (m *_State) GetTypeName() string {
-	return "State"
-}
-
-func (m *_State) GetLengthInBits() uint16 {
-	return m.GetLengthInBitsConditional(false)
-}
-
-func (m *_State) GetLengthInBitsConditional(lastItem bool) uint16 {
-	lengthInBits := uint16(0)
-
-	// Simple field (initCommand)
-	lengthInBits += 1
-
-	// Simple field (updCommand)
-	lengthInBits += 1
-
-	// Simple field (timestampAdded)
-	lengthInBits += 1
-
-	// Simple field (highPriorityCommand)
-	lengthInBits += 1
-
-	// Simple field (systemCommand)
-	lengthInBits += 1
-
-	// Simple field (adsCommand)
-	lengthInBits += 1
-
-	// Simple field (noReturn)
-	lengthInBits += 1
-
-	// Simple field (response)
-	lengthInBits += 1
-
-	// Simple field (broadcast)
-	lengthInBits += 1
-
-	// Reserved Field (reserved)
-	lengthInBits += 7
-
-	return lengthInBits
-}
-
-func (m *_State) GetLengthInBytes() uint16 {
-	return m.GetLengthInBits() / 8
-}
-
-func StateParse(readBuffer utils.ReadBuffer) (State, error) {
-	positionAware := readBuffer
-	_ = positionAware
-	if pullErr := readBuffer.PullContext("State"); pullErr != nil {
-		return nil, errors.Wrap(pullErr, "Error pulling for State")
-	}
-	currentPos := positionAware.GetPos()
-	_ = currentPos
-
-	// Simple Field (initCommand)
-	_initCommand, _initCommandErr := readBuffer.ReadBit("initCommand")
-	if _initCommandErr != nil {
-		return nil, errors.Wrap(_initCommandErr, "Error parsing 'initCommand' field of State")
-	}
-	initCommand := _initCommand
-
-	// Simple Field (updCommand)
-	_updCommand, _updCommandErr := readBuffer.ReadBit("updCommand")
-	if _updCommandErr != nil {
-		return nil, errors.Wrap(_updCommandErr, "Error parsing 'updCommand' field of State")
-	}
-	updCommand := _updCommand
-
-	// Simple Field (timestampAdded)
-	_timestampAdded, _timestampAddedErr := readBuffer.ReadBit("timestampAdded")
-	if _timestampAddedErr != nil {
-		return nil, errors.Wrap(_timestampAddedErr, "Error parsing 'timestampAdded' field of State")
-	}
-	timestampAdded := _timestampAdded
-
-	// Simple Field (highPriorityCommand)
-	_highPriorityCommand, _highPriorityCommandErr := readBuffer.ReadBit("highPriorityCommand")
-	if _highPriorityCommandErr != nil {
-		return nil, errors.Wrap(_highPriorityCommandErr, "Error parsing 'highPriorityCommand' field of State")
-	}
-	highPriorityCommand := _highPriorityCommand
-
-	// Simple Field (systemCommand)
-	_systemCommand, _systemCommandErr := readBuffer.ReadBit("systemCommand")
-	if _systemCommandErr != nil {
-		return nil, errors.Wrap(_systemCommandErr, "Error parsing 'systemCommand' field of State")
-	}
-	systemCommand := _systemCommand
-
-	// Simple Field (adsCommand)
-	_adsCommand, _adsCommandErr := readBuffer.ReadBit("adsCommand")
-	if _adsCommandErr != nil {
-		return nil, errors.Wrap(_adsCommandErr, "Error parsing 'adsCommand' field of State")
-	}
-	adsCommand := _adsCommand
-
-	// Simple Field (noReturn)
-	_noReturn, _noReturnErr := readBuffer.ReadBit("noReturn")
-	if _noReturnErr != nil {
-		return nil, errors.Wrap(_noReturnErr, "Error parsing 'noReturn' field of State")
-	}
-	noReturn := _noReturn
-
-	// Simple Field (response)
-	_response, _responseErr := readBuffer.ReadBit("response")
-	if _responseErr != nil {
-		return nil, errors.Wrap(_responseErr, "Error parsing 'response' field of State")
-	}
-	response := _response
-
-	// Simple Field (broadcast)
-	_broadcast, _broadcastErr := readBuffer.ReadBit("broadcast")
-	if _broadcastErr != nil {
-		return nil, errors.Wrap(_broadcastErr, "Error parsing 'broadcast' field of State")
-	}
-	broadcast := _broadcast
-
-	var reservedField0 *int8
-	// Reserved Field (Compartmentalized so the "reserved" variable can't leak)
-	{
-		reserved, _err := readBuffer.ReadInt8("reserved", 7)
-		if _err != nil {
-			return nil, errors.Wrap(_err, "Error parsing 'reserved' field of State")
-		}
-		if reserved != int8(0x0) {
-			log.Info().Fields(map[string]interface{}{
-				"expected value": int8(0x0),
-				"got value":      reserved,
-			}).Msg("Got unexpected response for reserved field.")
-			// We save the value, so it can be re-serialized
-			reservedField0 = &reserved
-		}
-	}
-
-	if closeErr := readBuffer.CloseContext("State"); closeErr != nil {
-		return nil, errors.Wrap(closeErr, "Error closing for State")
-	}
-
-	// Create the instance
-	return &_State{
-		InitCommand:         initCommand,
-		UpdCommand:          updCommand,
-		TimestampAdded:      timestampAdded,
-		HighPriorityCommand: highPriorityCommand,
-		SystemCommand:       systemCommand,
-		AdsCommand:          adsCommand,
-		NoReturn:            noReturn,
-		Response:            response,
-		Broadcast:           broadcast,
-		reservedField0:      reservedField0,
-	}, nil
-}
-
-func (m *_State) Serialize(writeBuffer utils.WriteBuffer) error {
-	positionAware := writeBuffer
-	_ = positionAware
-	if pushErr := writeBuffer.PushContext("State"); pushErr != nil {
-		return errors.Wrap(pushErr, "Error pushing for State")
-	}
-
-	// Simple Field (initCommand)
-	initCommand := bool(m.GetInitCommand())
-	_initCommandErr := writeBuffer.WriteBit("initCommand", (initCommand))
-	if _initCommandErr != nil {
-		return errors.Wrap(_initCommandErr, "Error serializing 'initCommand' field")
-	}
-
-	// Simple Field (updCommand)
-	updCommand := bool(m.GetUpdCommand())
-	_updCommandErr := writeBuffer.WriteBit("updCommand", (updCommand))
-	if _updCommandErr != nil {
-		return errors.Wrap(_updCommandErr, "Error serializing 'updCommand' field")
-	}
-
-	// Simple Field (timestampAdded)
-	timestampAdded := bool(m.GetTimestampAdded())
-	_timestampAddedErr := writeBuffer.WriteBit("timestampAdded", (timestampAdded))
-	if _timestampAddedErr != nil {
-		return errors.Wrap(_timestampAddedErr, "Error serializing 'timestampAdded' field")
-	}
-
-	// Simple Field (highPriorityCommand)
-	highPriorityCommand := bool(m.GetHighPriorityCommand())
-	_highPriorityCommandErr := writeBuffer.WriteBit("highPriorityCommand", (highPriorityCommand))
-	if _highPriorityCommandErr != nil {
-		return errors.Wrap(_highPriorityCommandErr, "Error serializing 'highPriorityCommand' field")
-	}
-
-	// Simple Field (systemCommand)
-	systemCommand := bool(m.GetSystemCommand())
-	_systemCommandErr := writeBuffer.WriteBit("systemCommand", (systemCommand))
-	if _systemCommandErr != nil {
-		return errors.Wrap(_systemCommandErr, "Error serializing 'systemCommand' field")
-	}
-
-	// Simple Field (adsCommand)
-	adsCommand := bool(m.GetAdsCommand())
-	_adsCommandErr := writeBuffer.WriteBit("adsCommand", (adsCommand))
-	if _adsCommandErr != nil {
-		return errors.Wrap(_adsCommandErr, "Error serializing 'adsCommand' field")
-	}
-
-	// Simple Field (noReturn)
-	noReturn := bool(m.GetNoReturn())
-	_noReturnErr := writeBuffer.WriteBit("noReturn", (noReturn))
-	if _noReturnErr != nil {
-		return errors.Wrap(_noReturnErr, "Error serializing 'noReturn' field")
-	}
-
-	// Simple Field (response)
-	response := bool(m.GetResponse())
-	_responseErr := writeBuffer.WriteBit("response", (response))
-	if _responseErr != nil {
-		return errors.Wrap(_responseErr, "Error serializing 'response' field")
-	}
-
-	// Simple Field (broadcast)
-	broadcast := bool(m.GetBroadcast())
-	_broadcastErr := writeBuffer.WriteBit("broadcast", (broadcast))
-	if _broadcastErr != nil {
-		return errors.Wrap(_broadcastErr, "Error serializing 'broadcast' field")
-	}
-
-	// Reserved Field (reserved)
-	{
-		var reserved int8 = int8(0x0)
-		if m.reservedField0 != nil {
-			log.Info().Fields(map[string]interface{}{
-				"expected value": int8(0x0),
-				"got value":      reserved,
-			}).Msg("Overriding reserved field with unexpected value.")
-			reserved = *m.reservedField0
-		}
-		_err := writeBuffer.WriteInt8("reserved", 7, reserved)
-		if _err != nil {
-			return errors.Wrap(_err, "Error serializing 'reserved' field")
-		}
-	}
-
-	if popErr := writeBuffer.PopContext("State"); popErr != nil {
-		return errors.Wrap(popErr, "Error popping for State")
-	}
-	return nil
-}
-
-func (m *_State) isState() bool {
-	return true
-}
-
-func (m *_State) 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()
-}


[plc4x] 01/05: chore(protocols/ads): Added some comments on my recent changes

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 42387ce05c1e1fa7419f25ee9106b12783c04c1d
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 25 10:27:20 2022 +0200

    chore(protocols/ads):  Added some comments on my recent changes
---
 protocols/ads/src/main/resources/protocols/ads/ads.mspec | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/protocols/ads/src/main/resources/protocols/ads/ads.mspec b/protocols/ads/src/main/resources/protocols/ads/ads.mspec
index a27f0cb72..da3ce1603 100644
--- a/protocols/ads/src/main/resources/protocols/ads/ads.mspec
+++ b/protocols/ads/src/main/resources/protocols/ads/ads.mspec
@@ -127,7 +127,7 @@
     [simple        uint        16  sourceAmsPort                             ]
     // 2 bytes.
     [discriminator CommandId       commandId                                 ]
-    // 2 bytes.
+    // 2 bytes. (I set these as constants in order to minimize the input needed for creating requests)
     [const         bit             initCommand            false              ]
     [const         bit             updCommand             false              ]
     [const         bit             timestampAdded         false              ]


[plc4x] 02/05: chore(code-gen): Added support for STR_LEN to the go code-generation.

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit 0cd8dc52ca21f0521d5bf886c75e9bffee8de846
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 25 10:28:29 2022 +0200

    chore(code-gen):  Added support for STR_LEN to the go code-generation.
---
 .../language/go/GoLanguageTemplateHelper.java      | 30 +++++++++++++++++++++-
 1 file changed, 29 insertions(+), 1 deletion(-)

diff --git a/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java b/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java
index d6ce46996..0afc466df 100644
--- a/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java
+++ b/code-generation/language-go/src/main/java/org/apache/plc4x/language/go/GoLanguageTemplateHelper.java
@@ -782,6 +782,8 @@ public class GoLanguageTemplateHelper extends BaseFreemarkerLanguageTemplateHelp
             return toArraySizeInBytesVariableExpression(field, typeReference, variableLiteral, parserArguments, serializerArguments, suppressPointerAccess, tracer);
         } else if ("CEIL".equals(variableLiteralName)) {
             return toCeilVariableExpression(field, variableLiteral, parserArguments, serializerArguments, serialize, suppressPointerAccess, tracer);
+        } else if ("STR_LEN".equals(variableLiteralName)) {
+            return toStrLenVariableExpression(field, typeReference, variableLiteral, parserArguments, serializerArguments, serialize, suppressPointerAccess, tracer);
         }
         // All uppercase names are not fields, but utility methods.
         // TODO: It seems we also run into this, in case of using enum constants in type-switches.
@@ -954,6 +956,20 @@ public class GoLanguageTemplateHelper extends BaseFreemarkerLanguageTemplateHelp
             "))";
     }
 
+    private String toStrLenVariableExpression(Field field, TypeReference typeReference, VariableLiteral variableLiteral, List<Argument> parserArguments, List<Argument> serializerArguments, boolean serialize, boolean suppressPointerAccess, Tracer tracer) {
+        tracer = tracer.dive("str-len");
+        VariableLiteral countLiteral = variableLiteral.getArgs()
+            .orElseThrow(() -> new RuntimeException("Str-len needs at least one arg"))
+            .get(0)
+            .asLiteral()
+            .orElseThrow(() -> new RuntimeException("Str-len needs a literal"))
+            .asVariableLiteral()
+            .orElseThrow(() -> new RuntimeException("Str-len needs a variable literal"));
+        return tracer + (typeReference instanceof SimpleTypeReference ? getCastExpressionForTypeReference(typeReference) : "") + "(len(" +
+            toVariableExpression(field, typeReference, countLiteral, parserArguments, serializerArguments, serialize, suppressPointerAccess) +
+            "))";
+    }
+
     private String toStaticCallVariableExpression(Field field, TypeReference typeReference, VariableLiteral variableLiteral, List<Argument> parserArguments, List<Argument> serializerArguments, boolean serialize, boolean suppressPointerAccess, Tracer tracer) {
         tracer = tracer.dive("STATIC_CALL");
         StringBuilder sb = new StringBuilder();
@@ -1377,7 +1393,7 @@ public class GoLanguageTemplateHelper extends BaseFreemarkerLanguageTemplateHelp
         return result;
     }
 
-    public boolean requiresStartPosAndCurPos() {
+    public boolean requiresCurPos() {
         if (thisType instanceof ComplexTypeDefinition) {
             ComplexTypeDefinition complexTypeDefinition = (ComplexTypeDefinition) this.thisType;
             for (Field curField : complexTypeDefinition.getFields()) {
@@ -1389,6 +1405,18 @@ public class GoLanguageTemplateHelper extends BaseFreemarkerLanguageTemplateHelp
         return false;
     }
 
+    public boolean requiresStartPos() {
+        if (thisType instanceof ComplexTypeDefinition) {
+            ComplexTypeDefinition complexTypeDefinition = (ComplexTypeDefinition) this.thisType;
+            for (Field curField : complexTypeDefinition.getFields()) {
+                if (requiresVariable(curField, "startPos")) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
     public boolean requiresVariable(Field curField, String variable) {
         if (curField.isArrayField()) {
             ArrayField arrayField = (ArrayField) curField;


[plc4x] 04/05: chore(plc4go): Renamed multiple elements: - PLCValueType -> PlcValueType - PlcDiscoveryEvent -> PlcDiscoveryItem

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit d04f12f8a624320167483c6c444a21e5c801696e
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 25 10:31:52 2022 +0200

    chore(plc4go): Renamed multiple elements:
    - PLCValueType -> PlcValueType
    - PlcDiscoveryEvent -> PlcDiscoveryItem
---
 plc4go/pkg/api/driver.go                              | 4 ++--
 plc4go/pkg/api/driverManager.go                       | 4 ++--
 plc4go/pkg/api/values/plc_value.go                    | 8 ++++----
 plc4go/protocols/s7/readwrite/model/COTPPacket.go     | 1 +
 plc4go/spi/PlcDiscoverer.go                           | 2 +-
 plc4go/spi/default/DefaultDriver.go                   | 2 +-
 plc4go/spi/values/BINT.go                             | 4 ++--
 plc4go/spi/values/BOOL.go                             | 4 ++--
 plc4go/spi/values/BREAL.go                            | 4 ++--
 plc4go/spi/values/BYTE.go                             | 4 ++--
 plc4go/spi/values/CHAR.go                             | 4 ++--
 plc4go/spi/values/DATE.go                             | 4 ++--
 plc4go/spi/values/DATE_AND_TIME.go                    | 4 ++--
 plc4go/spi/values/DINT.go                             | 4 ++--
 plc4go/spi/values/DWORD.go                            | 4 ++--
 plc4go/spi/values/INT.go                              | 4 ++--
 plc4go/spi/values/LINT.go                             | 4 ++--
 plc4go/spi/values/LREAL.go                            | 4 ++--
 plc4go/spi/values/LTIME.go                            | 4 ++--
 plc4go/spi/values/LWORD.go                            | 4 ++--
 plc4go/spi/values/NULL.go                             | 4 ++--
 plc4go/spi/values/PlcBitString.go                     | 2 +-
 plc4go/spi/values/PlcByteArray.go                     | 2 +-
 plc4go/spi/values/PlcList.go                          | 4 ++--
 plc4go/spi/values/PlcStruct.go                        | 4 ++--
 plc4go/spi/values/PlcValueAdapter.go                  | 4 ++--
 plc4go/spi/values/REAL.go                             | 4 ++--
 plc4go/spi/values/RawPlcValue.go                      | 4 ++--
 plc4go/spi/values/SINT.go                             | 4 ++--
 plc4go/spi/values/STRING.go                           | 4 ++--
 plc4go/spi/values/TIME.go                             | 4 ++--
 plc4go/spi/values/TIME_OF_DAY.go                      | 4 ++--
 plc4go/spi/values/UDINT.go                            | 4 ++--
 plc4go/spi/values/UINT.go                             | 4 ++--
 plc4go/spi/values/ULINT.go                            | 4 ++--
 plc4go/spi/values/USINT.go                            | 4 ++--
 plc4go/spi/values/WCHAR.go                            | 4 ++--
 plc4go/spi/values/WORD.go                             | 4 ++--
 plc4go/spi/values/WSTRING.go                          | 4 ++--
 plc4go/spi/values/value_combination_test.go           | 8 ++++----
 plc4go/tests/drivers/tests/manual_cbus_driver_test.go | 2 +-
 plc4go/tools/plc4xbrowser/ui/commands.go              | 2 +-
 42 files changed, 81 insertions(+), 80 deletions(-)

diff --git a/plc4go/pkg/api/driver.go b/plc4go/pkg/api/driver.go
index 67760f4d3..151941cfa 100644
--- a/plc4go/pkg/api/driver.go
+++ b/plc4go/pkg/api/driver.go
@@ -30,7 +30,7 @@ import (
 type PlcDriver interface {
 	// GetProtocolCode Get the short code used to identify this driver (As used in the connection string)
 	GetProtocolCode() string
-	// GetProtocolName Get a human readable name for this driver
+	// GetProtocolName Get a human-readable name for this driver
 	GetProtocolName() string
 
 	// GetDefaultTransport If the driver has a default form of transport, provide this and make
@@ -50,5 +50,5 @@ type PlcDriver interface {
 	// Discover TODO: document me
 	// FIXME: this leaks spi in the signature move to spi driver or create interfaces. Can also be done by moving spi in a proper module
 	Discover(callback func(event model.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error
-	DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error
+	DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error
 }
diff --git a/plc4go/pkg/api/driverManager.go b/plc4go/pkg/api/driverManager.go
index 4e8e5ecc4..964518cb0 100644
--- a/plc4go/pkg/api/driverManager.go
+++ b/plc4go/pkg/api/driverManager.go
@@ -44,7 +44,7 @@ type PlcDriverManager interface {
 	// Discover Execute all available discovery methods on all available drivers using all transports
 	Discover(callback func(event model.PlcDiscoveryItem), discoveryOptions ...WithDiscoveryOption) error
 	// DiscoverWithContext Execute all available discovery methods on all available drivers using all transports
-	DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryEvent), discoveryOptions ...WithDiscoveryOption) error
+	DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryItem), discoveryOptions ...WithDiscoveryOption) error
 }
 
 func NewPlcDriverManager() PlcDriverManager {
@@ -289,7 +289,7 @@ func (m *plcDriverManger) Discover(callback func(event model.PlcDiscoveryItem),
 	return m.DiscoverWithContext(context.TODO(), callback, discoveryOptions...)
 }
 
-func (m *plcDriverManger) DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryEvent), discoveryOptions ...WithDiscoveryOption) error {
+func (m *plcDriverManger) DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryItem), discoveryOptions ...WithDiscoveryOption) error {
 	// Check if we've got at least one option to restrict to certain protocols only.
 	// If there is at least one, we only check that protocol, if there are none, all
 	// available protocols are checked.
diff --git a/plc4go/pkg/api/values/plc_value.go b/plc4go/pkg/api/values/plc_value.go
index 003e0b6ea..8de4570c2 100644
--- a/plc4go/pkg/api/values/plc_value.go
+++ b/plc4go/pkg/api/values/plc_value.go
@@ -132,7 +132,7 @@ type PlcValue interface {
 	//
 	///
 
-	GetPLCValueType() PLCValueType
+	GetPlcValueType() PlcValueType
 }
 
 // RawPlcValue This type is used in cases where the driver doesn't have access to type information and therefore can't decode
@@ -149,10 +149,10 @@ type RawPlcValue interface {
 	RawReset()
 }
 
-type PLCValueType uint8
+type PlcValueType uint8
 
 const (
-	BINT PLCValueType = iota
+	BINT PlcValueType = iota
 	BIT_STRING
 	BOOL
 	BREAL
@@ -186,7 +186,7 @@ const (
 	WSTRING
 )
 
-func (p PLCValueType) String() string {
+func (p PlcValueType) String() string {
 	switch {
 	case p == BINT:
 		return "BINT"
diff --git a/plc4go/protocols/s7/readwrite/model/COTPPacket.go b/plc4go/protocols/s7/readwrite/model/COTPPacket.go
index a056a8bfd..9e08df261 100644
--- a/plc4go/protocols/s7/readwrite/model/COTPPacket.go
+++ b/plc4go/protocols/s7/readwrite/model/COTPPacket.go
@@ -152,6 +152,7 @@ func COTPPacketParse(readBuffer utils.ReadBuffer, cotpLen uint16) (COTPPacket, e
 	currentPos := positionAware.GetPos()
 	_ = currentPos
 	var startPos = positionAware.GetPos()
+	_ = startPos
 	var curPos uint16
 
 	// Implicit Field (headerLength) (Used for parsing, but its value is not stored as it's implicitly given by the objects content)
diff --git a/plc4go/spi/PlcDiscoverer.go b/plc4go/spi/PlcDiscoverer.go
index d0241389a..0d0f854cc 100644
--- a/plc4go/spi/PlcDiscoverer.go
+++ b/plc4go/spi/PlcDiscoverer.go
@@ -27,5 +27,5 @@ import (
 
 type PlcDiscoverer interface {
 	Discover(callback func(event model.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error
-	DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error
+	DiscoverWithContext(ctx context.Context, callback func(event model.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error
 }
diff --git a/plc4go/spi/default/DefaultDriver.go b/plc4go/spi/default/DefaultDriver.go
index 1f9164b07..733e15445 100644
--- a/plc4go/spi/default/DefaultDriver.go
+++ b/plc4go/spi/default/DefaultDriver.go
@@ -94,7 +94,7 @@ func (d *defaultDriver) Discover(_ func(event apiModel.PlcDiscoveryItem), _ ...o
 	panic("not available")
 }
 
-func (d *defaultDriver) DiscoverWithContext(_ context.Context, callback func(event apiModel.PlcDiscoveryEvent), discoveryOptions ...options.WithDiscoveryOption) error {
+func (d *defaultDriver) DiscoverWithContext(_ context.Context, callback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error {
 	panic("not available")
 }
 
diff --git a/plc4go/spi/values/BINT.go b/plc4go/spi/values/BINT.go
index d2694a771..236923c79 100644
--- a/plc4go/spi/values/BINT.go
+++ b/plc4go/spi/values/BINT.go
@@ -136,7 +136,7 @@ func (m PlcBINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcBINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcBINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.BINT
 }
 
@@ -161,5 +161,5 @@ func (m PlcBINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcBINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), m.value.BitLen(), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), m.value.BitLen(), m.value)
 }
diff --git a/plc4go/spi/values/BOOL.go b/plc4go/spi/values/BOOL.go
index b8545c14b..f55738f32 100644
--- a/plc4go/spi/values/BOOL.go
+++ b/plc4go/spi/values/BOOL.go
@@ -78,7 +78,7 @@ func (m PlcBOOL) GetString() string {
 	}
 }
 
-func (m PlcBOOL) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcBOOL) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.BOOL
 }
 
@@ -87,5 +87,5 @@ func (m PlcBOOL) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcBOOL) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 1, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 1, m.value)
 }
diff --git a/plc4go/spi/values/BREAL.go b/plc4go/spi/values/BREAL.go
index 7ac32c036..ee3cc0e59 100644
--- a/plc4go/spi/values/BREAL.go
+++ b/plc4go/spi/values/BREAL.go
@@ -165,7 +165,7 @@ func (m PlcBREAL) GetString() string {
 	return fmt.Sprintf("%g", m.GetFloat64())
 }
 
-func (m PlcBREAL) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcBREAL) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.BREAL
 }
 
@@ -191,5 +191,5 @@ func (m PlcBREAL) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcBREAL) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), m.value.MinPrec(), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), m.value.MinPrec(), m.value)
 }
diff --git a/plc4go/spi/values/BYTE.go b/plc4go/spi/values/BYTE.go
index 0dfffeee5..7bfa9fea4 100644
--- a/plc4go/spi/values/BYTE.go
+++ b/plc4go/spi/values/BYTE.go
@@ -100,7 +100,7 @@ func (m PlcBYTE) GetString() string {
 	return strVal
 }
 
-func (m PlcBYTE) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcBYTE) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.BYTE
 }
 
@@ -109,5 +109,5 @@ func (m PlcBYTE) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcBYTE) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 8, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 8, m.value)
 }
diff --git a/plc4go/spi/values/CHAR.go b/plc4go/spi/values/CHAR.go
index 60c8d040e..5d2164eb1 100644
--- a/plc4go/spi/values/CHAR.go
+++ b/plc4go/spi/values/CHAR.go
@@ -49,7 +49,7 @@ func (m PlcCHAR) GetString() string {
 	return string(m.value)
 }
 
-func (m PlcCHAR) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcCHAR) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.CHAR
 }
 
@@ -58,5 +58,5 @@ func (m PlcCHAR) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcCHAR) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 16, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 16, m.value)
 }
diff --git a/plc4go/spi/values/DATE.go b/plc4go/spi/values/DATE.go
index c0d3822dc..cd1c87a66 100644
--- a/plc4go/spi/values/DATE.go
+++ b/plc4go/spi/values/DATE.go
@@ -68,7 +68,7 @@ func (m PlcDATE) GetString() string {
 	return m.GetDate().Format("2006-01-02")
 }
 
-func (m PlcDATE) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcDATE) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.DATE
 }
 
@@ -77,5 +77,5 @@ func (m PlcDATE) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcDATE) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
 }
diff --git a/plc4go/spi/values/DATE_AND_TIME.go b/plc4go/spi/values/DATE_AND_TIME.go
index 589e1e7e1..9cc4f3793 100644
--- a/plc4go/spi/values/DATE_AND_TIME.go
+++ b/plc4go/spi/values/DATE_AND_TIME.go
@@ -54,7 +54,7 @@ func (m PlcDATE_AND_TIME) GetString() string {
 	return fmt.Sprintf("%v", m.GetDateTime())
 }
 
-func (m PlcDATE_AND_TIME) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcDATE_AND_TIME) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.DATE_AND_TIME
 }
 
@@ -63,5 +63,5 @@ func (m PlcDATE_AND_TIME) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcDATE_AND_TIME) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
 }
diff --git a/plc4go/spi/values/DINT.go b/plc4go/spi/values/DINT.go
index 997201bd6..49ed96ca0 100644
--- a/plc4go/spi/values/DINT.go
+++ b/plc4go/spi/values/DINT.go
@@ -147,7 +147,7 @@ func (m PlcDINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcDINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcDINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.DINT
 }
 
@@ -156,5 +156,5 @@ func (m PlcDINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcDINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 32, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 32, m.value)
 }
diff --git a/plc4go/spi/values/DWORD.go b/plc4go/spi/values/DWORD.go
index ed3e475fa..fbe5e50f8 100644
--- a/plc4go/spi/values/DWORD.go
+++ b/plc4go/spi/values/DWORD.go
@@ -99,7 +99,7 @@ func (m PlcDWORD) GetString() string {
 	return strVal
 }
 
-func (m PlcDWORD) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcDWORD) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.DWORD
 }
 
@@ -108,5 +108,5 @@ func (m PlcDWORD) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcDWORD) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 32, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 32, m.value)
 }
diff --git a/plc4go/spi/values/INT.go b/plc4go/spi/values/INT.go
index 29a7f0832..54e08aa11 100644
--- a/plc4go/spi/values/INT.go
+++ b/plc4go/spi/values/INT.go
@@ -140,7 +140,7 @@ func (m PlcINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.INT
 }
 
@@ -149,5 +149,5 @@ func (m PlcINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 16, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 16, m.value)
 }
diff --git a/plc4go/spi/values/LINT.go b/plc4go/spi/values/LINT.go
index 5bb1d749a..9e1304700 100644
--- a/plc4go/spi/values/LINT.go
+++ b/plc4go/spi/values/LINT.go
@@ -154,7 +154,7 @@ func (m PlcLINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcLINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcLINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.LINT
 }
 
@@ -163,5 +163,5 @@ func (m PlcLINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcLINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 64, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 64, m.value)
 }
diff --git a/plc4go/spi/values/LREAL.go b/plc4go/spi/values/LREAL.go
index 5827ce47d..2d6a215f7 100644
--- a/plc4go/spi/values/LREAL.go
+++ b/plc4go/spi/values/LREAL.go
@@ -161,7 +161,7 @@ func (m PlcLREAL) GetString() string {
 	return fmt.Sprintf("%g", m.GetFloat64())
 }
 
-func (m PlcLREAL) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcLREAL) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.LREAL
 }
 
@@ -170,5 +170,5 @@ func (m PlcLREAL) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcLREAL) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 64, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 64, m.value)
 }
diff --git a/plc4go/spi/values/LTIME.go b/plc4go/spi/values/LTIME.go
index 5b4dbada3..43501255d 100644
--- a/plc4go/spi/values/LTIME.go
+++ b/plc4go/spi/values/LTIME.go
@@ -59,7 +59,7 @@ func (m PlcLTIME) GetString() string {
 	return fmt.Sprintf("PT%0.fS", m.GetDuration().Seconds())
 }
 
-func (m PlcLTIME) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcLTIME) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.LTIME
 }
 
@@ -68,5 +68,5 @@ func (m PlcLTIME) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcLTIME) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
 }
diff --git a/plc4go/spi/values/LWORD.go b/plc4go/spi/values/LWORD.go
index e0f508be3..01cffba99 100644
--- a/plc4go/spi/values/LWORD.go
+++ b/plc4go/spi/values/LWORD.go
@@ -115,7 +115,7 @@ func (m PlcLWORD) GetString() string {
 	return strVal
 }
 
-func (m PlcLWORD) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcLWORD) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.LWORD
 }
 
@@ -124,5 +124,5 @@ func (m PlcLWORD) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcLWORD) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 64, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 64, m.value)
 }
diff --git a/plc4go/spi/values/NULL.go b/plc4go/spi/values/NULL.go
index d7b093918..abe612582 100644
--- a/plc4go/spi/values/NULL.go
+++ b/plc4go/spi/values/NULL.go
@@ -36,10 +36,10 @@ func (m PlcNULL) GetRaw() []byte {
 	return []byte{}
 }
 
-func (m PlcNULL) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcNULL) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.NULL
 }
 
 func (m PlcNULL) String() string {
-	return fmt.Sprintf("%s", m.GetPLCValueType())
+	return fmt.Sprintf("%s", m.GetPlcValueType())
 }
diff --git a/plc4go/spi/values/PlcBitString.go b/plc4go/spi/values/PlcBitString.go
index faa33e203..5c951b3a4 100644
--- a/plc4go/spi/values/PlcBitString.go
+++ b/plc4go/spi/values/PlcBitString.go
@@ -80,6 +80,6 @@ func (m PlcBitString) GetList() []apiValues.PlcValue {
 	return m.Values
 }
 
-func (m PlcBitString) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcBitString) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.BIT_STRING
 }
diff --git a/plc4go/spi/values/PlcByteArray.go b/plc4go/spi/values/PlcByteArray.go
index b5afba384..231ed94c3 100644
--- a/plc4go/spi/values/PlcByteArray.go
+++ b/plc4go/spi/values/PlcByteArray.go
@@ -59,7 +59,7 @@ func (m PlcByteArray) GetList() []apiValues.PlcValue {
 	return plcValues
 }
 
-func (m PlcByteArray) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcByteArray) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.BYTE_ARRAY
 }
 
diff --git a/plc4go/spi/values/PlcList.go b/plc4go/spi/values/PlcList.go
index f90c8eed6..e6bf4eb0a 100644
--- a/plc4go/spi/values/PlcList.go
+++ b/plc4go/spi/values/PlcList.go
@@ -202,7 +202,7 @@ func (m PlcList) GetStruct() map[string]apiValues.PlcValue {
 //
 ///
 
-func (m PlcList) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcList) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.LIST
 }
 
@@ -228,5 +228,5 @@ func (m PlcList) Serialize(writeBuffer utils.WriteBuffer) error {
 func (m PlcList) String() string {
 	allBits := 0
 	// TODO: do we want to aggregate the bit length?
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), allBits, m.Values)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), allBits, m.Values)
 }
diff --git a/plc4go/spi/values/PlcStruct.go b/plc4go/spi/values/PlcStruct.go
index 133125230..10d721fdd 100644
--- a/plc4go/spi/values/PlcStruct.go
+++ b/plc4go/spi/values/PlcStruct.go
@@ -82,7 +82,7 @@ func (m PlcStruct) GetString() string {
 	return sb.String()
 }
 
-func (m PlcStruct) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcStruct) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.STRUCT
 }
 
@@ -113,5 +113,5 @@ func (m PlcStruct) Serialize(writeBuffer utils.WriteBuffer) error {
 func (m PlcStruct) String() string {
 	allBits := 0
 	// TODO: do we want to aggregate the bit length?
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), allBits, m.values)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), allBits, m.values)
 }
diff --git a/plc4go/spi/values/PlcValueAdapter.go b/plc4go/spi/values/PlcValueAdapter.go
index 09f1243e5..1e127f74d 100644
--- a/plc4go/spi/values/PlcValueAdapter.go
+++ b/plc4go/spi/values/PlcValueAdapter.go
@@ -237,8 +237,8 @@ func (m PlcValueAdapter) GetDateTime() time.Time {
 	panic("GetDateTime not implemented")
 }
 
-func (m PlcValueAdapter) GetPLCValueType() apiValues.PLCValueType {
-	panic("GetPLCValueType not implemented")
+func (m PlcValueAdapter) GetPlcValueType() apiValues.PlcValueType {
+	panic("GetPlcValueType not implemented")
 }
 
 type PlcSimpleValueAdapter struct {
diff --git a/plc4go/spi/values/REAL.go b/plc4go/spi/values/REAL.go
index 8f8b92f2f..4ff08e76b 100644
--- a/plc4go/spi/values/REAL.go
+++ b/plc4go/spi/values/REAL.go
@@ -163,7 +163,7 @@ func (m PlcREAL) GetString() string {
 	return fmt.Sprintf("%g", m.GetFloat32())
 }
 
-func (m PlcREAL) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcREAL) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.REAL
 }
 
@@ -172,5 +172,5 @@ func (m PlcREAL) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcREAL) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 32, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 32, m.value)
 }
diff --git a/plc4go/spi/values/RawPlcValue.go b/plc4go/spi/values/RawPlcValue.go
index d419453ef..30b7bc3df 100644
--- a/plc4go/spi/values/RawPlcValue.go
+++ b/plc4go/spi/values/RawPlcValue.go
@@ -83,10 +83,10 @@ func (m RawPlcValue) GetString() string {
 	return hex.EncodeToString(m.GetRaw())
 }
 
-func (m RawPlcValue) GetPLCValueType() apiValues.PLCValueType {
+func (m RawPlcValue) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.RAW_PLC_VALUE
 }
 
 func (m RawPlcValue) String() string {
-	return fmt.Sprintf("%s", m.GetPLCValueType())
+	return fmt.Sprintf("%s", m.GetPlcValueType())
 }
diff --git a/plc4go/spi/values/SINT.go b/plc4go/spi/values/SINT.go
index 39a401a2f..c4b808763 100644
--- a/plc4go/spi/values/SINT.go
+++ b/plc4go/spi/values/SINT.go
@@ -132,7 +132,7 @@ func (m PlcSINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcSINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcSINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.SINT
 }
 
@@ -141,5 +141,5 @@ func (m PlcSINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcSINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 8, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 8, m.value)
 }
diff --git a/plc4go/spi/values/STRING.go b/plc4go/spi/values/STRING.go
index 458038c3a..a5f3d8da3 100644
--- a/plc4go/spi/values/STRING.go
+++ b/plc4go/spi/values/STRING.go
@@ -50,7 +50,7 @@ func (m PlcSTRING) GetString() string {
 	return m.value
 }
 
-func (m PlcSTRING) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcSTRING) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.STRING
 }
 
@@ -59,5 +59,5 @@ func (m PlcSTRING) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcSTRING) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len([]rune(m.value))*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len([]rune(m.value))*8), m.value)
 }
diff --git a/plc4go/spi/values/TIME.go b/plc4go/spi/values/TIME.go
index 96e4a2cf8..b8321a68c 100644
--- a/plc4go/spi/values/TIME.go
+++ b/plc4go/spi/values/TIME.go
@@ -59,7 +59,7 @@ func (m PlcTIME) GetString() string {
 	return fmt.Sprintf("PT%0.fS", m.GetDuration().Seconds())
 }
 
-func (m PlcTIME) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcTIME) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.TIME
 }
 
@@ -68,5 +68,5 @@ func (m PlcTIME) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcTIME) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
 }
diff --git a/plc4go/spi/values/TIME_OF_DAY.go b/plc4go/spi/values/TIME_OF_DAY.go
index 43a879426..cf153e938 100644
--- a/plc4go/spi/values/TIME_OF_DAY.go
+++ b/plc4go/spi/values/TIME_OF_DAY.go
@@ -71,7 +71,7 @@ func (m PlcTIME_OF_DAY) GetString() string {
 	return m.value.Format("15:04:05.000")
 }
 
-func (m PlcTIME_OF_DAY) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcTIME_OF_DAY) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.TIME_OF_DAY
 }
 
@@ -80,5 +80,5 @@ func (m PlcTIME_OF_DAY) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcTIME_OF_DAY) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len([]rune(m.GetString()))*8), m.value)
 }
diff --git a/plc4go/spi/values/UDINT.go b/plc4go/spi/values/UDINT.go
index 3ba0f4d3a..1d902b992 100644
--- a/plc4go/spi/values/UDINT.go
+++ b/plc4go/spi/values/UDINT.go
@@ -140,7 +140,7 @@ func (m PlcUDINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcUDINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcUDINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.UDINT
 }
 
@@ -149,5 +149,5 @@ func (m PlcUDINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcUDINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 32, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 32, m.value)
 }
diff --git a/plc4go/spi/values/UINT.go b/plc4go/spi/values/UINT.go
index 2186b761e..bbdc294c3 100644
--- a/plc4go/spi/values/UINT.go
+++ b/plc4go/spi/values/UINT.go
@@ -126,7 +126,7 @@ func (m PlcUINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcUINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcUINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.UINT
 }
 
@@ -135,5 +135,5 @@ func (m PlcUINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcUINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 16, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 16, m.value)
 }
diff --git a/plc4go/spi/values/ULINT.go b/plc4go/spi/values/ULINT.go
index 243f2a1e6..ee7fcbb02 100644
--- a/plc4go/spi/values/ULINT.go
+++ b/plc4go/spi/values/ULINT.go
@@ -154,7 +154,7 @@ func (m PlcULINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcULINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcULINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.ULINT
 }
 
@@ -163,5 +163,5 @@ func (m PlcULINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcULINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 64, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 64, m.value)
 }
diff --git a/plc4go/spi/values/USINT.go b/plc4go/spi/values/USINT.go
index 12da8ac59..c5d7b0508 100644
--- a/plc4go/spi/values/USINT.go
+++ b/plc4go/spi/values/USINT.go
@@ -112,7 +112,7 @@ func (m PlcUSINT) GetString() string {
 	return strconv.Itoa(int(m.GetInt64()))
 }
 
-func (m PlcUSINT) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcUSINT) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.USINT
 }
 
@@ -121,5 +121,5 @@ func (m PlcUSINT) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcUSINT) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 8, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 8, m.value)
 }
diff --git a/plc4go/spi/values/WCHAR.go b/plc4go/spi/values/WCHAR.go
index f2996e7b4..731eb2f68 100644
--- a/plc4go/spi/values/WCHAR.go
+++ b/plc4go/spi/values/WCHAR.go
@@ -51,7 +51,7 @@ func (m PlcWCHAR) GetString() string {
 	return string(m.value)
 }
 
-func (m PlcWCHAR) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcWCHAR) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.WCHAR
 }
 
@@ -60,5 +60,5 @@ func (m PlcWCHAR) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcWCHAR) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len(m.value)*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len(m.value)*8), m.value)
 }
diff --git a/plc4go/spi/values/WORD.go b/plc4go/spi/values/WORD.go
index dd92a7ab6..548a51d1c 100644
--- a/plc4go/spi/values/WORD.go
+++ b/plc4go/spi/values/WORD.go
@@ -91,7 +91,7 @@ func (m PlcWORD) GetString() string {
 	return strVal
 }
 
-func (m PlcWORD) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcWORD) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.WORD
 }
 
@@ -100,5 +100,5 @@ func (m PlcWORD) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcWORD) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), 16, m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), 16, m.value)
 }
diff --git a/plc4go/spi/values/WSTRING.go b/plc4go/spi/values/WSTRING.go
index 89a9ed3c7..6a39c054f 100644
--- a/plc4go/spi/values/WSTRING.go
+++ b/plc4go/spi/values/WSTRING.go
@@ -51,7 +51,7 @@ func (m PlcWSTRING) GetString() string {
 	return string(m.value)
 }
 
-func (m PlcWSTRING) GetPLCValueType() apiValues.PLCValueType {
+func (m PlcWSTRING) GetPlcValueType() apiValues.PlcValueType {
 	return apiValues.WSTRING
 }
 
@@ -60,5 +60,5 @@ func (m PlcWSTRING) Serialize(writeBuffer utils.WriteBuffer) error {
 }
 
 func (m PlcWSTRING) String() string {
-	return fmt.Sprintf("%s(%dbit):%v", m.GetPLCValueType(), uint32(len(m.value)*8), m.value)
+	return fmt.Sprintf("%s(%dbit):%v", m.GetPlcValueType(), uint32(len(m.value)*8), m.value)
 }
diff --git a/plc4go/spi/values/value_combination_test.go b/plc4go/spi/values/value_combination_test.go
index a190e54c0..37a399aa0 100644
--- a/plc4go/spi/values/value_combination_test.go
+++ b/plc4go/spi/values/value_combination_test.go
@@ -34,7 +34,7 @@ import (
 
 func TestCombinations(t *testing.T) {
 	tests := []struct {
-		name      apiValues.PLCValueType
+		name      apiValues.PlcValueType
 		arguments []apiValues.PlcValue
 	}{
 		{
@@ -307,10 +307,10 @@ func TestCombinations(t *testing.T) {
 			for _, argument := range tt.arguments {
 				argumentCopy := argument
 				t.Run(fmt.Sprintf("%s", argument), func(t *testing.T) {
-					plcValueType := reflect.TypeOf((*apiValues.PlcValue)(nil)).Elem()
+					PlcValueType := reflect.TypeOf((*apiValues.PlcValue)(nil)).Elem()
 					methods := make(map[string]reflect.Method)
-					for i := 0; i < plcValueType.NumMethod(); i++ {
-						method := plcValueType.Method(i)
+					for i := 0; i < PlcValueType.NumMethod(); i++ {
+						method := PlcValueType.Method(i)
 						methods[method.Name] = method
 					}
 
diff --git a/plc4go/tests/drivers/tests/manual_cbus_driver_test.go b/plc4go/tests/drivers/tests/manual_cbus_driver_test.go
index 20d25c5e1..6fbc971d3 100644
--- a/plc4go/tests/drivers/tests/manual_cbus_driver_test.go
+++ b/plc4go/tests/drivers/tests/manual_cbus_driver_test.go
@@ -175,7 +175,7 @@ func TestManualDiscovery(t *testing.T) {
 	driver := cbus.NewDriver()
 	driverManager.RegisterDriver(driver)
 	transports.RegisterTcpTransport(driverManager)
-	err := driver.Discover(func(event model.PlcDiscoveryEvent) {
+	err := driver.Discover(func(event model.PlcDiscoveryItem) {
 		println(event.(fmt.Stringer).String())
 	})
 	require.NoError(t, err)
diff --git a/plc4go/tools/plc4xbrowser/ui/commands.go b/plc4go/tools/plc4xbrowser/ui/commands.go
index 70c76cf07..d2edfe39e 100644
--- a/plc4go/tools/plc4xbrowser/ui/commands.go
+++ b/plc4go/tools/plc4xbrowser/ui/commands.go
@@ -52,7 +52,7 @@ var rootCommand = Command{
 					if !driver.SupportsDiscovery() {
 						return errors.Errorf("%s doesn't support discovery", driverId)
 					}
-					return driver.Discover(func(event model.PlcDiscoveryEvent) {
+					return driver.Discover(func(event model.PlcDiscoveryItem) {
 						_, _ = fmt.Fprintf(messageOutput, "%v\n", event)
 					})
 				} else {


[plc4x] 03/05: chore(code-gen): Fixed some problems related to using startPos and curPos in expressions

Posted by cd...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/ads-symbol-discovery
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit e2c2a90cdb73f70970218914c82d436bbe633538
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Thu Aug 25 10:29:03 2022 +0200

    chore(code-gen):  Fixed some problems related to using startPos and curPos in expressions
---
 .../src/main/resources/templates/go/complex-type-template.go.ftlh  | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/code-generation/language-go/src/main/resources/templates/go/complex-type-template.go.ftlh b/code-generation/language-go/src/main/resources/templates/go/complex-type-template.go.ftlh
index d7f09f89f..ea2e9ae40 100644
--- a/code-generation/language-go/src/main/resources/templates/go/complex-type-template.go.ftlh
+++ b/code-generation/language-go/src/main/resources/templates/go/complex-type-template.go.ftlh
@@ -753,8 +753,11 @@ func ${type.name}Parse(readBuffer utils.ReadBuffer<#if hasParserArguments>, ${pa
 	}
 	currentPos := positionAware.GetPos()
 	_ = currentPos
-	<#if helper.requiresStartPosAndCurPos()>
+	<#if helper.requiresStartPos() || helper.requiresCurPos()>
 	var startPos = positionAware.GetPos()
+	_ = startPos
+	</#if>
+	<#if helper.requiresCurPos()>
 	var curPos uint16
 	</#if>
 	<#assign reservedFieldIndex=0>
@@ -996,7 +999,7 @@ func ${type.name}Parse(readBuffer utils.ReadBuffer<#if hasParserArguments>, ${pa
 		return nil, errors.Wrap(_${constField.name}Err, "Error parsing '${constField.name}' field of ${type.name}")<@emitImport import="github.com/pkg/errors" />
 	}
 	if ${constField.name} != ${type.name}_${constField.name?upper_case} {
-		return nil, errors.New("Expected constant value " + fmt.Sprintf("%d", ${type.name}_${constField.name?upper_case}) + " but got " + fmt.Sprintf("%d", ${constField.name}))<@emitImport import="github.com/pkg/errors" /><@emitImport import="fmt" />
+		return nil, errors.New("Expected constant value " + fmt.Sprintf("%<#if constField.type.isBooleanTypeReference()>t<#else>d</#if>", ${type.name}_${constField.name?upper_case}) + " but got " + fmt.Sprintf("%<#if constField.type.isBooleanTypeReference()>t<#else>d</#if>", ${constField.name}))<@emitImport import="github.com/pkg/errors" /><@emitImport import="fmt" />
 	}
 				<#break>
 			<#case "discriminator">