]> rtime.felk.cvut.cz Git - coffee/mt-apps.git/blob - mt_rfid.h
tiny doc and macros
[coffee/mt-apps.git] / mt_rfid.h
1 /**
2  * mt_rfid.h
3  */
4
5 #ifndef MT_RFID_H
6 #define MT_RFID_H
7
8 // reader open parameters, see uFR manual
9 #define READER_TYPE    1 // uFR type (1Mbps)
10 #define PORT_INTERFACE 1 // serial, auto -> ftdi -> FAIL (some shity drivers missing)
11 #define PORT_NAME "/dev/ttyUSB0"
12
13 // async uid sending parameters
14 #define ASYNC_SUFFIX            0 // keep it zero: + separates uids, + terminates strings
15 #define ASYNC_BAUD_RATE   1000000 // 1Mbps, otherwise UFR_COMMUNICATION_BREAK
16
17 #define UFR_BEEP // define this to annoy people
18
19 // really simple JSON helpers
20 #define JSON_START() printf("{\n")
21 #define JSON_NUM(NAME) printf("\"" #NAME "\": %d", NAME)
22 #define JSON_NEXT() printf(",\n")
23 #define JSON_STR(NAME) printf("\"" #NAME "\": \"%s\"", NAME)
24 #define JSON_END() printf("\n}\n")
25
26 #endif