From ae38ed0355cbcda397df676f6d6913b552efef67 Mon Sep 17 00:00:00 2001
From: Kevin Lyda <kevin@ie.suberic.net>
Date: Wed, 1 Feb 2017 21:58:09 +0000
Subject: [PATCH] Work on GetConfiguration.

---
 devices/geiger/gqgmc.go | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/devices/geiger/gqgmc.go b/devices/geiger/gqgmc.go
index 6875b36..c16f7d8 100644
--- a/devices/geiger/gqgmc.go
+++ b/devices/geiger/gqgmc.go
@@ -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
 }
-- 
GitLab