diff --git a/examples/nfc-dep-target.c b/examples/nfc-dep-target.c index afab447..539bcb6 100644 --- a/examples/nfc-dep-target.c +++ b/examples/nfc-dep-target.c @@ -87,7 +87,7 @@ main (int argc, const char *argv[]) printf ("NFC device will now act as this D.E.P. target:\n"); print_nfc_dep_info ( nt.nti.ndi ); printf ("Waiting for initiator request...\n"); - if(!nfc_target_init (pnd, NTM_DEP, nt, abtRx, &szRx)) { + if(!nfc_target_init (pnd, NTM_DEP_ONLY, nt, abtRx, &szRx)) { nfc_perror(pnd, "nfc_target_init"); return EXIT_FAILURE; } diff --git a/examples/nfc-emulate-forum-tag4.c b/examples/nfc-emulate-forum-tag4.c index 8996545..650221b 100644 --- a/examples/nfc-emulate-forum-tag4.c +++ b/examples/nfc-emulate-forum-tag4.c @@ -120,7 +120,7 @@ main (int argc, char *argv[]) .nti.nai.szAtsLen = 0, }; - if (!nfc_target_init (pnd, NTM_ISO14443_4_PICC, nt, abtRx, &szRx)) { + if (!nfc_target_init (pnd, NTM_ISO14443_4_PICC_ONLY, nt, abtRx, &szRx)) { nfc_perror (pnd, "nfc_target_init"); ERR("Could not come out of auto-emulation, no command was received"); return EXIT_FAILURE; diff --git a/examples/nfc-emulate-tag.c b/examples/nfc-emulate-tag.c index dda8915..e5b9c81 100644 --- a/examples/nfc-emulate-tag.c +++ b/examples/nfc-emulate-tag.c @@ -118,7 +118,7 @@ nfc_target_emulate_tag(nfc_device_t* pnd, const nfc_target_t nt) byte_t abtTx[MAX_FRAME_LEN]; bool loop = true; - if (!nfc_target_init (pnd, NTM_PASSIVE, nt, abtRx, &szRx)) { + if (!nfc_target_init (pnd, NTM_PASSIVE_ONLY, nt, abtRx, &szRx)) { nfc_perror (pnd, "nfc_target_init"); return false; } diff --git a/examples/nfc-emulate-uid.c b/examples/nfc-emulate-uid.c index b1ccca6..576d1f9 100644 --- a/examples/nfc-emulate-uid.c +++ b/examples/nfc-emulate-uid.c @@ -139,7 +139,7 @@ main (int argc, char *argv[]) .nti.nai.szUidLen = 4, .nti.nai.szAtsLen = 0, }; - if (!nfc_target_init (pnd, NTM_PASSIVE, nt, abtRecv, &szRecvBits)) { + if (!nfc_target_init (pnd, NTM_PASSIVE_ONLY, nt, abtRecv, &szRecvBits)) { ERR ("Could not come out of auto-emulation, no command was received"); exit(EXIT_FAILURE); } diff --git a/examples/nfc-relay.c b/examples/nfc-relay.c index 3888e0f..90b1e4e 100644 --- a/examples/nfc-relay.c +++ b/examples/nfc-relay.c @@ -135,7 +135,7 @@ main (int argc, char *argv[]) .nti.nai.szAtsLen = 0, }; - if (!nfc_target_init (pndTag, NTM_PASSIVE, nt, abtReaderRx, &szReaderRxBits)) { + if (!nfc_target_init (pndTag, NTM_PASSIVE_ONLY, nt, abtReaderRx, &szReaderRxBits)) { ERR ("%s", "Initialization of NFC emulator failed"); nfc_disconnect (pndTag); return EXIT_FAILURE; diff --git a/include/nfc/nfc-types.h b/include/nfc/nfc-types.h index 1615ae2..2bde941 100644 --- a/include/nfc/nfc-types.h +++ b/include/nfc/nfc-types.h @@ -245,7 +245,7 @@ typedef struct { */ typedef struct { /** abtPupi store PUPI contained in ATQB (Answer To reQuest of type B) (see ISO14443-3) */ - byte_t abtPupi[4]; + 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) */ @@ -283,11 +283,11 @@ typedef enum { /** Configure the PN53x to accept all initiator mode */ NTM_NORMAL = 0x00, /** Configure the PN53x to accept to be initialized only in passive mode */ - NTM_PASSIVE = 0x01, + NTM_PASSIVE_ONLY = 0x01, /** Configure the PN53x to accept to be initialized only as DEP target */ - NTM_DEP = 0x02, + NTM_DEP_ONLY = 0x02, /** Configure the PN532 to accept to be initialized only as ISO/IEC14443-4 PICC */ - NTM_ISO14443_4_PICC = 0x04 + NTM_ISO14443_4_PICC_ONLY = 0x04 } nfc_target_mode_t; /** diff --git a/libnfc/chips/pn53x.c b/libnfc/chips/pn53x.c index 1b793d5..2b4121a 100644 --- a/libnfc/chips/pn53x.c +++ b/libnfc/chips/pn53x.c @@ -1026,17 +1026,17 @@ pn53x_target_init (nfc_device_t * pnd, const nfc_target_mode_t ntm, const nfc_ta // XXX I (Romuald) don't think that a good thing to select NDO_EASY_FRAMING here, that's a user choice... switch(ntm) { - case NTM_PASSIVE: + case NTM_PASSIVE_ONLY: pn53x_set_parameter(pnd, PARAM_AUTO_ATR_RES, false); pn53x_configure(pnd, NDO_EASY_FRAMING, false); break; - case NTM_DEP: + case NTM_DEP_ONLY: pn53x_set_parameter(pnd, PARAM_AUTO_ATR_RES, true); pn53x_configure(pnd, NDO_EASY_FRAMING, true); break; - case NTM_ISO14443_4_PICC: + case NTM_ISO14443_4_PICC_ONLY: if(pnd->nc != NC_PN532) { // This mode is not supported by pn531 neither pn533 pnd->iLastError = DENOTSUP;