I'm using a Raspberry Pi to build an NFC card reader applet in Java. For some reason Java doesn't 'see' the entire Terminal, while nfc-list and pcsc_scan all see the connected reader.
pi@raspberrypi ~ $ sudo nfc-poll nfc-poll uses libnfc 1.7.1 NFC reader: ACS / ACR122U PICC Interface opened NFC device will poll during 30000 ms (20 pollings of 300 ms for 5 modulations) ISO/IEC 14443A (106 kbps) target:
ATQA (SENS_RES): 00 04
UID (NFCID1): 3b 3a 34 06
And pcsc_scan
pi@raspberrypi ~/pcsc-tools-1.4.23 $ ./pcsc_scan
PC/SC device scanner
V 1.4.23 (c) 2001-2011, Ludovic Rousseau <ludovic.rousseau@free.fr>
Compiled with PC/SC lite version: 1.8.13
Using reader plug'n play mechanism
Scanning present readers...
0: ACS ACR122U 00 00
Mon Apr 13 12:06:54 2015
My Java code looks like this, it's a small script to see if the Terminals work.
import java.util.List;
import javax.smartcardio.*;
public class ReadCard {
public static void main(String[] argv) throws Exception {
// show the list of available terminals
TerminalFactory factory = TerminalFactory.getDefault();
List<CardTerminal> terminals = factory.terminals().list();
System.out.println("Terminals: " + terminals);
}
}
I've also tried to manually select the pcsc library with the following command:
pi@raspberrypi ~ $ java -Dsun.security.smartcardio.library=/usr/local/lib/libpcsclite.so.1 ReadCard
Terminals: []
pi@raspberrypi ~ $ whereis libpcsclite.so.1
libpcsclite.so: /usr/local/lib/libpcsclite.so.1 /usr/local/lib/libpcsclite.so
Unfortunatly, this didn't work either.
Looking for advice what to do next, thanks in advance!