import "github.com/pkg/term"
Package term manages POSIX terminals. As POSIX terminals are connected to, or emulate, a UART, this package also provides control over the various UART and serial line parameters.
func CBreakMode(t *Term) errorCBreakMode places the terminal into cbreak mode.
func RawMode(t *Term) errorRawMode places the terminal into raw mode.
func Speed(baud int) func(*Term) errorSpeed sets the baud rate option for the terminal.
type Term struct {
// contains filtered or unexported fields
}Term represents an asynchronous communications port.
func Open(name string, options ...func(*Term) error) (*Term, error)Open opens an asynchronous communications port.
func (t *Term) Available() (int, error)Available returns how many bytes are unused in the buffer.
func (t *Term) Buffered() (int, error)Buffered returns the number of bytes that have been written into the current buffer.
func (t *Term) Close() errorClose closes the device and releases any associated resources.
func (t *Term) DTR() (bool, error)DTR returns the state of the DTR (data terminal ready) signal.
func (t *Term) Flush() errorFlush flushes both data received but not read, and data written but not transmitted.
func (t *Term) RTS() (bool, error)RTS returns the state of the RTS (data terminal ready) signal.
func (t *Term) Read(b []byte) (int, error)Read reads up to len(b) bytes from the terminal. It returns the number of bytes read and an error, if any. EOF is signaled by a zero count with err set to io.EOF.
func (t *Term) Restore() errorRestore restores the state of the terminal captured at the point that the terminal was originally opened.
func (t *Term) SendBreak() errorSendBreak sends a break signal.
func (t *Term) SetCbreak() errorSetCbreak sets cbreak mode.
func (t *Term) SetDTR(v bool) errorSetDTR sets the DTR (data terminal ready) signal.
func (t *Term) SetOption(options ...func(*Term) error) errorSetOption takes one or more option function and applies them in order to Term.
func (t *Term) SetRTS(v bool) errorSetRTS sets the RTS (data terminal ready) signal.
func (t *Term) SetRaw() errorSetRaw sets raw mode.
func (t *Term) SetSpeed(baud int) errorSetSpeed sets the receive and transmit baud rates.
func (t *Term) Write(b []byte) (int, error)Write writes len(b) bytes to the terminal. It returns the number of bytes written and an error, if any. Write returns a non-nil error when n != len(b).
Generated by godoc2md