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