Skip to content

Commit

Permalink
Merge pull request #44 from j-vizcaino/master
Browse files Browse the repository at this point in the history
Add support for missing baudrates between 50 and 1200.

Also closes #41
  • Loading branch information
tarm committed May 6, 2016
2 parents a53c419 + a71a8ff commit 8f6b208
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 8f6b208

Please sign in to comment.