Skip to content

Commit

Permalink
some missing function for forum type 4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
aligot-cblue committed Nov 23, 2019
1 parent 14b9b9a commit 804949d
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions NfcAdapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ boolean NfcAdapter::tagPresent(unsigned long timeout)

if (timeout == 0)
{
success = shield->readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, (uint8_t*)&uidLength);
}
else
{
success = shield->readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, (uint8_t*)&uidLength, timeout);
// default value in PNE532lib is 1000
timeout = 1000;
}

// aligot why do I need inlisted @true ? FIXME
success = shield->readPassiveTargetID(PN532_MIFARE_ISO14443A, uid, (uint8_t*)&uidLength, timeout, true, &ATQA, &SAK);

return success;
}

Expand Down Expand Up @@ -94,6 +95,15 @@ boolean NfcAdapter::clean()
}
else
#endif
if (type == TAG_TYPE_4)
{
#ifdef NDEF_DEBUG
Serial.println(F("Cleaning Mifare Plus"));
#endif
MifarePlus mifarePlus = MifarePlus(*shield);
return mifarePlus.clean();
}
else
if (type == TAG_TYPE_2)
{
#ifdef NDEF_DEBUG
Expand Down Expand Up @@ -136,6 +146,15 @@ NfcTag NfcAdapter::read()
MifareUltralight ultralight = MifareUltralight(*shield);
return ultralight.read(uid, uidLength);
}
else
if (type == TAG_TYPE_4)
{
#ifdef NDEF_DEBUG
Serial.println(F("Reading Mifare Plus"));
#endif
MifarePlus mifplus = MifarePlus(*shield);
return mifplus.read(uid, uidLength);
}
else if (type == TAG_TYPE_UNKNOWN)
{
#ifdef NDEF_USE_SERIAL
Expand Down

0 comments on commit 804949d

Please sign in to comment.