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 2020/11/11 10:14:58 UTC

[plc4x] branch feature/plc4go updated (da01c44 -> 5d19d05)

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

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


    from da01c44  - Started implementing discovery for KNX
     new a6899ec  - Renamed the KNX config option "group-address-type" to "group-address-num-levels" - Implemented a first version of the subscription API in Go - Got the PLC4Go KNX driver working (Connect, Ping and Subscribe)
     new 5d19d05  - Increased the timeout in order to avoid random test-failures in the integration-tests

The 2 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:
 plc4go/cmd/main/drivers/knxnetip_test.go           |  12 +-
 .../internal/plc4go/knxnetip/KncNetIpConnection.go | 125 ++++++++++++++------
 plc4go/internal/plc4go/knxnetip/KnxNetIpField.go   |  81 ++++++++++++-
 .../plc4go/knxnetip/KnxNetIpMessageCodec.go        |  13 ++-
 .../internal/plc4go/knxnetip/KnxNetIpSubscriber.go | 129 +++++++++++++++++++++
 plc4go/internal/plc4go/modbus/ModbusConnection.go  |   4 +-
 .../internal/plc4go/modbus/ModbusMessageCodec.go   |  13 ++-
 plc4go/internal/plc4go/modbus/ModbusReader.go      |   4 +-
 plc4go/internal/plc4go/modbus/ModbusWriter.go      |   4 +-
 .../plc4go/model/DefaultPlcSubscriptionEvent.go    | 103 ++++++++++++++++
 .../plc4go/model/DefaultPlcSubscriptionRequest.go  |   8 +-
 ...sponse.go => DefaultPlcSubscriptionResponse.go} |  33 +++---
 plc4go/internal/plc4go/spi/MessageCodec.go         |   2 +-
 plc4go/pkg/plc4go/model/plc_read_response.go       |   1 +
 .../pkg/plc4go/model/plc_subscription_request.go   |   3 +
 .../pkg/plc4go/model/plc_subscription_response.go  |   5 +-
 .../java/ads/configuration/AdsConfiguration.java   |   4 +-
 .../configuration/KnxNetIpConfiguration.java       |  14 +--
 .../knxnetip/context/KnxNetIpDriverContext.java    |   2 +-
 .../plc4x/java/knxnetip/ets5/model/Ets5Model.java  |   2 +-
 src/site/asciidoc/users/protocols/knxnetip.adoc    |   3 +-
 21 files changed, 474 insertions(+), 91 deletions(-)
 create mode 100644 plc4go/internal/plc4go/knxnetip/KnxNetIpSubscriber.go
 create mode 100644 plc4go/internal/plc4go/model/DefaultPlcSubscriptionEvent.go
 copy plc4go/internal/plc4go/model/{DefaultPlcReadResponse.go => DefaultPlcSubscriptionResponse.go} (72%)


[plc4x] 02/02: - Increased the timeout in order to avoid random test-failures in the integration-tests

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

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

commit 5d19d05c33d8d440d3cb3c4186396771cd972bab
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed Nov 11 11:14:50 2020 +0100

    - Increased the timeout in order to avoid random test-failures in the integration-tests
---
 .../org/apache/plc4x/java/ads/configuration/AdsConfiguration.java     | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/configuration/AdsConfiguration.java b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/configuration/AdsConfiguration.java
index 5d71319..6a7e5c8 100644
--- a/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/configuration/AdsConfiguration.java
+++ b/plc4j/drivers/ads/src/main/java/org/apache/plc4x/java/ads/configuration/AdsConfiguration.java
@@ -57,11 +57,11 @@ public class AdsConfiguration implements Configuration, TcpTransportConfiguratio
     protected int sourceAmsPort;
 
     @ConfigurationParameter("timeout-symbolic-address-resolution")
-    @IntDefaultValue(1000)
+    @IntDefaultValue(2000)
     protected int timeoutSymbolicAddressResolution;
 
     @ConfigurationParameter("timeout-request")
