Skip to content

Commit

Permalink
Windows: check that device is still connected
Browse files Browse the repository at this point in the history
  • Loading branch information
manuelbl committed Apr 20, 2024
1 parent c8c49a6 commit c12a2d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ public boolean isOpened() {

@Override
public synchronized void open() {
if (isOpened())
throwException("device is already open");

checkIsClosed("device is already open");
showAsOpen = true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private static void onUnpluggedDevice(UsbDevice device) {
System.err.println("Device should not be openable after disconnect");
} catch (UsbException e) {
if (!e.getMessage().contains("disconnected"))
System.err.println(STR."Unexpected error: \{e.getMessage()}");
System.err.println("Unexpected error: " + e.getMessage());
}
}).start();
}
Expand Down

0 comments on commit c12a2d2

Please sign in to comment.