Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ntag2xx_ReadPage only reads 4 bytes at a time #40

Open
scottjenson opened this issue Nov 10, 2017 · 0 comments
Open

ntag2xx_ReadPage only reads 4 bytes at a time #40

scottjenson opened this issue Nov 10, 2017 · 0 comments

Comments

@scottjenson
Copy link

Adafruit_PN532.cpp specifically calls out in the code that it limits reads 4 bytes at a time:

/* Copy the 4 data bytes to the output buffer         */
/* Block content starts at byte 9 of a valid response */
/* Note that the command actually reads 16 byte or 4  */
/* pages at a time ... we simply discard the last 12  */
/* bytes                                              */

For the more modern tags (I'm using NTAG213) you can read 16 bytes at time. I don't understand the spec well enough to know if there is any way to test for this 4/16 split. However if I change the following line
memcpy (buffer, pn532_packetbuffer+8, 4);
to
memcpy (buffer, pn532_packetbuffer+8, 16);
It works great for my tag (and I'm running 4x faster)

One alternative would be to pass in a flag to ntag2xx_ReadPage so you could just specify reads of 4 or 16 bytes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants