misc: updated dependencies

This commit is contained in:
evilsocket 2018-09-13 13:22:40 +02:00
parent 678865cd6d
commit c8f60e5968
No known key found for this signature in database
GPG key ID: 1564D7F30393A456
201 changed files with 32341 additions and 3357 deletions

View file

@ -3,6 +3,7 @@
package serial
import (
"fmt"
"os"
"time"
"unsafe"
@ -44,10 +45,10 @@ func openPort(name string, baud int, databits byte, parity Parity, stopbits Stop
4000000: unix.B4000000,
}
rate := bauds[baud]
rate, ok := bauds[baud]
if rate == 0 {
return
if !ok {
return nil, fmt.Errorf("Unrecognized baud rate")
}
f, err := os.OpenFile(name, unix.O_RDWR|unix.O_NOCTTY|unix.O_NONBLOCK, 0666)