From 63e7c6954ec51b77ce39f18be8062608c11192a9 Mon Sep 17 00:00:00 2001 From: bmalinowsky Date: Thu, 25 Apr 2024 20:51:36 +0200 Subject: [PATCH] Set/get EMI type is only mandatory if > 1 EMI types are supported --- src/io/calimero/link/KNXNetworkMonitorUsb.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/io/calimero/link/KNXNetworkMonitorUsb.java b/src/io/calimero/link/KNXNetworkMonitorUsb.java index 018ab436..6f55074f 100644 --- a/src/io/calimero/link/KNXNetworkMonitorUsb.java +++ b/src/io/calimero/link/KNXNetworkMonitorUsb.java @@ -177,8 +177,13 @@ private boolean trySetActiveEmi(final UsbConnection.EmiType active) throws KNXPortClosedException, KNXTimeoutException, InterruptedException { if (emiTypes.contains(active)) { - conn.setActiveEmiType(active); - activeEmi = conn.activeEmiType(); + // set & get/response of EMI type is only mandatory if > 1 EMI types are supported + if (emiTypes.size() > 1) { + conn.setActiveEmiType(active); + activeEmi = conn.activeEmiType(); + } + else + activeEmi = active; return activeEmi == active; } return false;