Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Kevin Lyda
gqgmc
Commits
13e4ab24
Commit
13e4ab24
authored
Feb 01, 2017
by
Kevin Lyda
💬
Browse files
Work on GetConfiguration.
parent
b1c42252
Pipeline
#1235
passed with stage
in 58 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
devices/geiger/gqgmc.go
View file @
13e4ab24
...
...
@@ -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
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment