Topic: Two tags in one reader? Three readers in one computer?

I was wondering if it's possible to read two tags in one reader at once. Using the nfc-list example I don't see how hmm

I was also wondering if it's possible to use three identical reads (touchatag) in the same computer. How can I see which tag is from which reader?

Re: Two tags in one reader? Three readers in one computer?

Is it possible on the card first? Can a card have two simulanously selected tags?

The problem of idenitfying touchatags is down to a USB identification problem. We use the coloured LEDs to indicate the role of a particular reader in a multiple reader configuration.

Re: Two tags in one reader? Three readers in one computer?

That's what I don't know.. Does the API support checking which reader was used to read each tag? Can it read more than one tag at once?

Re: Two tags in one reader? Three readers in one computer?

Hello,

Rorsch wrote:

Does the API support checking which reader was used to read each tag?

Yes.

Rorsch wrote:

Can it read more than one tag at once?

Yes.

Have a look at **lsnfc** util from nfc-tools (nfcutils package):
http://code.google.com/p/nfc-tools/wiki/nfcutils

Bye.

Romuald Conty

Re: Two tags in one reader? Three readers in one computer?

I'm actually using libnfc with JNI, so I can use it in Processing .  I've compiled a simple library that can check if an RFID reader is connected, and which tag (ISO14443A) is present on the reader. Everything was working fine and solidly.

Reading the lsnfc.c was assurance enough that reading multiple tags was simple enough. I changed the method that returns a string with the tag ID, so now it would return an array with tag IDs.

The problem is that my application in Processing crashes if I check for tags more than once. The structure of my application is as follows:

1. I check if the reader is connected.
2. If it is, I pick up the array with the tag IDs from the tags at the reader.
3. If the array is empty I draw a small white box on the screen.
4. If the array is not empty, I draw a different shape for each of the tags present.

If I have the RFID reader with no tags present, Processing keeps drawing the white box, meaning that the library can check continuously for tags, returning an empty array. If I have a tag on the reader (or place one after the application has launched), everything crashes, but only after drawing the correct shapes once.

It must mean that the library crashes when I try to re-generate a new array with tag ids (but only if the length of the array is more than 0), but I really don't know why. On the previous version I could check which tag was present at any time - the only major difference is this piece of code (from lsnfc.c):

do {
        // Reads the Tag from the RFID Reader
        if (nfc_initiator_select_tag(pdi,IM_ISO14443A_106,NULL,0,&ti)) {
            
            // Converts the Tag ID from hex to String
            strcpy(tagId,"");

            for (uiPos=0; uiPos < ti.tia.uiUidLen; uiPos++) {
                sprintf(temp,"%02x",ti.tia.abtUid[uiPos]);
                strcat(tagId,temp);
            }
            strcpy(tagsTmp[tag_count], tagId);
            tag_count++;

            nfc_initiator_deselect_tag(pdi);
        } else {
            no_more_tags = true;
        }
    } while (no_more_tags != true);

Any help would be great, if it helps I can post the rest of the code

Last edited by Rorsch (2010-03-14 20:21:42)

Re: Two tags in one reader? Three readers in one computer?

Hello,

Could you attempt to wrote a small source that will reproduce your problem without Processing usage.

If you post it there, I will be able to reproduce your problem... If I can reproduce your problem locally, I don't have any idea that can help you.

Romuald Conty

Re: Two tags in one reader? Three readers in one computer?

The problem it seems, is the way I declare the tagsTmp array. If I declare it as a fixed-size array (char *tagsTmp[3][14]; everything works fine.

My problem is when I try to declare tagsTmp has an dynamic array (which has nothing to do with libnfc):

int N = 0;
typedef char Tag[14];
Tag *tagsTmp = malloc(N * sizeof *tagsTmp);

I'll try to work around this, thanks for all your help smile

(Is it asking too much if you can tell where to get an example of how to work with multiple readers (of the same model) on one computer?)

Last edited by Rorsch (2010-03-15 12:17:15)

Re: Two tags in one reader? Three readers in one computer?

Note: I'm using Windows. Is it possible to see from which reader a tag is being read? I'm trying to use three touchatag readers.

Re: Two tags in one reader? Three readers in one computer?

It seems that for libnfc-1.3.3 there's the following function:

void nfc_list_devices (nfc_device_desc_t pnddDevices[], size_t szDevices, size_t *pszDeviceFound)

Is there something similar for the version 1.2.1? If no, is there instructions on how to compile the 1.3.3 library in a dll (in Visual Studio for example)?

Last edited by Rorsch (2010-03-18 10:51:12)

Re: Two tags in one reader? Three readers in one computer?

Rorsch wrote:

It seems that for libnfc-1.3.3 there's the following function:

void nfc_list_devices (nfc_device_desc_t pnddDevices[], size_t szDevices, size_t *pszDeviceFound)

Is there something similar for the version 1.2.1?

No, it was one of the major enhancements of 1.3.x versions.

Rorsch wrote:

If no, is there instructions on how to compile the 1.3.3 library in a dll (in Visual Studio for example)?

No, we lack of contributors from Windows world...

Romuald Conty