Skip to content

Commit

Permalink
Ignore exclusively open readers
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpaljak committed Mar 7, 2023
1 parent 5598e4a commit cb15dfe
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/pro/javacard/nfc4pc/NFC4PC.java
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,11 @@ public void readerListChanged(List<PCSCReader> list) {
Map<String, Boolean> newStates = new HashMap<>();
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)) {
for (PCSCReader e : list) {
String n = e.getName();
if (e.isExclusive()) {
log.debug("Ignoring exclusively in use reader \"{}\"", n);
} else if (newStates.get(n) && !readerStates.getOrDefault(n, false)) {
log.debug("Detected change in reader \"{}\"", n);
MainWrapper.tapCounter.incrementAndGet();
setTooltip();
Expand Down

0 comments on commit cb15dfe

Please sign in to comment.