#include "mt_rfid.h"
#include "signal_exit.h"
+#include "json_helpers.h"
// shit to avoid constant repetition
#define CONCAT_AGAIN(A,B) A ## B
return fd;
}
-// really simple JSON helpers
-#define JSON_START() dprintf(fd,"{")
-#define JSON_NUM(NAME) dprintf(fd,"\"" #NAME "\":%d", NAME) //see the int?
-#define JSON_NEXT() dprintf(fd,",")
-#define JSON_STR(NAME) dprintf(fd,"\"" #NAME "\":\"%s\"", NAME)
-#define JSON_END() dprintf(fd,"}\n")
-
// print complete json
-#define JSON_PRINT() do { \
+#define RFID_JSON_PRINT() do { \
JSON_START(); \
JSON_STR(type); \
JSON_NEXT(); \
return;
}
- JSON_PRINT();
+ RFID_JSON_PRINT();
#ifdef UFR_BEEP
ReaderUISignal(0, 1); // no light, one beep