diff --git a/examples/nfc-utils.c b/examples/nfc-utils.c index 494cc8d..fd2b521 100644 --- a/examples/nfc-utils.c +++ b/examples/nfc-utils.c @@ -137,14 +137,8 @@ print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi) { printf (" ATQB: "); print_hex (nbi.abtAtqb, 12); - printf (" ID: "); - print_hex (nbi.abtId, 4); - printf (" CID: %02x\n", nbi.btCid); - if (nbi.szInfLen > 0) { - printf (" INF: "); - print_hex (nbi.abtInf, nbi.szInfLen); - } - printf (" PARAMS: %02x %02x %02x %02x\n", nbi.btParam1, nbi.btParam2, nbi.btParam3, nbi.btParam4); + printf (" ATTRIB_RES: "); + print_hex (nbi.abtAttribRes, nbi.szAttribRes); } /** diff --git a/include/nfc/nfc-types.h b/include/nfc/nfc-types.h index e3f142b..f0bc0b3 100644 --- a/include/nfc/nfc-types.h +++ b/include/nfc/nfc-types.h @@ -230,14 +230,8 @@ typedef struct { */ typedef struct { byte_t abtAtqb[12]; - byte_t abtId[4]; - byte_t btParam1; - byte_t btParam2; - byte_t btParam3; - byte_t btParam4; - byte_t btCid; - size_t szInfLen; - byte_t abtInf[64]; + size_t szAttribRes; + byte_t abtAttribRes[64]; } nfc_iso14443b_info_t; /** diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 86cff99..e2210e3 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -321,7 +321,6 @@ bool pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_t nc, nfc_target_type_t ntt, nfc_target_info_t * pnti) { - uint8_t ui8AttribResLen; switch (ntt) { case NTT_MIFARE: case NTT_GENERIC_PASSIVE_106: @@ -372,25 +371,9 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_ memcpy (pnti->nbi.abtAtqb, pbtRawData, 12); pbtRawData += 12; - // Store temporarily the ATTRIB_RES length - ui8AttribResLen = *(pbtRawData++); - - // Store the 4 bytes ID - memcpy (pnti->nbi.abtId, pbtRawData, 4); - pbtRawData += 4; - - pnti->nbi.btParam1 = *(pbtRawData++); - pnti->nbi.btParam2 = *(pbtRawData++); - pnti->nbi.btParam3 = *(pbtRawData++); - pnti->nbi.btParam4 = *(pbtRawData++); - - // Test if the Higher layer (INF) is available - if (ui8AttribResLen > 8) { - pnti->nbi.szInfLen = *(pbtRawData++); - memcpy (pnti->nbi.abtInf, pbtRawData, pnti->nbi.szInfLen); - } else { - pnti->nbi.szInfLen = 0; - } + // FIXME This part is not correct: ATTRIB_RES should be decoded but I can't find the right document that explains how to CORRECTLY decode this frame + pnti->nbi.szAttribRes = *(pbtRawData++); + memcpy (pnti->nbi.abtAttribRes, pbtRawData, pnti->nbi.szAttribRes); break; case NTT_FELICA_212: