list_targets support for ASK CTS512B (no anticol support yet)
This commit is contained in:
parent
53f1acfdcb
commit
ab54a37678
6 changed files with 88 additions and 54 deletions
|
|
@ -199,30 +199,30 @@ main (int argc, const char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
nm.nmt = NMT_ISO14443B3SR;
|
||||
nm.nmt = NMT_ISO14443B2SR;
|
||||
nm.nbr = NBR_106;
|
||||
// List ISO14443B-3 ST SRx family targets
|
||||
// List ISO14443B-2 ST SRx family targets
|
||||
if (nfc_initiator_list_passive_targets (pnd, nm, ant, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
size_t n;
|
||||
if (verbose || (szTargetFound > 0)) {
|
||||
printf ("%d ISO14443B-3 ST SRx passive target(s) found%s\n", (int) szTargetFound, (szTargetFound == 0) ? ".\n" : ":");
|
||||
printf ("%d ISO14443B-2 ST SRx passive target(s) found%s\n", (int) szTargetFound, (szTargetFound == 0) ? ".\n" : ":");
|
||||
}
|
||||
for (n = 0; n < szTargetFound; n++) {
|
||||
print_nfc_iso14443b3sr_info (ant[n].nti.nsi, verbose);
|
||||
print_nfc_iso14443b2sr_info (ant[n].nti.nsi, verbose);
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
nm.nmt = NMT_ISO14443B3CT;
|
||||
nm.nmt = NMT_ISO14443B2CT;
|
||||
nm.nbr = NBR_106;
|
||||
// List ISO14443B-3 ASK CTx family targets
|
||||
// List ISO14443B-2 ASK CTx family targets
|
||||
if (nfc_initiator_list_passive_targets (pnd, nm, ant, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
size_t n;
|
||||
if (verbose || (szTargetFound > 0)) {
|
||||
printf ("%d ISO14443B-3 ASK CTx passive target(s) found%s\n", (int) szTargetFound, (szTargetFound == 0) ? ".\n" : ":");
|
||||
printf ("%d ISO14443B-2 ASK CTx passive target(s) found%s\n", (int) szTargetFound, (szTargetFound == 0) ? ".\n" : ":");
|
||||
}
|
||||
for (n = 0; n < szTargetFound; n++) {
|
||||
print_nfc_iso14443b3ct_info (ant[n].nti.nci, verbose);
|
||||
print_nfc_iso14443b2ct_info (ant[n].nti.nci, verbose);
|
||||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -632,17 +632,22 @@ print_nfc_iso14443bi_info (const nfc_iso14443bi_info_t nii, bool verbose)
|
|||
}
|
||||
|
||||
void
|
||||
print_nfc_iso14443b3sr_info (const nfc_iso14443b3sr_info_t nsi, bool verbose)
|
||||
print_nfc_iso14443b2sr_info (const nfc_iso14443b2sr_info_t nsi, bool verbose)
|
||||
{
|
||||
printf (" UID: ");
|
||||
print_hex (nsi.abtUID, 8);
|
||||
}
|
||||
|
||||
void
|
||||
print_nfc_iso14443b3ct_info (const nfc_iso14443b3ct_info_t nci, bool verbose)
|
||||
print_nfc_iso14443b2ct_info (const nfc_iso14443b2ct_info_t nci, bool verbose)
|
||||
{
|
||||
printf (" Data: ");
|
||||
print_hex (nci.abtData, nci.szDataLen);
|
||||
uint32_t uid;
|
||||
uid = (nci.abtUID[3] << 24) + (nci.abtUID[2] << 16) + (nci.abtUID[1] << 8) + nci.abtUID[0];
|
||||
printf (" UID: ");
|
||||
print_hex (nci.abtUID, sizeof(nci.abtUID));
|
||||
printf (" UID (decimal): %010u\n", uid);
|
||||
printf (" Product Code: %02X\n", nci.btProdCode);
|
||||
printf (" Fab Code: %02X\n", nci.btFabCode);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
@ -754,13 +759,13 @@ print_nfc_target (const nfc_target_t nt, bool verbose)
|
|||
printf ("ISO/IEC 14443-4B' (%s) target:\n", str_nfc_baud_rate(nt.nm.nbr));
|
||||
print_nfc_iso14443bi_info (nt.nti.nii, verbose);
|
||||
break;
|
||||
case NMT_ISO14443B3SR:
|
||||
printf ("ISO/IEC 14443-3B ST SRx (%s) target:\n", str_nfc_baud_rate(nt.nm.nbr));
|
||||
print_nfc_iso14443b3sr_info (nt.nti.nsi, verbose);
|
||||
case NMT_ISO14443B2SR:
|
||||
printf ("ISO/IEC 14443-2B ST SRx (%s) target:\n", str_nfc_baud_rate(nt.nm.nbr));
|
||||
print_nfc_iso14443b2sr_info (nt.nti.nsi, verbose);
|
||||
break;
|
||||
case NMT_ISO14443B3CT:
|
||||
printf ("ISO/IEC 14443-3B ASK CTx (%s) target:\n", str_nfc_baud_rate(nt.nm.nbr));
|
||||
print_nfc_iso14443b3ct_info (nt.nti.nci, verbose);
|
||||
case NMT_ISO14443B2CT:
|
||||
printf ("ISO/IEC 14443-2B ASK CTx (%s) target:\n", str_nfc_baud_rate(nt.nm.nbr));
|
||||
print_nfc_iso14443b2ct_info (nt.nti.nci, verbose);
|
||||
break;
|
||||
case NMT_DEP:
|
||||
printf ("D.E.P. (%s) target:\n", str_nfc_baud_rate(nt.nm.nbr));
|
||||
|
|
|
|||
|
|
@ -89,8 +89,8 @@ void print_hex_par (const byte_t * pbtData, const size_t szBits, const byte_t
|
|||
void print_nfc_iso14443a_info (const nfc_iso14443a_info_t nai, bool verbose);
|
||||
void print_nfc_iso14443b_info (const nfc_iso14443b_info_t nbi, bool verbose);
|
||||
void print_nfc_iso14443bi_info (const nfc_iso14443bi_info_t nii, bool verbose);
|
||||
void print_nfc_iso14443b3sr_info (const nfc_iso14443b3sr_info_t nsi, bool verbose);
|
||||
void print_nfc_iso14443b3ct_info (const nfc_iso14443b3ct_info_t nci, bool verbose);
|
||||
void print_nfc_iso14443b2sr_info (const nfc_iso14443b2sr_info_t nsi, bool verbose);
|
||||
void print_nfc_iso14443b2ct_info (const nfc_iso14443b2ct_info_t nci, bool verbose);
|
||||
void print_nfc_felica_info (const nfc_felica_info_t nfi, bool verbose);
|
||||
void print_nfc_jewel_info (const nfc_jewel_info_t nji, bool verbose);
|
||||
void print_nfc_dep_info (const nfc_dep_info_t ndi, bool verbose);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue