public void run() {
{*/
try {
//MP65TerminalManager.initContext();
SmartwareTerminalManager manager = new SmartwareTerminalManager();
List<GenericTerminal> terminals = manager.list();
terminals = manager.list();
terminals = manager.list();
if (0 == terminals.size()) {
System.out.println("Smartware terminal not detected.");
return;
}
SmartwareTerminal terminal = (SmartwareTerminal) terminals.get(0);
terminals = manager.list();
terminal.addLogHandler(new ScardPrintStreamLogHandler(System.out));
System.out.println("Please insert a card in terminal " + terminal.getName());
while (false == terminal.isCardPresent()) {
try {
Thread.sleep(200);
} catch (InterruptedException ex) {
Logger.getLogger(SmartwareTerminal.class.getName()).log(Level.SEVERE, null, ex);
}
}
terminals = manager.list();
terminals = manager.list();
System.out.println("Try to connect to " + terminal.getName());
Apdu apdu;
terminal.coldConnect();
GenericContactTerminal contactTerminal=terminal;
contactTerminal.logFrequency();