Skip to content

Commit

Permalink
Added informative comment
Browse files Browse the repository at this point in the history
  • Loading branch information
cmaglie committed Aug 9, 2023
1 parent bafe313 commit cce2170
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions serial_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,8 @@ func setTermSettingsBaudrate(speed int, settings *unix.Termios) (error, bool) {
}

func (port *unixPort) Drain() error {
// It's not super well documented, but this is the same as calling tcdrain:
// - https://git.musl-libc.org/cgit/musl/tree/src/termios/tcdrain.c
// - https://elixir.bootlin.com/linux/v6.2.8/source/drivers/tty/tty_io.c#L2673
return unix.IoctlSetInt(port.handle, unix.TCSBRK, 1)
}

0 comments on commit cce2170

Please sign in to comment.