protocol: support \r\n from serial output
This commit is contained in:
parent
6e6f61d04b
commit
6e5bf54598
1 changed files with 4 additions and 4 deletions
|
|
@ -75,7 +75,9 @@ func deserialise(in io.Reader, init []byte) (*Result, []byte, error) {
|
|||
for i := 0; i < n2; i++ {
|
||||
// '\r' is really '\n'
|
||||
if data[i] == '\r' {
|
||||
data[i] = '\n'
|
||||
data = append(data[:i], data[i+1:]...)
|
||||
n2--
|
||||
continue
|
||||
}
|
||||
|
||||
if data[i] == 0x4 {
|
||||
|
|
@ -83,15 +85,13 @@ func deserialise(in io.Reader, init []byte) (*Result, []byte, error) {
|
|||
want_output = false
|
||||
output = data[:i]
|
||||
data = data[i+1:]
|
||||
/*
|
||||
// The TBM gives us our own commands back
|
||||
for j := 0; j < len(output); j++ {
|
||||
if output[j] == '\r' {
|
||||
if output[j] == '\n' {
|
||||
output = output[j+1:]
|
||||
break
|
||||
}
|
||||
}
|
||||
*/
|
||||
break
|
||||
} else {
|
||||
errorcode = data[:i]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue