aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/layerscape/modules.mk
Commit message (Expand)AuthorAgeFilesLines
* layerscape: fix pfe module autoload issueYangbo Lu2017-11-101-1/+1
* layerscape: support LSDK ppfeYangbo Lu2017-11-101-1/+2
* layerscape: add 64b/32b target for ls1012ardb deviceYutang Jiang2016-10-311-0/+20
id='n16' href='#n16'>16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
package org.sufficientlysecure.keychain.smartcard;

import java.io.IOException;

import nordpol.IsoCard;

public class NfcTransport implements Transport {
    // timeout is set to 100 seconds to avoid cancellation during calculation
    private static final int TIMEOUT = 100 * 1000;
    private final IsoCard mIsoCard;

    public NfcTransport(final IsoCard isoDep) throws IOException {
        this.mIsoCard = isoDep;
        mIsoCard.setTimeout(TIMEOUT);
        mIsoCard.connect();
    }

    @Override
    public byte[] sendAndReceive(final byte[] data) throws TransportIoException, IOException {
        return mIsoCard.transceive(data);
    }

    @Override
    public void release() {
    }

    @Override
    public boolean isConnected() {
        return mIsoCard.isConnected();
    }

    @Override
    public boolean allowPersistentConnection() {
        return false;
    }
}