diff --git a/libnfc/bitutils.c b/libnfc/bitutils.c index f841251..61fe1d6 100644 --- a/libnfc/bitutils.c +++ b/libnfc/bitutils.c @@ -212,3 +212,13 @@ void print_hex_par(const byte_t* pbtData, const size_t szBits, const byte_t* pbt printf("\n"); } +void print_nfc_iso14443a_info(const nfc_iso14443a_info_t nai) +{ + printf(" ATQA (SENS_RES): "); print_hex(nai.abtAtqa,2); + printf(" UID (NFCID%c): ",(nai.abtUid[0]==0x08?'3':'1')); print_hex(nai.abtUid, nai.szUidLen); + printf(" SAK (SEL_RES): "); print_hex(&nai.btSak,1); + if (nai.szAtsLen) { + printf(" ATS (ATR): "); + print_hex(nai.abtAts, nai.szAtsLen); + } +} diff --git a/libnfc/bitutils.h b/libnfc/bitutils.h index 1a9eea1..37f0341 100644 --- a/libnfc/bitutils.h +++ b/libnfc/bitutils.h @@ -65,5 +65,7 @@ NFC_EXPORT void print_hex(const byte_t* pbtData, const size_t szLen); NFC_EXPORT void print_hex_bits(const byte_t* pbtData, const size_t szBits); NFC_EXPORT void print_hex_par(const byte_t* pbtData, const size_t szBits, const byte_t* pbtDataPar); +NFC_EXPORT void print_nfc_iso14443a_info(const nfc_iso14443a_info_t nai); + #endif // _LIBNFC_BITUTILS_H_