相关疑难解决方法(0)

通过Android USB主机与智能卡读卡器通信

我正在尝试向智能卡发送命令.我使用Gemalto IDBridge CT30(PC TWIN阅读器)和通过USB连接到Android设备的IDBridge K30.

我尝试通过USB发送SELECT APDU命令:

boolean claim = openedConnection.claimInterface(usbInterface, true);
byte[] data = new byte[]{
        (byte) 0x00, (byte) 0xA4, (byte) 0x04, (byte) 0x0C,
        (byte) 0x07, (byte) 0xA0, (byte) 0x00, (byte) 0x00,
        (byte) 0x01, (byte) 0x18, (byte) 0x45, (byte) 0x4E};
Run Code Online (Sandbox Code Playgroud)

之后我收到了答案:

final int dataTransferred = this.openedConnection.bulkTransfer(endPointOut, data, data.length, TIMEOUT_MS);
if(!(dataTransferred == 0 || dataTransferred == data.length)) {
    throw new Exception("Error durring sending command [" + dataTransferred + " ; " + data.length + "]"); //$NON-NLS-1$ …
Run Code Online (Sandbox Code Playgroud)

usb android smartcard pcsc smartcard-reader

7
推荐指数
2
解决办法
2842
查看次数

标签 统计

android ×1

pcsc ×1

smartcard ×1

smartcard-reader ×1

usb ×1