Reading NTAG216 User Data pages w/ ACR122U and Python

Also the thing to know about APDUs is that ISO14443A chips like the NTAG216 use something called pseudo APDUs which is why you must use the direct transmit command in the first place. An APDU is a convention of ISO7816 over ISO14443A. Since the NTAG216 does not speak ISO7816, it is a pseudo APDU we’re dealing with which must be enveloped inside a normal ISO7816 command schema… that sandwiching or envelopment is the “direct transmit” command. The entire first part of the command FF 00 00 00 05 relates directly the APDU schema (CLA = FF, INS = 00, P1 = 00, P2 = 00, Lc = 05) … the body or “command data” of the APDU goes to the ACR122U and it sees D4 42 and says “ah, the rest of this command is meant to be sent directly to the contactless card as a raw command”.

The commands you sent previously like firmver FF 00 48 00 00 are actual APDUs that the reader handles for you based on real ISO7816 APDUs.

This all came about because smartcards used to be contact only… so there was no air interface or contactless protocols to worry about, and commands were sent directly to cards… but with the advent of contactless protocols like ISO14443A and ISO15693, there had to be some process of melding the two together in some way so a “contactless smartcard” could become a reality… and this is what we’re left with… so it’s no wonder it’s a bit confusing.

Make sense?

1 Like