Commit 13e4ab24 authored by Kevin Lyda's avatar Kevin Lyda 💬
Browse files

Work on GetConfiguration.

parent b1c42252
Pipeline #1235 passed with stage
in 58 seconds
......@@ -450,20 +450,22 @@ func (gc *GQGMCCounter) recv(length int) ([]byte, error) {
if err != nil {
return nil, err
}
read := n
if n != length {
for i := 0; i < 20; i++ {
fmt.Printf("%d(%d) ", n, len(buf))
n, err = gc.port.Read(buf[len(buf):])
fmt.Printf("%d(%d) ", n, read)
n, err = gc.port.Read(buf[read:])
if err != nil {
return nil, err
}
if len(buf) == length {
read += n
if read == length {
break
}
}
fmt.Printf("%d(%d)\n", n, len(buf))
fmt.Printf("%d(%d)\n", n, read)
}
if len(buf) != length {
if read != length {
fmt.Printf("Short read: %+v\n", buf)
return nil, fmt.Errorf("Short read (got: %d, wanted: %d)", n, length)
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment