Replace wrong decoded ISO14443-B data by ATTRIB_RES field.

New issue
Summary: Improve ISO 14443-B data (ATTRIB_RES) decoding
Before this revision, pn53x_decode_target_data() wrongly decode ISO14443-B. Currently, whole ATTRIB_RES field is stored in nfc_target_info_t struct.
I do not find the correct documentation to fix it better than this, but at least it now retrieves a correct value.
This commit is contained in:
Romuald Conty 2010-09-22 19:10:50 +00:00
parent 2d6c0f5f1a
commit e2a2557396
3 changed files with 7 additions and 36 deletions

View file

@ -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: