-21-
v7.0
Libelium’s library
8.15. Printing data
This function is very useful for viewing data content in vectors when you are debugging the code.
Example of use:
{
RFID.print(readData,16); //Print data read and stored in readData vector in the
serial monitor
}
http://www.libelium.com/development/waspmote/examples/RFID1356-01-basic-example
8.16. Comparing UIDs
This function compares 2 UIDs to check if they are equal. It is useful to check if the UID we have just detected is the same than a
predetermined UID. One logic application could be access control for a single person.
Example of use:
{
uint8_t state; // stores the status of the executed command
uint8_t ATQ[2]; // stores the ATQ-A
uint8_t UID[4]; // stores the UID (unique identification) of a card
uint8_t card[] = {0xXY, 0xXY, 0xXY, 0xXY}; // the UID of the card that we want to find
boolean tr = false;
...
state = RFID13.init(UID, ATQ); // inits systems and look for cards
tr = RFID13.equalUIDs(card, UID); // if the read UID is the same than the original card, tr
// will be true
}
http://www.libelium.com/development/waspmote/examples/RFID1356-06-single-cards-counter
8.17. Searching a UID among a group of UIDs
This function tests if a certain UID is contained in a set or vector of UIDs. It is useful to check if the UID we have just detected is
inside a predetermined set or group of UIDs. One logic application could be access control for a group of people.
Example of use:
{
#define nCards 3 // edit: number of possible cards
uint8_t state; // stores the status of the executed command
uint8_t ATQ[2]; // stores the ATQ-A
uint8_t UID[4]; // stores the UID (unique identification) of a card
// edit: vector with the UIDs of all the cards
uint8_t vCards [nCards*4] = {0xXY, 0xXY, 0xXY, 0xXY,
0xXY, 0xXY, 0xXY, 0xXY,
0xXY, 0xXY, 0xXY, 0xXY};
int card = -1; // stores the index of the present card
...
state = RFID13.init(UID, ATQ); // inits systems and look for cards
card = RFID13.searchUID(vCards, UID, nCards); // looks for the read card inside the data
// base. If so, it returns its index in the vector.
//
If
not,
-1.
}
http://www.libelium.com/development/waspmote/examples/RFID1356-06-single-cards-counter