Fixed set baudrate error handeling.
This commit is contained in:
parent
a4eb5389e0
commit
f10f105886
1 changed files with 4 additions and 1 deletions
3
real.go
3
real.go
|
@ -11,7 +11,10 @@ type real struct {
|
|||
func (r *real) SetBaudRate(portPath string, baudrate int) error {
|
||||
setBaudRateCMD := exec.Command("stty", "-F", portPath, fmt.Sprint(baudrate))
|
||||
_, err := setBaudRateCMD.Output()
|
||||
if err != nil {
|
||||
return errStack(ERR_SET_BAUDRATE_FAILED(), err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (r *real) CheckBaudRate(portPath string) (baudrate int, err error) {
|
||||
|
|
Loading…
Add table
Reference in a new issue