README.md file is updated.
This commit is contained in:
parent
f1cbf9c85d
commit
3db2249957
1 changed files with 11 additions and 9 deletions
20
README.md
20
README.md
|
@ -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.
|
Loading…
Add table
Reference in a new issue