summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/librfid/rfid.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/include/librfid/rfid.h b/include/librfid/rfid.h
index f0ecc16..0b98be6 100644
--- a/include/librfid/rfid.h
+++ b/include/librfid/rfid.h
@@ -13,17 +13,30 @@ enum rfid_frametype {
RFID_MIFARE_FRAME,
};
-//#define DEBUG
+#define DEBUG_LIBRFID
-#ifdef DEBUG
+#ifdef DEBUG_LIBRFID
+
+#ifdef LIBRFID_FIRMWARE
+extern void debugp(const char *format, ...);
+extern const char *hexdump(const void *data, unsigned int len);
+#define rfid_hexdump(x, y) hexdump(x, y)
+#define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
+#define DEBUGPC(x, args ...) debugp(x, ## args)
+#else /* LIBRFID_FIRMWARE */
+extern const char *rfid_hexdump(const void *data, unsigned int len);
#define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
#define DEBUGPC(x, args ...) fprintf(stderr, x, ## args)
-#else
+#endif /* LIBRFID_FIRMWARE */
+
+#else /* DEBUG */
+extern const char *rfid_hexdump(const void *data, unsigned int len);
+
#define DEBUGP(x, args ...)
#define DEBUGPC(x, args ...)
-#endif
-extern const char *rfid_hexdump(const void *data, unsigned int len);
+#endif /* DEBUG */
+
#ifndef ARRAY_SIZE
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
personal git repositories of Harald Welte. Your mileage may vary