restructuring directory

This commit is contained in:
Roel Verdult 2009-06-03 08:07:58 +00:00
parent 7203015ed9
commit 4188f99a20
33 changed files with 71 additions and 54 deletions

24
README
View file

@ -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.

View file

@ -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.

View file

@ -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

View file

30
automake/autogen.sh Executable file
View file

@ -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

View file

@ -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) AC_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE AM_INIT_AUTOMAKE
@ -15,7 +15,6 @@ AC_PATH_PROG(PKG_CONFIG, pkg-config)
AC_HEADER_STDC AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h]) AC_CHECK_HEADERS([stdlib.h])
# libusb # libusb
PKG_CHECK_MODULES(LIBUSB, libusb, [WITH_USB=1], [WITH_USB=0]) PKG_CHECK_MODULES(LIBUSB, libusb, [WITH_USB=1], [WITH_USB=0])
if test "$WITH_USB" == "0" ; then if test "$WITH_USB" == "0" ; then
@ -25,12 +24,14 @@ AC_SUBST(LIBUSB_LIBS)
AC_SUBST(LIBUSB_CFLAGS) AC_SUBST(LIBUSB_CFLAGS)
# libpcsclite # libpcsclite
PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, [WITH_PCSC=1], [WITH_PCSC=0]) if test "$SKIP_PCSC" == "0" ; then
if test "$WITH_PCSC" == "0" ; then PKG_CHECK_MODULES(LIBPCSCLITE, libpcsclite, [WITH_PCSC=1], [WITH_PCSC=0])
AC_MSG_ERROR([libpcsclite is mandatory.]) if test "$WITH_PCSC" == "0" ; then
AC_MSG_ERROR([libpcsclite is mandatory.])
fi
AC_SUBST(LIBPCSCLITE_LIBS)
AC_SUBST(LIBPCSCLITE_CFLAGS)
fi fi
AC_SUBST(LIBPCSCLITE_LIBS)
AC_SUBST(LIBPCSCLITE_CFLAGS)
AC_CONFIG_FILES([ AC_CONFIG_FILES([
Makefile Makefile

View file

@ -13,7 +13,7 @@ LIBNFC_LINK=
# General settings # General settings
############################################### ###############################################
LIBNFC_LDFLAGS=$(LIBPCSC_LIB) $(LIBUSB_LIB) LIBNFC_LDFLAGS=$(LIBPCSC_LIB) $(LIBUSB_LIB)
LIBNFC_PATH=.. LIBNFC_PATH=../../src
VPATH=$(LIBNFC_PATH) VPATH=$(LIBNFC_PATH)
############################################### ###############################################
@ -24,7 +24,7 @@ LD = gcc
CFLAGS = -fPIC -Wall -O4 $(LIBPCSC_HEADERS) $(LIBUSB_HEADERS) CFLAGS = -fPIC -Wall -O4 $(LIBPCSC_HEADERS) $(LIBUSB_HEADERS)
LDFLAGS = -fPIC -Wall -O4 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 HEADERS = devices.h bitutils.h defines.h libnfc.h
LIBNFC = libnfc.$(LIBNFC_TYPE) LIBNFC = libnfc.$(LIBNFC_TYPE)
EXES = anticol emulate list mftool relay EXES = anticol emulate list mftool relay

View file

@ -39,6 +39,7 @@ typedef void* dev_spec; // Device connection specification
#define INVALID_DEVICE_INFO null #define INVALID_DEVICE_INFO null
#define MAX_FRAME_LEN 264 #define MAX_FRAME_LEN 264
#define DEVICE_NAME_LENGTH 256 #define DEVICE_NAME_LENGTH 256
#define MAX_DEVICES 16
// Useful macros // Useful macros
#define MIN(a,b) (((a) < (b)) ? (a) : (b)) #define MIN(a,b) (((a) < (b)) ? (a) : (b))

View file

@ -41,7 +41,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define ACR122_WRAP_LEN 5 #define ACR122_WRAP_LEN 5
#define ACR122_COMMAND_LEN 266 #define ACR122_COMMAND_LEN 266
#define ACR122_RESPONSE_LEN 268 #define ACR122_RESPONSE_LEN 268
#define MAX_READERS 16
typedef struct { typedef struct {
SCARDCONTEXT hCtx; 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) dev_info* dev_acr122_connect(const ui32 uiIndex)
{ {
char* pacReaders[MAX_READERS]; char* pacReaders[MAX_DEVICES];
char acList[256+64*MAX_READERS]; char acList[256+64*MAX_DEVICES];
ulong ulListLen = sizeof(acList); ulong ulListLen = sizeof(acList);
ui32 uiPos; ui32 uiPos;
ui32 uiReaderCount; ui32 uiReaderCount;
@ -90,7 +89,7 @@ dev_info* dev_acr122_connect(const ui32 uiIndex)
for (uiPos=0; uiPos<ulListLen; uiPos++) for (uiPos=0; uiPos<ulListLen; uiPos++)
{ {
// Make sure don't break out of our reader array // Make sure don't break out of our reader array
if (uiReaderCount == MAX_READERS) break; if (uiReaderCount == MAX_DEVICES) break;
// Test if there is a next reader available // Test if there is a next reader available
if (acList[uiPos] == 0x00) if (acList[uiPos] == 0x00)

View file

@ -25,11 +25,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "types.h" #include "types.h"
#include "dev_acr122.h" #include "dev_acr122.h"
#include "dev_pn531.h" #include "dev_pn531.h"
#include "dev_arygon.h"
const static struct dev_callbacks dev_callbacks_list[] = { const static struct dev_callbacks dev_callbacks_list[] = {
// Driver Name Connect Transceive Disconect // Driver Name Connect Transceive Disconect
{ "ACR122", dev_acr122_connect, dev_acr122_transceive, dev_acr122_disconnect }, { "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_ #endif // _LIBNFC_DEVICES_H_