6 typedef struct ev_io_ufr {
8 char uid_data[24]; // store uid here (uid is 10 bytes max)
9 char *uid; // current position in uid_data
10 int fd; // PORT_NAME file descriptor
13 typedef struct mt_rfid_t {
14 ev_io_ufr w; // reader watcher
15 int fd; // print JSON output here
20 // reader open parameters, see uFR manual
21 #define UFR_READER_TYPE 1 // uFR type (1Mbps)
22 #define UFR_PORT_INTERFACE 1 // serial; auto->ftdi->FAIL
23 #define UFR_PORT_NAME "/dev/ttyUSB0" // reader device
24 #define UFR_ASYNC_BAUD_RATE 1000000 // 1Mbps, otherwise UFR_COMMUNICATION_BREAK
26 #define UFR_BEEP // define this to annoy people
28 // connect to the reader, add self to loop and make it write to fd
29 // return 0 on success, negative number otherwise
30 int mt_rfid_init(mt_rfid_t *self, struct ev_loop *loop, int fd);
32 // disconnect from reader
33 void mt_rfid_deinit(mt_rfid_t *self);
37 #define mt_rfid_init(self, loop, fd) 0
38 #define mt_rfid_deinit(self) 0
40 #endif /* HAVE_RFID */