-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathconfig.go
More file actions
70 lines (57 loc) · 1.13 KB
/
config.go
File metadata and controls
70 lines (57 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package serial
type Config struct {
// Device Name (ex. "COM1" on Windows, "/dev/ttyUSB0" on Linux)
//
Device string
// Baud Rate, use BaudRate_*, default 9600
//
BaudRate int
// Data Bits per byte, use DataBits_*, default 8
//
DataBits int
// Stop Bits per byte, use StopBits_*, default 1
//
StopBits int
// Parity, use Parity_*, default None
//
Parity int
// termios VMIN, default 1
//
// see 'man termios(3)'
//
VMIN uint8
// termios VTIME, default 0
//
VTIME uint8
// win32 COMMTIMEOUTS
//
// see http://msdn.microsoft.com/en-us/library/windows/desktop/aa363190(v=vs.85).aspx/html
//
ReadIntervalTimeout uint32
ReadTotalTimeoutMultiplier uint32
ReadTotalTimeoutConstant uint32
WriteTotalTimeoutMultiplier uint32
WriteTotalTimeoutConstant uint32
}
const (
BaudRate_9600 = 9600
BaudRate_14400 = 14400
BaudRate_19200 = 19200
BaudRate_38400 = 38400
BaudRate_57600 = 57600
BaudRate_115200 = 115200
)
const (
DataBits_5 int = 2000000
DataBits_6 = iota
DataBits_7
DataBits_8
StopBits_1
StopBits_1_5
StopBits_2
Parity_None
Parity_Odd
Parity_Even
Parity_Mark
Parity_Space
)