Our Online Store have the new products: RFID antenna board. Currently it can work with JC10M24R and JCOP4 card chips.
Compared with normal cards, the antenna board module has a smaller size and fixed holes, which is easy to integrate in the IOT(Internet Of Things) project.

the byte array can not receive the data in data field of APDU command

JavaCard Applet Development Related Questions and Answers.
marclo
Posts: 20
Joined: Thu Nov 19, 2015 5:41 am
Points :127
Contact:

the byte array can not receive the data in data field of APDU command

Post by marclo » Thu Nov 19, 2015 7:37 am

I have a question when writing a simple java card applet.

Here is my code:

Code: Select all

public class javacard_applet extends Applet
{
   
   public static void install(byte[] bArray, short bOffset, byte bLength)
   {
      new javacard_applet().register(bArray, (short) (bOffset + 1), bArray[bOffset]);
   }

   public void process(APDU apdu)
   {
      if (selectingApplet())
      {
         return;
      }

      byte[] buf = apdu.getBuffer();
      switch (buf[ISO7816.OFFSET_INS])
      {
      case (byte)0x01:
         break;
      case (byte)0x02:
         break;
      default:
         ISOException.throwIt(ISO7816.SW_INS_NOT_SUPPORTED);
      }
   }
   
}


when I send APDU command
>> /send 00010000051122334455

The array buf can not receive the data in the data field of APDU command. I mean it can only receive the first five bytes(0001000005) but the last five bytes(1122334455).



Why this happened? Am I making any mistakes?
You do not have the required permissions to view the files attached to this post. Please login first.

User avatar
Ellisun
Posts: 50
Joined: Wed May 20, 2015 3:47 am
Points :472
Contact:

Re: the byte array can not receive the data in data field of APDU command

Post by Ellisun » Tue Nov 24, 2015 7:18 am

Maybe, you using protocol is T0.
In T0, you should call apdu.setIncomingAndReceive() function to indicates that this APDU has incoming data. It is the primary receive method.

Post Reply Previous topicNext topic

Who is online

Users browsing this forum: No registered users and 53 guests

JavaCard OS : Disclaimer