I am reading multiple pages from a Mifare Ultralight tag and i would like to send that information to my server api to check if the card is valid.
The output of mfrc522.PICC_DumpToSerial(&(mfrc522.uid)); is:
Page 0 1 2 3
0 04 7F 7F 8C
1 02 66 60 81
2 85 48 00 00
3 E1 10 12 00
4 01 03 A0 0C
5 34 03 00 FE
6 00 00 00 00
7 00 00 00 00
8 00 00 00 00
9 00 00 00 00
10 00 00 00 00
11 00 00 00 00
12 00 00 00 00
13 00 00 00 00
14 00 00 00 00
15 00 00 00 00
With the next code i can read individual pages and i get the following result:
for(byte page = 0; page <= 10; page++) {
MFRC522::StatusCode status = mfrc522.MIFARE_Read(page, buffer, &Count);
if(status==mfrc522.STATUS_OK){
Serial.print("page ");
Serial.print(page);
Serial.print(": ");
dumpInfo(buffer,4);
}
Count = sizeof(buffer);
}
void dumpInfo(byte *ar, int len){
for(int i=0 ; i<len ; i++){
if(ar[i]<0x10) {
Serial.print(F("0"));
}
Serial.print(ar[i], HEX);
Serial.print(F(" "));
}
Serial.println("");
}
page 0: 04 7F 7F 8C
page 1: 02 66 60 81
page 2: 85 48 00 00
page 3: E1 10 12 00
page 4: 01 03 A0 0C
page 5: 34 03 00 FE
page 6: 00 00 00 00
page 7: 00 00 00 00
page 8: 00 00 00 00
page 9: 00 00 00 00
page 10: 00 00 00 00
I just don't know how to send the single page information as a string**?** or char array to my webserver.
What would be a good way, i can convert the hex values on my server but if i need to do it in C++ that would be also okay for me
For me the best would be some kind of array:
pages [
0: [04,
7F,
7F,
8C],
1: [02,
66,
60,
81],
2: [E1,
10,
12,
00],
3: ...
]
Is this possible?