added ndef record parse sketch

This commit is contained in:
merlokk 2019-03-05 00:51:32 +02:00
parent a2f8f0628c
commit 64a5b355b5

View file

@ -24,6 +24,14 @@ uint16_t ndefTLVGetLength(uint8_t *data, size_t *indx) {
return len;
}
int ndefRecordDecodeAndPrint(uint8_t *ndefRecord, size_t ndefRecordLen) {
return 0;
}
int NDEFDecodeAndPrint(uint8_t *ndef, size_t ndefLen, bool verbose) {
size_t indx = 0;
@ -44,9 +52,9 @@ int NDEFDecodeAndPrint(uint8_t *ndef, size_t ndefLen, bool verbose) {
uint16_t len = ndefTLVGetLength(&ndef[indx], &indx);
PrintAndLogEx(INFO, "NDEF message. len: %d", len);
// ndef decode
int res = ndefRecordDecodeAndPrint(&ndef[indx], len);
if (res)
return res;
indx += len;
break;