We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e3a2cf6 commit 72bcdc1Copy full SHA for 72bcdc1
serialport.go
@@ -103,6 +103,12 @@ func (p *serport) reader() {
103
104
n, err := p.portIo.Read(ch)
105
106
+ if err != nil {
107
+ ch = append(buffered_ch.Bytes(), ch[:n]...)
108
+ n += len(buffered_ch.Bytes())
109
+ buffered_ch.Reset()
110
+ }
111
+
112
//if we detect that port is closing, break out o this for{} loop.
113
if p.isClosing {
114
strmsg := "Shutting down reader on " + p.portConf.Name
@@ -111,10 +117,6 @@ func (p *serport) reader() {
117
break
118
}
119
- ch = append(buffered_ch.Bytes(), ch[:n]...)
115
- n += len(buffered_ch.Bytes())
116
- buffered_ch.Reset()
-
120
// read can return legitimate bytes as well as an error
121
// so process the bytes if n > 0
122
if n > 0 {
0 commit comments