Package uk.co.nimp.scard

Examples of uk.co.nimp.scard.GenericTerminal


    @Override
    public List<GenericTerminal> list() throws ScardException {
        List<GenericTerminal> terminalsList = new ArrayList<GenericTerminal>();
        for(int i=0;i<virtualReaders.length;i++){
            try {
                GenericTerminal terminal = getTerminalImpl(virtualReaders[i]);
                terminalsList.add(terminal);
            } catch (ScardException e) {
            }
        }
View Full Code Here


    private static final Map<String, Reference<GenericTerminal>> terminals = new HashMap<String, Reference<GenericTerminal>>();

    protected static GenericTerminal getTerminalImpl(String name) throws ScardException {
        String fullName="VirtualMultiThreadedTerminal_"+name;
        Reference<GenericTerminal> ref = terminals.get(fullName);
        GenericTerminal terminal = (ref != null) ? ref.get() : null;
        if (terminal != null) {
            return terminal;
        }

        terminal = new VirtualMultiThreadedTerminal(fullName);
View Full Code Here

    @Override
    public List<GenericTerminal> list() throws ScardException {
        List<GenericTerminal> terminalsList = new ArrayList<GenericTerminal>();
        for(int i=0;i<virtualReaders.length;i++){
            try {
                GenericTerminal terminal = getTerminalImpl(virtualReaders[i]);
                terminalsList.add(terminal);
            } catch (ScardException e) {
            }
        }
View Full Code Here

    private static final Map<String, Reference<GenericTerminal>> terminals = new HashMap<String, Reference<GenericTerminal>>();

    protected static GenericTerminal getTerminalImpl(String name) throws ScardException {
        String fullName="VirtualMonoThreadedTerminal_"+name;
        Reference<GenericTerminal> ref = terminals.get(fullName);
        GenericTerminal terminal = (ref != null) ? ref.get() : null;
        if (terminal != null) {
            return terminal;
        }
        synchronized(VirtualMonoThreadedTerminalManager.class){
            startDllCall();
View Full Code Here

            selectedTerminals.add(Utilities.terminalChooser(availableTerminals));
        }
        if (1 == selectedTerminals.size()) {
            PrintStream ps = System.out;
            ScardPrintStreamLogHandler printStreamLogHandler = new ScardPrintStreamLogHandler(ps);
            GenericTerminal terminal = selectedTerminals.get(0);
            terminal.addLogHandler(printStreamLogHandler);
        }
    }
View Full Code Here

        List<GenericTerminal> terminals = manager.list();
        if (0 == terminals.size()) {
            System.out.println("PcSc terminal not detected.");
            return;
        }
        GenericTerminal terminal = terminals.get(0);
        System.out.println("Try to connected to "+terminal);

        terminal.coldConnect();
        System.out.println("connected to "+terminal+ " using protocol "+GenericTerminal.getProtocolName(terminal.getProtocol()));

        long start=System.currentTimeMillis();
        Apdu readApdu=new Apdu();
        int maxLe=0x100;
        int base=0x500000;
        int size=0x024000;
        readApdu.setIns(0x0A);
        readApdu.setExpectedLe(maxLe);
        readApdu.setExpectedSw(0x9000);

        int nLoops=size/maxLe;
        int nLast=size%maxLe;
        File fout=new File(ATimeUtilities.getTimeTagMillisecond()+".bin");
        System.out.println("Output file:");
        System.out.println(fout.getCanonicalPath());
       
        FileOutputStream fos = new FileOutputStream(fout);
        int address=base;
        for(int i=0;i<nLoops;i++){
            setHeader(readApdu,address);
            terminal.sendApdu(readApdu);
            fos.write(readApdu.getLeData());
            address+=maxLe;
        }
        if(nLast>0){
            readApdu.setExpectedLe(nLast);
View Full Code Here

TOP

Related Classes of uk.co.nimp.scard.GenericTerminal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.