@@ -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)
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user