remove nfc-message.h usage from examples.

This commit is contained in:
Romuald Conty 2011-03-05 08:53:46 +00:00
parent a55a52e0a9
commit dba06a555e
14 changed files with 43 additions and 15 deletions

View file

@ -4,7 +4,8 @@
#include <stdlib.h> #include <stdlib.h>
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h"
int int
main (int argc, const char *argv[]) main (int argc, const char *argv[])

View file

@ -45,7 +45,6 @@
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#define SAK_FLAG_ATS_SUPPORTED 0x20 #define SAK_FLAG_ATS_SUPPORTED 0x20

View file

@ -62,7 +62,6 @@
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#define MAX_FRAME_LEN 264 #define MAX_FRAME_LEN 264

View file

@ -49,7 +49,6 @@
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#define MAX_FRAME_LEN (264) #define MAX_FRAME_LEN (264)

View file

@ -52,7 +52,6 @@
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#define MAX_FRAME_LEN 264 #define MAX_FRAME_LEN 264

View file

@ -51,7 +51,7 @@
#include <string.h> #include <string.h>
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#define MAX_DEVICE_COUNT 16 #define MAX_DEVICE_COUNT 16

View file

@ -47,7 +47,6 @@
#include <ctype.h> #include <ctype.h>
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "mifare.h" #include "mifare.h"

View file

@ -46,7 +46,7 @@
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-types.h> #include <nfc/nfc-types.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#define MAX_DEVICE_COUNT 16 #define MAX_DEVICE_COUNT 16

View file

@ -47,11 +47,9 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <signal.h> #include <signal.h>
//#include <stddef.h>
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#ifndef _WIN32 #ifndef _WIN32

View file

@ -45,7 +45,6 @@
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#define MAX_FRAME_LEN 264 #define MAX_FRAME_LEN 264

View file

@ -39,6 +39,44 @@
# include <stdlib.h> # include <stdlib.h>
# include <string.h> # include <string.h>
/**
* @macro DBG
* @brief Print a message of standard output only in DEBUG mode
*/
#ifdef DEBUG
// #define DBG(x, args...) printf("DBG %s:%d: " x "\n", __FILE__, __LINE__,## args )
# define DBG(...) do { \
warnx ("DBG %s:%d", __FILE__, __LINE__); \
warnx (" " __VA_ARGS__ ); \
} while (0)
#else
# define DBG(...) {}
#endif
/**
* @macro WARN
* @brief Print a warn message
*/
# define WARN(...) do { \
warnx ("WARNING %s:%d", __FILE__, __LINE__); \
warnx (" " __VA_ARGS__ ); \
} while (0)
#else
# define WARN(...) warnx ("WARNING: " __VA_ARGS__ )
#endif
/**
* @macro ERR
* @brief Print a error message
*/
# define ERR(...) do { \
warnx ("ERROR %s:%d", __FILE__, __LINE__); \
warnx (" " __VA_ARGS__ ); \
} while (0)
#else
# define ERR(...) warnx ("ERROR: " __VA_ARGS__ )
#endif
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);

View file

@ -36,7 +36,6 @@
#include <string.h> #include <string.h>
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"
#include "chips/pn53x.h" #include "chips/pn53x.h"

View file

@ -54,9 +54,8 @@
#endif #endif
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h"
#include "nfc-utils.h"
#include "chips/pn53x.h" #include "chips/pn53x.h"
#define MAX_FRAME_LEN 264 #define MAX_FRAME_LEN 264

View file

@ -50,7 +50,6 @@
#include <unistd.h> #include <unistd.h>
#include <nfc/nfc.h> #include <nfc/nfc.h>
#include <nfc/nfc-messages.h>
#include "nfc-utils.h" #include "nfc-utils.h"