Rework for Linux & BSD differences
This commit is contained in:
committed by
Cristian Maglie
parent
ff38fe2a78
commit
bafe313749
@@ -1,5 +1,4 @@
|
||||
//go:build darwin || dragonfly || freebsd || netbsd || openbsd
|
||||
// +build darwin dragonfly freebsd netbsd openbsd
|
||||
|
||||
package serial
|
||||
|
||||
|
||||
@@ -87,11 +87,5 @@ func setTermSettingsBaudrate(speed int, settings *unix.Termios) (error, bool) {
|
||||
}
|
||||
|
||||
func (port *unixPort) Drain() error {
|
||||
// simulate drain with change settings with TCSETSW
|
||||
settings, err := port.getTermSettings()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return unix.IoctlSetTermios(port.handle, unix.TCSETSW, settings)
|
||||
return unix.IoctlSetInt(port.handle, unix.TCSBRK, 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user