From 8ce3c0c770ef95f9b994eabb8e46faafd8703c28 Mon Sep 17 00:00:00 2001 From: Chris Liechti Date: Sat, 27 Aug 2016 23:54:51 +0200 Subject: parity: new PARITY_IGNORE setting (posix/win32) see #154 for discussion --- serial/serialposix.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'serial/serialposix.py') diff --git a/serial/serialposix.py b/serial/serialposix.py index 30af312..27f97f3 100644 --- a/serial/serialposix.py +++ b/serial/serialposix.py @@ -360,6 +360,9 @@ class Serial(SerialBase, PlatformSpecific): elif self._parity == serial.PARITY_SPACE and plat[:5] == 'linux': cflag |= (termios.PARENB | CMSPAR) cflag &= ~(termios.PARODD) + elif self._parity == serial.PARITY_IGNORE: + cflag |= termios.PARENB # enable parity bit + iflag |= termios.IGNPAR # ignore its value / no error report else: raise ValueError('Invalid parity: {!r}'.format(self._parity)) # setup flow control -- cgit v1.2.1