-    @IntDefaultValue(2000)
+    @IntDefaultValue(4000)
     protected int timeoutRequest;
 
     public AmsNetId getTargetAmsNetId() {


[plc4x] 01/02: - Renamed the KNX config option "group-address-type" to "group-address-num-levels" - Implemented a first version of the subscription API in Go - Got the PLC4Go KNX driver working (Connect, Ping and Subscribe)

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

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

commit a6899ec58c114b4a46815061b8d3f15fdf5c356c
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed Nov 11 11:14:03 2020 +0100

    - Renamed the KNX config option "group-address-type" to "group-address-num-levels"
    - Implemented a first version of the subscription API in Go
    - Got the PLC4Go KNX driver working (Connect, Ping and Subscribe)
---
 plc4go/cmd/main/drivers/knxnetip_test.go           |  12 +-
 .../internal/plc4go/knxnetip/KncNetIpConnection.go | 125 ++++++++++++++------
 plc4go/internal/plc4go/knxnetip/KnxNetIpField.go   |  81 ++++++++++++-
 .../plc4go/knxnetip/KnxNetIpMessageCodec.go        |  13 ++-
 .../internal/plc4go/knxnetip/KnxNetIpSubscriber.go | 129 +++++++++++++++++++++
 plc4go/internal/plc4go/modbus/ModbusConnection.go  |   4 +-
 .../internal/plc4go/modbus/ModbusMessageCodec.go   |  13 ++-
 plc4go/internal/plc4go/modbus/ModbusReader.go      |   4 +-
 plc4go/internal/plc4go/modbus/ModbusWriter.go      |   4 +-
 .../plc4go/model/DefaultPlcSubscriptionEvent.go    | 103 ++++++++++++++++
 .../plc4go/model/DefaultPlcSubscriptionRequest.go  |   8 +-
 .../plc4go/model/DefaultPlcSubscriptionResponse.go |  89 ++++++++++++++
 plc4go/internal/plc4go/spi/MessageCodec.go         |   2 +-
 plc4go/pkg/plc4go/model/plc_read_response.go       |   1 +
 .../pkg/plc4go/model/plc_subscription_request.go   |   3 +
 .../pkg/plc4go/model/plc_subscription_response.go  |   5 +-
 .../configuration/KnxNetIpConfiguration.java       |  14 +--
 .../knxnetip/context/KnxNetIpDriverContext.java    |   2 +-
 .../plc4x/java/knxnetip/ets5/model/Ets5Model.java  |   2 +-
 src/site/asciidoc/users/protocols/knxnetip.adoc    |   3 +-
 20 files changed, 548 insertions(+), 69 deletions(-)

diff --git a/plc4go/cmd/main/drivers/knxnetip_test.go b/plc4go/cmd/main/drivers/knxnetip_test.go
index 6104e46..187f62a 100644
--- a/plc4go/cmd/main/drivers/knxnetip_test.go
+++ b/plc4go/cmd/main/drivers/knxnetip_test.go
@@ -79,15 +79,16 @@ func TestKnxNetIpPlc4goDriver(t *testing.T) {
     defer connection.Close()
 
     // Prepare a read-request
-    pollingInterval, err := time.ParseDuration("5s")
+    /*pollingInterval, err := time.ParseDuration("5s")
     if err != nil {
         t.Errorf("invalid format")
         t.Fail()
         return
-    }
+    }*/
     srb := connection.SubscriptionRequestBuilder()
-    srb.AddChangeOfStateItem("field1", "*/*/*")
-    srb.AddCyclicItem("field2", "holding-register:3:REAL", pollingInterval)
+    srb.AddChangeOfStateItem("heating-actual-temperature", "*/*/10:DPT_Value_Temp")
+    srb.AddChangeOfStateItem("heating-target-temperature", "*/*/11:DPT_Value_Temp")
+    srb.AddChangeOfStateItem("heating-valve-open", "*/*/12:DPT_OpenClose")
     srb.AddItemHandler(knxEventHandler)
     subscriptionRequest, err := srb.Build()
     if err != nil {
@@ -107,6 +108,9 @@ func TestKnxNetIpPlc4goDriver(t *testing.T) {
         return
     }
 
+    // Wait 2 minutes
+    time.Sleep(120 * time.Second)
+
     // Do something with the response
     /*value1 := rrr.Response.GetValue("field1")
     value2 := rrr.Response.GetValue("field2")
diff --git a/plc4go/internal/plc4go/knxnetip/KncNetIpConnection.go b/plc4go/internal/plc4go/knxnetip/KncNetIpConnection.go
index 0093bbd..681f5fe 100644
--- a/plc4go/internal/plc4go/knxnetip/KncNetIpConnection.go
+++ b/plc4go/internal/plc4go/knxnetip/KncNetIpConnection.go
@@ -58,6 +58,7 @@ type KnxNetIpConnection struct {
     fieldHandler             spi.PlcFieldHandler
     valueHandler             spi.PlcValueHandler
     quitConnectionStateTimer chan struct{}
+    subscribers              []*KnxNetIpSubscriber
 
     GatewayKnxAddress      *driverModel.KnxAddress
     GatewayName            string
@@ -68,17 +69,18 @@ type KnxNetIpConnection struct {
     plc4go.PlcConnection
 }
 
-func NewKnxNetIpConnection(messageCodec spi.MessageCodec, options map[string][]string, fieldHandler spi.PlcFieldHandler) KnxNetIpConnection {
-    return KnxNetIpConnection{
+func NewKnxNetIpConnection(messageCodec spi.MessageCodec, options map[string][]string, fieldHandler spi.PlcFieldHandler) *KnxNetIpConnection {
+    return &KnxNetIpConnection{
         messageCodec:       messageCodec,
         options:            options,
         fieldHandler:       fieldHandler,
         valueHandler:       NewValueHandler(),
         requestInterceptor: interceptors.NewSingleItemRequestInterceptor(),
+        subscribers:        []*KnxNetIpSubscriber{},
     }
 }
 
-func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
+func (m *KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
     ch := make(chan plc4go.PlcConnectionConnectResult)
     go func() {
         err := m.messageCodec.Connect()
@@ -113,9 +115,9 @@ func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
             return
         }
         // Register an expected response
-        check := func(response interface{}) bool {
+        check := func(response interface{}) (bool, bool) {
             searchResponse := driverModel.CastSearchResponse(response)
-            return searchResponse != nil
+            return searchResponse != nil, false
         }
 
         // Create a channel for async execution of the connection
@@ -144,12 +146,11 @@ func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
 
                 // As soon as we got a successful search-response back, send a connection request.
                 localAddress := m.castIpToKnxAddress(udpTransportInstance.LocalAddress.IP)
-                remoteAddress := m.castIpToKnxAddress(udpTransportInstance.RemoteAddress.IP)
                 connectionRequest := driverModel.NewConnectionRequest(
                     driverModel.NewHPAIDiscoveryEndpoint(driverModel.HostProtocolCode_IPV4_UDP,
                         localAddress, uint16(udpTransportInstance.LocalAddress.Port)),
                     driverModel.NewHPAIDataEndpoint(driverModel.HostProtocolCode_IPV4_UDP,
-                        remoteAddress, uint16(udpTransportInstance.RemoteAddress.Port)),
+                        localAddress, uint16(udpTransportInstance.LocalAddress.Port)),
                     driverModel.NewConnectionRequestInformationTunnelConnection(driverModel.KnxLayer_TUNNEL_LINK_LAYER),
                 )
 
@@ -162,15 +163,11 @@ func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
                     return
                 }
                 // Register an expected response
-                check := func(response interface{}) bool {
+                check := func(response interface{}) (bool, bool) {
                     connectionResponse := driverModel.CastConnectionResponse(response)
-                    return connectionResponse != nil
+                    return connectionResponse != nil, false
                 }
 
-                // Expected:    06100205001a 0801c0a82a32c70e 0801c0a82a32c70e 04040200
-                //                      xxxx
-                // Got:         061002050026 0801c0a82a32fd37 140100000000000000000000ffffc0a82a0b0e57 04040200
-
                 // Register a callback to handle the response
                 connectionResponseChan := m.messageCodec.Expect(check)
                 go func() {
@@ -179,6 +176,18 @@ func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
                     // Save the communication channel id
                     m.CommunicationChannelId = connectionResponse.CommunicationChannelId
                     if connectionResponse.Status == driverModel.Status_NO_ERROR {
+                        // Register a listener for incoming tunneling requests
+                        checkTunnelReq := func(response interface{}) (bool, bool) {
+                            tunnelingRequest := driverModel.CastTunnelingRequest(response)
+                            return (tunnelingRequest != nil) &&
+                                    (tunnelingRequest.TunnelingRequestDataBlock.CommunicationChannelId == m.CommunicationChannelId),
+                                true
+                        }
+                        tunnelingRequestChan := m.messageCodec.Expect(checkTunnelReq)
+                        go func() {
+                            m.handleIncomingTunnelingRequest(tunnelingRequestChan)
+                        }()
+
                         tunnelConnectionDataBlock := connectionResponse.ConnectionResponseDataBlock.Child.(
                         *driverModel.ConnectionResponseDataBlockTunnelConnection)
                         // Save the KNX Address the Gateway assigned to this connection.
@@ -201,7 +210,7 @@ func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
                                 case <-connectionStateTimer.C:
                                     // We're using the connection-state-request as ping operation ...
                                     ping := m.Ping()
-                                    pingResult := <- ping
+                                    pingResult := <-ping
                                     if pingResult.Err != nil {
                                         // TODO: Do some error handling here ...
                                         connectionStateTimer.Stop()
@@ -215,7 +224,7 @@ func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
                         }()
                     } else {
                         ch <- plc4go.NewPlcConnectionConnectResult(m,
-                            errors.New("got a connection response with status " + strconv.Itoa(int(connectionResponse.Status))))
+                            errors.New("got a connection response with status "+strconv.Itoa(int(connectionResponse.Status))))
                     }
                 }()
             } else {
@@ -230,7 +239,7 @@ func (m KnxNetIpConnection) Connect() <-chan plc4go.PlcConnectionConnectResult {
     return ch
 }
 
-func (m KnxNetIpConnection) Close() <-chan plc4go.PlcConnectionCloseResult {
+func (m *KnxNetIpConnection) Close() <-chan plc4go.PlcConnectionCloseResult {
     // TODO: Implement ...
     ch := make(chan plc4go.PlcConnectionCloseResult)
     go func() {
@@ -239,11 +248,11 @@ func (m KnxNetIpConnection) Close() <-chan plc4go.PlcConnectionCloseResult {
     return ch
 }
 
-func (m KnxNetIpConnection) IsConnected() bool {
+func (m *KnxNetIpConnection) IsConnected() bool {
     panic("implement me")
 }
 
-func (m KnxNetIpConnection) Ping() <-chan plc4go.PlcConnectionPingResult {
+func (m *KnxNetIpConnection) Ping() <-chan plc4go.PlcConnectionPingResult {
     result := make(chan plc4go.PlcConnectionPingResult)
     //	diagnosticRequestPdu := driverModel.NewModbusPDUDiagnosticRequest(0, 0x42)
     go func() {
@@ -277,9 +286,9 @@ func (m KnxNetIpConnection) Ping() <-chan plc4go.PlcConnectionPingResult {
             return
         }
         // Register an expected response
-        check := func(response interface{}) bool {
+        check := func(response interface{}) (bool, bool) {
             connectionStateResponse := driverModel.CastConnectionStateResponse(response)
-            return connectionStateResponse != nil
+            return connectionStateResponse != nil, false
         }
 
         // Register a callback to handle the response
@@ -298,44 +307,94 @@ func (m KnxNetIpConnection) Ping() <-chan plc4go.PlcConnectionPingResult {
     return result
 }
 
-func (m KnxNetIpConnection) GetMetadata() apiModel.PlcConnectionMetadata {
+func (m *KnxNetIpConnection) GetMetadata() apiModel.PlcConnectionMetadata {
     return ConnectionMetadata{}
 }
 
-func (m KnxNetIpConnection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder {
+func (m *KnxNetIpConnection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder {
     panic("this connection doesn't support reading")
 }
 
-func (m KnxNetIpConnection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder {
+func (m *KnxNetIpConnection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder {
     return internalModel.NewDefaultPlcWriteRequestBuilder(
         m.fieldHandler, m.valueHandler, NewKnxNetIpWriter(m.messageCodec))
 }
 
-func (m KnxNetIpConnection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder {
-    return nil /*internalModel.NewDefaultPlcSubscriptionRequestBuilder(
-      m.fieldHandler, m.valueHandler, NewKnxNetIpSubscriber(m.unitIdentifier, m.messageCodec))*/
+func (m *KnxNetIpConnection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder {
+    return internalModel.NewDefaultPlcSubscriptionRequestBuilder(
+        m.fieldHandler, m.valueHandler, NewKnxNetIpSubscriber(m))
 }
 
-func (m KnxNetIpConnection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder {
+func (m *KnxNetIpConnection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder {
     return nil /*internalModel.NewDefaultPlcUnsubscriptionRequestBuilder(
-      m.fieldHandler, m.valueHandler, NewKnxNetIpSubscriber(m.unitIdentifier, m.messageCodec))*/
+      m.fieldHandler, m.valueHandler, NewKnxNetIpSubscriber(m.messageCodec))*/
 }
 
-func (m KnxNetIpConnection) GetTransportInstance() transports.TransportInstance {
+func (m *KnxNetIpConnection) GetTransportInstance() transports.TransportInstance {
     if mc, ok := m.messageCodec.(spi.TransportInstanceExposer); ok {
         return mc.GetTransportInstance()
     }
     return nil
 }
 
-func (m KnxNetIpConnection) GetPlcFieldHandler() spi.PlcFieldHandler {
+func (m *KnxNetIpConnection) GetPlcFieldHandler() spi.PlcFieldHandler {
     return m.fieldHandler
 }
 
-func (m KnxNetIpConnection) GetPlcValueHandler() spi.PlcValueHandler {
+func (m *KnxNetIpConnection) GetPlcValueHandler() spi.PlcValueHandler {
     return m.valueHandler
 }
 
-func (m KnxNetIpConnection) castIpToKnxAddress(ip net.IP) *driverModel.IPAddress {
-    return driverModel.NewIPAddress(utils.ByteToInt8(ip)[len(ip) - 4:])
+func (m *KnxNetIpConnection) castIpToKnxAddress(ip net.IP) *driverModel.IPAddress {
+    return driverModel.NewIPAddress(utils.ByteToInt8(ip)[len(ip)-4:])
+}
+
+func (m *KnxNetIpConnection) handleIncomingTunnelingRequest(tunnelingRequestChan chan interface{}) {
+    for {
+        msg := <-tunnelingRequestChan
+        tunnelingRequest := driverModel.CastTunnelingRequest(msg)
+        // Send a response for this message
+        tunnelingResponse := driverModel.NewTunnelingResponse(driverModel.NewTunnelingResponseDataBlock(
+            m.CommunicationChannelId, tunnelingRequest.TunnelingRequestDataBlock.SequenceCounter,
+            driverModel.Status_NO_ERROR))
+        err := m.messageCodec.Send(tunnelingResponse)
+        if err != nil {
+            // TODO: Somehow react on this ...
+            break
+        }
+
+        cemiDataInd := driverModel.CastCEMIDataInd(tunnelingRequest.Cemi.Child)
+        if cemiDataInd != nil {
+            for _, subscriber := range m.subscribers {
+                subscriber.handle(cemiDataInd.CemiDataFrame)
+            }
+        }
+    }
+}
+
+func (m *KnxNetIpConnection) getGroupAddressNumLevels() uint8 {
+    if val, ok := m.options["group-address-num-levels"]; ok {
+        groupAddressNumLevels, err := strconv.Atoi(val[0])
+        if err == nil {
+            return uint8(groupAddressNumLevels)
+        }
+    }
+    return 3
+}
+
+func (m *KnxNetIpConnection) addSubscriber(subscriber *KnxNetIpSubscriber) {
+    for _, sub := range m.subscribers {
+        if sub == subscriber {
+            return
+        }
+    }
+    m.subscribers = append(m.subscribers, subscriber)
+}
+
+func (m *KnxNetIpConnection) removeSubscriber(subscriber *KnxNetIpSubscriber) {
+    for i, sub := range m.subscribers {
+        if sub == subscriber {
+            m.subscribers = append(m.subscribers[:i], m.subscribers[i+1:]...)
+        }
+    }
 }
diff --git a/plc4go/internal/plc4go/knxnetip/KnxNetIpField.go b/plc4go/internal/plc4go/knxnetip/KnxNetIpField.go
index fee5a54..cb8c96f 100644
--- a/plc4go/internal/plc4go/knxnetip/KnxNetIpField.go
+++ b/plc4go/internal/plc4go/knxnetip/KnxNetIpField.go
@@ -21,11 +21,15 @@ package knxnetip
 import (
     "errors"
     "plc4x.apache.org/plc4go/v0/internal/plc4go/knxnetip/readwrite/model"
-    model2 "plc4x.apache.org/plc4go/v0/pkg/plc4go/model"
+    driverModel "plc4x.apache.org/plc4go/v0/internal/plc4go/knxnetip/readwrite/model"
+    apiModel "plc4x.apache.org/plc4go/v0/pkg/plc4go/model"
+    "strconv"
+    "strings"
 )
 
 type KnxNetIpField interface {
-     model2.PlcField
+    matches(knxGroupAddress driverModel.KnxGroupAddress) bool
+    apiModel.PlcField
 }
 
 type KnxNetIpGroupAddress3LevelPlcField struct {
@@ -56,6 +60,16 @@ func (k KnxNetIpGroupAddress3LevelPlcField) GetQuantity() uint16 {
     return 1
 }
 
+func (k KnxNetIpGroupAddress3LevelPlcField) matches(knxGroupAddress driverModel.KnxGroupAddress) bool {
+    level3KnxGroupAddress := driverModel.CastKnxGroupAddress3Level(knxGroupAddress)
+    if level3KnxGroupAddress == nil {
+        return false
+    }
+    return matches(k.MainGroup, strconv.Itoa(int(level3KnxGroupAddress.MainGroup))) &&
+        matches(k.MiddleGroup, strconv.Itoa(int(level3KnxGroupAddress.MiddleGroup))) &&
+        matches(k.SubGroup, strconv.Itoa(int(level3KnxGroupAddress.SubGroup)))
+}
+
 type KnxNetIpGroupAddress2LevelPlcField struct {
     FieldType   *model.KnxDatapointType
     // 5 Bits: Values 0-31
@@ -81,6 +95,15 @@ func (k KnxNetIpGroupAddress2LevelPlcField) GetQuantity() uint16 {
     return 1
 }
 
+func (k KnxNetIpGroupAddress2LevelPlcField) matches(knxGroupAddress driverModel.KnxGroupAddress) bool {
+    level2KnxGroupAddress := driverModel.CastKnxGroupAddress2Level(knxGroupAddress)
+    if level2KnxGroupAddress == nil {
+        return false
+    }
+    return matches(k.MainGroup, strconv.Itoa(int(level2KnxGroupAddress.MainGroup))) &&
+        matches(k.SubGroup, strconv.Itoa(int(level2KnxGroupAddress.SubGroup)))
+}
+
 type KnxNetIpGroupAddress1LevelPlcField struct {
     FieldType   *model.KnxDatapointType
     // 16 Bits
@@ -103,9 +126,61 @@ func (k KnxNetIpGroupAddress1LevelPlcField) GetQuantity() uint16 {
     return 1
 }
 
-func CastToKnxNetIpFieldFromPlcField(plcField model2.PlcField) (KnxNetIpField, error) {
+func (k KnxNetIpGroupAddress1LevelPlcField) matches(knxGroupAddress driverModel.KnxGroupAddress) bool {
+    level1KnxGroupAddress := driverModel.CastKnxGroupAddressFreeLevel(knxGroupAddress)
+    if level1KnxGroupAddress == nil {
+        return false
+    }
+    return matches(k.MainGroup, strconv.Itoa(int(level1KnxGroupAddress.SubGroup)))
+}
+
+func CastToKnxNetIpFieldFromPlcField(plcField apiModel.PlcField) (KnxNetIpField, error) {
     if knxNetIpField, ok := plcField.(KnxNetIpField); ok {
         return knxNetIpField, nil
     }
     return nil, errors.New("couldn't cast to KnxNetIpField")
 }
+
+func matches(pattern string, groupAddressPart string) bool {
+    // A "*" simply matches everything
+    if pattern == "*" {
+        return true
+    }
+    // If the pattern starts and ends with square brackets, it's a list of values or range queries
+    if strings.HasPrefix(pattern, "[") && strings.HasSuffix(pattern, "]") {
+        matches := true
+        for _, segment := range strings.Split(pattern, ",") {
+            if strings.Contains(segment, "-") {
+                // If the segment contains a "-", then it's a range query
+                split := strings.Split(segment, "-")
+                if len(split) == 2 {
+                    if val, err := strconv.Atoi(groupAddressPart); err != nil {
+                        var err error
+                        var from int
+                        if from, err = strconv.Atoi(split[0]); err != nil {
+                            continue
+                        }
+                        if val < from {
+                            continue
+                        }
+                        var to int
+                        if to, err = strconv.Atoi(split[1]); err == nil {
+                            continue
+                        }
+                        if val > to {
+                            continue
+                        }
+                        matches = true
+                    }
+                }
+            } else if segment == groupAddressPart {
+                // In all other cases it's an explicit value
+                matches = true
+            }
+        }
+        return matches
+    } else {
+        return pattern == groupAddressPart
+    }
+    return false
+}
diff --git a/plc4go/internal/plc4go/knxnetip/KnxNetIpMessageCodec.go b/plc4go/internal/plc4go/knxnetip/KnxNetIpMessageCodec.go
index 90f288d..21dcca4 100644
--- a/plc4go/internal/plc4go/knxnetip/KnxNetIpMessageCodec.go
+++ b/plc4go/internal/plc4go/knxnetip/KnxNetIpMessageCodec.go
@@ -29,7 +29,7 @@ import (
 
 type KnxNetIpExpectation struct {
 	timestamp       time.Time
-	check           func(interface{}) bool
+	check           func(interface{}) (bool, bool)
 	responseChannel chan interface{}
 }
 
@@ -105,7 +105,7 @@ func (m *KnxNetIpMessageCodec) Receive() (interface{}, error) {
 	return nil, nil
 }
 
-func (m *KnxNetIpMessageCodec) Expect(check func(interface{}) bool) chan interface{} {
+func (m *KnxNetIpMessageCodec) Expect(check func(interface{}) (bool, bool)) chan interface{} {
 	responseChanel := make(chan interface{})
 	expectation := KnxNetIpExpectation{
 		timestamp:       time.Now(),
@@ -129,11 +129,14 @@ func work(codec *KnxNetIpMessageCodec) {
 				// Go through all expectations
 				for index, expectation := range codec.expectations {
 					// Check if the current message matches the expectations
-					if expectation.check(message) {
+					if match, keepExpectation := expectation.check(message); match {
 						// Send the decoded message back
 						expectation.responseChannel <- message
-						// Remove this expectation from the list.
-						codec.expectations = append(codec.expectations[:index], codec.expectations[index+1:]...)
+						// If the expectation doesn't want to keep the expectation active, remove it
+						if !keepExpectation {
+                            // Remove this expectation from the list.
+                            codec.expectations = append(codec.expectations[:index], codec.expectations[index+1:]...)
+                        }
 						messageHandled = true
 						break
 					}
diff --git a/plc4go/internal/plc4go/knxnetip/KnxNetIpSubscriber.go b/plc4go/internal/plc4go/knxnetip/KnxNetIpSubscriber.go
new file mode 100644
index 0000000..4bdad4d
--- /dev/null
+++ b/plc4go/internal/plc4go/knxnetip/KnxNetIpSubscriber.go
@@ -0,0 +1,129 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package knxnetip
+
+import (
+    driverModel "plc4x.apache.org/plc4go/v0/internal/plc4go/knxnetip/readwrite/model"
+    internalModel "plc4x.apache.org/plc4go/v0/internal/plc4go/model"
+    "plc4x.apache.org/plc4go/v0/internal/plc4go/spi"
+    "plc4x.apache.org/plc4go/v0/internal/plc4go/utils"
+    apiModel "plc4x.apache.org/plc4go/v0/pkg/plc4go/model"
+    "plc4x.apache.org/plc4go/v0/pkg/plc4go/values"
+    "time"
+)
+
+type KnxNetIpSubscriber struct {
+    connection           *KnxNetIpConnection
+    subscriptionRequests []internalModel.DefaultPlcSubscriptionRequest
+    spi.PlcWriter
+}
+
+func NewKnxNetIpSubscriber(connection *KnxNetIpConnection) *KnxNetIpSubscriber {
+    return &KnxNetIpSubscriber{
+        connection: connection,
+        subscriptionRequests: []internalModel.DefaultPlcSubscriptionRequest{},
+    }
+}
+
+func (m *KnxNetIpSubscriber) Subscribe(subscriptionRequest apiModel.PlcSubscriptionRequest) <-chan apiModel.PlcSubscriptionRequestResult {
+    result := make(chan apiModel.PlcSubscriptionRequestResult)
+    go func() {
+        // Add this subscriber to the connection.
+        m.connection.addSubscriber(m)
+
+        // Save the subscription request
+        m.subscriptionRequests = append(m.subscriptionRequests, subscriptionRequest.(internalModel.DefaultPlcSubscriptionRequest))
+
+        // Just populate all requests with an OK
+        responseCodes := map[string]apiModel.PlcResponseCode{}
+        for _, fieldName := range subscriptionRequest.GetFieldNames() {
+            responseCodes[fieldName] = apiModel.PlcResponseCode_OK
+        }
+
+        result <- apiModel.PlcSubscriptionRequestResult{
+            Request:  subscriptionRequest,
+            Response: internalModel.NewDefaultPlcSubscriptionResponse(subscriptionRequest, responseCodes),
+            Err:      nil,
+        }
+    }()
+    return result
+}
+
+func (m *KnxNetIpSubscriber) Unsubscribe(unsubscriptionRequest apiModel.PlcUnsubscriptionRequest) <-chan apiModel.PlcUnsubscriptionRequestResult {
+    result := make(chan apiModel.PlcUnsubscriptionRequestResult)
+
+    // TODO: As soon as we establish a connection, we start getting data...
+    // subscriptions are more an internal handling of which values to pass where.
+
+    return result
+}
+
+func (m *KnxNetIpSubscriber) handle(cemiDataFrame *driverModel.CEMIDataFrame) {
+    // Decode the group-address according to the settings in the driver
+    // Group addresses can be 1, 2 or 3 levels (3 being the default)
+    garb := utils.NewReadBuffer(utils.Int8ToUint8(cemiDataFrame.DestinationAddress))
+    groupAddress, err := driverModel.KnxGroupAddressParse(garb, m.connection.getGroupAddressNumLevels())
+    if err != nil {
+        return
+    }
+
+    // Go through all subscription-requests and process each separately
+    for _, subscriptionRequest := range m.subscriptionRequests {
+        fields := map[string]apiModel.PlcField{}
+        types := map[string]internalModel.SubscriptionType{}
+        intervals := map[string]time.Duration{}
+        responseCodes := map[string]apiModel.PlcResponseCode{}
+        plcValues := map[string]values.PlcValue{}
+
+        // Check if this datagram matches any address in this subscription request
+        // As depending on the address used for fields, the decoding is different, we need to decode on-demand here.
+        for _, fieldName := range subscriptionRequest.GetFieldNames() {
+            field, err := CastToKnxNetIpFieldFromPlcField(subscriptionRequest.GetField(fieldName))
+            if err != nil {
+                continue
+            }
+            // If it matches, take the datatype of each matching field and try to decode the payload
+            if field.matches(*groupAddress) {
+                var payload []uint8
+                payload = append(payload, uint8(cemiDataFrame.DataFirstByte))
+                payload = append(payload, utils.Int8ToByte(cemiDataFrame.Data)...)
+                rb := utils.NewReadBuffer(payload)
+                plcValue, err := driverModel.KnxDatapointParse(rb, field.GetTypeName())
+                fields[fieldName] = field
+                types[fieldName] = subscriptionRequest.GetType(fieldName)
+                intervals[fieldName] = subscriptionRequest.GetInterval(fieldName)
+                if err == nil {
+                    responseCodes[fieldName] = apiModel.PlcResponseCode_OK
+                    plcValues[fieldName] = plcValue
+                } else {
+                    // TODO: Do a little more here ...
+                    responseCodes[fieldName] = apiModel.PlcResponseCode_INTERNAL_ERROR
+                    plcValues[fieldName] = nil
+                }
+            }
+        }
+
+        // Assemble a PlcSubscription event
+        if len(plcValues) > 0 {
+            event := internalModel.NewDefaultPlcSubscriptionEvent(fields, types, intervals, responseCodes, plcValues)
+            eventHandler := subscriptionRequest.GetEventHandler()
+            eventHandler(event)
+        }
+    }
+}
diff --git a/plc4go/internal/plc4go/modbus/ModbusConnection.go b/plc4go/internal/plc4go/modbus/ModbusConnection.go
index d7b2a1d..84d1277 100644
--- a/plc4go/internal/plc4go/modbus/ModbusConnection.go
+++ b/plc4go/internal/plc4go/modbus/ModbusConnection.go
@@ -99,10 +99,10 @@ func (m ModbusConnection) Ping() <-chan plc4go.PlcConnectionPingResult {
 			return
 		}
 		// Register an expected response
-		check := func(response interface{}) bool {
+		check := func(response interface{}) (bool, bool) {
 			responseAdu := driverModel.CastModbusTcpADU(response)
 			return responseAdu.TransactionIdentifier == 1 &&
-				responseAdu.UnitIdentifier == m.unitIdentifier
+				responseAdu.UnitIdentifier == m.unitIdentifier, false
 		}
 		// Register a callback to handle the response
 		pingResponseChanel := m.messageCodec.Expect(check)
diff --git a/plc4go/internal/plc4go/modbus/ModbusMessageCodec.go b/plc4go/internal/plc4go/modbus/ModbusMessageCodec.go
index dcd0b0a..85269f1 100644
--- a/plc4go/internal/plc4go/modbus/ModbusMessageCodec.go
+++ b/plc4go/internal/plc4go/modbus/ModbusMessageCodec.go
@@ -29,7 +29,7 @@ import (
 
 type ModbusExpectation struct {
 	timestamp       time.Time
-	check           func(interface{}) bool
+	check           func(interface{}) (bool, bool)
 	responseChannel chan interface{}
 }
 
@@ -104,7 +104,7 @@ func (m *ModbusMessageCodec) Receive() (interface{}, error) {
 	return nil, nil
 }
 
-func (m *ModbusMessageCodec) Expect(check func(interface{}) bool) chan interface{} {
+func (m *ModbusMessageCodec) Expect(check func(interface{}) (bool, bool)) chan interface{} {
 	responseChanel := make(chan interface{})
 	expectation := ModbusExpectation{
 		timestamp:       time.Now(),
@@ -128,11 +128,14 @@ func work(codec *ModbusMessageCodec) {
 				// Go through all expectations
 				for index, expectation := range codec.expectations {
 					// Check if the current message matches the expectations
-					if expectation.check(message) {
+					if match, keepExpectation := expectation.check(message); match {
 						// Send the decoded message back
 						expectation.responseChannel <- message
-						// Remove this expectation from the list.
-						codec.expectations = append(codec.expectations[:index], codec.expectations[index+1:]...)
+                        // If the expectation doesn't want to keep the expectation active, remove it
+                        if !keepExpectation {
+                            // Remove this expectation from the list.
+                            codec.expectations = append(codec.expectations[:index], codec.expectations[index+1:]...)
+                        }
 						messageHandled = true
 						break
 					}
diff --git a/plc4go/internal/plc4go/modbus/ModbusReader.go b/plc4go/internal/plc4go/modbus/ModbusReader.go
index 2b1596b..fec5ba7 100644
--- a/plc4go/internal/plc4go/modbus/ModbusReader.go
+++ b/plc4go/internal/plc4go/modbus/ModbusReader.go
@@ -112,10 +112,10 @@ func (m *ModbusReader) Read(readRequest model.PlcReadRequest) <-chan model.PlcRe
 		}
 
 		// Register an expected response
-		check := func(response interface{}) bool {
+		check := func(response interface{}) (bool, bool) {
 			responseAdu := modbusModel.CastModbusTcpADU(response)
 			return responseAdu.TransactionIdentifier == uint16(transactionIdentifier) &&
-				responseAdu.UnitIdentifier == requestAdu.UnitIdentifier
+				responseAdu.UnitIdentifier == requestAdu.UnitIdentifier, false
 		}
 		// Register a callback to handle the response
 		responseChan := m.messageCodec.Expect(check)
diff --git a/plc4go/internal/plc4go/modbus/ModbusWriter.go b/plc4go/internal/plc4go/modbus/ModbusWriter.go
index 9801d64..fe6ddad 100644
--- a/plc4go/internal/plc4go/modbus/ModbusWriter.go
+++ b/plc4go/internal/plc4go/modbus/ModbusWriter.go
@@ -132,10 +132,10 @@ func (m ModbusWriter) Write(writeRequest model.PlcWriteRequest) <-chan model.Plc
 		}
 
 		// Register an expected response
-		check := func(response interface{}) bool {
+		check := func(response interface{}) (bool, bool) {
 			responseAdu := modbusModel.CastModbusTcpADU(response)
 			return responseAdu.TransactionIdentifier == uint16(transactionIdentifier) &&
-				responseAdu.UnitIdentifier == requestAdu.UnitIdentifier
+				responseAdu.UnitIdentifier == requestAdu.UnitIdentifier, false
 		}
 		// Register a callback to handle the response
 		responseChan := m.messageCodec.Expect(check)
diff --git a/plc4go/internal/plc4go/model/DefaultPlcSubscriptionEvent.go b/plc4go/internal/plc4go/model/DefaultPlcSubscriptionEvent.go
new file mode 100644
index 0000000..746fb65
--- /dev/null
+++ b/plc4go/internal/plc4go/model/DefaultPlcSubscriptionEvent.go
@@ -0,0 +1,103 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package model
+
+import (
+    "encoding/xml"
+    "plc4x.apache.org/plc4go/v0/pkg/plc4go/model"
+    "plc4x.apache.org/plc4go/v0/pkg/plc4go/values"
+    "time"
+)
+
+type DefaultPlcSubscriptionEvent struct {
+    fields        map[string]model.PlcField
+    types         map[string]SubscriptionType
+    intervals     map[string]time.Duration
+    responseCodes map[string]model.PlcResponseCode
+    values        map[string]values.PlcValue
+    model.PlcSubscriptionEvent
+}
+
+func NewDefaultPlcSubscriptionEvent(fields map[string]model.PlcField, types map[string]SubscriptionType,
+    intervals map[string]time.Duration, responseCodes map[string]model.PlcResponseCode, values map[string]values.PlcValue) DefaultPlcSubscriptionEvent {
+    return DefaultPlcSubscriptionEvent{
+        fields:        fields,
+        types:         types,
+        intervals:     intervals,
+        responseCodes: responseCodes,
+        values:        values,
+    }
+}
+
+func (m DefaultPlcSubscriptionEvent) GetFieldNames() []string {
+    var fieldNames []string
+    for fieldName, _ := range m.fields {
+        fieldNames = append(fieldNames, fieldName)
+    }
+    return fieldNames
+}
+
+func (m DefaultPlcSubscriptionEvent) GetField(name string) model.PlcField {
+    return m.fields[name]
+}
+
+func (m DefaultPlcSubscriptionEvent) GetType(name string) SubscriptionType {
+    return m.types[name]
+}
+
+func (m DefaultPlcSubscriptionEvent) GetInterval(name string) time.Duration {
+    return m.intervals[name]
+}
+
+func (m DefaultPlcSubscriptionEvent) GetResponseCode(name string) model.PlcResponseCode {
+    return m.responseCodes[name]
+}
+
+func (m DefaultPlcSubscriptionEvent) GetValue(name string) values.PlcValue {
+    return m.values[name]
+}
+
+func (m DefaultPlcSubscriptionEvent) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
+    if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "PlcSubscriptionRequest"}}); err != nil {
+        return err
+    }
+
+    if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "fields"}}); err != nil {
+        return err
+    }
+    for fieldName, field := range m.fields {
+        if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: fieldName}}); err != nil {
+            return err
+        }
+        if err := e.EncodeElement(field, xml.StartElement{Name: xml.Name{Local: "field"}}); err != nil {
+            return err
+        }
+        if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: fieldName}}); err != nil {
+            return err
+        }
+    }
+    if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "fields"}}); err != nil {
+        return err
+    }
+
+    if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "PlcSubscriptionRequest"}}); err != nil {
+        return err
+    }
+    return nil
+}
diff --git a/plc4go/internal/plc4go/model/DefaultPlcSubscriptionRequest.go b/plc4go/internal/plc4go/model/DefaultPlcSubscriptionRequest.go
index 53dd8b8..d56125b 100644
--- a/plc4go/internal/plc4go/model/DefaultPlcSubscriptionRequest.go
+++ b/plc4go/internal/plc4go/model/DefaultPlcSubscriptionRequest.go
@@ -50,6 +50,8 @@ func NewDefaultPlcSubscriptionRequestBuilder(fieldHandler spi.PlcFieldHandler, v
         fieldHandler: fieldHandler,
         valueHandler: valueHandler,
         queries:      map[string]string{},
+        types:        map[string]SubscriptionType{},
+        intervals:    map[string]time.Duration{},
     }
 }
 
@@ -101,7 +103,7 @@ type DefaultPlcSubscriptionRequest struct {
 }
 
 func (m DefaultPlcSubscriptionRequest) Execute() <-chan model.PlcSubscriptionRequestResult {
-    panic("implement me")
+    return m.subscriber.Subscribe(m)
 }
 
 func (m DefaultPlcSubscriptionRequest) GetFieldNames() []string {
@@ -116,6 +118,10 @@ func (m DefaultPlcSubscriptionRequest) GetField(name string) model.PlcField {
     return m.fields[name]
 }
 
+func (m DefaultPlcSubscriptionRequest) GetEventHandler() model.PlcSubscriptionEventHandler {
+    return m.eventHandler
+}
+
 func (m DefaultPlcSubscriptionRequest) GetType(name string) SubscriptionType {
     return m.types[name]
 }
diff --git a/plc4go/internal/plc4go/model/DefaultPlcSubscriptionResponse.go b/plc4go/internal/plc4go/model/DefaultPlcSubscriptionResponse.go
new file mode 100644
index 0000000..86ea6a0
--- /dev/null
+++ b/plc4go/internal/plc4go/model/DefaultPlcSubscriptionResponse.go
@@ -0,0 +1,89 @@
+//
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+//
+package model
+
+import (
+    "encoding/xml"
+	"plc4x.apache.org/plc4go/v0/pkg/plc4go/model"
+)
+
+type DefaultPlcSubscriptionResponse struct {
+	request       model.PlcSubscriptionRequest
+	responseCodes map[string]model.PlcResponseCode
+	model.PlcReadResponse
+}
+
+func NewDefaultPlcSubscriptionResponse(request model.PlcSubscriptionRequest, responseCodes map[string]model.PlcResponseCode) DefaultPlcSubscriptionResponse {
+	return DefaultPlcSubscriptionResponse{
+		request:       request,
+		responseCodes: responseCodes,
+	}
+}
+
+func (m DefaultPlcSubscriptionResponse) GetRequest() model.PlcSubscriptionRequest {
+    return m.request
+}
+
+func (m DefaultPlcSubscriptionResponse) GetFieldNames() []string {
+	var fieldNames []string
+	for fieldName, _ := range m.responseCodes {
+		fieldNames = append(fieldNames, fieldName)
+	}
+	return fieldNames
+}
+
+func (m DefaultPlcSubscriptionResponse) GetResponseCode(name string) model.PlcResponseCode {
+	return m.responseCodes[name]
+}
+
+func (m DefaultPlcSubscriptionResponse) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
+	if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "PlcReadResponse"}}); err != nil {
+		return err
+	}
+
+	if err := e.EncodeElement(m.request, xml.StartElement{Name: xml.Name{Local: "PlcReadRequest"}}); err != nil {
+		return err
+	}
+
+	if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: "values"}}); err != nil {
+		return err
+	}
+	for _, fieldName := range m.GetFieldNames() {
+		if err := e.EncodeToken(xml.StartElement{Name: xml.Name{Local: fieldName},
+			Attr: []xml.Attr{
+				{Name: xml.Name{Local: "result"}, Value: m.GetResponseCode(fieldName).GetName()},
+			}}); err != nil {
+			return err
+		}
+		if err := e.EncodeElement(m.GetValue(fieldName), xml.StartElement{Name: xml.Name{Local: "field"}}); err != nil {
+			return err
+		}
+		if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: fieldName}}); err != nil {
+			return err
+		}
+	}
+	if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "values"}}); err != nil {
+		return err
+	}
+
+	if err := e.EncodeToken(xml.EndElement{Name: xml.Name{Local: "PlcReadResponse"}}); err != nil {
+		return err
+	}
+	return nil
+}
diff --git a/plc4go/internal/plc4go/spi/MessageCodec.go b/plc4go/internal/plc4go/spi/MessageCodec.go
index f44fe81..b3e6a2a 100644
--- a/plc4go/internal/plc4go/spi/MessageCodec.go
+++ b/plc4go/internal/plc4go/spi/MessageCodec.go
@@ -25,6 +25,6 @@ type MessageCodec interface {
 
     Send(message interface{}) error
     Receive() (interface{},error)
-    Expect(check func(interface{}) bool) chan interface{}
+    Expect(check func(interface{}) (bool, bool)) chan interface{}
 
 }
diff --git a/plc4go/pkg/plc4go/model/plc_read_response.go b/plc4go/pkg/plc4go/model/plc_read_response.go
index 6f4e30e..3b950ed 100644
--- a/plc4go/pkg/plc4go/model/plc_read_response.go
+++ b/plc4go/pkg/plc4go/model/plc_read_response.go
@@ -22,6 +22,7 @@ import "plc4x.apache.org/plc4go/v0/pkg/plc4go/values"
 
 type PlcReadResponse interface {
 	GetRequest() PlcReadRequest
+    GetFieldNames() []string
 	GetResponseCode(name string) PlcResponseCode
 	GetValue(name string) values.PlcValue
 	PlcResponse
diff --git a/plc4go/pkg/plc4go/model/plc_subscription_request.go b/plc4go/pkg/plc4go/model/plc_subscription_request.go
index 1c5b96c..15afd88 100644
--- a/plc4go/pkg/plc4go/model/plc_subscription_request.go
+++ b/plc4go/pkg/plc4go/model/plc_subscription_request.go
@@ -38,5 +38,8 @@ type PlcSubscriptionRequestResult struct {
 
 type PlcSubscriptionRequest interface {
     Execute() <-chan PlcSubscriptionRequestResult
+    GetFieldNames() []string
+    GetField(name string) PlcField
+    GetEventHandler() PlcSubscriptionEventHandler
     PlcRequest
 }
diff --git a/plc4go/pkg/plc4go/model/plc_subscription_response.go b/plc4go/pkg/plc4go/model/plc_subscription_response.go
index 71457bd..f744951 100644
--- a/plc4go/pkg/plc4go/model/plc_subscription_response.go
+++ b/plc4go/pkg/plc4go/model/plc_subscription_response.go
@@ -18,5 +18,8 @@
 //
 package model
 
-type PlcSubscriptionResponse struct {
+type PlcSubscriptionResponse interface {
+    GetRequest() PlcSubscriptionRequest
+    GetFieldNames() []string
+    GetResponseCode(name string) PlcResponseCode
 }
diff --git a/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/configuration/KnxNetIpConfiguration.java b/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/configuration/KnxNetIpConfiguration.java
index 6a0b8e5..7d37587 100644
--- a/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/configuration/KnxNetIpConfiguration.java
+++ b/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/configuration/KnxNetIpConfiguration.java
@@ -38,9 +38,9 @@ public class KnxNetIpConfiguration implements Configuration, UdpTransportConfigu
     @ConfigurationParameter("knxproj-file-path")
     public String knxprojFilePath;
 
-    @ConfigurationParameter("group-address-type")
+    @ConfigurationParameter("group-address-num-levels")
     @IntDefaultValue(3)
-    public int groupAddressType = 3;
+    public int groupAddressNumLevels = 3;
 
     @ConfigurationParameter("connection-type")
     @StringDefaultValue("LINK_LAYER")
@@ -62,12 +62,12 @@ public class KnxNetIpConfiguration implements Configuration, UdpTransportConfigu
         this.knxprojFilePath = knxprojFilePath;
     }
 
-    public int getGroupAddressType() {
-        return groupAddressType;
+    public int getGroupAddressNumLevels() {
+        return groupAddressNumLevels;
     }
 
-    public void setGroupAddressType(int groupAddressType) {
-        this.groupAddressType = groupAddressType;
+    public void setGroupAddressNumLevels(int groupAddressNumLevels) {
+        this.groupAddressNumLevels = groupAddressNumLevels;
     }
 
     public String getConnectionType() {
@@ -122,7 +122,7 @@ public class KnxNetIpConfiguration implements Configuration, UdpTransportConfigu
     public String toString() {
         return "Configuration{" +
             "knxprojFilePath=" + knxprojFilePath + ", " +
-            "groupAddressType=" + groupAddressType +
+            "groupAddressNumLevels=" + groupAddressNumLevels +
             '}';
     }
 
diff --git a/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/context/KnxNetIpDriverContext.java b/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/context/KnxNetIpDriverContext.java
index 386122b..fa31afe 100644
--- a/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/context/KnxNetIpDriverContext.java
+++ b/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/context/KnxNetIpDriverContext.java
@@ -56,7 +56,7 @@ public class KnxNetIpDriverContext implements DriverContext, HasConfiguration<Kn
                     configuration.knxprojFilePath));
             }
         } else {
-            groupAddressType = (byte) configuration.groupAddressType;
+            groupAddressType = (byte) configuration.groupAddressNumLevels;
         }
         tunnelConnectionType = KnxLayer.valueOf("TUNNEL_" + configuration.getConnectionType());
     }
