nfc_target_receive_bits() function returns now received bits count on success and libnfc error code on failure.
This commit is contained in:
parent
951dde8143
commit
0de1136037
7 changed files with 18 additions and 16 deletions
|
|
@ -172,7 +172,7 @@ main (int argc, char *argv[])
|
|||
|
||||
while (true) {
|
||||
// Test if we received a frame
|
||||
if (nfc_target_receive_bits (pnd, abtRecv, &szRecvBits, NULL)) {
|
||||
if (nfc_target_receive_bits (pnd, abtRecv, &szRecvBits, NULL) > 0) {
|
||||
// Prepare the command to send back for the anti-collision request
|
||||
switch (szRecvBits) {
|
||||
case 7: // Request or Wakeup
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ main (int argc, char *argv[])
|
|||
|
||||
while (!quitting) {
|
||||
// Test if we received a frame from the reader
|
||||
if (nfc_target_receive_bits (pndTag, abtReaderRx, &szReaderRxBits, abtReaderRxPar)) {
|
||||
if (nfc_target_receive_bits (pndTag, abtReaderRx, &szReaderRxBits, 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