Prevent from exporting messages macros outside of libnfc.
This commit is contained in:
parent
b73d9f03fa
commit
7924d10fad
12 changed files with 58 additions and 16 deletions
|
@ -5,7 +5,11 @@ bin_PROGRAMS = nfc-anticol nfc-list nfc-mftool nfc-mfultool nfc-relay nfc-emulat
|
||||||
# set the include path found by configure
|
# set the include path found by configure
|
||||||
INCLUDES= $(all_includes)
|
INCLUDES= $(all_includes)
|
||||||
|
|
||||||
nfcinclude_HEADERS = libnfc.h bitutils.h defines.h types.h mifaretag.h mifareultag.h devices.h rs232.h dev_arygon.h dev_pn531.h dev_pn533.h
|
nfc_devices_headers = dev_arygon.h dev_pn531.h dev_pn533.h
|
||||||
|
nfc_examples_headers = mifaretag.h mifareultag.h
|
||||||
|
nfcinclude_HEADERS = libnfc.h bitutils.h defines.h types.h rs232.h devices.h messages.h
|
||||||
|
nfcinclude_HEADERS += $(nfc_devices_headers)
|
||||||
|
nfcinclude_HEADERS += $(nfc_examples_headers)
|
||||||
nfcincludedir = $(includedir)/libnfc
|
nfcincludedir = $(includedir)/libnfc
|
||||||
|
|
||||||
lib_LTLIBRARIES = libnfc.la
|
lib_LTLIBRARIES = libnfc.la
|
||||||
|
|
|
@ -27,6 +27,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
#include "libnfc.h"
|
#include "libnfc.h"
|
||||||
|
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
#define SAK_FLAG_ATS_SUPPORTED 0x20
|
#define SAK_FLAG_ATS_SUPPORTED 0x20
|
||||||
|
|
||||||
static byte_t abtRx[MAX_FRAME_LEN];
|
static byte_t abtRx[MAX_FRAME_LEN];
|
||||||
|
|
|
@ -29,18 +29,6 @@ typedef void* dev_spec; // Device connection specification
|
||||||
#define DEVICE_NAME_LENGTH 256
|
#define DEVICE_NAME_LENGTH 256
|
||||||
#define MAX_DEVICES 16
|
#define MAX_DEVICES 16
|
||||||
|
|
||||||
// Useful macros
|
|
||||||
#ifdef DEBUG
|
|
||||||
// #define DBG(x, args...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__,## args )
|
|
||||||
#define DBG(x, ...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__, ## __VA_ARGS__ )
|
|
||||||
#else
|
|
||||||
#define DBG(...) {}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define INFO(x, ...) printf("INFO: " x "\n", ## __VA_ARGS__ )
|
|
||||||
#define WARN(x, ...) printf("WARNING: " x "\n", ## __VA_ARGS__ )
|
|
||||||
#define ERR(x, ...) printf("ERROR: " x "\n", ## __VA_ARGS__ )
|
|
||||||
|
|
||||||
#if defined __cplusplus
|
#if defined __cplusplus
|
||||||
#define LIBNFC_EXTERN_C extern "C"
|
#define LIBNFC_EXTERN_C extern "C"
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -31,6 +31,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "defines.h"
|
#include "defines.h"
|
||||||
|
#include "messages.h"
|
||||||
#include "bitutils.h"
|
#include "bitutils.h"
|
||||||
|
|
||||||
// WINDOWS: #define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE SCARD_CTL_CODE(3500)
|
// WINDOWS: #define IOCTL_CCID_ESCAPE_SCARD_CTL_CODE SCARD_CTL_CODE(3500)
|
||||||
|
|
|
@ -19,8 +19,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dev_arygon.h"
|
#include "dev_arygon.h"
|
||||||
|
|
||||||
#include "rs232.h"
|
#include "rs232.h"
|
||||||
#include "bitutils.h"
|
#include "bitutils.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#define SERIAL_STRING "COM"
|
#define SERIAL_STRING "COM"
|
||||||
|
|
|
@ -21,14 +21,15 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
/*
|
/*
|
||||||
Thanks to d18c7db and Okko for example code
|
Thanks to d18c7db and Okko for example code
|
||||||
*/
|
*/
|
||||||
|
#include "dev_pn533.h"
|
||||||
#include "defines.h"
|
|
||||||
|
|
||||||
#include <usb.h>
|
#include <usb.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "dev_pn533.h"
|
|
||||||
|
#include "defines.h"
|
||||||
#include "bitutils.h"
|
#include "bitutils.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
#define BUFFER_LENGTH 256
|
#define BUFFER_LENGTH 256
|
||||||
#define USB_TIMEOUT 30000
|
#define USB_TIMEOUT 30000
|
||||||
|
|
|
@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "libnfc.h"
|
#include "libnfc.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
static byte_t abtRecv[MAX_FRAME_LEN];
|
static byte_t abtRecv[MAX_FRAME_LEN];
|
||||||
static uint32_t uiRecvBits;
|
static uint32_t uiRecvBits;
|
||||||
|
|
|
@ -27,6 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
#include "devices.h"
|
#include "devices.h"
|
||||||
|
|
||||||
#include "bitutils.h"
|
#include "bitutils.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
// Registers and symbols masks used to covers parts within a register
|
// Registers and symbols masks used to covers parts within a register
|
||||||
#define REG_CIU_TX_MODE 0x6302
|
#define REG_CIU_TX_MODE 0x6302
|
||||||
|
|
|
@ -25,6 +25,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "libnfc.h"
|
#include "libnfc.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
static dev_info* pdi;
|
static dev_info* pdi;
|
||||||
static byte_t abtFelica[5] = { 0x00, 0xff, 0xff, 0x00, 0x00 };
|
static byte_t abtFelica[5] = { 0x00, 0xff, 0xff, 0x00, 0x00 };
|
||||||
|
|
38
src/messages.h
Normal file
38
src/messages.h
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
/*
|
||||||
|
|
||||||
|
Public platform independent Near Field Communication (NFC) library
|
||||||
|
Copyright (C) 2009, Roel Verdult
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Lesser General Public License as published by
|
||||||
|
the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
This program is distributed in the hope that it will be useful,
|
||||||
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
GNU General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Lesser General Public License
|
||||||
|
along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _LIBNFC_MESSAGES_H_
|
||||||
|
#define _LIBNFC_MESSAGES_H_
|
||||||
|
|
||||||
|
// #define DEBUG /* DEBUG flag can also be enabled using ./configure --enable-debug */
|
||||||
|
|
||||||
|
// Useful macros
|
||||||
|
#ifdef DEBUG
|
||||||
|
// #define DBG(x, args...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__,## args )
|
||||||
|
#define DBG(x, ...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__, ## __VA_ARGS__ )
|
||||||
|
#else
|
||||||
|
#define DBG(...) {}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define INFO(x, ...) printf("INFO: " x "\n", ## __VA_ARGS__ )
|
||||||
|
#define WARN(x, ...) printf("WARNING: " x "\n", ## __VA_ARGS__ )
|
||||||
|
#define ERR(x, ...) printf("ERROR: " x "\n", ## __VA_ARGS__ )
|
||||||
|
|
||||||
|
#endif // _LIBNFC_MESSAGES_H_
|
|
@ -24,6 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "libnfc.h"
|
#include "libnfc.h"
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
static byte_t abtReaderRx[MAX_FRAME_LEN];
|
static byte_t abtReaderRx[MAX_FRAME_LEN];
|
||||||
static byte_t abtReaderRxPar[MAX_FRAME_LEN];
|
static byte_t abtReaderRxPar[MAX_FRAME_LEN];
|
||||||
|
|
|
@ -26,6 +26,8 @@ available: http://www.teuniz.net/RS-232/index.html
|
||||||
|
|
||||||
#include "rs232.h"
|
#include "rs232.h"
|
||||||
|
|
||||||
|
#include "messages.h"
|
||||||
|
|
||||||
// Test if we are dealing with unix operating systems
|
// Test if we are dealing with unix operating systems
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue