Fixed set baudrate error handeling.

This commit is contained in:
Foil-hat-guy 2025-05-05 00:39:35 +03:00
parent a4eb5389e0
commit f10f105886
No known key found for this signature in database
GPG key ID: 221CC305A7B23591

View file

@ -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()
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) {