Skip to content

Commit

Permalink
COmments on exclusive readers
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpaljak committed Mar 7, 2023
1 parent bef3ecf commit 5598e4a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/main/java/pro/javacard/nfc4pc/NFC4PC.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ private void setTooltip() {
if (headless) {
System.out.println(msg);
} else {
icon.setTrayIconTooltip(msg);
// Called from init, thus can be null
if (icon != null)
icon.setTrayIconTooltip(msg);
}
}

Expand Down Expand Up @@ -142,6 +144,7 @@ public void readerListChanged(List<PCSCReader> list) {
list.forEach(e -> newStates.put(e.getName(), e.isPresent()));

for (String n : newStates.keySet()) {
// TODO: ignore exclusive readers
if (newStates.get(n) && !readerStates.getOrDefault(n, false)) {
log.debug("Detected change in reader \"{}\"", n);
MainWrapper.tapCounter.incrementAndGet();
Expand Down Expand Up @@ -259,6 +262,7 @@ void tryToRead() {
}
onTap(n, uid.get(), location);
} catch (Exception e) {
// TODO: notifiy exclusively opened readers
log.error("Could not connect to or read: " + e.getMessage(), e);
notifyUser(n, "Could not read: " + SCard.getExceptionMessage(e));
} finally {
Expand Down

0 comments on commit 5598e4a

Please sign in to comment.