This discussion is archived
1 Reply Latest reply: Dec 27, 2012 12:51 AM by Sebastien_Lorquet RSS

Transmission Protocol T=CL (or) T=RF . How to implement?

981792 Newbie
Currently Being Moderated
Hello Team,

I need your help for the below Java Card Communication. I have implemented the Transmission protocol "T=0" and "T=1" but I am not able to implement "T=CL".

Could someone help me in giving steps for me to proceed how to use "T=CL"

Can you give me steps and some sample code? Thanks.


Code
          CardTerminals terminalList;
          TerminalFactory factory = TerminalFactory.getDefault();
          terminalList = factory.terminals();
          /* Choose a reader knowing its name */
          CardTerminal MyReader = terminalList.getTerminal("Dell Smart Card Reader Keyboard 0");
          /* Connect to the card currently in the reader */
          Card card=null;
          try {
               card = MyReader.connect("T=CL");
     
          /* Exchange APDUs with the card */
          CardChannel channel = card.getBasicChannel();
          byte[] ApduArray = {(byte) 0xFF,(byte) 0xCA,(byte) 0x00,(byte) 0x00,(byte) 0x00};
          CommandAPDU getData = new CommandAPDU(ApduArray);
          ResponseAPDU CardApduResponse = channel.transmit(getData);
          /* Disconnect */
          System.out
          .println("Response: " + Integer.toHexString(CardApduResponse.getSW())); //$NON-NLS-1$
          card.disconnect(true);
          
          } catch (CardException e1) {
               // TODO Auto-generated catch block
               e1.printStackTrace();
          }

Error

java.lang.IllegalArgumentException: Unsupported protocol T=CL
     at sun.security.smartcardio.CardImpl.<init>(CardImpl.java:63)
     at sun.security.smartcardio.TerminalImpl.connect(TerminalImpl.java:61)
  • 1. Re: Transmission Protocol T=CL (or) T=RF . How to implement?
    Sebastien_Lorquet Journeyer
    Currently Being Moderated
    T=CL is NOT a protocol. Just show me the specification for this protocol. You can't, because it does not exist.

    See Here: http://en.wikipedia.org/wiki/Talk%3ASmart_card#Contactless_protocol_-not.22T.3DCL.22

    Only T=0 and T=1 are card protocols

    Moreover, most contactless readers use APDU level of exchange so you don't have to do anything special here.

    Just use T=* or T=0 or T=1, it does NOT change anything for contactless cards.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points