I'm developing a Javacard application with a ACS ACR38USBSAM reader using javax.smartcardio
API. I'm having problems with detecting presence and absence of the SAM card.
Listing the available terminals yields two CardTerminal
s, ACS ACR38USB 0 and ACS ACR38USBSAM 0. Here I'm trying to use the ACS ACR38USBSAM 0 terminal to detect change of SAM presence.
CardTerminal terminal = factory.terminals().getTerminal("ACS ACR38USBSAM 0");
terminal.waitForCardPresent(0);
The method for detecting changes like waitForCardPresent(0)
and waitForCardAbsent(0)
is behaving as expected when used for normal card terminal but does not detect SAM cards correctly.
- When
waitForCardPresent(0)
is called, the method will always returntrue
even if SAM is not present. - When
waitForCardAbsent(0)
is called, the method will always wait even if the SAM has been disconnected.
I've also read the Technical Specification and Reference Manual from the device's page but I still have very little idea whether it's supposed to be that way. I presume that this is by design, though I still don't understand the reasons behind it.
I understand in practical use the SAM would be very rarely removed or changed. This is not in itself a very crucial requirement but mostly just for convenience.