summaryrefslogtreecommitdiff
path: root/serial/serialposix.py
diff options
context:
space:
mode:
authorChris Liechti <cliechti@gmx.net>2016-08-27 23:54:51 +0200
committerChris Liechti <cliechti@gmx.net>2016-08-27 23:54:51 +0200
commit8ce3c0c770ef95f9b994eabb8e46faafd8703c28 (patch)
tree3b828704fd031f79af51205de96f29ac15316a0f /serial/serialposix.py
parentc9f8996d2cdaa676e7e99d102d0e2cc67bce9f59 (diff)
downloadpyserial-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.py3
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