mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
Add support for space parity
This commit is contained in:
parent
bf972bd2f9
commit
360deb3c72
2 changed files with 10 additions and 2 deletions
|
|
@ -34,9 +34,11 @@ Set flow control (default: none).
|
|||
|
||||
Set stop bits (default: 1).
|
||||
.TP
|
||||
.BR \-p ", " "\-\-parity odd" | even | none | mark
|
||||
.BR \-p ", " "\-\-parity odd" | even | none | mark | space
|
||||
|
||||
Set parity (default: none).
|
||||
|
||||
Note: With mark parity the parity bit is always 0. With space parity the parity bit is always 1. Not all platforms support mark and space parity.
|
||||
.TP
|
||||
.BR \-o ", " "\-\-output\-delay " \fI<ms>
|
||||
|
||||
|
|
|
|||
|
|
@ -625,10 +625,16 @@ void tty_configure(void)
|
|||
}
|
||||
else if ( strcmp("mark", option.parity) == 0)
|
||||
{
|
||||
tio.c_cflag &= ~PARENB;
|
||||
tio.c_cflag |= PARENB;
|
||||
tio.c_cflag |= PARODD;
|
||||
tio.c_cflag |= CMSPAR;
|
||||
}
|
||||
else if ( strcmp("space", option.parity) == 0)
|
||||
{
|
||||
tio.c_cflag |= PARENB;
|
||||
tio.c_cflag &= ~PARODD;
|
||||
tio.c_cflag |= CMSPAR;
|
||||
}
|
||||
else
|
||||
{
|
||||
error_printf("Invalid parity");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue