Skip to content

Commit

Permalink
Always set active emi type (usb connection needs it for emi type)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmalinowsky committed May 12, 2024
1 parent ad9f92c commit 2193504
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/io/calimero/link/KNXNetworkLinkUsb.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,10 @@ private boolean trySetActiveEmi(final UsbConnection.EmiType active) throws KNXPo
KNXTimeoutException, InterruptedException
{
if (emiTypes.contains(active)) {
// set & get/response of EMI type is only mandatory if > 1 EMI types are supported
if (emiTypes.size() > 1) {
conn.setActiveEmiType(active);
conn.setActiveEmiType(active);
// getting response of EMI type is only mandatory if > 1 EMI types are supported
if (emiTypes.size() > 1)
activeEmi = conn.activeEmiType();
}
else
activeEmi = active;
return activeEmi == active;
Expand Down
7 changes: 3 additions & 4 deletions src/io/calimero/link/KNXNetworkMonitorUsb.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ private boolean trySetActiveEmi(final UsbConnection.EmiType active)
throws KNXPortClosedException, KNXTimeoutException, InterruptedException
{
if (emiTypes.contains(active)) {
// set & get/response of EMI type is only mandatory if > 1 EMI types are supported
if (emiTypes.size() > 1) {
conn.setActiveEmiType(active);
conn.setActiveEmiType(active);
// getting response of EMI type is only mandatory if > 1 EMI types are supported
if (emiTypes.size() > 1)
activeEmi = conn.activeEmiType();
}
else
activeEmi = active;
return activeEmi == active;
Expand Down

0 comments on commit 2193504

Please sign in to comment.