quick_start_example1 is now compiled when running make check or distcheck (Fixes Issue 178)
This commit is contained in:
parent
e76e531d2d
commit
3b657ee547
2 changed files with 18 additions and 9 deletions
|
@ -17,6 +17,9 @@ bin_PROGRAMS += \
|
||||||
pn53x-tamashell
|
pn53x-tamashell
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
check_PROGRAMS = \
|
||||||
|
quick_start_example1
|
||||||
|
|
||||||
# set the include path found by configure
|
# set the include path found by configure
|
||||||
INCLUDES = $(all_includes) $(LIBNFC_CFLAGS)
|
INCLUDES = $(all_includes) $(LIBNFC_CFLAGS)
|
||||||
|
|
||||||
|
@ -67,6 +70,11 @@ pn53x_tamashell_LDADD = $(top_builddir)/libnfc/libnfc.la \
|
||||||
$(top_builddir)/utils/libnfcutils.la
|
$(top_builddir)/utils/libnfcutils.la
|
||||||
pn53x_tamashell_LDFLAGS = @READLINE_LIBS@
|
pn53x_tamashell_LDFLAGS = @READLINE_LIBS@
|
||||||
|
|
||||||
|
quick_start_example1_SOURCES = doc/quick_start_example1.c
|
||||||
|
quick_start_example1_LDADD = $(top_builddir)/libnfc/libnfc.la \
|
||||||
|
$(top_builddir)/utils/libnfcutils.la
|
||||||
|
|
||||||
|
|
||||||
dist_man_MANS = \
|
dist_man_MANS = \
|
||||||
nfc-anticol.1 \
|
nfc-anticol.1 \
|
||||||
nfc-dep-initiator.1 \
|
nfc-dep-initiator.1 \
|
||||||
|
|
|
@ -5,13 +5,14 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <nfc/nfc.h>
|
#include <nfc/nfc.h>
|
||||||
|
|
||||||
#include "nfc-utils.h"
|
#include "utils/nfc-utils.h"
|
||||||
|
#include "libnfc/chips/pn53x.h"
|
||||||
|
|
||||||
int
|
int
|
||||||
main (int argc, const char *argv[])
|
main (int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
nfc_device *pnd;
|
nfc_device *pnd;
|
||||||
nfc_target_info nti;
|
nfc_target nt;
|
||||||
|
|
||||||
// Display libnfc version
|
// Display libnfc version
|
||||||
const char *acLibnfcVersion = nfc_version ();
|
const char *acLibnfcVersion = nfc_version ();
|
||||||
|
@ -34,17 +35,17 @@ main (int argc, const char *argv[])
|
||||||
.nmt = NMT_ISO14443A,
|
.nmt = NMT_ISO14443A,
|
||||||
.nbr = NBR_106,
|
.nbr = NBR_106,
|
||||||
};
|
};
|
||||||
if (nfc_initiator_select_passive_target (pnd, PM_ISO14443A_106, NULL, 0, &nti)) {
|
if (nfc_initiator_select_passive_target (pnd, nmMifare, NULL, 0, &nt)) {
|
||||||
printf ("The following (NFC) ISO14443A tag was found:\n");
|
printf ("The following (NFC) ISO14443A tag was found:\n");
|
||||||
printf (" ATQA (SENS_RES): ");
|
printf (" ATQA (SENS_RES): ");
|
||||||
print_hex (nti.nai.abtAtqa, 2);
|
print_hex (nt.nti.nai.abtAtqa, 2);
|
||||||
printf (" UID (NFCID%c): ", (nti.nai.abtUid[0] == 0x08 ? '3' : '1'));
|
printf (" UID (NFCID%c): ", (nt.nti.nai.abtUid[0] == 0x08 ? '3' : '1'));
|
||||||
print_hex (nti.nai.abtUid, nti.nai.szUidLen);
|
print_hex (nt.nti.nai.abtUid, nt.nti.nai.szUidLen);
|
||||||
printf (" SAK (SEL_RES): ");
|
printf (" SAK (SEL_RES): ");
|
||||||
print_hex (&nti.nai.btSak, 1);
|
print_hex (&nt.nti.nai.btSak, 1);
|
||||||
if (nti.nai.szAtsLen) {
|
if (nt.nti.nai.szAtsLen) {
|
||||||
printf (" ATS (ATR): ");
|
printf (" ATS (ATR): ");
|
||||||
print_hex (nti.nai.abtAts, nti.nai.szAtsLen);
|
print_hex (nt.nti.nai.abtAts, nt.nti.nai.szAtsLen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Disconnect from NFC device
|
// Disconnect from NFC device
|
||||||
|
|
Loading…
Reference in a new issue