diff --git a/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/ets5/model/Ets5Model.java b/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/ets5/model/Ets5Model.java
index 115f782..98ce454 100644
--- a/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/ets5/model/Ets5Model.java
+++ b/plc4j/drivers/knxnetip/src/main/java/org/apache/plc4x/java/knxnetip/ets5/model/Ets5Model.java
@@ -112,7 +112,7 @@ public class Ets5Model {
     @Override
     public String toString() {
         return new ToStringBuilder(this, ToStringStyle.SHORT_PREFIX_STYLE)
-            .append("groupAddressType", groupAddressType)
+            .append("groupAddressNumLevels", groupAddressType)
             .append("groupAddresses", groupAddresses)
             .toString();
     }
diff --git a/src/site/asciidoc/users/protocols/knxnetip.adoc b/src/site/asciidoc/users/protocols/knxnetip.adoc
index b848005..31356de 100644
--- a/src/site/asciidoc/users/protocols/knxnetip.adoc
+++ b/src/site/asciidoc/users/protocols/knxnetip.adoc
@@ -64,9 +64,10 @@
 |
 | `knxproj-file-path`
 | Path to the `knxproj` file. The default KNXnet/IP protocol doesn't provide all the information needed to be able to fully decode the messages. For this the user needs to provide the project file created in the KNX IDE `ETS5` to provide the missing information. Only if this file is provided, will the driver be able to decode the data entirely. If this parameter is omitted, only raw KNX payload will be returned.
+NOTE: This setting is currently only supported in the Java implementation
 
 |
-| `group-address-type` (3)
+| `group-address-num-levels` (3)
 | KNX Addresses can be encoded in multiple ways. Which encoding is used, is too not provided by the protocol itself so it has to be provided externally:
 
 - 3 Levels: {main-group (5 bit)}/{middle-group (3 bit)}/{sub-group (8 bit)}