Page 1 of 1

A strange problem with my applet

Posted: Wed Mar 30, 2016 11:31 pm
by trgorce
I have completed an applet recently. But I am stuck on a problem.
When I used JCIDE to debug my applet, I found that no matter which protocol I selected, my applet never entered into the line
"if (protocol == apdu.PROTOCOL_MEDIA_CONTACTLESS_TYPE_A)" , I don't know why this happened. Could somebody help me solve this issue? Thanks!

Here is part of my code.

Code: Select all

byte protocol = apdu.getProtocol();
         if (protocol  == apdu.PROTOCOL_MEDIA_CONTACTLESS_TYPE_A)
         {
            ;
         }
         else if (protocol == apdu.PROTOCOL_T1)
         {
            ;
         }
         else if (protocol == apdu.PROTOCOL_T1)
         {
            ;
         }

Re: A strange problem with my applet

Posted: Thu Mar 31, 2016 1:20 am
by popmun09
What is the value of protocol?

Re: A strange problem with my applet

Posted: Thu Mar 31, 2016 1:37 am
by trgorce
popmun09 wrote:What is the value of PROTOCOL_MEDIA_CONTACTLESS_TYPE_A?


0x81

Re: A strange problem with my applet

Posted: Fri Apr 01, 2016 3:01 am
by mabel
ISO 7816 transport protocol type T=1. This constant is also used to denote the T=CL variant for contactless cards defined in ISO14443-4.


According to the spec says, you should do the following operation:
PROTOCOL_MEDIA_CONTACTLESS_TYPE_A|apdu.PROTOCOL_T1