term.c_iflag &= ~IGNPAR;
term.c_cflag &= ~(PARODD | PARENB);
switch (parity) {
- case 0:
+ case SERIAL_PARITY_NONE:
term.c_iflag |= IGNPAR;
break;
- case 1:
+ case SERIAL_PARITY_EVEN:
term.c_cflag |= PARENB;
break;
- case 2:
+ case SERIAL_PARITY_ODD:
term.c_cflag |= PARENB | PARODD;
break;
default:
fd = serial_open(l->data, O_RDWR | O_NONBLOCK);
if (fd != -1) {
serial_params[devcnt] = serial_backup_params(fd);
- serial_set_params(fd, 115200, 8, 0, 1, 2);
+ serial_set_params(fd, 115200, 8, SERIAL_PARITY_NONE, 1, 2);
ret = SR_OK;
for (i = 0; i < 5; i++) {
if ((ret = send_shortcommand(fd,
};
#endif
+#define SERIAL_PARITY_NONE 0
+#define SERIAL_PARITY_EVEN 1
+#define SERIAL_PARITY_ODD 2
struct sr_serial_dev_inst {
char *port;
int fd;