Topic: Automatic detection of removal of card

Hello all,
I have a DesFire reader (with a controller, PCD etc) with a serial port through which it is connected to a PC. The firmware in the reader will poll for a card and after detecting the card will proceed to RATS command. Once this is done the reader will send a message through serial port that a valid (DesFire) card is detected. PC may then send, for example, create application command to the reader. There could be some time delay (may be even 5 minutes) between the reader indicating to PC and PC sending the command. In this time the card could have been removed and when the command from PC is sent to the reader, the reader should be able to inform PC of absence of the card. How can the reader keep polling for the presence of the same card? Is there any method to do this? Thanks for your time.


Partha

Last edited by Parthasaradhi (2011-02-21 05:36:10)

Re: Automatic detection of removal of card

Hello,

With libnfc, you have to list the available tags and see if the tag have been removed.

Romuald Conty

Re: Automatic detection of removal of card

Hi Romuald Conty,
Thanks for the reply, 'list' meaning number of cards in the range?  if so how does one update the list? In my case I am not expecting more than 1 card. The need here is to check if the card has been removed or replaced with another card.


Partha

Re: Automatic detection of removal of card

Hey,

Parthasaradhi wrote:

In my case I am not expecting more than 1 card. The need here is to check if the card has been removed or replaced with another card.

Ok, so you can use nfc_initiator_select_passive_target() and pass the UID of attempted card.
You should look at API documentation:
http://www.libnfc.org/api/nfc_8h.html#a … 4230508c4b

I hope it helps.

Romuald Conty

Re: Automatic detection of removal of card

Hi Romuald Conty,
Thank you. Will check the link and revert if not able to solve the problem.

Partha

Re: Automatic detection of removal of card

Hi Romuald Conty,
When a card is detected by the reader, at one point before RATS command, the reader assigns an ID to the card (CID). I was wondering if PPS can be sent to the card just to check if the card is still in and active before any other command is executed. If a reply is received from card then everything is fine. Will post after testing.


Partha