From 42ed06af7401741e10682b1cb3d2b6727cdb9e4e Mon Sep 17 00:00:00 2001 From: Romuald Conty Date: Sat, 2 Jun 2012 00:17:52 +0000 Subject: [PATCH] Update to use latest libnfc devel version --- configure.ac | 6 +++--- debian/changelog | 6 ++++++ debian/control | 2 +- src/Makefile.am | 2 +- src/lsnfc.c | 10 +++++----- 5 files changed, 16 insertions(+), 10 deletions(-) diff --git a/configure.ac b/configure.ac index 534161b..56c61d1 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(nfcutils, 0.3.0, rconty@il4p.fr) +AC_INIT([nfcutils],[0.3.1],[rconty@il4p.fr]) AC_CONFIG_HEADER(config.h) @@ -13,7 +13,7 @@ AC_DEFINE_UNQUOTED([SVN_REVISION], ["$SVN_REVISION"], [SVN revision]) AM_INIT_AUTOMAKE m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) -AC_LANG_C +AC_LANG([C]) AC_PROG_CC AC_PROG_MAKE_SET @@ -59,7 +59,7 @@ fi AC_SUBST([DEBUG_CFLAGS]) # Checks for pkg-config modules. -LIBNFC_REQUIRED_VERSION=1.5.1 +LIBNFC_REQUIRED_VERSION=1.6.0 PKG_CHECK_MODULES([libnfc], [libnfc >= $LIBNFC_REQUIRED_VERSION], [], [AC_MSG_ERROR([libnfc >= $LIBNFC_REQUIRED_VERSION is mandatory.])]) AC_SUBST(libnfc_LIBS) diff --git a/debian/changelog b/debian/changelog index 0cb868c..708ae89 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +nfcutils (0.3.0-pre1-0) unstable; urgency=low + + * Update libnfc version. + + -- Romuald Conty Thu, 16 Sep 2010 20:42:42 +0200 + nfcutils (0.2.9-0) unstable; urgency=low * New upstream release. diff --git a/debian/control b/debian/control index 609ceb4..ca17ce4 100644 --- a/debian/control +++ b/debian/control @@ -8,7 +8,7 @@ Homepage: http://code.google.com/p/nfc-tools/wiki/nfcutils Package: nfcutils Architecture: any -Depends: ${shlibs:Depends}, libnfc-dev (>= 1.3.0) +Depends: ${shlibs:Depends}, libnfc-dev (>= 1.6.0) Description: Near Field Communication (NFC) utilities This package contains one utility for listing NFC devices and in-field tags or targets. diff --git a/src/Makefile.am b/src/Makefile.am index 4166df8..dda0330 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,4 +1,4 @@ -INCLUDES = $(all_includes) +AM_CPPFLAGS = $(all_includes) AM_CFLAGS = @libnfc_CFLAGS@ AM_LDFLAGS = @libnfc_LIBS@ diff --git a/src/lsnfc.c b/src/lsnfc.c index e6ad032..05bb61c 100644 --- a/src/lsnfc.c +++ b/src/lsnfc.c @@ -88,7 +88,7 @@ mifare_ultralight_identification(const nfc_iso14443a_info nai) }; if((res = nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL)) >= 0 ) { nfc_device_set_property_bool (pnd, NP_EASY_FRAMING, false); - if ((res = nfc_initiator_transceive_bytes(pnd, abtCmd,sizeof(abtCmd), abtRx, &szRxLen, 0)) >= 0) { + if ((res = nfc_initiator_transceive_bytes(pnd, abtCmd,sizeof(abtCmd), abtRx, sizeof(abtRx), 0)) >= 0) { // AUTH step1 command success, so it's a Ultralight C nfc_device_set_property_bool (pnd, NP_EASY_FRAMING, true); nfc_initiator_deselect_target(pnd); @@ -126,13 +126,13 @@ mifare_desfire_identification(const nfc_iso14443a_info nai) .nbr = NBR_106 }; if((nfcRes = nfc_initiator_select_passive_target(pnd, nm, nai.abtUid, nai.szUidLen, NULL)) >= 0 ) { - if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen, 0)) >= 0) { + if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, sizeof(abtRx), 0)) >= 0) { // MIFARE DESFire GetVersion command success, decoding... - if( szRxLen == 8 ) { // GetVersion should reply 8 bytes + if( nfcRes == 8 ) { // GetVersion should reply 8 bytes memcpy( abtDESFireVersion, abtRx + 1, 7 ); abtCmd[0] = 0xAF; // ask for GetVersion next bytes - if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, &szRxLen, 0)) >= 0) { - if( szRxLen == 8 ) { // GetVersion should reply 8 bytes + if ((nfcRes = nfc_initiator_transceive_bytes(pnd, abtCmd, sizeof(abtCmd), abtRx, sizeof(abtRx), 0)) >= 0) { + if( nfcRes == 8 ) { // GetVersion should reply 8 bytes memcpy( abtDESFireVersion + 7, abtRx + 1, 7 ); res = malloc(16); // We can alloc res: we will be able to provide information bool bEV1 = ( ( abtDESFireVersion[3] == 0x01 ) && ( abtDESFireVersion[10] == 0x01 ) ); // Hardware major version and software major version should be equals to 1 to be an DESFire EV1