From 7c2c0f22e688749edaffe5a49ec02e98de3ddd39 Mon Sep 17 00:00:00 2001 From: Holger Friedrich Date: Sun, 12 Dec 2021 12:55:09 +0100 Subject: [PATCH] [knx] Upgrade Calimero library to release 2.5. (#11759) - Upstream update of base library for KNX access from v2.4 to v2.5. - Adapt AbstractKNXClient to new interface and replace calls of deprecated methods. Fixes #6849. Signed-off-by: Holger Friedrich --- bundles/org.openhab.binding.knx/pom.xml | 6 +++--- .../knx/internal/client/AbstractKNXClient.java | 11 ++++++----- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/bundles/org.openhab.binding.knx/pom.xml b/bundles/org.openhab.binding.knx/pom.xml index 0fd8b473bb5fd..f7faff1148a82 100644 --- a/bundles/org.openhab.binding.knx/pom.xml +++ b/bundles/org.openhab.binding.knx/pom.xml @@ -22,7 +22,7 @@ com.github.calimero calimero-core - 2.4 + 2.5 compile @@ -34,7 +34,7 @@ com.github.calimero calimero-device - 2.4 + 2.5 compile @@ -46,7 +46,7 @@ com.github.calimero calimero-rxtx - 2.4 + 2.5 compile diff --git a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java index de860c6bed274..a791cea90b0f5 100644 --- a/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java +++ b/bundles/org.openhab.binding.knx/src/main/java/org/openhab/binding/knx/internal/client/AbstractKNXClient.java @@ -12,6 +12,7 @@ */ package org.openhab.binding.knx.internal.client; +import java.time.Duration; import java.util.Set; import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.LinkedBlockingQueue; @@ -48,7 +49,7 @@ import tuwien.auto.calimero.mgmt.ManagementClientImpl; import tuwien.auto.calimero.mgmt.ManagementProcedures; import tuwien.auto.calimero.mgmt.ManagementProceduresImpl; -import tuwien.auto.calimero.process.ProcessCommunicationBase; +import tuwien.auto.calimero.process.ProcessCommunication; import tuwien.auto.calimero.process.ProcessCommunicator; import tuwien.auto.calimero.process.ProcessCommunicatorImpl; import tuwien.auto.calimero.process.ProcessEvent; @@ -181,17 +182,17 @@ private synchronized boolean connect() { managementProcedures = new ManagementProceduresImpl(link); ManagementClient managementClient = new ManagementClientImpl(link); - managementClient.setResponseTimeout(responseTimeout); + managementClient.responseTimeout(Duration.ofSeconds(responseTimeout)); this.managementClient = managementClient; deviceInfoClient = new DeviceInfoClientImpl(managementClient); ProcessCommunicator processCommunicator = new ProcessCommunicatorImpl(link); - processCommunicator.setResponseTimeout(responseTimeout); + processCommunicator.responseTimeout(Duration.ofSeconds(responseTimeout)); processCommunicator.addProcessListener(processListener); this.processCommunicator = processCommunicator; - ProcessCommunicationResponder responseCommunicator = new ProcessCommunicationResponder(link); + ProcessCommunicationResponder responseCommunicator = new ProcessCommunicationResponder(link, null); this.responseCommunicator = responseCommunicator; link.addLinkListener(this); @@ -439,7 +440,7 @@ public void respondToKNX(OutboundSpec responseSpec) throws KNXException { } } - private void sendToKNX(ProcessCommunicationBase communicator, KNXNetworkLink link, GroupAddress groupAddress, + private void sendToKNX(ProcessCommunication communicator, KNXNetworkLink link, GroupAddress groupAddress, String dpt, Type type) throws KNXException { if (!connectIfNotAutomatic()) { return;