I have a little problem with my program. For the first time as plugging the reader everything is in order, the program finds reader, but when, during the program, I disconnect the reader, and then plug it in again, and then run search again, the program is not able to find the reader. I have only CardException with message: list() failed
Anyone know how to fix it?
TerminalFactory factory = TerminalFactory.getDefault();
System.out.println(factory);
List<CardTerminal> terminals = new ArrayList<CardTerminal>();
if (factory == null) {
return terminals;
}
try {
terminals = factory.terminals().list();
} catch (CardException e) {
System.out.println(e.getMessage());
}
I tried also this:
try {
factory = TerminalFactory.getInstance("PC/SC", null, new jnasmartcardio.Smartcardio());
} catch (NoSuchAlgorithmException e1) {
e1.printStackTrace();
}
Thx for help.