diff --git a/serial_linux.go b/serial_linux.go index 65420f3..ba0e802 100644 --- a/serial_linux.go +++ b/serial_linux.go @@ -5,6 +5,7 @@ package serial import ( "fmt" "os" + "syscall" "time" "unsafe" @@ -95,6 +96,10 @@ func openPort(name string, baud int, databits byte, parity Parity, stopbits Stop cflagToUse |= unix.PARODD case ParityEven: cflagToUse |= unix.PARENB + case ParityMark: + cflagToUse |= syscall.PARENB + cflagToUse |= unix.CMSPAR + cflagToUse |= syscall.PARODD default: return nil, ErrBadParity }