-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Recovering from Error #37
Comments
Hi @bierlair, Sorry for the late response. I've been quite busy. I'll take a look at it this afternoon. I'll test it with my card. I'll let you know what I figure out. 🙂 |
From what I've found out so far is that once you receive a 0x6300 message, you cannot do anything else until the card reader goes back into "IDLE" mode (usually within 1-2 seconds, when the LED switches back to steady green). If I was to build some kind of artificial timeout of 2 seconds between both try/catch blocks, it would work fine. This leads me to believe that it's a by-design feature that cannot be changed... unless there is a certain APDU that forces to go back into IDLE state right away. |
I'm trying to write some methods that are checking if a card (in my case NTAG-21x) needs authentication or not.
So far what I'm doing is reading 4 Bytes from Page 4 and if it fails, it means that I need to authenticate.
The problem occurs that the error thrown during that reading failure is preventing me from doing anything meaningful until I disconnect and reconnect the card.
Here some code:
Errors looks somewhat like this:
first try/catch:
second try/catch:
Is there a way to reset the state without disconnecting the card?
... or is my authentication approach simply inefficient?
The text was updated successfully, but these errors were encountered: