Rename nfc_target_type_t as pn53x_target_type_t
This commit is contained in:
parent
c53c512831
commit
695e5c2f37
14 changed files with 99 additions and 99 deletions
|
@ -66,7 +66,7 @@ main (int argc, const char *argv[])
|
|||
}
|
||||
|
||||
const nfc_target_t nt = {
|
||||
.ntt = NTT_DEP_PASSIVE_106,
|
||||
.ptt = PTT_DEP_PASSIVE_106,
|
||||
.nti.ndi.abtNFCID3 = { 0x12, 0x34, 0x56, 0x78, 0x9a, 0xbc, 0xde, 0xff, 0x00, 0x00 },
|
||||
.nti.ndi.szGB = 4,
|
||||
.nti.ndi.abtGB = { 0x12, 0x34, 0x56, 0x78 },
|
||||
|
|
|
@ -112,7 +112,7 @@ main (int argc, char *argv[])
|
|||
printf ("Emulating NDEF tag now, please touch it with a second NFC device\n");
|
||||
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_MIFARE,
|
||||
.ptt = PTT_MIFARE,
|
||||
.nti.nai.abtAtqa = { 0x00, 0x04 },
|
||||
.nti.nai.abtUid = { 0x08, 0x00, 0xb0, 0x0b },
|
||||
.nti.nai.btSak = 0x20,
|
||||
|
|
|
@ -173,7 +173,7 @@ main (int argc, char *argv[])
|
|||
// Example of a Mifare Classic Mini
|
||||
// Note that crypto1 is not implemented in this example
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_MIFARE,
|
||||
.ptt = PTT_MIFARE,
|
||||
.nti.nai.abtAtqa = { 0x00, 0x04 },
|
||||
.nti.nai.abtUid = { 0x08, 0xab, 0xcd, 0xef },
|
||||
.nti.nai.btSak = 0x09,
|
||||
|
@ -183,7 +183,7 @@ main (int argc, char *argv[])
|
|||
/*
|
||||
// Example of a FeliCa
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_FELICA_212,
|
||||
.ptt = PTT_FELICA_212,
|
||||
.nti.nfi.abtId = { 0x01, 0xFE, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF },
|
||||
.nti.nfi.abtPad = { 0x12, 0x34, 0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xFF },
|
||||
.nti.nfi.abtSysCode = { 0xFF, 0xFF },
|
||||
|
@ -192,7 +192,7 @@ main (int argc, char *argv[])
|
|||
/*
|
||||
// Example of a ISO14443-4 (DESfire)
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_MIFARE,
|
||||
.ptt = PTT_MIFARE,
|
||||
.nti.nai.abtAtqa = { 0x03, 0x44 },
|
||||
.nti.nai.abtUid = { 0x08, 0xab, 0xcd, 0xef },
|
||||
.nti.nai.btSak = 0x20,
|
||||
|
|
|
@ -132,7 +132,7 @@ main (int argc, char *argv[])
|
|||
|
||||
// Note: We have to build a "fake" nfc_target_t in order to do exactly the same that was done before the new nfc_target_init() was introduced.
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_MIFARE,
|
||||
.ptt = PTT_MIFARE,
|
||||
.nti.nai.abtAtqa = { 0x04, 0x00 },
|
||||
.nti.nai.abtUid = { 0xde, 0xad, 0xbe, 0xaf },
|
||||
.nti.nai.btSak = 0x20,
|
||||
|
|
|
@ -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_ISO14443_4B_106, NTT_JEWEL_106};
|
||||
const pn53x_target_type_t pttArray[5] = {PTT_GENERIC_PASSIVE_106, PTT_GENERIC_PASSIVE_212, PTT_GENERIC_PASSIVE_424, PTT_ISO14443_4B_106, PTT_JEWEL_106};
|
||||
const size_t szTargetTypes = 5;
|
||||
|
||||
nfc_target_t antTargets[2];
|
||||
|
@ -106,53 +106,53 @@ main (int argc, const char *argv[])
|
|||
printf ("Connected to NFC reader: %s\n", pnd->acName);
|
||||
|
||||
printf ("PN532 will poll during %ld ms\n", (unsigned long) btPollNr * szTargetTypes * btPeriod * 150);
|
||||
res = nfc_initiator_poll_targets (pnd, nttArray, szTargetTypes, btPollNr, btPeriod, antTargets, &szTargetFound);
|
||||
res = nfc_initiator_poll_targets (pnd, pttArray, szTargetTypes, btPollNr, btPeriod, antTargets, &szTargetFound);
|
||||
if (res) {
|
||||
uint8_t n;
|
||||
printf ("%ld target(s) have been found.\n", (unsigned long) szTargetFound);
|
||||
for (n = 0; n < szTargetFound; n++) {
|
||||
printf ("T%d: targetType=%02x ", n + 1, antTargets[n].ntt);
|
||||
switch(antTargets[n].ntt) {
|
||||
case NTT_JEWEL_106:
|
||||
printf ("T%d: targetType=%02x ", n + 1, antTargets[n].ptt);
|
||||
switch(antTargets[n].ptt) {
|
||||
case PTT_JEWEL_106:
|
||||
printf ("(Innovision Jewel tag), targetData:\n");
|
||||
print_nfc_jewel_info (antTargets[n].nti.nji);
|
||||
break;
|
||||
case NTT_MIFARE:
|
||||
case PTT_MIFARE:
|
||||
printf ("(Mifare card), targetData:\n");
|
||||
print_nfc_iso14443a_info (antTargets[n].nti.nai);
|
||||
break;
|
||||
case NTT_FELICA_212:
|
||||
case PTT_FELICA_212:
|
||||
printf ("(FeliCa 212 kbps card), targetData:\n");
|
||||
print_nfc_felica_info (antTargets[n].nti.nfi);
|
||||
break;
|
||||
case NTT_FELICA_424:
|
||||
case PTT_FELICA_424:
|
||||
printf ("(FeliCa 212 kbps card), targetData:\n");
|
||||
print_nfc_felica_info (antTargets[n].nti.nfi);
|
||||
break;
|
||||
case NTT_ISO14443_4A_106:
|
||||
case PTT_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_ISO14443_4B_TCL_106:
|
||||
case PTT_ISO14443_4B_TCL_106:
|
||||
printf ("(Passive 106 kbps ISO/IEC 14443-4B card), targetData:\n");
|
||||
print_nfc_iso14443b_info (antTargets[n].nti.nbi);
|
||||
break;
|
||||
case NTT_DEP_PASSIVE_106:
|
||||
case PTT_DEP_PASSIVE_106:
|
||||
printf ("(DEP passive 106 kbps)\n");
|
||||
break;
|
||||
case NTT_DEP_PASSIVE_212:
|
||||
case PTT_DEP_PASSIVE_212:
|
||||
printf ("(DEP passive 212 kbps)\n");
|
||||
break;
|
||||
case NTT_DEP_PASSIVE_424:
|
||||
case PTT_DEP_PASSIVE_424:
|
||||
printf ("(DEP passive 424 kbps)\n");
|
||||
break;
|
||||
case NTT_DEP_ACTIVE_106:
|
||||
case PTT_DEP_ACTIVE_106:
|
||||
printf ("(DEP active 106 kbps)\n");
|
||||
break;
|
||||
case NTT_DEP_ACTIVE_212:
|
||||
case PTT_DEP_ACTIVE_212:
|
||||
printf ("(DEP active 212 kbps)\n");
|
||||
break;
|
||||
case NTT_DEP_ACTIVE_424:
|
||||
case PTT_DEP_ACTIVE_424:
|
||||
printf ("(DEP active 424 kbps)\n");
|
||||
break;
|
||||
};
|
||||
|
|
|
@ -127,7 +127,7 @@ main (int argc, char *argv[])
|
|||
printf ("[+] For example, send a RATS command or use the \"nfc-anticol\" tool\n");
|
||||
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_MIFARE,
|
||||
.ptt = PTT_MIFARE,
|
||||
.nti.nai.abtAtqa = { 0x04, 0x00 },
|
||||
.nti.nai.abtUid = { 0xde, 0xad, 0xbe, 0xef },
|
||||
.nti.nai.btSak = 0x20,
|
||||
|
|
|
@ -212,55 +212,55 @@ print_nfc_dep_info (const nfc_dep_info_t ndi)
|
|||
}
|
||||
}
|
||||
|
||||
void print_nfc_target_type( const nfc_target_type_t ntt )
|
||||
void print_nfc_target_type( const pn53x_target_type_t ptt )
|
||||
{
|
||||
switch (ntt) {
|
||||
case NTT_GENERIC_PASSIVE_106:
|
||||
switch (ptt) {
|
||||
case PTT_GENERIC_PASSIVE_106:
|
||||
printf ("Generic passive 106 kbps (ISO/IEC14443-4A, mifare, DEP)\n");
|
||||
break;
|
||||
case NTT_GENERIC_PASSIVE_212:
|
||||
case PTT_GENERIC_PASSIVE_212:
|
||||
printf ("Generic passive 212 kbps (FeliCa, DEP)\n");
|
||||
break;
|
||||
case NTT_GENERIC_PASSIVE_424:
|
||||
case PTT_GENERIC_PASSIVE_424:
|
||||
printf ("Generic passive 424 kbps (FeliCa, DEP)\n");
|
||||
break;
|
||||
case NTT_ISO14443_4B_106:
|
||||
case PTT_ISO14443_4B_106:
|
||||
printf ("Passive 106 kbps ISO/IEC14443-4B\n");
|
||||
break;
|
||||
case NTT_JEWEL_106:
|
||||
case PTT_JEWEL_106:
|
||||
printf ("Innovision Jewel tag\n");
|
||||
break;
|
||||
case NTT_MIFARE:
|
||||
case PTT_MIFARE:
|
||||
printf ("mifare card\n");
|
||||
break;
|
||||
case NTT_FELICA_212:
|
||||
case PTT_FELICA_212:
|
||||
printf ("FeliCa 212 kbps card\n");
|
||||
break;
|
||||
case NTT_FELICA_424:
|
||||
case PTT_FELICA_424:
|
||||
printf ("FeliCa 424 kbps card\n");
|
||||
break;
|
||||
case NTT_ISO14443_4A_106:
|
||||
case PTT_ISO14443_4A_106:
|
||||
printf ("Passive 106 kbps ISO/IEC14443-4A\n");
|
||||
break;
|
||||
case NTT_ISO14443_4B_TCL_106:
|
||||
case PTT_ISO14443_4B_TCL_106:
|
||||
printf ("Passive 106 kbps ISO/IEC14443-4B with TCL flag\n");
|
||||
break;
|
||||
case NTT_DEP_PASSIVE_106:
|
||||
case PTT_DEP_PASSIVE_106:
|
||||
printf ("DEP passive 106 kbps\n");
|
||||
break;
|
||||
case NTT_DEP_PASSIVE_212:
|
||||
case PTT_DEP_PASSIVE_212:
|
||||
printf ("DEP passive 212 kbps\n");
|
||||
break;
|
||||
case NTT_DEP_PASSIVE_424:
|
||||
case PTT_DEP_PASSIVE_424:
|
||||
printf ("DEP passive 424 kbps\n");
|
||||
break;
|
||||
case NTT_DEP_ACTIVE_106:
|
||||
case PTT_DEP_ACTIVE_106:
|
||||
printf ("DEP active 106 kbps\n");
|
||||
break;
|
||||
case NTT_DEP_ACTIVE_212:
|
||||
case PTT_DEP_ACTIVE_212:
|
||||
printf ("DEP active 212 kbps\n");
|
||||
break;
|
||||
case NTT_DEP_ACTIVE_424:
|
||||
case PTT_DEP_ACTIVE_424:
|
||||
printf ("DEP active 424 kbps\n");
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ void print_nfc_felica_info (const nfc_felica_info_t nfi);
|
|||
void print_nfc_jewel_info (const nfc_jewel_info_t nji);
|
||||
void print_nfc_dep_info (const nfc_dep_info_t ndi);
|
||||
|
||||
void print_nfc_target_type( const nfc_target_type_t ntt );
|
||||
void print_nfc_target_type( const pn53x_target_type_t ptt );
|
||||
|
||||
nfc_device_desc_t *parse_device_desc (int argc, const char *argv[], size_t * szFound);
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ main (int argc, const char *argv[])
|
|||
size_t szRx;
|
||||
|
||||
nfc_target_t nt = {
|
||||
.ntt = NTT_MIFARE,
|
||||
.ptt = PTT_MIFARE,
|
||||
.nti.nai.abtAtqa = { 0x04, 0x00 },
|
||||
.nti.nai.abtUid = { 0x08, 0xad, 0xbe, 0xaf },
|
||||
.nti.nai.btSak = 0x20,
|
||||
|
|
|
@ -291,43 +291,43 @@ typedef enum {
|
|||
} nfc_target_mode_t;
|
||||
|
||||
/**
|
||||
* @enum nfc_target_type_t
|
||||
* @enum pn53x_target_type_t
|
||||
* @brief NFC target type enumeration
|
||||
*/
|
||||
typedef enum {
|
||||
/** Generic passive 106 kbps (ISO/IEC14443-4A, mifare, DEP) */
|
||||
NTT_GENERIC_PASSIVE_106 = 0x00,
|
||||
PTT_GENERIC_PASSIVE_106 = 0x00,
|
||||
/** Generic passive 212 kbps (FeliCa, DEP) */
|
||||
NTT_GENERIC_PASSIVE_212 = 0x01,
|
||||
PTT_GENERIC_PASSIVE_212 = 0x01,
|
||||
/** Generic passive 424 kbps (FeliCa, DEP) */
|
||||
NTT_GENERIC_PASSIVE_424 = 0x02,
|
||||
PTT_GENERIC_PASSIVE_424 = 0x02,
|
||||
/** Passive 106 kbps ISO/IEC14443-4B */
|
||||
NTT_ISO14443_4B_106 = 0x03,
|
||||
PTT_ISO14443_4B_106 = 0x03,
|
||||
/** Innovision Jewel tag */
|
||||
NTT_JEWEL_106 = 0x04,
|
||||
PTT_JEWEL_106 = 0x04,
|
||||
/** Mifare card */
|
||||
NTT_MIFARE = 0x10,
|
||||
PTT_MIFARE = 0x10,
|
||||
/** FeliCa 212 kbps card */
|
||||
NTT_FELICA_212 = 0x11,
|
||||
PTT_FELICA_212 = 0x11,
|
||||
/** FeliCa 424 kbps card */
|
||||
NTT_FELICA_424 = 0x12,
|
||||
PTT_FELICA_424 = 0x12,
|
||||
/** Passive 106 kbps ISO/IEC 14443-4A */
|
||||
NTT_ISO14443_4A_106 = 0x20,
|
||||
PTT_ISO14443_4A_106 = 0x20,
|
||||
/** Passive 106 kbps ISO/IEC 14443-4B with TCL flag */
|
||||
NTT_ISO14443_4B_TCL_106 = 0x23,
|
||||
PTT_ISO14443_4B_TCL_106 = 0x23,
|
||||
/** DEP passive 106 kbps */
|
||||
NTT_DEP_PASSIVE_106 = 0x40,
|
||||
PTT_DEP_PASSIVE_106 = 0x40,
|
||||
/** DEP passive 212 kbps */
|
||||
NTT_DEP_PASSIVE_212 = 0x41,
|
||||
PTT_DEP_PASSIVE_212 = 0x41,
|
||||
/** DEP passive 424 kbps */
|
||||
NTT_DEP_PASSIVE_424 = 0x42,
|
||||
PTT_DEP_PASSIVE_424 = 0x42,
|
||||
/** DEP active 106 kbps */
|
||||
NTT_DEP_ACTIVE_106 = 0x80,
|
||||
PTT_DEP_ACTIVE_106 = 0x80,
|
||||
/** DEP active 212 kbps */
|
||||
NTT_DEP_ACTIVE_212 = 0x81,
|
||||
PTT_DEP_ACTIVE_212 = 0x81,
|
||||
/** DEP active 424 kbps */
|
||||
NTT_DEP_ACTIVE_424 = 0x82,
|
||||
} nfc_target_type_t;
|
||||
PTT_DEP_ACTIVE_424 = 0x82,
|
||||
} pn53x_target_type_t;
|
||||
|
||||
/**
|
||||
* @struct nfc_target_t
|
||||
|
@ -335,7 +335,7 @@ typedef enum {
|
|||
*/
|
||||
typedef struct {
|
||||
nfc_target_info_t nti;
|
||||
nfc_target_type_t ntt;
|
||||
pn53x_target_type_t ptt;
|
||||
} nfc_target_t;
|
||||
|
||||
// Reset struct alignment to default
|
||||
|
|
|
@ -74,7 +74,7 @@ extern "C" {
|
|||
NFC_EXPORT bool nfc_initiator_list_passive_targets (nfc_device_t * pnd, const nfc_modulation_t nmInitModulation,
|
||||
nfc_target_info_t anti[], const size_t szTargets,
|
||||
size_t * pszTargetFound);
|
||||
NFC_EXPORT bool nfc_initiator_poll_targets (nfc_device_t * pnd, const nfc_target_type_t * pnttTargetTypes,
|
||||
NFC_EXPORT bool nfc_initiator_poll_targets (nfc_device_t * pnd, const pn53x_target_type_t * ppttTargetTypes,
|
||||
const size_t szTargetTypes, const byte_t btPollNr, const byte_t btPeriod,
|
||||
nfc_target_t * pntTargets, size_t * pszTargetFound);
|
||||
NFC_EXPORT bool nfc_initiator_select_dep_target (nfc_device_t * pnd, const nfc_modulation_t nmInitModulation,
|
||||
|
|
|
@ -369,15 +369,15 @@ pn53x_unwrap_frame (const byte_t * pbtFrame, const size_t szFrameBits, byte_t *
|
|||
}
|
||||
|
||||
bool
|
||||
pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_t nc, nfc_target_type_t ntt,
|
||||
pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_t nc, pn53x_target_type_t ptt,
|
||||
nfc_target_info_t * pnti)
|
||||
{
|
||||
uint8_t szAttribRes;
|
||||
|
||||
switch (ntt) {
|
||||
case NTT_MIFARE:
|
||||
case NTT_GENERIC_PASSIVE_106:
|
||||
case NTT_ISO14443_4A_106:
|
||||
switch (ptt) {
|
||||
case PTT_MIFARE:
|
||||
case PTT_GENERIC_PASSIVE_106:
|
||||
case PTT_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_ISO14443_4B_106:
|
||||
case NTT_ISO14443_4B_TCL_106:
|
||||
case PTT_ISO14443_4B_106:
|
||||
case PTT_ISO14443_4B_TCL_106:
|
||||
// We skip the first byte: its the target number (Tg)
|
||||
pbtRawData++;
|
||||
|
||||
|
@ -442,8 +442,8 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_
|
|||
}
|
||||
break;
|
||||
|
||||
case NTT_FELICA_212:
|
||||
case NTT_FELICA_424:
|
||||
case PTT_FELICA_212:
|
||||
case PTT_FELICA_424:
|
||||
// We skip the first byte: its the target number (Tg)
|
||||
pbtRawData++;
|
||||
|
||||
|
@ -461,7 +461,7 @@ pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_
|
|||
memcpy (pnti->nfi.abtSysCode, pbtRawData, 2);
|
||||
}
|
||||
break;
|
||||
case NTT_JEWEL_106:
|
||||
case PTT_JEWEL_106:
|
||||
// We skip the first byte: its the target number (Tg)
|
||||
pbtRawData++;
|
||||
|
||||
|
@ -569,7 +569,7 @@ pn53x_InRelease (nfc_device_t * pnd, const uint8_t ui8Target)
|
|||
|
||||
bool
|
||||
pn53x_InAutoPoll (nfc_device_t * pnd,
|
||||
const nfc_target_type_t * pnttTargetTypes, const size_t szTargetTypes,
|
||||
const pn53x_target_type_t * ppttTargetTypes, const size_t szTargetTypes,
|
||||
const byte_t btPollNr, const byte_t btPeriod, nfc_target_t * pntTargets, size_t * pszTargetFound)
|
||||
{
|
||||
size_t szTxInAutoPoll,
|
||||
|
@ -592,7 +592,7 @@ pn53x_InAutoPoll (nfc_device_t * pnd,
|
|||
pbtTxInAutoPoll[2] = btPollNr;
|
||||
pbtTxInAutoPoll[3] = btPeriod;
|
||||
for (n = 0; n < szTargetTypes; n++) {
|
||||
pbtTxInAutoPoll[4 + n] = pnttTargetTypes[n];
|
||||
pbtTxInAutoPoll[4 + n] = ppttTargetTypes[n];
|
||||
}
|
||||
|
||||
szRx = MAX_FRAME_LEN;
|
||||
|
@ -607,19 +607,19 @@ pn53x_InAutoPoll (nfc_device_t * pnd,
|
|||
byte_t *pbt = abtRx + 1;
|
||||
/* 1st target */
|
||||
// Target type
|
||||
pntTargets[0].ntt = *(pbt++);
|
||||
pntTargets[0].ptt = *(pbt++);
|
||||
// AutoPollTargetData length
|
||||
ln = *(pbt++);
|
||||
pn53x_decode_target_data (pbt, ln, pnd->nc, pntTargets[0].ntt, &(pntTargets[0].nti));
|
||||
pn53x_decode_target_data (pbt, ln, pnd->nc, pntTargets[0].ptt, &(pntTargets[0].nti));
|
||||
pbt += ln;
|
||||
|
||||
if (abtRx[0] > 1) {
|
||||
/* 2nd target */
|
||||
// Target type
|
||||
pntTargets[1].ntt = *(pbt++);
|
||||
pntTargets[1].ptt = *(pbt++);
|
||||
// AutoPollTargetData length
|
||||
ln = *(pbt++);
|
||||
pn53x_decode_target_data (pbt, ln, pnd->nc, pntTargets[1].ntt, &(pntTargets[1].nti));
|
||||
pn53x_decode_target_data (pbt, ln, pnd->nc, pntTargets[1].ptt, &(pntTargets[1].nti));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1070,10 +1070,10 @@ pn53x_target_init (nfc_device_t * pnd, const nfc_target_mode_t ntm, const nfc_ta
|
|||
const byte_t * pbtGB = NULL;
|
||||
size_t szGB = 0;
|
||||
|
||||
switch(nt.ntt) {
|
||||
case NTT_MIFARE:
|
||||
case NTT_GENERIC_PASSIVE_106:
|
||||
case NTT_ISO14443_4A_106: {
|
||||
switch(nt.ptt) {
|
||||
case PTT_MIFARE:
|
||||
case PTT_GENERIC_PASSIVE_106:
|
||||
case PTT_ISO14443_4A_106: {
|
||||
// Set ATQA (SENS_RES)
|
||||
abtMifareParams[0] = nt.nti.nai.abtAtqa[1];
|
||||
abtMifareParams[1] = nt.nti.nai.abtAtqa[0];
|
||||
|
@ -1089,8 +1089,8 @@ pn53x_target_init (nfc_device_t * pnd, const nfc_target_mode_t ntm, const nfc_ta
|
|||
}
|
||||
break;
|
||||
|
||||
case NTT_FELICA_212:
|
||||
case NTT_FELICA_424:
|
||||
case PTT_FELICA_212:
|
||||
case PTT_FELICA_424:
|
||||
// Set NFCID2t
|
||||
memcpy(abtFeliCaParams, nt.nti.nfi.abtId, 8);
|
||||
// Set PAD
|
||||
|
@ -1100,9 +1100,9 @@ pn53x_target_init (nfc_device_t * pnd, const nfc_target_mode_t ntm, const nfc_ta
|
|||
pbtFeliCaParams = abtFeliCaParams;
|
||||
break;
|
||||
|
||||
case NTT_DEP_PASSIVE_106:
|
||||
case NTT_DEP_PASSIVE_212:
|
||||
case NTT_DEP_PASSIVE_424:
|
||||
case PTT_DEP_PASSIVE_106:
|
||||
case PTT_DEP_PASSIVE_212:
|
||||
case PTT_DEP_PASSIVE_424:
|
||||
pbtNFCID3t = nt.nti.ndi.abtNFCID3;
|
||||
szGB = nt.nti.ndi.szGB;
|
||||
if (szGB) pbtGB = nt.nti.ndi.abtGB;
|
||||
|
|
|
@ -105,7 +105,7 @@ bool pn53x_wrap_frame (const byte_t * pbtTx, const size_t szTxBits, const byt
|
|||
size_t * pszFrameBits);
|
||||
bool pn53x_unwrap_frame (const byte_t * pbtFrame, const size_t szFrameBits, byte_t * pbtRx, size_t * pszRxBits,
|
||||
byte_t * pbtRxPar);
|
||||
bool pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_t nc, nfc_target_type_t ntt,
|
||||
bool pn53x_decode_target_data (const byte_t * pbtRawData, size_t szDataLen, nfc_chip_t nc, pn53x_target_type_t ptt,
|
||||
nfc_target_info_t * pnti);
|
||||
|
||||
bool pn53x_get_firmware_version (nfc_device_t * pnd);
|
||||
|
@ -140,7 +140,7 @@ bool pn53x_InListPassiveTarget (nfc_device_t * pnd, const nfc_modulation_t nm
|
|||
const size_t szInitiatorDataLen, byte_t * pbtTargetsData, size_t * pszTargetsData);
|
||||
bool pn53x_InDeselect (nfc_device_t * pnd, const uint8_t ui8Target);
|
||||
bool pn53x_InRelease (nfc_device_t * pnd, const uint8_t ui8Target);
|
||||
bool pn53x_InAutoPoll (nfc_device_t * pnd, const nfc_target_type_t * pnttTargetTypes, const size_t szTargetTypes,
|
||||
bool pn53x_InAutoPoll (nfc_device_t * pnd, const pn53x_target_type_t * ppttTargetTypes, const size_t szTargetTypes,
|
||||
const byte_t btPollNr, const byte_t btPeriod, nfc_target_t * pntTargets,
|
||||
size_t * pszTargetFound);
|
||||
bool pn53x_InJumpForDEP (nfc_device_t * pnd, const nfc_modulation_t nmInitModulation,
|
||||
|
|
18
libnfc/nfc.c
18
libnfc/nfc.c
|
@ -333,30 +333,30 @@ nfc_initiator_select_passive_target (nfc_device_t * pnd,
|
|||
// Fill the tag info struct with the values corresponding to this init modulation
|
||||
switch (nmInitModulation) {
|
||||
case NM_ISO14443A_106:
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_GENERIC_PASSIVE_106, pnti)) {
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, PTT_GENERIC_PASSIVE_106, pnti)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case NM_FELICA_212:
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_FELICA_212, pnti)) {
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, PTT_FELICA_212, pnti)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
case NM_FELICA_424:
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_FELICA_424, pnti)) {
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, PTT_FELICA_424, pnti)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case NM_ISO14443B_106:
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_ISO14443_4B_106, pnti)) {
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, PTT_ISO14443_4B_106, pnti)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
||||
case NM_JEWEL_106:
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, NTT_JEWEL_106, pnti)) {
|
||||
if (!pn53x_decode_target_data (abtTargetsData + 1, szTargetsData - 1, pnd->nc, PTT_JEWEL_106, pnti)) {
|
||||
return false;
|
||||
}
|
||||
break;
|
||||
|
@ -431,8 +431,8 @@ nfc_initiator_list_passive_targets (nfc_device_t * pnd, const nfc_modulation_t n
|
|||
* @return Returns \c true if action was successfully performed; otherwise returns \c false.
|
||||
*
|
||||
* @param pnd \a nfc_device_t struct pointer that represent currently used device
|
||||
* @param pnttTargetTypes array of desired target types
|
||||
* @param szTargetTypes pnttTargetTypes count
|
||||
* @param ppttTargetTypes array of desired target types
|
||||
* @param szTargetTypes ppttTargetTypes count
|
||||
* @param btPollNr specifies the number of polling
|
||||
* @note one polling is a polling for each desired target type
|
||||
* @param btPeriod indicates the polling period in units of 150 ms
|
||||
|
@ -441,13 +441,13 @@ nfc_initiator_list_passive_targets (nfc_device_t * pnd, const nfc_modulation_t n
|
|||
*/
|
||||
bool
|
||||
nfc_initiator_poll_targets (nfc_device_t * pnd,
|
||||
const nfc_target_type_t * pnttTargetTypes, const size_t szTargetTypes,
|
||||
const pn53x_target_type_t * ppttTargetTypes, const size_t szTargetTypes,
|
||||
const byte_t btPollNr, const byte_t btPeriod,
|
||||
nfc_target_t * pntTargets, size_t * pszTargetFound)
|
||||
{
|
||||
pnd->iLastError = 0;
|
||||
|
||||
return pn53x_InAutoPoll (pnd, pnttTargetTypes, szTargetTypes, btPollNr, btPeriod, pntTargets, pszTargetFound);
|
||||
return pn53x_InAutoPoll (pnd, ppttTargetTypes, szTargetTypes, btPollNr, btPeriod, pntTargets, pszTargetFound);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue