Commit ae38ed03 authored by Kevin Lyda's avatar Kevin Lyda 💬
Browse files

Work on GetConfiguration.

parent 68a4c89c
Pipeline #1233 passed with stage
in 56 seconds
......@@ -452,7 +452,8 @@ func (gc *GQGMCCounter) recv(length int) ([]byte, error) {
}
if n != length {
for i := 0; i < 20; i++ {
_, err = gc.port.Read(buf[len(buf):])
fmt.Printf("%d ", n)
n, err = gc.port.Read(buf[len(buf):])
if err != nil {
return nil, err
}
......@@ -460,9 +461,11 @@ func (gc *GQGMCCounter) recv(length int) ([]byte, error) {
break
}
}
fmt.Printf("%d\n", n)
}
if n != length {
return nil, fmt.Errorf("Short read (got: %d, wanted: %d)", uint32(n), length)
fmt.Printf("Short read: %+v\n", buf)
return nil, fmt.Errorf("Short read (got: %d, wanted: %d)", n, length)
}
return buf, nil
}
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