NFC tag information [duplicate]
Asked Answered
D

1

-3

I have a question, it is possible know the code source of explain th type of tag NFC that I read? If is a Mifare 1k or Ntag203 or another else?

protected void onNewIntent(Intent intent){
    String[] techList = tag.getTechList();
    for(String tech:techList) {
        //I think must insert here the code         
    }
}
Donne answered 5/6, 2014 at 10:40 Comment(0)
S
0

Fingerprinting of NFC tags is not quite easy. Most tags don't just tell you "I am XY". Moreover, for certain tag technologies there exist many different tags from several different manufacturers. E.g. NFC Forum Type 2 tags are made by NXP, Infineon, Kovio and others.

Finding out if a tag is MIFARE Classic is rather simple on devices with NXP's NFC chipset. On those devices you will see android.nfc.tech.MifareClassic listed in the tech-list (result of Tag.getTechList()method). For other NfcA tags, you could start by doing the following:

  1. If the tag has a 7-byte UID (get it via Tag.getId()), the first byte indicates the tag manufacturer's ISO 7816-6 registered chip manufacturer code. E.g. 0x04 for NXP, 0x05 for Infineon, etc.

  2. Once you know the chip manufacturer, you could try to send manufacturer-specific commands to the tag (e.g. for NXP tags you could send a GET_VERSION command to check if the tag is an NTAG/MF Ultralight EV1 tag or an authentication command to check if it is Ultralight C) . Some manufacturers also code further chip information into the UID.

  3. You can scan the tags memory to find the memory size and decide upon that value what chip type it is.

Sheetfed answered 5/6, 2014 at 11:8 Comment(6)
thank you very much for the answer. If the tag has not UID of 7-bytes? Is possible know the manufacturer?Donne
Depending on the tag type you may have some tag specific features that you could use to identify the tag/manufacturer. However, for other than 7-byte UIDs you cannot identify the manufacturer based on the first byte of the UID.Sheetfed
There is another method to identify manufacturer for example in Mifare Classic or Mifare Ultralight?Donne
No bullet-proof one, but you might be able to distinguish between different tag types/manufactureres based on the content of some of the reserved bytes of the tag memory. And for MIFARE Classic based on the content of the manufacturer block.Sheetfed
Sorry I don't understand, where is for MIFARE Classic the block of the manufacturer? For NXP how can send GET_VERSION command? Exist library for this?Donne
The manufacturer block of MIFARE Classic is the first block of the first sector (i.e. sector 0, block 0). For cards that support the GET_VERSION command, you can simply send that command through the NfcA.transceive() method.Sheetfed

© 2022 - 2024 — McMap. All rights reserved.