File tree 2 files changed +14
-14
lines changed
2 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -83,19 +83,6 @@ func (sh *serialhub) Unregister(port *serport) {
83
83
sh .mu .Unlock ()
84
84
}
85
85
86
- // Write data to the serial port.
87
- func (sh * serialhub ) Write (port * serport , data string , sendMode string ) {
88
- // if user sent in the commands as one text mode line
89
- switch sendMode {
90
- case "send" :
91
- port .sendBuffered <- data
92
- case "sendnobuf" :
93
- port .sendNoBuf <- []byte (data )
94
- case "sendraw" :
95
- port .sendRaw <- data
96
- }
97
- }
98
-
99
86
func (sh * serialhub ) FindPortByName (portname string ) (* serport , bool ) {
100
87
sh .mu .Lock ()
101
88
defer sh .mu .Unlock ()
@@ -328,5 +315,5 @@ func spWrite(arg string) {
328
315
}
329
316
330
317
// send it to the write channel
331
- sh .Write (port , data , bufferingMode )
318
+ port .Write (data , bufferingMode )
332
319
}
Original file line number Diff line number Diff line change @@ -174,6 +174,19 @@ func (p *serport) reader(buftype string) {
174
174
}
175
175
}
176
176
177
+ // Write data to the serial port.
178
+ func (p * serport ) Write (data string , sendMode string ) {
179
+ // if user sent in the commands as one text mode line
180
+ switch sendMode {
181
+ case "send" :
182
+ p .sendBuffered <- data
183
+ case "sendnobuf" :
184
+ p .sendNoBuf <- []byte (data )
185
+ case "sendraw" :
186
+ p .sendRaw <- data
187
+ }
188
+ }
189
+
177
190
// this method runs as its own thread because it's instantiated
178
191
// as a "go" method. so if it blocks inside, it is ok
179
192
func (p * serport ) writerBuffered () {
You can’t perform that action at this time.
0 commit comments