Rearrange source code.
This commit is contained in:
parent
be1639b452
commit
c7d77d7664
59 changed files with 43 additions and 107 deletions
|
@ -15,7 +15,7 @@ IF(NOT MSVC)
|
||||||
ENDIF(NOT MSVC)
|
ENDIF(NOT MSVC)
|
||||||
|
|
||||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_SOURCE_DIR}/config.h)
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
# make it easy to locate CMake modules for finding libraries
|
# make it easy to locate CMake modules for finding libraries
|
||||||
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")
|
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules/")
|
||||||
|
@ -84,7 +84,9 @@ IF(NOT MSVC)
|
||||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libnfc.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
|
||||||
ENDIF(NOT MSVC)
|
ENDIF(NOT MSVC)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(src)
|
ADD_SUBDIRECTORY(libnfc)
|
||||||
|
ADD_SUBDIRECTORY(include)
|
||||||
|
ADD_SUBDIRECTORY(examples)
|
||||||
|
|
||||||
# Binary Package
|
# Binary Package
|
||||||
IF(MSVC)
|
IF(MSVC)
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
ACLOCAL_AMFLAGS = -I m4
|
ACLOCAL_AMFLAGS = -I m4
|
||||||
|
|
||||||
SUBDIRS = src cmake_modules
|
AM_CFLAGS = $(LIBNFC_CFLAGS)
|
||||||
|
|
||||||
|
SUBDIRS = libnfc examples include cmake_modules
|
||||||
|
|
||||||
pkgconfigdir = $(libdir)/pkgconfig
|
pkgconfigdir = $(libdir)/pkgconfig
|
||||||
pkgconfig_DATA = libnfc.pc
|
pkgconfig_DATA = libnfc.pc
|
||||||
|
|
17
configure.ac
17
configure.ac
|
@ -46,7 +46,7 @@ AC_TYPE_UINT32_T
|
||||||
AC_TYPE_UINT64_T
|
AC_TYPE_UINT64_T
|
||||||
AC_TYPE_INT32_T
|
AC_TYPE_INT32_T
|
||||||
|
|
||||||
LIBNFC_CFLAGS='-I$(top_srcdir)/src/lib -I$(top_builddir)/src/include -I$(top_srcdir)/src/include'
|
LIBNFC_CFLAGS='-I$(top_srcdir)/libnfc -I$(top_builddir)/include -I$(top_srcdir)/include'
|
||||||
AC_SUBST(LIBNFC_CFLAGS)
|
AC_SUBST(LIBNFC_CFLAGS)
|
||||||
|
|
||||||
# Debug support (default:no)
|
# Debug support (default:no)
|
||||||
|
@ -189,14 +189,13 @@ CFLAGS="$CFLAGS -Du_int8_t=uint8_t -Du_int16_t=uint16_t"
|
||||||
|
|
||||||
AC_CONFIG_FILES([
|
AC_CONFIG_FILES([
|
||||||
Makefile
|
Makefile
|
||||||
src/include/Makefile
|
include/Makefile
|
||||||
src/include/nfc/Makefile
|
include/nfc/Makefile
|
||||||
src/lib/chips/Makefile
|
libnfc/chips/Makefile
|
||||||
src/lib/buses/Makefile
|
libnfc/buses/Makefile
|
||||||
src/lib/drivers/Makefile
|
libnfc/drivers/Makefile
|
||||||
src/lib/Makefile
|
libnfc/Makefile
|
||||||
src/examples/Makefile
|
examples/Makefile
|
||||||
src/Makefile
|
|
||||||
cmake_modules/Makefile
|
cmake_modules/Makefile
|
||||||
libnfc.pc
|
libnfc.pc
|
||||||
Doxyfile
|
Doxyfile
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
SET(EXAMPLES-SOURCES nfc-list nfc-mfclassic nfc-mfultralight nfcip-initiator nfcip-target nfc-anticol nfc-emulate nfc-relay)
|
SET(EXAMPLES-SOURCES nfc-list nfc-mfclassic nfc-mfultralight nfcip-initiator nfcip-target nfc-anticol nfc-emulate nfc-relay)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../lib)
|
# XXX: Examples should not use private API!
|
||||||
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libnfc)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
|
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS})
|
||||||
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS} ${PCSC_LIBRARY_DIRS})
|
LINK_DIRECTORIES(${LIBUSB_LIBRARY_DIRS} ${PCSC_LIBRARY_DIRS})
|
|
@ -6,31 +6,31 @@ INCLUDES= $(all_includes) $(LIBNFC_CFLAGS)
|
||||||
nfcinclude_HEADERS = mifaretag.h mifareultag.h
|
nfcinclude_HEADERS = mifaretag.h mifareultag.h
|
||||||
nfcincludedir = $(includedir)/nfc
|
nfcincludedir = $(includedir)/nfc
|
||||||
|
|
||||||
AM_CFLAGS = -I$(top_srcdir)/src/lib
|
AM_CFLAGS = -I$(top_srcdir)/libnfc
|
||||||
|
|
||||||
nfc_anticol_SOURCES = nfc-anticol.c
|
nfc_anticol_SOURCES = nfc-anticol.c
|
||||||
nfc_anticol_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfc_anticol_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
nfc_list_SOURCES = nfc-list.c
|
nfc_list_SOURCES = nfc-list.c
|
||||||
nfc_list_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfc_list_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
nfc_mfultralight_SOURCES = nfc-mfultralight.c mifareultag.h
|
nfc_mfultralight_SOURCES = nfc-mfultralight.c mifareultag.h
|
||||||
nfc_mfultralight_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfc_mfultralight_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
nfc_mfclassic_SOURCES = nfc-mfclassic.c mifaretag.h
|
nfc_mfclassic_SOURCES = nfc-mfclassic.c mifaretag.h
|
||||||
nfc_mfclassic_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfc_mfclassic_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
nfc_relay_SOURCES = nfc-relay.c
|
nfc_relay_SOURCES = nfc-relay.c
|
||||||
nfc_relay_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfc_relay_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
nfc_emulate_SOURCES = nfc-emulate.c
|
nfc_emulate_SOURCES = nfc-emulate.c
|
||||||
nfc_emulate_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfc_emulate_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
nfcip_target_SOURCES = nfcip-target.c
|
nfcip_target_SOURCES = nfcip-target.c
|
||||||
nfcip_target_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfcip_target_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
nfcip_initiator_SOURCES = nfcip-initiator.c
|
nfcip_initiator_SOURCES = nfcip-initiator.c
|
||||||
nfcip_initiator_LDADD = $(top_builddir)/src/lib/libnfc.la
|
nfcip_initiator_LDADD = $(top_builddir)/libnfc/libnfc.la
|
||||||
|
|
||||||
dist_man_MANS = nfc-anticol.1 nfc-emulate.1 nfc-list.1 nfc-mfclassic.1 nfc-mfultralight.1 nfc-relay.1
|
dist_man_MANS = nfc-anticol.1 nfc-emulate.1 nfc-list.1 nfc-mfclassic.1 nfc-mfultralight.1 nfc-relay.1
|
||||||
|
|
|
@ -8,9 +8,9 @@ libnfc_la_SOURCES = nfc.c bitutils.c
|
||||||
libnfc_la_LDFLAGS = -no-undefined -version-info=0:0:0
|
libnfc_la_LDFLAGS = -no-undefined -version-info=0:0:0
|
||||||
libnfc_la_CFLAGS =
|
libnfc_la_CFLAGS =
|
||||||
libnfc_la_LIBADD = \
|
libnfc_la_LIBADD = \
|
||||||
$(top_builddir)/src/lib/chips/libnfcchips.la \
|
$(top_builddir)/libnfc/chips/libnfcchips.la \
|
||||||
$(top_builddir)/src/lib/buses/libnfcbuses.la \
|
$(top_builddir)/libnfc/buses/libnfcbuses.la \
|
||||||
$(top_builddir)/src/lib/drivers/libnfcdrivers.la
|
$(top_builddir)/libnfc/drivers/libnfcdrivers.la
|
||||||
|
|
||||||
if PCSC_LITE_ENABLED
|
if PCSC_LITE_ENABLED
|
||||||
libnfc_la_CFLAGS += @LIBPCSCLITE_CFLAGS@ -DHAVE_PCSC_LITE
|
libnfc_la_CFLAGS += @LIBPCSCLITE_CFLAGS@ -DHAVE_PCSC_LITE
|
|
@ -26,27 +26,20 @@
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <nfc/nfc-types.h>
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* FIXME: There is no place for this here
|
* FIXME: There is no place for this here
|
||||||
*/
|
*/
|
||||||
#ifdef _WIN32
|
#if defined (_WIN32)
|
||||||
/* Windows platform */
|
#if defined(nfc_EXPORTS)
|
||||||
#ifndef _WINDLL
|
#define NFC_EXPORT __declspec(dllexport)
|
||||||
/* CMake compilation */
|
#else
|
||||||
#ifdef nfc_EXPORTS
|
#define NFC_EXPORT __declspec(dllimport)
|
||||||
#define NFC_EXPORT __declspec(dllexport)
|
#endif /* nfc_EXPORTS */
|
||||||
#else /* nfc_EXPORTS */
|
#else /* defined (_WIN32) */
|
||||||
#define NFC_EXPORT __declspec(dllimport)
|
#define NFC_EXPORT
|
||||||
#endif /* nfc_EXPORTS */
|
#endif
|
||||||
#else /* _WINDLL */
|
|
||||||
/* Manual makefile */
|
|
||||||
#define NFC_EXPORT
|
|
||||||
#endif /* _WINDLL */
|
|
||||||
#else /* _WIN32 */
|
|
||||||
#define NFC_EXPORT
|
|
||||||
#endif /* _WIN32 */
|
|
||||||
|
|
||||||
#include <nfc/nfc-types.h>
|
|
||||||
|
|
||||||
byte_t oddparity(const byte_t bt);
|
byte_t oddparity(const byte_t bt);
|
||||||
void oddparity_byte_ts(const byte_t* pbtData, const size_t szLen, byte_t* pbtPar);
|
void oddparity_byte_ts(const byte_t* pbtData, const size_t szLen, byte_t* pbtPar);
|
|
@ -5,5 +5,5 @@ INCLUDES= $(all_includes) $(LIBNFC_CFLAGS)
|
||||||
noinst_HEADERS = uart.h
|
noinst_HEADERS = uart.h
|
||||||
noinst_LTLIBRARIES = libnfcbuses.la
|
noinst_LTLIBRARIES = libnfcbuses.la
|
||||||
libnfcbuses_la_SOURCES = uart.c
|
libnfcbuses_la_SOURCES = uart.c
|
||||||
libnfcbuses_la_CFLAGS = -I$(top_srcdir)/src/lib
|
libnfcbuses_la_CFLAGS = -I$(top_srcdir)/libnfc
|
||||||
|
|
|
@ -5,5 +5,5 @@ INCLUDES= $(all_includes) $(LIBNFC_CFLAGS)
|
||||||
noinst_HEADERS = pn53x.h
|
noinst_HEADERS = pn53x.h
|
||||||
noinst_LTLIBRARIES = libnfcchips.la
|
noinst_LTLIBRARIES = libnfcchips.la
|
||||||
libnfcchips_la_SOURCES = pn53x.c
|
libnfcchips_la_SOURCES = pn53x.c
|
||||||
libnfcchips_la_CFLAGS = -I$(top_srcdir)/src/lib
|
libnfcchips_la_CFLAGS = -I$(top_srcdir)/libnfc
|
||||||
|
|
|
@ -4,7 +4,7 @@ INCLUDES= $(all_includes) $(LIBNFC_CFLAGS)
|
||||||
noinst_HEADERS = arygon.h pn532_uart.h
|
noinst_HEADERS = arygon.h pn532_uart.h
|
||||||
noinst_LTLIBRARIES = libnfcdrivers.la
|
noinst_LTLIBRARIES = libnfcdrivers.la
|
||||||
libnfcdrivers_la_SOURCES = arygon.c pn532_uart.c
|
libnfcdrivers_la_SOURCES = arygon.c pn532_uart.c
|
||||||
libnfcdrivers_la_CFLAGS = -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/lib/buses
|
libnfcdrivers_la_CFLAGS = -I$(top_srcdir)/libnfc -I$(top_srcdir)/libnfc/buses
|
||||||
libnfcdrivers_la_LIBADD =
|
libnfcdrivers_la_LIBADD =
|
||||||
|
|
||||||
if PCSC_LITE_ENABLED
|
if PCSC_LITE_ENABLED
|
|
@ -1,24 +0,0 @@
|
||||||
IF(LIBNFC_VERBOSE_OUTPUT)
|
|
||||||
ADD_DEFINITIONS("-DDEBUG")
|
|
||||||
ENDIF(LIBNFC_VERBOSE_OUTPUT)
|
|
||||||
|
|
||||||
IF(LIBNFC_SERIAL_AUTOPROBE_ENABLED)
|
|
||||||
ADD_DEFINITIONS("-DSERIAL_AUTOPROBE_ENABLED")
|
|
||||||
ENDIF(LIBNFC_SERIAL_AUTOPROBE_ENABLED)
|
|
||||||
|
|
||||||
IF(LIBNFC_LANG_C99 AND NOT MSVC)
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99")
|
|
||||||
ENDIF(LIBNFC_LANG_C99 AND NOT MSVC)
|
|
||||||
|
|
||||||
IF(MSVC)
|
|
||||||
# We should fix the code, not hide warning!
|
|
||||||
ADD_DEFINITIONS("-D_CRT_SECURE_NO_WARNINGS")
|
|
||||||
# Include the stdint headers, because MSVC does not have them
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../win32/stdint)
|
|
||||||
ENDIF(MSVC)
|
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${LIBUSB_INCLUDE_DIRS} ${PCSC_INCLUDE_DIRS} ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(lib)
|
|
||||||
ADD_SUBDIRECTORY(examples)
|
|
||||||
ADD_SUBDIRECTORY(include)
|
|
|
@ -1,6 +0,0 @@
|
||||||
INCLUDES = $(LIBNFC_CFLAGS)
|
|
||||||
|
|
||||||
SUBDIRS = lib examples include
|
|
||||||
|
|
||||||
EXTRA_DIST = CMakeLists.txt
|
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
/**
|
|
||||||
* @mainpage libnfc reference manual
|
|
||||||
*
|
|
||||||
* @section intro_sec Introduction
|
|
||||||
* This is the developer manual for \b libnfc.
|
|
||||||
*
|
|
||||||
* @section quick_start_sec Quick start
|
|
||||||
* If you are looking for libnfc's public API, you should start with nfc.h
|
|
||||||
* Some commented examples that present how to use \b libnfc can be found here:
|
|
||||||
* @subpage examples_page
|
|
||||||
*
|
|
||||||
* @section upgrading_sec Upgrading from previous version
|
|
||||||
* If you are upgrading from a previous \b libnfc version, please take care about changes, specially API changes.
|
|
||||||
* All important changes should be listed in @subpage changelog_page.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @page examples_page Examples
|
|
||||||
* @section intro_sec Introduction
|
|
||||||
* This page present some examples to help developers which use \b libnfc.
|
|
||||||
*
|
|
||||||
* @section example_1_sec Simple tag UID reader.
|
|
||||||
* This short commented code example should be helpful to quick start development with \b libnfc, it grab the first available NFC device and print the first found ISO14443-A tag (e.g. MIFARE Classic, MIFARE Ultralight).
|
|
||||||
* @include quick_start_example1.c
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @page changelog_page ChangeLog from 1.2.1 to 1.3.0
|
|
||||||
* @verbinclude ChangeLog
|
|
||||||
*/
|
|
||||||
|
|
Loading…
Reference in a new issue