No description
Find a file
Romain Tartiere bef4ec342f Don't keep unsupported tags selected.
Currently, when the libfreefare finds a NFC target, it checks whether it's a
supported one looking at it's ATQA.

If the target's ATQA is not in the supported ATQA list, the target was not
deselected.  While this is buggy, it allowed to detect 2 tags with colliding
ATQA on a single NFC device and still have the ATQA of each tag (on ATQA
collision, the ATQA is set to 0x0000 by the NFC chip, but as the tag is not
deselected, it will have a second chance to tell it's ATQA when it will be idle
again):

 computer             PCD                   PICC1   PICC2
    |                  |             ATQA:  0x1234  0x6789
    |                  |                      |       |
    |- InListTargets ->|                      |       |
    |                  |------ REQA ----->(===============)
    |                  |<---- ATQA 1234 ------|       |      } Both reply
    |                  |<---- ATQA 6789 --------------|      } simultaneously
    |                  |                      S       |
    |                  | // Collision detected PICC1 only is selected because
    |                  | // only a single tag was wanted.  It's ATQA is set
    |                  | // to 0x0000.
    |<-- ATQA 0x0000 --|                      S       |
    | // Unsuported ATQA, skipped             S       |
    |                  |                      S       |
    | // DESELECT IS MISSING HERE!            S       |
    |                  |                      S       |
    |- InListTargets ->|                      S       |
    |                  |------ REQA ----->(===============)
    |                  |<---- ATQA 6789 --------------S // PICC1 won't reply
    |<-- ATQA 0x6789 --|                      |       S // it is still selected
    | // Supported, deselect it               |       S
    |--- InDeselect -->|                      |       S
    |                  |-------- HALT --------------->X
    |                  |                      |       X
    |- InListTargets ->|                      |       X
    |                  |------ REQA ----->(===============)
    |                  |<---- ATQA 1234 ------S       X // PICC2 won't reply
    |<-- ATQA 0x1234 --|                      S       X // it is deselected
    | // Supported, deselect it               S       X
    |--- InDeselect -->|                      S       X
    |                  |-------- HALT ------->X       X
    |                  |                      X       X
    |--- InDeselect -->|                      X       X
    |                  |------ REQA ----->(===============)
    |                  |                      X       X // No reply
    |                  |                      X       X

                                          Tag timeline legend:
                                            | - Target idle
                                            S - Target selected
                                            X - Target deselected

Since PN53x devices can only known about 2 tags simultaneously, presenting 3
targets to the NFC device caused an infinite loop.

This commit prevents this infinite loop to occur, and will be completed later
by another commit for not relying on the ATQA to determine targets type.
2010-08-04 12:08:38 +00:00
contrib Add my Vim snippets as contrib. 2010-07-29 07:14:11 +00:00
examples Fix $Id$ vcs keywords. 2010-07-29 06:25:57 +00:00
libfreefare Don't keep unsupported tags selected. 2010-08-04 12:08:38 +00:00
test Fix svn:keyword (I'll commit something to handle this automagically in ~2 commits). 2010-07-29 05:58:04 +00:00
AUTHORS Merge the freefare-desfire branch into trunk. 2010-07-26 21:48:18 +00:00
ChangeLog Import libfreefare into trunk. 2009-12-18 20:32:25 +00:00
configure.ac Reintroduce the possibility to hexdump(3) PCD <=> PICC transmissions. 2010-07-29 06:11:27 +00:00
COPYING Import libfreefare into trunk. 2009-12-18 20:32:25 +00:00
HACKING Merge the freefare-desfire branch into trunk. 2010-07-26 21:48:18 +00:00
libfreefare.pc.in Install a libfreefare.pc pkg-config module. 2009-12-18 21:31:45 +00:00
Makefile.am Fix $Id$ vcs keywords. 2010-07-29 06:25:57 +00:00
NEWS New API functions mad_application_read(), mad_application_write(). 2010-07-03 10:04:06 +00:00
README Merge the freefare-desfire branch into trunk. 2010-07-26 21:48:18 +00:00
TODO Add TODO file. 2010-07-03 10:06:34 +00:00

The libfreefare project aims to provide a convenient API for Mifare card
manipulations.

Supported tags:
  - Mifare Classic 1k
  - Mifare Classic 4k
  - Mifare DESFire 4K
  - Mifare Ultralight

Supported features:
  - Mifare Application Directory (MAD) v1
  - Mifare Application Directory (MAD) v2