Go to the documentation of this file.
41 #ifndef _EXAMPLES_NFC_UTILS_H_
42 # define _EXAMPLES_NFC_UTILS_H_
53 # define DBG(...) do { \
54 warnx ("DBG %s:%d", __FILE__, __LINE__); \
55 warnx (" " __VA_ARGS__ ); \
66 # define WARN(...) do { \
67 warnx ("WARNING %s:%d", __FILE__, __LINE__); \
68 warnx (" " __VA_ARGS__ ); \
71 # define WARN(...) warnx ("WARNING: " __VA_ARGS__ )
79 # define ERR(...) do { \
80 warnx ("ERROR %s:%d", __FILE__, __LINE__); \
81 warnx (" " __VA_ARGS__ ); \
84 # define ERR(...) warnx ("ERROR: " __VA_ARGS__ )
88 #define MIN(a,b) (((a) < (b)) ? (a) : (b))
91 #define MAX(a,b) (((a) > (b)) ? (a) : (b))
94 uint8_t oddparity(
const uint8_t bt);
95 void oddparity_bytes_ts(
const uint8_t *pbtData,
const size_t szLen, uint8_t *pbtPar);
97 void print_hex(
const uint8_t *pbtData,
const size_t szLen);
98 void print_hex_bits(
const uint8_t *pbtData,
const size_t szBits);
99 void print_hex_par(
const uint8_t *pbtData,
const size_t szBits,
const uint8_t *pbtDataPar);
101 void print_nfc_target(
const nfc_target *pnt,
bool verbose);