Change some nfc_target_type_t to insist on the ISO/IEC 14443-4 compliance
This commit is contained in:
parent
0fe30e3db7
commit
c53c512831
5 changed files with 17 additions and 17 deletions
|
@ -72,7 +72,7 @@ main (int argc, const char *argv[])
|
|||
|
||||
const byte_t btPollNr = 20;
|
||||
const byte_t btPeriod = 2;
|
||||
const nfc_target_type_t nttArray[5] = {NTT_GENERIC_PASSIVE_106, NTT_GENERIC_PASSIVE_212, NTT_GENERIC_PASSIVE_424, NTT_ISO14443B_106, NTT_JEWEL_106};
|
||||
const nfc_target_type_t nttArray[5] = {NTT_GENERIC_PASSIVE_106, NTT_GENERIC_PASSIVE_212, NTT_GENERIC_PASSIVE_424, NTT_ISO14443_4B_106, NTT_JEWEL_106};
|
||||
const size_t szTargetTypes = 5;
|
||||
|
||||
nfc_target_t antTargets[2];
|
||||
|
@ -129,11 +129,11 @@ main (int argc, const char *argv[])
|
|||
printf ("(FeliCa 212 kbps card), targetData:\n");
|
||||
print_nfc_felica_info (antTargets[n].nti.nfi);
|
||||
break;
|
||||
case NTT_ISO14443A_106:
|
||||
case NTT_ISO14443_4A_106:
|
||||
printf ("(Passive 106 kbps ISO/IEC 14443-4A card), targetData:\n");
|
||||
print_nfc_iso14443a_info (antTargets[n].nti.nai);
|
||||
break;
|
||||
case NTT_ISO14443B_TCL_106:
|
||||
case NTT_ISO14443_4B_TCL_106:
|
||||
printf ("(Passive 106 kbps ISO/IEC 14443-4B card), targetData:\n");
|
||||
print_nfc_iso14443b_info (antTargets[n].nti.nbi);
|
||||
break;
|
||||
|
|
|
@ -224,7 +224,7 @@ void print_nfc_target_type( const nfc_target_type_t ntt )
|
|||
case NTT_GENERIC_PASSIVE_424:
|
||||
printf ("Generic passive 424 kbps (FeliCa, DEP)\n");
|
||||
break;
|
||||
case NTT_ISO14443B_106:
|
||||
case NTT_ISO14443_4B_106:
|
||||
printf ("Passive 106 kbps ISO/IEC14443-4B\n");
|
||||
break;
|
||||
case NTT_JEWEL_106:
|
||||
|
@ -239,10 +239,10 @@ void print_nfc_target_type( const nfc_target_type_t ntt )
|
|||
case NTT_FELICA_424:
|
||||
printf ("FeliCa 424 kbps card\n");
|
||||
break;
|
||||
case NTT_ISO14443A_106:
|
||||
case NTT_ISO14443_4A_106:
|
||||
printf ("Passive 106 kbps ISO/IEC14443-4A\n");
|
||||
break;
|
||||
case NTT_ISO14443B_TCL_106:
|
||||
case NTT_ISO14443_4B_TCL_106:
|
||||
printf ("Passive 106 kbps ISO/IEC14443-4B with TCL flag\n");
|
||||
break;
|
||||
case NTT_DEP_PASSIVE_106:
|
||||
|
|
|
@ -302,19 +302,19 @@ typedef enum {
|
|||
/** Generic passive 424 kbps (FeliCa, DEP) */
|
||||
NTT_GENERIC_PASSIVE_424 = 0x02,
|
||||
/** Passive 106 kbps ISO/IEC14443-4B */
|
||||
NTT_ISO14443B_106 = 0x03,
|
||||
NTT_ISO14443_4B_106 = 0x03,
|
||||
/** Innovision Jewel tag */
|
||||
NTT_JEWEL_106 = 0x04,
|
||||
/** mifare card */
|
||||
/** Mifare card */
|
||||
NTT_MIFARE = 0x10,
|
||||
/** FeliCa 212 kbps card */
|
||||
NTT_FELICA_212 = 0x11,
|
||||
/** FeliCa 424 kbps card */
|
||||
NTT_FELICA_424 = 0x12,
|
||||
/** Passive 106 kbps ISO/IEC14443-4A */
|
||||
NTT_ISO14443A_106 = 0x20,
|
||||
/** Passive 106 kbps ISO/IEC14443-4B with TCL flag */
|
||||
NTT_ISO14443B_TCL_106 = 0x23,
|
||||
/** Passive 106 kbps ISO/IEC 14443-4A */
|
||||
NTT_ISO14443_4A_106 = 0x20,
|
||||
/** Passive 106 kbps ISO/IEC 14443-4B with TCL flag */
|
||||
NTT_ISO14443_4B_TCL_106 = 0x23,
|
||||
/** DEP passive 106 kbps */
|
||||
NTT_DEP_PASSIVE_106 = 0x40,
|
||||
/** DEP passive 212 kbps */
|
||||
|
|
|
@ -377,7 +377,7 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_
|
|||
switch (ntt) {
|
||||
case NTT_MIFARE:
|
||||
case NTT_GENERIC_PASSIVE_106:
|
||||
case NTT_ISO14443A_106:
|
||||
case NTT_ISO14443_4A_106:
|
||||
// We skip the first byte: its the target number (Tg)
|
||||
pbtRawData++;
|
||||
|
||||
|
@ -415,8 +415,8 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_
|
|||
}
|
||||
break;
|
||||
|
||||
case NTT_ISO14443B_106:
|
||||
case NTT_ISO14443B_TCL_106:
|
||||
case NTT_ISO14443_4B_106:
|
||||
case NTT_ISO14443_4B_TCL_106:
|
||||
// We skip the first byte: its the target number (Tg)
|
||||
pbtRawData++;
|
||||
|
||||
|
@ -1073,7 +1073,7 @@ pn53x_target_init (nfc_device_t * pnd, const nfc_target_mode_t ntm, const nfc_ta
|
|||
switch(nt.ntt) {
|
||||
case NTT_MIFARE:
|
||||
case NTT_GENERIC_PASSIVE_106:
|
||||
case NTT_ISO14443A_106: {
|
||||
case NTT_ISO14443_4A_106: {
|
||||
// Set ATQA (SENS_RES)
|
||||
abtMifareParams[0] = nt.nti.nai.abtAtqa[1];
|
||||
abtMifareParams[1] = nt.nti.nai.abtAtqa[0];
|
||||
|
|
|
@ -350,7 +350,7 @@ nfc_initiator_select_passive_target (nfc_device_t * pnd,
|
|||
break;
|
||||
|
||||
case NM_ISO14443B_106:
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_ISO14443B_106, pnti)) {
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_ISO14443_4B_106, pnti)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue