Fix packet length checksum computation.
The doc says LCS (aka abtTx[4]) must be set so that the lower byte of LCS+LEN (aka abtTx[3]) is 0x00. This has not to be related to the USB buffer size, so that we can adjust it without breaking down the libnfc.
This commit is contained in:
parent
7f9f907bc2
commit
af584bd474
1 changed files with 1 additions and 1 deletions
|
@ -251,7 +251,7 @@ bool pn53x_usb_transceive(const nfc_device_spec_t nds, const byte_t* pbtTx, cons
|
|||
// Packet length = data length (len) + checksum (1) + end of stream marker (1)
|
||||
abtTx[3] = szTxLen;
|
||||
// Packet length checksum
|
||||
abtTx[4] = BUFFER_LENGTH - abtTx[3];
|
||||
abtTx[4] = 0x0100 - abtTx[3];
|
||||
// Copy the PN53X command into the packet abtTx
|
||||
memmove(abtTx+5,pbtTx,szTxLen);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue