@@ -36,7 +36,7 @@ type serport struct {
36
36
sendBuffered chan string
37
37
38
38
// unbuffered channel of outbound messages that bypass internal serial port buffer
39
- sendNoBuf chan string
39
+ sendNoBuf chan [] byte
40
40
41
41
// Do we have an extra channel/thread to watch our buffer?
42
42
BufferType string
@@ -180,7 +180,7 @@ func (p *serport) writerBuffered() {
180
180
} else {
181
181
// send to the non-buffered serial port writer
182
182
//log.Println("About to send to p.sendNoBuf channel")
183
- p .sendNoBuf <- data
183
+ p .sendNoBuf <- [] byte ( data )
184
184
}
185
185
}
186
186
msgstr := "writerBuffered just got closed. make sure you make a new one. port:" + p .portConf .Name
@@ -204,7 +204,7 @@ func (p *serport) writerNoBuf() {
204
204
205
205
// FINALLY, OF ALL THE CODE IN THIS PROJECT
206
206
// WE TRULY/FINALLY GET TO WRITE TO THE SERIAL PORT!
207
- n2 , err := p .portIo .Write ([] byte ( data ) )
207
+ n2 , err := p .portIo .Write (data )
208
208
209
209
log .Print ("Just wrote " , n2 , " bytes to serial: " , string (data ))
210
210
if err != nil {
@@ -254,7 +254,7 @@ func spHandlerOpen(portname string, baud int, buftype string) {
254
254
log .Print ("Opened port successfully" )
255
255
//p := &serport{send: make(chan []byte, 256), portConf: conf, portIo: sp}
256
256
// we can go up to 256,000 lines of gcode in the buffer
257
- p := & serport {sendBuffered : make (chan string , 256000 ), sendNoBuf : make (chan string ), portConf : conf , portIo : sp , BufferType : buftype }
257
+ p := & serport {sendBuffered : make (chan string , 256000 ), sendNoBuf : make (chan [] byte ), portConf : conf , portIo : sp , BufferType : buftype }
258
258
259
259
var bw Bufferflow
260
260
0 commit comments