Documentation ¶
Overview ¶
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.
Index ¶
- func CBreakMode(t *Term) error
- func RawMode(t *Term) error
- func Speed(baud int) func(*Term) error
- type Term
- func (t *Term) Available() (int, error)
- func (t *Term) Buffered() (int, error)
- func (t *Term) Close() error
- func (t *Term) DTR() (bool, error)
- func (t *Term) Flush() error
- func (t *Term) RTS() (bool, error)
- func (t *Term) Read(b []byte) (int, error)
- func (t *Term) Restore() error
- func (t *Term) SendBreak() error
- func (t *Term) SetCbreak() error
- func (t *Term) SetDTR(v bool) error
- func (t *Term) SetOption(options ...func(*Term) error) error
- func (t *Term) SetRTS(v bool) error
- func (t *Term) SetRaw() error
- func (t *Term) SetSpeed(baud int) error
- func (t *Term) Write(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Term ¶
type Term struct {
// contains filtered or unexported fields
}
Term represents an asynchronous communications port.
func (*Term) Buffered ¶
Buffered returns the number of bytes that have been written into the current buffer.
func (*Term) Flush ¶
Flush flushes both data received but not read, and data written but not transmitted.
func (*Term) Read ¶
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 (*Term) Restore ¶
Restore restores the state of the terminal captured at the point that the terminal was originally opened.
func (*Term) SetOption ¶
SetOption takes one or more option function and applies them in order to Term.