Page 1 of 1

how to send apdu command to my function

Posted: Fri Nov 20, 2015 7:51 am
by chico0609
I wanna pass the APDU command to the this function. But I do not know how to do this.

Code: Select all

ResponseAPDU respApdu = channel.transmit( new CommandAPDU(cmd));


For example, the commands is as follows
CLA: 00
INS:80
P1: 00
P2:00
LC: 02
Data In : 1E06
Le: 0F

How can I write above instructions into bytes and send to the function I mentioned? I need to get 9000 as success response.

Re: how to send apdu command to my function

Posted: Tue Dec 01, 2015 1:16 am
by btwtiger

Code: Select all

int CLA = 0x00;
int INS = 0x80;
int P1  = 0x00;
int P2  = 0x00;
//int LC  = 0x02;
byte[] data = new byte[] {(byte) 0x1E, (byte) 0x06};
int Le  = 0x0F;

ResponseAPDU respApdu = channel.transmit( new CommandAPDU(CLA, INS, P1, P2, data, Le));