Hi, Brian!
The following is the code that I am using to get the ATR of the terminals
attached. The problem is it gives a different CardID but the ATR it returns
is always of the first terminal attached until I remove the card from the
first terminal. How can I get the the correct ATR. Please help.
try
{
SmartCard.start();
CardTerminalRegistry ctr = CardTerminalRegistry.getRegistry ();
Enumeration terminals = ctr.getCardTerminals ();
String myString = new String("wanted terminal");
while (terminals.hasMoreElements () )
{
CardTerminal terminal = (CardTerminal) terminals.nextElement ();
if (terminal.getName().equals(myString))
{
SmartCard myCard = SmartCard.waitForCard(new
CardRequest(CardRequest.ANYCARD));
if (myCard != null)
{
CardID cardID = myCard.getCardID();
System.out.println("CardID : " + cardID);
} //endif
else
System.out.println("\nDid not get a smart card object");
} //endif
} //end while
} //end try
// here catch exceptions for the try block
Please note : Here 'myString' has the name of the terminal of which the ATR
is requested.
.
Thanks,
Opencard Student.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
---
> Visit the OpenCard web site at http://www.opencard.org/ for more
> information on OpenCard---binaries, source code, documents.
> This list is being archived at http://www.opencard.org/archive/opencard/
! To unsubscribe from the [EMAIL PROTECTED] mailing list send an email
! to
! [EMAIL PROTECTED]
! containing the word
! unsubscribe
! in the body.