diff --git a/README.md b/README.md index aa92b9f..763e3ef 100644 --- a/README.md +++ b/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) -``` \ No newline at end of file + 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. \ No newline at end of file