Attempt to provide clean types for API
This commit is contained in:
parent
9020014160
commit
d289eabc36
19 changed files with 437 additions and 311 deletions
|
|
@ -142,7 +142,11 @@ main (int argc, const char *argv[])
|
|||
printf ("Connected to NFC device: %s\n", pnd->acName);
|
||||
|
||||
// List ISO14443A targets
|
||||
if (nfc_initiator_list_passive_targets (pnd, PM_ISO14443A_106, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
nfc_modulation_t nm = {
|
||||
.nmt = NMT_ISO14443A,
|
||||
.nbr = NBR_106,
|
||||
};
|
||||
if (nfc_initiator_list_passive_targets (pnd, nm, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
size_t n;
|
||||
printf ("%d ISO14443A passive target(s) was found%s\n", (int) szTargetFound, (szTargetFound == 0) ? ".\n" : ":");
|
||||
for (n = 0; n < szTargetFound; n++) {
|
||||
|
|
@ -150,8 +154,11 @@ main (int argc, const char *argv[])
|
|||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
nm.nmt = NMT_FELICA;
|
||||
nm.nbr = NBR_212;
|
||||
// List Felica tags
|
||||
if (nfc_initiator_list_passive_targets (pnd, PM_FELICA_212, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
if (nfc_initiator_list_passive_targets (pnd, nm, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
size_t n;
|
||||
printf ("%d Felica (212 kbps) passive target(s) was found%s\n", (int) szTargetFound,
|
||||
(szTargetFound == 0) ? ".\n" : ":");
|
||||
|
|
@ -160,7 +167,9 @@ main (int argc, const char *argv[])
|
|||
printf ("\n");
|
||||
}
|
||||
}
|
||||
if (nfc_initiator_list_passive_targets (pnd, PM_FELICA_424, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
|
||||
nm.nbr = NBR_424;
|
||||
if (nfc_initiator_list_passive_targets (pnd, nm, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
size_t n;
|
||||
printf ("%d Felica (424 kbps) passive target(s) was found%s\n", (int) szTargetFound,
|
||||
(szTargetFound == 0) ? ".\n" : ":");
|
||||
|
|
@ -169,8 +178,11 @@ main (int argc, const char *argv[])
|
|||
printf ("\n");
|
||||
}
|
||||
}
|
||||
|
||||
nm.nmt = NMT_ISO14443B;
|
||||
nm.nbr = NBR_106;
|
||||
// List ISO14443B targets
|
||||
if (nfc_initiator_list_passive_targets (pnd, PM_ISO14443B_106, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
if (nfc_initiator_list_passive_targets (pnd, nm, anti, MAX_TARGET_COUNT, &szTargetFound)) {
|
||||
size_t n;
|
||||
printf ("%d ISO14443B passive target(s) was found%s\n", (int) szTargetFound, (szTargetFound == 0) ? ".\n" : ":");
|
||||
for (n = 0; n < szTargetFound; n++) {
|
||||
|
|
@ -179,8 +191,10 @@ main (int argc, const char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
nm.nmt = NMT_JEWEL;
|
||||
nm.nbr = NBR_106;
|
||||
// List Jewel targets
|
||||
if (nfc_initiator_list_passive_targets(pnd, PM_JEWEL_106, anti, MAX_TARGET_COUNT, &szTargetFound )) {
|
||||
if (nfc_initiator_list_passive_targets(pnd, nm, anti, MAX_TARGET_COUNT, &szTargetFound )) {
|
||||
size_t n;
|
||||
printf("%d Jewel passive target(s) was found%s\n", (int)szTargetFound, (szTargetFound==0)?".\n":":");
|
||||
for(n=0; n<szTargetFound; n++) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue