Improve ATQB decoding: "PUPI", "Application Data", and "Protocol Info" is now available as separated fields.
This commit is contained in:
parent
ccfd24a682
commit
2f95fb254b
3 changed files with 27 additions and 7 deletions
|
@ -135,8 +135,12 @@ print_nfc_felica_info (const nfc_felica_info_t nfi)
|
||||||
void
|
void
|
||||||
print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi)
|
print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi)
|
||||||
{
|
{
|
||||||
printf (" ATQB: ");
|
printf (" PUPI: ");
|
||||||
print_hex (nbi.abtAtqb, 12);
|
print_hex (nbi.abtPupi, 4);
|
||||||
|
printf (" Application Data: ");
|
||||||
|
print_hex (nbi.abtApplicationData, 4);
|
||||||
|
printf (" Protocol Info: ");
|
||||||
|
print_hex (nbi.abtProtocolInfo, 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -231,8 +231,12 @@ typedef struct {
|
||||||
* @brief NFC ISO14443B tag information
|
* @brief NFC ISO14443B tag information
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
/** abtAtqb store ATQB (Answer To reQuest of type B) */
|
/** abtPupi store PUPI contained in ATQB (Answer To reQuest of type B) (see ISO14443-3) */
|
||||||
byte_t abtAtqb[12];
|
byte_t abtPupi[4];
|
||||||
|
/** abtApplicationData store Application Data contained in ATQB (see ISO14443-3) */
|
||||||
|
byte_t abtApplicationData[4];
|
||||||
|
/** abtProtocolInfo store Protocol Info contained in ATQB (see ISO14443-3) */
|
||||||
|
byte_t abtProtocolInfo[3];
|
||||||
/** ui8CardIdentifier store CID (Card Identifier) attributted by PCD to the PICC */
|
/** ui8CardIdentifier store CID (Card Identifier) attributted by PCD to the PICC */
|
||||||
uint8_t ui8CardIdentifier;
|
uint8_t ui8CardIdentifier;
|
||||||
} nfc_iso14443b_info_t;
|
} nfc_iso14443b_info_t;
|
||||||
|
|
|
@ -369,10 +369,22 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_
|
||||||
// We skip the first byte: its the target number (Tg)
|
// We skip the first byte: its the target number (Tg)
|
||||||
pbtRawData++;
|
pbtRawData++;
|
||||||
|
|
||||||
// Store the mandatory info
|
// Now we are in ATQB, we skip the first ATQB byte always equal to 0x50
|
||||||
memcpy (pnti->nbi.abtAtqb, pbtRawData, 12);
|
pbtRawData++;
|
||||||
pbtRawData += 12;
|
|
||||||
|
// Store the PUPI (Pseudo-Unique PICC Identifier)
|
||||||
|
memcpy (pnti->nbi.abtPupi, pbtRawData, 4);
|
||||||
|
pbtRawData += 4;
|
||||||
|
|
||||||
|
// Store the Application Data
|
||||||
|
memcpy (pnti->nbi.abtApplicationData, pbtRawData, 4);
|
||||||
|
pbtRawData += 4;
|
||||||
|
|
||||||
|
// Store the Protocol Info
|
||||||
|
memcpy (pnti->nbi.abtProtocolInfo, pbtRawData, 3);
|
||||||
|
pbtRawData += 3;
|
||||||
|
|
||||||
|
// We leave the ATQB field, we now enter in Card IDentifier
|
||||||
szAttribRes = *(pbtRawData++);
|
szAttribRes = *(pbtRawData++);
|
||||||
if (szAttribRes) {
|
if (szAttribRes) {
|
||||||
pnti->nbi.ui8CardIdentifier = *(pbtRawData++);
|
pnti->nbi.ui8CardIdentifier = *(pbtRawData++);
|
||||||
|
|
Loading…
Add table
Reference in a new issue