README.md file is updated.

This commit is contained in:
Foil-hat-guy 2025-05-18 22:09:04 +03:00
parent f1cbf9c85d
commit 3db2249957
No known key found for this signature in database
GPG key ID: 221CC305A7B23591

View file

@ -2,8 +2,10 @@
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.
- set tty baudrate
- check tty baudrate
- test if selected baudrate is available for some tty
- test if a given file is a tty
-------------
@ -20,16 +22,16 @@ import (
)
```
3. Create new stty object by means of **Get()** function:
3. Test if some file is a tty:
```go
sttyControl, err := stty.Get()
err := stty.ValidateTtyFile("/dev/ttyUSB0")
```
If **stty** is unavailable at the current system this function will
return an error.
4. Use stty object to perform some tasks. For instance, test if baudrate of 9600
is available at **/dev/ttyUSB0**:
```go
ok, err := sttyControl.TestBaudRate("/dev/ttyUSB0", 9600)
```
err := stty.CMD().TestBaudRate("/dev/ttyUSB0", 9600)
```
If **stty** is not available stty, all methods of object returned by CMD() function
will return ERR_TTY_MISSING error.