Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of PN532 by
Ndef.cpp
00001 #include "Ndef.h" 00002 #include "PN532_debug.h" 00003 00004 // Borrowed from Adafruit_NFCShield_I2C 00005 void PrintHex(const uint8_t * data, const long numuint8_ts) 00006 { 00007 uint32_t szPos; 00008 for (szPos=0; szPos < numuint8_ts; szPos++) 00009 { 00010 DMSG("0x"); 00011 // Append leading 0 for small values 00012 if (data[szPos] <= 0xF) 00013 DMSG("0"); 00014 DMSG_HEX(data[szPos]&0xff); 00015 if ((numuint8_ts > 1) && (szPos != numuint8_ts - 1)) 00016 { 00017 DMSG(" "); 00018 } 00019 } 00020 DMSG(""); 00021 } 00022 00023 // Borrowed from Adafruit_NFCShield_I2C 00024 void PrintHexChar(const uint8_t * data, const long numuint8_ts) 00025 { 00026 uint32_t szPos; 00027 for (szPos=0; szPos < numuint8_ts; szPos++) 00028 { 00029 // Append leading 0 for small values 00030 DMSG_HEX(data[szPos]); 00031 } 00032 DMSG(" "); 00033 for (szPos=0; szPos < numuint8_ts; szPos++) 00034 { 00035 if (data[szPos] <= 0x1F) 00036 DMSG("."); 00037 else 00038 DMSG("%c", (char)data[szPos]); 00039 } 00040 DMSG("\n"); 00041 } 00042 00043 // Note if buffer % blockSize != 0, last block will not be written 00044 void DumpHex(const uint8_t * data, const long numuint8_ts, const unsigned int blockSize) 00045 { 00046 int i; 00047 for (i = 0; i < (numuint8_ts / blockSize); i++) 00048 { 00049 PrintHexChar(data, blockSize); 00050 data += blockSize; 00051 } 00052 }
Generated on Tue Jul 12 2022 16:40:03 by
1.7.2
