initial
[smouse] / src / serial.h
1 #ifndef SERIAL_H_
2 #define SERIAL_H_
3
4 #define SER_8N1         0
5 #define SER_8N2         1
6 #define SER_HWFLOW      2
7
8 int ser_open(const char *port, int baud, unsigned int mode);
9 void ser_close(int fd);
10
11 int ser_pending(int fd);
12 /* if msec < 0: wait for ever */
13 int ser_wait(int fd, long msec);
14
15 int ser_write(int fd, const char *buf, int count);
16 int ser_read(int fd, char *buf, int count);
17
18 void ser_printf(int fd, const char *fmt, ...);
19 char *ser_getline(int fd, char *buf, int bsz);
20
21 #endif  /* SERIAL_H_ */