nfc_target_receive_*() need to know rx buffer size
This commit is contained in:
parent
601105ef79
commit
22bea8d99b
11 changed files with 31 additions and 23 deletions
|
|
@ -126,7 +126,7 @@ main (int argc, const char *argv[])
|
|||
}
|
||||
|
||||
printf("Initiator request received. Waiting for data...\n");
|
||||
if ((res = nfc_target_receive_bytes (pnd, abtRx, 0)) < 0) {
|
||||
if ((res = nfc_target_receive_bytes (pnd, abtRx, sizeof (abtRx), 0)) < 0) {
|
||||
nfc_perror(pnd, "nfc_target_receive_bytes");
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ nfc_target_emulate_tag(nfc_device *pnd, nfc_target *pnt)
|
|||
nfc_device_set_property_bool (pnd, NP_HANDLE_CRC, false);
|
||||
init_mfc_auth = false;
|
||||
}
|
||||
if ((res = nfc_target_receive_bytes(pnd, abtRx, 0)) < 0) {
|
||||
if ((res = nfc_target_receive_bytes(pnd, abtRx, sizeof (abtRx), 0)) < 0) {
|
||||
nfc_perror (pnd, "nfc_target_receive_bytes");
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -172,7 +172,7 @@ main (int argc, char *argv[])
|
|||
|
||||
while (true) {
|
||||
// Test if we received a frame
|
||||
if ((szRecvBits = nfc_target_receive_bits (pnd, abtRecv, NULL)) > 0) {
|
||||
if ((szRecvBits = nfc_target_receive_bits (pnd, abtRecv, sizeof (abtRecv), 0)) > 0) {
|
||||
// Prepare the command to send back for the anti-collision request
|
||||
switch (szRecvBits) {
|
||||
case 7: // Request or Wakeup
|
||||
|
|
|
|||
|
|
@ -179,7 +179,7 @@ main (int argc, char *argv[])
|
|||
|
||||
while (!quitting) {
|
||||
// Test if we received a frame from the reader
|
||||
if ((szReaderRxBits = nfc_target_receive_bits (pndTag, abtReaderRx, abtReaderRxPar)) > 0) {
|
||||
if ((szReaderRxBits = nfc_target_receive_bits (pndTag, abtReaderRx, sizeof (abtReaderRx), abtReaderRxPar)) > 0) {
|
||||
// Drop down the field before sending a REQA command and start a new session
|
||||
if (szReaderRxBits == 7 && abtReaderRx[0] == 0x26) {
|
||||
// Drop down field for a very short time (original tag will reboot)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue