From eeaad85151d7521438604d32c79763d0165e8363 Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Tue, 17 Aug 2010 15:24:37 +0000 Subject: [PATCH] Add SAK decoding for compliance with ISO/IEC. --- examples/nfc-utils.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/examples/nfc-utils.c b/examples/nfc-utils.c index 95b01e1..46fe5c7 100644 --- a/examples/nfc-utils.c +++ b/examples/nfc-utils.c @@ -84,6 +84,9 @@ void print_hex_par(const byte_t* pbtData, const size_t szBits, const byte_t* pbt printf("\n"); } +#define SAK_ISO14443_4_COMPLIANT 0x20 +#define SAK_ISO18092_COMPLIANT 0x40 + void print_nfc_iso14443a_info(const nfc_iso14443a_info_t nai) { printf(" ATQA (SENS_RES): "); print_hex(nai.abtAtqa,2); @@ -93,6 +96,12 @@ void print_nfc_iso14443a_info(const nfc_iso14443a_info_t nai) printf(" ATS (ATR): "); print_hex(nai.abtAts, nai.szAtsLen); } + if ( (nai.btSak & SAK_ISO14443_4_COMPLIANT) || (nai.btSak & SAK_ISO18092_COMPLIANT) ) { + printf(" Compliant with: "); + if (nai.btSak & SAK_ISO14443_4_COMPLIANT) printf("ISO/IEC 14443-4 "); + if (nai.btSak & SAK_ISO18092_COMPLIANT) printf("ISO/IEC 18092"); + printf("\n"); + } } /**