Added Set(...) method to set all comm-params altogether

This commit is contained in:
Cristian Maglie
2014-12-15 18:43:09 +01:00
parent ff10f48795
commit fffcc61237
2 changed files with 65 additions and 18 deletions

View File

@@ -10,9 +10,6 @@ import "io"
// SerialPort object
type SerialPort interface {
// Read(p []byte) (n int, err error)
// Write(p []byte) (n int, err error)
// Close() error
io.ReadWriteCloser
// Set port speed
@@ -26,6 +23,9 @@ type SerialPort interface {
// Set stop bits
SetStopBits(bits StopBits) error
// Set all parameters together
Set(baudrate int, parity Parity, databits int, stopbits StopBits) error
}
type Parity int