v1.1.0 Latest Latest

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: BSD-2-Clause Imports: 5 Imported by: 151



Package termios implements the low level termios(3) terminal line discipline facilities.

For a higher level interface please use the github.com/pkg/term package.



View Source
const (

	TCSANOW   = 0
View Source
const (
	TCSETS  = 0x5402
	TCSETSW = 0x5403
	TCSETSF = 0x5404
	TCFLSH  = 0x540B
	TCSBRK  = 0x5409
	TCSBRKP = 0x5425

	IXON    = 0x00000400
	IXANY   = 0x00000800
	IXOFF   = 0x00001000
	CRTSCTS = 0x80000000


This section is empty.


func Cfgetispeed

func Cfgetispeed(attr *unix.Termios) uint32

Cfgetispeed returns the input baud rate stored in the termios structure.

func Cfgetospeed

func Cfgetospeed(attr *unix.Termios) uint32

Cfgetospeed returns the output baud rate stored in the termios structure.

func Cfmakecbreak

func Cfmakecbreak(attr *unix.Termios)

Cfmakecbreak modifies attr for cbreak mode.

func Cfmakeraw

func Cfmakeraw(attr *unix.Termios)

Cfmakeraw modifies attr for raw mode.

func Ptsname

func Ptsname(fd uintptr) (string, error)

func Pty

func Pty() (*os.File, *os.File, error)

Pty returns a UNIX 98 pseudoterminal device. Pty returns a pair of fds representing the master and slave pair.

func Tcdrain

func Tcdrain(fd uintptr) error

Tcdrain waits until all output written to the object referred to by fd has been transmitted.

func Tcflush

func Tcflush(fd, selector uintptr) error

Tcflush discards data written to the object referred to by fd but not transmitted, or data received but not read, depending on the value of selector.

func Tcgetattr

func Tcgetattr(fd uintptr, argp *unix.Termios) error

Tcgetattr gets the current serial port settings.

func Tcsendbreak

func Tcsendbreak(fd, duration uintptr) error

Tcsendbreak transmits a continuous stream of zero-valued bits for a specific duration, if the terminal is using asynchronous serial data transmission. If duration is zero, it transmits zero-valued bits for at least 0.25 seconds, and not more that 0.5 seconds. If duration is not zero, it sends zero-valued bits for some implementation-defined length of time.

func Tcsetattr

func Tcsetattr(fd, action uintptr, argp *unix.Termios) error

Tcsetattr sets the current serial port settings.

func Tiocinq

func Tiocinq(fd uintptr) (int, error)

Tiocinq returns the number of bytes in the input buffer.

func Tiocmbic

func Tiocmbic(fd uintptr, status int) error

Tiocmbic clears the indicated modem bits.

func Tiocmbis

func Tiocmbis(fd uintptr, status int) error

Tiocmbis sets the indicated modem bits.

func Tiocmget

func Tiocmget(fd uintptr) (int, error)

Tiocmget returns the state of the MODEM bits.

func Tiocmset

func Tiocmset(fd uintptr, status int) error

Tiocmset sets the state of the MODEM bits.

func Tiocoutq

func Tiocoutq(fd uintptr) (int, error)

Tiocoutq return the number of bytes in the output buffer.


This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL