[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 <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich 2021-12-12 12:55:09 +01:00 committed by GitHub
parent e9ac2be397
commit 4a58a5158c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -22,7 +22,7 @@
<dependency> <dependency>
<groupId>com.github.calimero</groupId> <groupId>com.github.calimero</groupId>
<artifactId>calimero-core</artifactId> <artifactId>calimero-core</artifactId>
<version>2.4</version> <version>2.5</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -34,7 +34,7 @@
<dependency> <dependency>
<groupId>com.github.calimero</groupId> <groupId>com.github.calimero</groupId>
<artifactId>calimero-device</artifactId> <artifactId>calimero-device</artifactId>
<version>2.4</version> <version>2.5</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>
@ -46,7 +46,7 @@
<dependency> <dependency>
<groupId>com.github.calimero</groupId> <groupId>com.github.calimero</groupId>
<artifactId>calimero-rxtx</artifactId> <artifactId>calimero-rxtx</artifactId>
<version>2.4</version> <version>2.5</version>
<scope>compile</scope> <scope>compile</scope>
<exclusions> <exclusions>
<exclusion> <exclusion>

View File

@ -12,6 +12,7 @@
*/ */
package org.openhab.binding.knx.internal.client; package org.openhab.binding.knx.internal.client;
import java.time.Duration;
import java.util.Set; import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet; import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.LinkedBlockingQueue;
@ -48,7 +49,7 @@ import tuwien.auto.calimero.mgmt.ManagementClient;
import tuwien.auto.calimero.mgmt.ManagementClientImpl; import tuwien.auto.calimero.mgmt.ManagementClientImpl;
import tuwien.auto.calimero.mgmt.ManagementProcedures; import tuwien.auto.calimero.mgmt.ManagementProcedures;
import tuwien.auto.calimero.mgmt.ManagementProceduresImpl; 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.ProcessCommunicator;
import tuwien.auto.calimero.process.ProcessCommunicatorImpl; import tuwien.auto.calimero.process.ProcessCommunicatorImpl;
import tuwien.auto.calimero.process.ProcessEvent; import tuwien.auto.calimero.process.ProcessEvent;
@ -181,17 +182,17 @@ public abstract class AbstractKNXClient implements NetworkLinkListener, KNXClien
managementProcedures = new ManagementProceduresImpl(link); managementProcedures = new ManagementProceduresImpl(link);
ManagementClient managementClient = new ManagementClientImpl(link); ManagementClient managementClient = new ManagementClientImpl(link);
managementClient.setResponseTimeout(responseTimeout); managementClient.responseTimeout(Duration.ofSeconds(responseTimeout));
this.managementClient = managementClient; this.managementClient = managementClient;
deviceInfoClient = new DeviceInfoClientImpl(managementClient); deviceInfoClient = new DeviceInfoClientImpl(managementClient);
ProcessCommunicator processCommunicator = new ProcessCommunicatorImpl(link); ProcessCommunicator processCommunicator = new ProcessCommunicatorImpl(link);
processCommunicator.setResponseTimeout(responseTimeout); processCommunicator.responseTimeout(Duration.ofSeconds(responseTimeout));
processCommunicator.addProcessListener(processListener); processCommunicator.addProcessListener(processListener);
this.processCommunicator = processCommunicator; this.processCommunicator = processCommunicator;
ProcessCommunicationResponder responseCommunicator = new ProcessCommunicationResponder(link); ProcessCommunicationResponder responseCommunicator = new ProcessCommunicationResponder(link, null);
this.responseCommunicator = responseCommunicator; this.responseCommunicator = responseCommunicator;
link.addLinkListener(this); link.addLinkListener(this);
@ -439,7 +440,7 @@ public abstract class AbstractKNXClient implements NetworkLinkListener, KNXClien
} }
} }
private void sendToKNX(ProcessCommunicationBase communicator, KNXNetworkLink link, GroupAddress groupAddress, private void sendToKNX(ProcessCommunication communicator, KNXNetworkLink link, GroupAddress groupAddress,
String dpt, Type type) throws KNXException { String dpt, Type type) throws KNXException {
if (!connectIfNotAutomatic()) { if (!connectIfNotAutomatic()) {
return; return;