// macros for convenience
#define READER_TYPE 1 // uFR type (1Mbps)
#define PORT_INTERFACE 1 // serial
-#ifndef PORT_NAME
#define PORT_NAME "/dev/ttyUSB0"
-#endif
-
-// poll the uFR reader and print JSON formatted card info to stdout.
-// run it directly or using pthreads.
-void *mt_rfid_run(void *ptr);
-
-//example
-/*
-
-pthread_t t;
-mt_rfid_t ufr = {READER_TYPE, PORT_NAME, PORT_INTERFACE, 0, 1};
-if (!pthread_create(&t, NULL, mt_rfid_run, (void *)&ufr)) {
- getchar();
- ufr.run = 0;
- pthread_join(t, NULL);
-}
+#define ASYNC_SUFFIX 0
+#define ASYNC_BAUD_RATE 1000000
+#define BASYNC_BAUD_RATE B1000000
-*/
+// really simple JSON helpers
+#define JSON_NUM(NAME) printf("\"" #NAME "\": %d", NAME)
+#define JSON_STR(NAME) printf("\"" #NAME "\": \"%s\"", NAME)
+#define JSON_START() printf("{\n")
+#define JSON_NEXT() printf(",\n")
+#define JSON_END() printf("\n}\n")
#endif