-// really simple JSON helpers
-#define JSON_START() dprintf(fd,"{")
-#define JSON_NUM(NAME) dprintf(fd,"\"" #NAME "\": %d", NAME)
-#define JSON_NEXT() dprintf(fd,",")
-#define JSON_STR(NAME) dprintf(fd,"\"" #NAME "\": \"%s\"", NAME)
-#define JSON_END() dprintf(fd,"}\n")
+// connect to the reader, add self to loop and make it write to fd
+// return 0 on success, negative number otherwise
+int mt_rfid_init(mt_rfid_t *self, struct ev_loop *loop, int fd);
+
+// disconnect from reader
+void mt_rfid_deinit(mt_rfid_t *self);
+
+#else
+
+#define mt_rfid_init(self, loop, fd) 0
+#define mt_rfid_deinit(self) 0