No description
Find a file
2025-05-05 01:33:01 +03:00
dummy.go Error handeling by means of errors.Is 2025-05-05 00:00:56 +03:00
error.go Test if Unwrap method is supported is added. 2025-05-05 01:22:01 +03:00
go.mod Validate tty file name function is added. 2025-04-30 02:02:55 +03:00
go.sum Validate tty file name function is added. 2025-04-30 02:02:55 +03:00
LICENSE First commit. 2025-04-28 22:57:43 +03:00
README.md README.md is updated. 2025-04-28 23:15:37 +03:00
real.go Fixed set baudrate error handeling. 2025-05-05 00:39:35 +03:00
stty.go Testing patherror fix. 2025-05-05 01:33:01 +03:00

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

  1. Download the package by go get command:
go get code.foilhatguy.casa/pub/stty
  1. Import package to your golang code:
import (
	"code.foilhatguy.casa/pub/stty"
)
  1. 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.

  1. 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)