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

Increasing the answer/command buffer size #76

Open
salmg opened this issue Apr 7, 2020 · 4 comments
Open

Increasing the answer/command buffer size #76

salmg opened this issue Apr 7, 2020 · 4 comments

Comments

@salmg
Copy link
Contributor

salmg commented Apr 7, 2020

Noticed that the buffer used for PN532 communication is limited by 64 bytes:

#define PN532_PACKBUFFSIZ 64

  • The C-APDU command length can be up to 261 bytes (CLA-INS-P1-P2-P3-255 data bytes-Le)
  • The R-APDU returned to the host controller can have a length of 258 bytes (256 data bytes-SW1-SW2)

By design, the library uses just one buffer for commands and answers with fixed size(PN532_PACKBUFFSIZ) but a very low one.

Using only 64 bytes from the PN532 buffer is almost four times less its limit. This limitation affects directly the ISO/14443A or raw communication projects.

Making some tests, I noticed that the actual library design could be implemented with a buffer size of 255 without changing anything else:

#define PN532_PACKBUFFSIZ 255

@asdfjkl
Copy link

asdfjkl commented Oct 20, 2020

can you confirm/deny that sending a large apdu (say 80 bytes) is possible? In my setup ( #73 ) increasing the command buffer for receiving apdus works fine (large apdu replies are received ok), but sending large apdus fails.

@salmg
Copy link
Contributor Author

salmg commented Oct 26, 2020

I have to mentioned that I tested that buffer size using only the SPI configuration.

@caternuson
Copy link
Contributor

Looks similar to #38

@mhaberler
Copy link

can you confirm/deny that sending a large apdu (say 80 bytes) is possible? In my setup ( #73 ) increasing the command buffer for receiving apdus works fine (large apdu replies are received ok), but sending large apdus fails.

see the manual reference in #124 which is unambiguous

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

4 participants