From 4188f99a20f8597d5c66af45a5a0cf4d2d6112aa Mon Sep 17 00:00:00 2001 From: Roel Verdult Date: Wed, 3 Jun 2009 08:07:58 +0000 Subject: [PATCH] restructuring directory --- LICENSE.TXT => LICENSE | 0 README | 24 ++++++++++++++ README.TXT | 24 -------------- autogen.sh | 16 ---------- AUTHORS => automake/AUTHORS | 0 COPYING => automake/COPYING | 0 ChangeLog => automake/ChangeLog | 0 INSTALL => automake/INSTALL | 0 Makefile.am => automake/Makefile.am | 0 NEWS => automake/NEWS | 0 automake/autogen.sh | 30 ++++++++++++++++++ configure.ac => automake/configure.ac | 15 +++++---- install-sh => automake/install-sh | 0 libnfc.pc.in => automake/libnfc.pc.in | 0 missing => automake/missing | 0 {linux => manualmake/linux}/Makefile | 0 {macosx => manualmake/macosx}/Makefile | 4 +-- {win32 => manualmake/win32}/WINSCARD.LIB | Bin {win32 => manualmake/win32}/anticol.vcproj | 0 {win32 => manualmake/win32}/emulate.vcproj | 0 {win32 => manualmake/win32}/libnfc.def | 0 {win32 => manualmake/win32}/libnfc.sln | 0 {win32 => manualmake/win32}/libnfc.vcproj | 0 {win32 => manualmake/win32}/libusb/libusb.lib | Bin .../win32}/libusb/libusb0.dll | Bin .../win32}/libusb/libusb0_x64.dll | Bin {win32 => manualmake/win32}/libusb/usb.h | 0 {win32 => manualmake/win32}/list.vcproj | 0 {win32 => manualmake/win32}/mftool.vcproj | 0 {win32 => manualmake/win32}/relay.vcproj | 0 src/defines.h | 1 + src/dev_acr122.c | 7 ++-- src/devices.h | 4 ++- 33 files changed, 71 insertions(+), 54 deletions(-) rename LICENSE.TXT => LICENSE (100%) delete mode 100644 README.TXT delete mode 100755 autogen.sh rename AUTHORS => automake/AUTHORS (100%) rename COPYING => automake/COPYING (100%) rename ChangeLog => automake/ChangeLog (100%) rename INSTALL => automake/INSTALL (100%) rename Makefile.am => automake/Makefile.am (100%) rename NEWS => automake/NEWS (100%) create mode 100755 automake/autogen.sh rename configure.ac => automake/configure.ac (63%) rename install-sh => automake/install-sh (100%) rename libnfc.pc.in => automake/libnfc.pc.in (100%) rename missing => automake/missing (100%) rename {linux => manualmake/linux}/Makefile (100%) rename {macosx => manualmake/macosx}/Makefile (92%) rename {win32 => manualmake/win32}/WINSCARD.LIB (100%) rename {win32 => manualmake/win32}/anticol.vcproj (100%) rename {win32 => manualmake/win32}/emulate.vcproj (100%) rename {win32 => manualmake/win32}/libnfc.def (100%) rename {win32 => manualmake/win32}/libnfc.sln (100%) rename {win32 => manualmake/win32}/libnfc.vcproj (100%) rename {win32 => manualmake/win32}/libusb/libusb.lib (100%) rename {win32 => manualmake/win32}/libusb/libusb0.dll (100%) rename {win32 => manualmake/win32}/libusb/libusb0_x64.dll (100%) rename {win32 => manualmake/win32}/libusb/usb.h (100%) rename {win32 => manualmake/win32}/list.vcproj (100%) rename {win32 => manualmake/win32}/mftool.vcproj (100%) rename {win32 => manualmake/win32}/relay.vcproj (100%) diff --git a/LICENSE.TXT b/LICENSE similarity index 100% rename from LICENSE.TXT rename to LICENSE diff --git a/README b/README index e69de29..6790fbe 100644 --- a/README +++ b/README @@ -0,0 +1,24 @@ +------------------------------------------------------------------------ +Public platform independent Near Field Communication (NFC) library +Copyright (C) 2009, Roel Verdult + +------------------------------------------------------------------------ +Welcome to the developers community of libnfc. + +Since it is hard to keep all information up to date +we decided to only maintain the online documentation. +Please visit the official website for more info: +http://www.libnfc.org + +If you have questions, remarks, bug-reports, we encourage you to +post this in the developers community: +http://www.libnfc.org/community + +------------------------------------------------------------------------ +Proprietary Notes: + +FeliCa is s registered trademark of Sony Corporation. MIFARE is a +trademark of NXP Semiconductors. Jewel Topaz is a trademark of Innovision +Research & Technology. All other trademarks are the property of their +respective owners. + diff --git a/README.TXT b/README.TXT deleted file mode 100644 index 01ce245..0000000 --- a/README.TXT +++ /dev/null @@ -1,24 +0,0 @@ ------------------------------------------------------------------------- -Public platform independent Near Field Communication (NFC) library -Copyright (C) 2009, Roel Verdult - ------------------------------------------------------------------------- -Welcome to the developers community of libnfc. - -Since it is hard to keep all information up to date -we decided to only maintain the online documentation. -Please visit the official website for more info: -http://www.libnfc.org - -If you have questions, remarks, bug-reports, we encourage you to -post this in the developers community: -http://www.libnfc.org/community - ------------------------------------------------------------------------- -Proprietary Notes: - -FeliCa is s registered trademark of Sony Corporation. MIFARE is a -trademark of NXP Semiconductors. Jewel Topaz is a trademark of Innovision -Research & Technology. All other trademarks are the property of their -respective owners. - diff --git a/autogen.sh b/autogen.sh deleted file mode 100755 index 0846992..0000000 --- a/autogen.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -rm -rf autom4te.cache -rm -f aclocal.m4 ltmain.sh - -touch README - -echo "Running aclocal..." ; aclocal $ACLOCAL_FLAGS || exit 1 -echo "Running autoheader..." ; autoheader || exit 1 -echo "Running autoconf..." ; autoconf || exit 1 -echo "Running libtoolize..." ; (libtoolize --copy --automake || glibtoolize --automake) || exit 1 -echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1 - -if [ -z "$NOCONFIGURE" ]; then - ./configure "$@" -fi diff --git a/AUTHORS b/automake/AUTHORS similarity index 100% rename from AUTHORS rename to automake/AUTHORS diff --git a/COPYING b/automake/COPYING similarity index 100% rename from COPYING rename to automake/COPYING diff --git a/ChangeLog b/automake/ChangeLog similarity index 100% rename from ChangeLog rename to automake/ChangeLog diff --git a/INSTALL b/automake/INSTALL similarity index 100% rename from INSTALL rename to automake/INSTALL diff --git a/Makefile.am b/automake/Makefile.am similarity index 100% rename from Makefile.am rename to automake/Makefile.am diff --git a/NEWS b/automake/NEWS similarity index 100% rename from NEWS rename to automake/NEWS diff --git a/automake/autogen.sh b/automake/autogen.sh new file mode 100755 index 0000000..11eec5f --- /dev/null +++ b/automake/autogen.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +rm -rf autom4te.cache +rm -f aclocal.m4 ltmain.sh + +touch README + +LIBTOOLIZE=libtoolize +SKIP_PCSC="0" + +case `uname -s` in +Darwin) + LIBTOOLIZE=glibtoolize + ACLOCAL_ARGS="-I /opt/local/share/aclocal/" + SKIP_PCSC="1" + ;; +FreeBSD) + ACLOCAL_ARGS="-I /usr/local/share/aclocal/" + ;; +esac + +echo "Running aclocal..." ; aclocal $ACLOCAL_ARGS -I . || exit 1 +echo "Running autoheader..." ; autoheader || exit 1 +echo "Running autoconf..." ; autoconf || exit 1 +echo "Running libtoolize..." ; $LIBTOOLIZE --force --automake || exit 1 +echo "Running automake..." ; automake --add-missing --copy --gnu || exit 1 + +if [ -z "$NOCONFIGURE" ]; then + ./configure "$@" +fi diff --git a/configure.ac b/automake/configure.ac similarity index 63% rename from configure.ac rename to automake/configure.ac index 73042c3..85ed45c 100644 --- a/configure.ac +++ b/automake/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(libnfc, 1.1.1, roel@libnfc.org) +AC_INIT(libnfc, 1.1.1, info@libnfc.org) AC_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE @@ -15,7 +15,6 @@ AC_PATH_PROG(PKG_CONFIG, pkg-config) AC_HEADER_STDC AC_CHECK_HEADERS([stdlib.h]) - # libusb PKG_CHECK_MODULES(LIBUSB, libusb, [WITH_USB=1], [WITH_USB=0]) if test "$WITH_USB" == "0" ; then @@ -25,12 +24,14 @@ AC_SUBST(LIBUSB_LIBS) AC_SUBST(LIBUSB_CFLAGS) # libpcsclite -PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, [WITH_PCSC=1], [WITH_PCSC=0]) -if test "$WITH_PCSC" == "0" ; then - AC_MSG_ERROR([libpcsclite is mandatory.]) +if test "$SKIP_PCSC" == "0" ; then + PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, [WITH_PCSC=1], [WITH_PCSC=0]) + if test "$WITH_PCSC" == "0" ; then + AC_MSG_ERROR([libpcsclite is mandatory.]) + fi + AC_SUBST(LIBPCSCLITE_LIBS) + AC_SUBST(LIBPCSCLITE_CFLAGS) fi -AC_SUBST(LIBPCSCLITE_LIBS) -AC_SUBST(LIBPCSCLITE_CFLAGS) AC_CONFIG_FILES([ Makefile diff --git a/install-sh b/automake/install-sh similarity index 100% rename from install-sh rename to automake/install-sh diff --git a/libnfc.pc.in b/automake/libnfc.pc.in similarity index 100% rename from libnfc.pc.in rename to automake/libnfc.pc.in diff --git a/missing b/automake/missing similarity index 100% rename from missing rename to automake/missing diff --git a/linux/Makefile b/manualmake/linux/Makefile similarity index 100% rename from linux/Makefile rename to manualmake/linux/Makefile diff --git a/macosx/Makefile b/manualmake/macosx/Makefile similarity index 92% rename from macosx/Makefile rename to manualmake/macosx/Makefile index cab8233..1806d0c 100644 --- a/macosx/Makefile +++ b/manualmake/macosx/Makefile @@ -13,7 +13,7 @@ LIBNFC_LINK= # General settings ############################################### LIBNFC_LDFLAGS=$(LIBPCSC_LIB) $(LIBUSB_LIB) -LIBNFC_PATH=.. +LIBNFC_PATH=../../src VPATH=$(LIBNFC_PATH) ############################################### @@ -24,7 +24,7 @@ LD = gcc CFLAGS = -fPIC -Wall -O4 $(LIBPCSC_HEADERS) $(LIBUSB_HEADERS) LDFLAGS = -fPIC -Wall -O4 -OBJS = dev_pn531.o dev_acr122.o bitutils.o libnfc.o +OBJS = dev_pn531.o dev_acr122.o dev_arygon.o bitutils.o libnfc.o rs232.o HEADERS = devices.h bitutils.h defines.h libnfc.h LIBNFC = libnfc.$(LIBNFC_TYPE) EXES = anticol emulate list mftool relay diff --git a/win32/WINSCARD.LIB b/manualmake/win32/WINSCARD.LIB similarity index 100% rename from win32/WINSCARD.LIB rename to manualmake/win32/WINSCARD.LIB diff --git a/win32/anticol.vcproj b/manualmake/win32/anticol.vcproj similarity index 100% rename from win32/anticol.vcproj rename to manualmake/win32/anticol.vcproj diff --git a/win32/emulate.vcproj b/manualmake/win32/emulate.vcproj similarity index 100% rename from win32/emulate.vcproj rename to manualmake/win32/emulate.vcproj diff --git a/win32/libnfc.def b/manualmake/win32/libnfc.def similarity index 100% rename from win32/libnfc.def rename to manualmake/win32/libnfc.def diff --git a/win32/libnfc.sln b/manualmake/win32/libnfc.sln similarity index 100% rename from win32/libnfc.sln rename to manualmake/win32/libnfc.sln diff --git a/win32/libnfc.vcproj b/manualmake/win32/libnfc.vcproj similarity index 100% rename from win32/libnfc.vcproj rename to manualmake/win32/libnfc.vcproj diff --git a/win32/libusb/libusb.lib b/manualmake/win32/libusb/libusb.lib similarity index 100% rename from win32/libusb/libusb.lib rename to manualmake/win32/libusb/libusb.lib diff --git a/win32/libusb/libusb0.dll b/manualmake/win32/libusb/libusb0.dll similarity index 100% rename from win32/libusb/libusb0.dll rename to manualmake/win32/libusb/libusb0.dll diff --git a/win32/libusb/libusb0_x64.dll b/manualmake/win32/libusb/libusb0_x64.dll similarity index 100% rename from win32/libusb/libusb0_x64.dll rename to manualmake/win32/libusb/libusb0_x64.dll diff --git a/win32/libusb/usb.h b/manualmake/win32/libusb/usb.h similarity index 100% rename from win32/libusb/usb.h rename to manualmake/win32/libusb/usb.h diff --git a/win32/list.vcproj b/manualmake/win32/list.vcproj similarity index 100% rename from win32/list.vcproj rename to manualmake/win32/list.vcproj diff --git a/win32/mftool.vcproj b/manualmake/win32/mftool.vcproj similarity index 100% rename from win32/mftool.vcproj rename to manualmake/win32/mftool.vcproj diff --git a/win32/relay.vcproj b/manualmake/win32/relay.vcproj similarity index 100% rename from win32/relay.vcproj rename to manualmake/win32/relay.vcproj diff --git a/src/defines.h b/src/defines.h index 6ec18e2..0cd80dc 100644 --- a/src/defines.h +++ b/src/defines.h @@ -39,6 +39,7 @@ typedef void* dev_spec; // Device connection specification #define INVALID_DEVICE_INFO null #define MAX_FRAME_LEN 264 #define DEVICE_NAME_LENGTH 256 +#define MAX_DEVICES 16 // Useful macros #define MIN(a,b) (((a) < (b)) ? (a) : (b)) diff --git a/src/dev_acr122.c b/src/dev_acr122.c index b8bb640..635322a 100644 --- a/src/dev_acr122.c +++ b/src/dev_acr122.c @@ -41,7 +41,6 @@ along with this program. If not, see . #define ACR122_WRAP_LEN 5 #define ACR122_COMMAND_LEN 266 #define ACR122_RESPONSE_LEN 268 -#define MAX_READERS 16 typedef struct { SCARDCONTEXT hCtx; @@ -59,8 +58,8 @@ static byte abtLed[9] = { 0xFF,0x00,0x40,0x05,0x04,0x00,0x00,0x00,0x00 }; dev_info* dev_acr122_connect(const ui32 uiIndex) { - char* pacReaders[MAX_READERS]; - char acList[256+64*MAX_READERS]; + char* pacReaders[MAX_DEVICES]; + char acList[256+64*MAX_DEVICES]; ulong ulListLen = sizeof(acList); ui32 uiPos; ui32 uiReaderCount; @@ -90,7 +89,7 @@ dev_info* dev_acr122_connect(const ui32 uiIndex) for (uiPos=0; uiPos. #include "types.h" #include "dev_acr122.h" #include "dev_pn531.h" +#include "dev_arygon.h" const static struct dev_callbacks dev_callbacks_list[] = { // Driver Name Connect Transceive Disconect { "ACR122", dev_acr122_connect, dev_acr122_transceive, dev_acr122_disconnect }, - { "PN531USB", dev_pn531_connect, dev_pn531_transceive, dev_pn531_disconnect } + { "PN531USB", dev_pn531_connect, dev_pn531_transceive, dev_pn531_disconnect }, + { "ARYGON", dev_arygon_connect, dev_arygon_transceive, dev_arygon_disconnect } }; #endif // _LIBNFC_DEVICES_H_