Skip to content

Commit

Permalink
No need for exclusive mode for this
Browse files Browse the repository at this point in the history
  • Loading branch information
martinpaljak committed Mar 7, 2023
1 parent 7c57c3b commit bef3ecf
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/main/java/pro/javacard/nfc4pc/NFC4PC.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,15 +224,6 @@ void tryToRead() {
// This is called on the named thread of the reader.
String n = Thread.currentThread().getName();

// Windows needs a bit of time TODO: add loop
if (com.sun.jna.Platform.isWindows()) {
try {
log.debug("Windows. Sleeping 300ms");
Thread.sleep(300);
} catch (InterruptedException e) {
log.debug("Interrupted");
}
}
// We manually open the instance
CardTerminal t = readers.get();
if (t == null) {
Expand All @@ -244,7 +235,8 @@ void tryToRead() {
try {
// Try to get exclusive access for a second
// c = LoggingCardTerminal.getInstance(manager.getTerminal(reader)).connect("EXCLUSIVE;*");
c = t.connect("EXCLUSIVE;*");
c = t.connect("*");
c.beginExclusive();
// get UID
APDUBIBO b = new APDUBIBO(CardBIBO.wrap(c));
var uid = CardCommands.getUID(b);
Expand Down

0 comments on commit bef3ecf

Please sign in to comment.