Hi
> The ATR is parsed because the Resource Manager has to determine which
> protocols can be used on the card and is in charge of sending a PTS when
> the application has the choice of T=0 or T=1 and chooses the one that is
> not default. The driver could also do this instead of the RM but when I
> proposed that I didn't get very positive results from the responses : )
ATRDecodeATR() should ignore any ATR that does not start with 3B or 3F and
should assume a memory card instead. Most memory/logic cards support the
ISO7816-3 ATR for synchronous cards. This is either 16 or 32 bits long. For
cards not supporting the ATR (e.g. card with I2C bus protocol) it is common
practice to read the ATR from the first 4 bytes in memory.
For memory cards it is the responsibility of the reader driver to select the
appropriate protocol, but it still is important for the application to receive
the ATR. Quite often the application uses the ATR to determine the size of
memory available. The MCT specification contains a definition for the ATR.
> I think an easy way to do this is to send back a bogus ATR such as
>
> Say your ATR for a memory card is: AD FE AC DE
>
>
> 3B 04 ad fe ac de
>
> 1) You must send 3B.
> 2) Then send the memory card's ATR as historical bytes in
> this bogus ATR .....
IMHO it should not do that. The most common memory cards (I2C, 2Wire, 3 Wire)
return either 8x, 9x or Ax in the first byte. I have not yet seens a memory
card that returns 3B or 3F in the ATR.
Andreas
--
Andreas Schwier Tel. +49 171 8334920
CardContact Software & System Consulting
http://www.cardcontact.de
***************************************************************
Linux Smart Card Developers - M.U.S.C.L.E.
(Movement for the Use of Smart Cards in a Linux Environment)
http://www.linuxnet.com/smartcard/index.html
***************************************************************