Reputation: 23
Does anyone know how to get the Smart Card ATR for an Android application by using the NFC API? The card that I am using is a contactless card. I have this code
szATR =" 3B " + getATRLeString(myTag.getHistoricalBytes())+ "80 01 " + getHexString(myTag.getHistoricalBytes())+""+ getATRXorString(myTag.getHistoricalBytes());
but it is returning null
as response.
Upvotes: 0
Views: 1674
Reputation: 86313
Technically a NFC tag does not has something like an ATR.
The ATR is used for contact based smart card communication. The ATR mostly contains data required for the contact based communication such as maximum communication speed, guard times etc. All of these informations are not applicable for NFC. The ATR may also contain the so called historical bytes.
If your call to myTag.getHistoricalBytes() returns null, then your NFC tag simply does not has any historical bytes to return.
Regarding ATR and NFC in general: Since lots of NFC tags and smart-cards talk the same high level communication protocol (ISO7816) it was a natural choice to add NFC functionality to smart-card readers. For compatibility reasons with older software some ATR was required for the software and the smart-card infrastructure to work. Therefore, whenever you see an ATR in the context of NFC you can be sure it is a fake ATR generated by the driver or the reader.
Upvotes: 3