1

I used following in the code to connect card and get channel

card = terminal.connect("T=1");
channel = card.getBasicChannel();

Here T=1 i.e. protocol is hardcoded. Is there any way from which we can find protocol of the card inserted in card reader ?

javacard.framework.APDU has method getProtocol() but I want protocol at the time of connecting with card.

Kunal Surana
  • 659
  • 5
  • 14

1 Answers1

2

From the javadoc of CardTerminal.connect(String protocol)

protocol - the protocol to use ("T=0", "T=1", or "T=CL"), or "*" to connect using any available protocol.

So it looks like you could use the wildcard.

Arnaud
  • 17,229
  • 3
  • 31
  • 44