-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathPort.go
178 lines (141 loc) · 3.22 KB
/
Port.go
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
// Code generated by mockery v0.0.0-dev. DO NOT EDIT.
package mocks
import (
mock "github.com/stretchr/testify/mock"
go_bug_stserial "go.bug.st/serial"
time "time"
)
// Port is an autogenerated mock type for the Port type
type Port struct {
mock.Mock
}
// Close provides a mock function with given fields:
func (_m *Port) Close() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// GetModemStatusBits provides a mock function with given fields:
func (_m *Port) GetModemStatusBits() (*go_bug_stserial.ModemStatusBits, error) {
ret := _m.Called()
var r0 *go_bug_stserial.ModemStatusBits
if rf, ok := ret.Get(0).(func() *go_bug_stserial.ModemStatusBits); ok {
r0 = rf()
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(*go_bug_stserial.ModemStatusBits)
}
}
var r1 error
if rf, ok := ret.Get(1).(func() error); ok {
r1 = rf()
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Read provides a mock function with given fields: p
func (_m *Port) Read(p []byte) (int, error) {
ret := _m.Called(p)
var r0 int
if rf, ok := ret.Get(0).(func([]byte) int); ok {
r0 = rf(p)
} else {
r0 = ret.Get(0).(int)
}
var r1 error
if rf, ok := ret.Get(1).(func([]byte) error); ok {
r1 = rf(p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// ResetInputBuffer provides a mock function with given fields:
func (_m *Port) ResetInputBuffer() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// ResetOutputBuffer provides a mock function with given fields:
func (_m *Port) ResetOutputBuffer() error {
ret := _m.Called()
var r0 error
if rf, ok := ret.Get(0).(func() error); ok {
r0 = rf()
} else {
r0 = ret.Error(0)
}
return r0
}
// SetDTR provides a mock function with given fields: dtr
func (_m *Port) SetDTR(dtr bool) error {
ret := _m.Called(dtr)
var r0 error
if rf, ok := ret.Get(0).(func(bool) error); ok {
r0 = rf(dtr)
} else {
r0 = ret.Error(0)
}
return r0
}
// SetMode provides a mock function with given fields: mode
func (_m *Port) SetMode(mode *go_bug_stserial.Mode) error {
ret := _m.Called(mode)
var r0 error
if rf, ok := ret.Get(0).(func(*go_bug_stserial.Mode) error); ok {
r0 = rf(mode)
} else {
r0 = ret.Error(0)
}
return r0
}
// SetRTS provides a mock function with given fields: rts
func (_m *Port) SetRTS(rts bool) error {
ret := _m.Called(rts)
var r0 error
if rf, ok := ret.Get(0).(func(bool) error); ok {
r0 = rf(rts)
} else {
r0 = ret.Error(0)
}
return r0
}
// SetReadTimeout provides a mock function with given fields: t
func (_m *Port) SetReadTimeout(t time.Duration) error {
ret := _m.Called(t)
var r0 error
if rf, ok := ret.Get(0).(func(time.Duration) error); ok {
r0 = rf(t)
} else {
r0 = ret.Error(0)
}
return r0
}
// Write provides a mock function with given fields: p
func (_m *Port) Write(p []byte) (int, error) {
ret := _m.Called(p)
var r0 int
if rf, ok := ret.Get(0).(func([]byte) int); ok {
r0 = rf(p)
} else {
r0 = ret.Get(0).(int)
}
var r1 error
if rf, ok := ret.Get(1).(func([]byte) error); ok {
r1 = rf(p)
} else {
r1 = ret.Error(1)
}
return r0, r1
}