diff options
author | Chris Liechti <cliechti@gmx.net> | 2016-08-27 23:54:51 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2016-08-27 23:54:51 +0200 |
commit | 8ce3c0c770ef95f9b994eabb8e46faafd8703c28 (patch) | |
tree | 3b828704fd031f79af51205de96f29ac15316a0f /serial/serialposix.py | |
parent | c9f8996d2cdaa676e7e99d102d0e2cc67bce9f59 (diff) | |
download | pyserial-git-8ce3c0c770ef95f9b994eabb8e46faafd8703c28.tar.gz |
parity: new PARITY_IGNORE setting (posix/win32)issue-154
see #154 for discussion
Diffstat (limited to 'serial/serialposix.py')
-rw-r--r-- | serial/serialposix.py | 3 |
1 files changed, 3 insertions, 0 deletions
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 |