File tree 1 file changed +9
-13
lines changed
1 file changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -101,7 +101,15 @@ func (sh *serialhub) run() {
101
101
sh .mu .Unlock ()
102
102
case wr := <- sh .write :
103
103
// if user sent in the commands as one text mode line
104
- write (wr )
104
+ switch wr .buffer {
105
+ case "send" :
106
+ wr .p .sendBuffered <- wr .d
107
+ case "sendnobuf" :
108
+ wr .p .sendNoBuf <- []byte (wr .d )
109
+ case "sendraw" :
110
+ wr .p .sendRaw <- wr .d
111
+ }
112
+ // no default since we alredy verified in spWrite()
105
113
}
106
114
}
107
115
}
@@ -120,18 +128,6 @@ func (sh *serialhub) FindPortByName(portname string) (*serport, bool) {
120
128
return nil , false
121
129
}
122
130
123
- func write (wr writeRequest ) {
124
- switch wr .buffer {
125
- case "send" :
126
- wr .p .sendBuffered <- wr .d
127
- case "sendnobuf" :
128
- wr .p .sendNoBuf <- []byte (wr .d )
129
- case "sendraw" :
130
- wr .p .sendRaw <- wr .d
131
- }
132
- // no default since we alredy verified in spWrite()
133
- }
134
-
135
131
// List broadcasts a Json representation of the ports found
136
132
func (sp * SerialPortList ) List () {
137
133
sp .portsLock .Lock ()
You can’t perform that action at this time.
0 commit comments