}
}
terminals = manager.list();
terminals = manager.list();
System.out.println("Try to connect to " + terminal.getName());
Apdu apdu;
terminal.coldConnect();
GenericContactTerminal contactTerminal=terminal;
contactTerminal.logFrequency();
contactTerminal.logVoltage();
apdu = new Apdu(0x00, 0x8A, 0x00, 0x44, 0x02);
terminal.sendApdu(apdu);
/*apdu = new Apdu(0x00, 0x32, 0x01, 0x03, 0x00);
terminal.sendApdu(apdu);
apdu = new Apdu(0x00, 0x7E, 0x00, 0x00, 0x00);
terminal.sendApdu(apdu);*/
apdu = new Apdu("FC39000720000010000051C000FFEEFFEE0000000802AA0051C000000010000000000800AA");
terminal.sendApdu(apdu);
terminal.logLine(ScardLogHandler.LOG_INFO, "Force clock to 5MHz");
contactTerminal.setFrequency(5000000);
contactTerminal.logFrequency(false);
contactTerminal.logFrequency(true);
if(5000000!=contactTerminal.getFrequency(true)) throw new RuntimeException();
terminal.logLine(ScardLogHandler.LOG_INFO, "Force clock to low");
contactTerminal.setClkPin(false);
contactTerminal.logFrequency(false);
contactTerminal.logFrequency(true);
if(0!=contactTerminal.getFrequency(true)) throw new RuntimeException();
terminal.logLine(ScardLogHandler.LOG_INFO, "Force clock to high");
contactTerminal.setClkPin(true);
contactTerminal.logFrequency(true);
if(0!=contactTerminal.getFrequency(true)) throw new RuntimeException();
terminal.logLine(ScardLogHandler.LOG_INFO, "Force clock to 3MHz");
contactTerminal.setFrequency(3000000);
contactTerminal.logFrequency(false);
contactTerminal.logFrequency(true);
if(3000000!=contactTerminal.getFrequency(true)) throw new RuntimeException();
terminal.logLine(ScardLogHandler.LOG_INFO, "Force voltage to 1620mV");
contactTerminal.setVoltage(1620);
contactTerminal.logVoltage();
apdu = new Apdu(0x00, 0x8A, 0x00, 0xDC, 0x01);
terminal.sendApdu(apdu);
terminal.logLine(ScardLogHandler.LOG_INFO, "Force voltage to 3000mV");
contactTerminal.setVoltage(3000);
contactTerminal.logVoltage();
terminal.sendApdu(apdu);