diff --git a/serial_darwin.go b/serial_darwin.go index ad970a8..a9c8109 100644 --- a/serial_darwin.go +++ b/serial_darwin.go @@ -46,6 +46,11 @@ var databitsMap = map[int]int{ const tcCMSPAR int = 0 // may be CMSPAR or PAREXT const tcIUCLC int = 0 +const tcCCTS_OFLOW int = 0x00010000 +const tcCRTS_IFLOW int = 0x00020000 + +const tcCRTSCTS int = (tcCCTS_OFLOW | tcCRTS_IFLOW) + // syscall wrappers //sys ioctl(fd int, req uint64, data uintptr) (err error) diff --git a/serial_freebsd.go b/serial_freebsd.go index 318e25c..55b02f8 100644 --- a/serial_freebsd.go +++ b/serial_freebsd.go @@ -48,6 +48,11 @@ var databitsMap = map[int]int{ const tcCMSPAR int = 0 // may be CMSPAR or PAREXT const tcIUCLC int = 0 +const tcCCTS_OFLOW int = 0x00010000 +const tcCRTS_IFLOW int = 0x00020000 + +const tcCRTSCTS int = tcCCTS_OFLOW + func termiosMask(data int) uint32 { return uint32(data) } diff --git a/serial_linux.go b/serial_linux.go index 983975f..9308ace 100644 --- a/serial_linux.go +++ b/serial_linux.go @@ -58,6 +58,8 @@ var databitsMap = map[int]int{ const tcCMSPAR int = 0 // may be CMSPAR or PAREXT const tcIUCLC = syscall.IUCLC +const tcCRTSCTS int = 0x80000000 + func termiosMask(data int) uint32 { return uint32(data) } diff --git a/serial_unix.go b/serial_unix.go index d03c4bd..c71dc53 100644 --- a/serial_unix.go +++ b/serial_unix.go @@ -203,6 +203,9 @@ func setRawMode(settings *syscall.Termios) { // Set local mode settings.Cflag |= termiosMask(syscall.CREAD | syscall.CLOCAL) + // Explicitly disable RTS/CTS flow control + settings.Cflag &= ^termiosMask(tcCRTSCTS) + // Set raw mode settings.Lflag &= ^termiosMask(syscall.ICANON | syscall.ECHO | syscall.ECHOE | syscall.ECHOK | syscall.ECHONL | syscall.ECHOCTL | syscall.ECHOPRT | syscall.ECHOKE | syscall.ISIG | syscall.IEXTEN)