Skip to content

Commit

Permalink
Add support for missing baudrates between 50 and 1200
Browse files Browse the repository at this point in the history
  • Loading branch information
j-vizcaino committed May 3, 2016
1 parent a53c419 commit a71a8ff
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions serial_posix.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,24 @@ func openPort(name string, baud int, databits byte, parity Parity, stopbits Stop
speed = C.B4800
case 2400:
speed = C.B2400
case 1200:
speed = C.B1200
case 600:
speed = C.B600
case 300:
speed = C.B300
case 200:
speed = C.B200
case 150:
speed = C.B150
case 134:
speed = C.B134
case 110:
speed = C.B110
case 75:
speed = C.B75
case 50:
speed = C.B50
default:
f.Close()
return nil, fmt.Errorf("Unknown baud rate %v", baud)
Expand Down

0 comments on commit a71a8ff

Please sign in to comment.