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/09 15:37:33 UTC
[plc4x] 02/02: - Started implementing discovery for KNX
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 da01c447f60836dba0dafa18aaa4b2020a982d80
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Mon Nov 9 16:37:21 2020 +0100
- Started implementing discovery for KNX
---
plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go b/plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go
index 6ccdc84..7a30edc 100644
--- a/plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go
+++ b/plc4go/internal/plc4go/knxnetip/KnxNetIpDriver.go
@@ -56,6 +56,12 @@ func (m KnxNetIpDriver) CheckQuery(query string) error {
}
func (m KnxNetIpDriver) GetConnection(transportUrl url.URL, transports map[string]transports.Transport, options map[string][]string) <-chan plc4go.PlcConnectionConnectResult {
+ // If the host is set to "discover", use the KNX discovery mechanism
+ if transportUrl.Host == "-discover-" {
+ // Multicast address every KNX gateway is required to respond to.
+ transportUrl.Host = "224.0.23.12"
+ }
+
// Get an the transport specified in the url
transport, ok := transports[transportUrl.Scheme]
if !ok {