No description
go.mod | ||
LICENSE | ||
README.md | ||
stty.go |
The "STTY" package
This package provides simplified way to invoke stty utility to perform some tasks by means of it. For now the only a few number of functions are implemented: set tty baudrate, check tty baudrate and test if selected baudrate is available for some tty.
Usage
- Download the package by go get command:
go get code.foilhatguy.casa/pub/stty
- Import package to your golang code:
import (
"code.foilhatguy.casa/pub/stty"
)
- Create new stty object by means of Get() function:
sttyControl, err := stty.Get()
If stty is unavailable at the current system this function will return an error.
- Use stty object to perform some tasks. For instance, test if baudrate of 9600 is available at /dev/ttyUSB0:
ok, err := sttyControl.TestBaudRate("/dev/ttyUSB0", 9600)