Can I have sort of example?
I think I have to indicate that in APDU that more bytes coming, but how will be next apdu will processed? I mean for that I have to create new buffer to store data and than when I will get next apdu with more bytes I have to append data into that buffer.
It seems me overhead or is it only way to send long response?
> I mean for that I have to create new buffer to store data and than
> when I will get next apdu with more bytes I have to append data into that buffer.
> It seems me overhead or is it only way to send long response?
Nobody said that programming a JavaCard is easy.
Jan
You can try the following sequence:
apdu.setOugoing();
apdu.setOutgoingLength(Len);
apdu.sendBytesLong(var1,(short)0,(short)var1.lenth);
apdu.sendBytesLong(var2,(short)0,(short)var2.lenth);
apdu.sendBytesLong(var3,(short)0,(short)var3.lenth);
etcccc....
return;
hope it helps
Hi razzaz...
I'm newbie on javacard and i want to send more than 255 bytes in response apdu.
I've tried to using the sample code u gave, but now i'm confused to receive multiple response apdu in my host aplication. It always gives me 6180 exception. Here the code i 'm using on card ...
apdu.setOutgoing();
apdu.setOutgoingLength(result);
apdu.sendBytesLong(cmd_apdu, (short)0, (short)64);
apdu.sendBytesLong(cmd_apdu, (short)64, (short)64);
var result will gave (short) 128 that is 256 bytes. Am i right?
Is it my code right? if does, how to receive the response apdu at my host app? If doesn't, what's the right code?
Thanks in advance...
By sending the status code 6180 the card tells the off-card entity that it can fetch 0x80 (= 128) bytes from the card.
Normally this is done by sending an ISO "GET RESPONSE" command, e.g. "00 C0 00 00 80".
After sending the GET RESPONSE command the off-card entity will receive the data and a new status code.
If this is something like 61XY then more data (0xXY) can be fetched. If the status code is 9000 then all data is received.
Also see http://www.cardwerk.com/smartcards/smartcard_standard_ISO7816-4_7_transmission_interindustry_commands.aspx#chap7_1
for more information on GET RESPONSE.
Have fun.