0
votes

I'm trying to manage value block with a Mifare Classic and PN532 reader. I'm using an open source library named "libnfc" but I do not see anything related to value blocks in this library.

Does anyone know how I could make increment, decrement and transfer calls with this reader & library?

1

1 Answers

0
votes

Have a look at the header utils/mifare.h (and its associated implementation utils/mifare.c). They contain an implementation of the MIFARE reader commands. For instance, for the increment command, you would use something like:

mp.mpv.abtValue[0] = 1;
mp.mpv.abtValue[1] = 0;
mp.mpv.abtValue[2] = 0;
mp.mpv.abtValue[3] = 0;

nfc_initiator_mifare_cmd(pnd, MC_INCREMENT, blockNumber, &mp);

Where pnd is a nfc_device *, mp is a mifare_param and you previously authenticated to that sector (see utils/nfc-mfclassic.c).