-22-
v7.0
Libelium’s library
8.18. Converting from a string to a uint8_t pointer
This function converts from a string to a pointer to uint8_t’s. When we want to write a word or phrase in an RFID card, this
function is useful to convert from ASCII code to the format the RFID/NFC module can understand.
Example of use:
{
uint8_t aux[16]; // auxiliar uint8_t pointer
char text [16]; // auxiliar string
int number = 3; // stores numbers
...
sprintf(text ,”Its a test %d “, number*4); // add a number to a string (dynamic !! )
RFID13.string2vector(text, aux); // converts from string to a uint8_t pointer
}
http://www.libelium.com/development/waspmote/examples/RFID1356-03-bus-ticketing
8.19. Converting from a uint8_t pointer to an integer
This function converts from a pointer to uint8_t’s to an integer. When we want to read a number frim an RFID card, this function
is useful to convert from ASCII conde to the format we can understand, an integer.
Example of use:
{
uint8_t aux[16] = {0x51, 0x52, 0x53, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; // auxiliar uint8_t pointer
int number = 0; // stores numbers
...
number = vector2int(aux); // converts from a uint8_t pointer to an integer
}
http://www.libelium.com/development/waspmote/examples/RFID1356-03-bus-ticketing