Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gqgmc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
gqgmc
Commits
da2b152e
There was a problem fetching the pipeline summary.
Commit
da2b152e
authored
Jan 30, 2017
by
Kevin Lyda
Browse files
Options
Downloads
Patches
Plain Diff
Flesh it out more.
parent
85158cc3
Branches
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/geiger/gqgmc.go
+10
-13
10 additions, 13 deletions
devices/geiger/gqgmc.go
with
10 additions
and
13 deletions
devices/geiger/gqgmc.go
+
10
−
13
View file @
da2b152e
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
package
geiger
package
geiger
import
(
import
(
"errors"
"fmt"
"fmt"
"time"
"time"
...
@@ -356,17 +357,13 @@ func (gc *GQGMCCounter) sendCmd(cmd []byte) {
...
@@ -356,17 +357,13 @@ func (gc *GQGMCCounter) sendCmd(cmd []byte) {
}
}
func
(
gc
*
GQGMCCounter
)
readCmdReturn
(
length
uint32
)
([]
byte
,
error
)
{
func
(
gc
*
GQGMCCounter
)
readCmdReturn
(
length
uint32
)
([]
byte
,
error
)
{
// Now read the returned raw byte string. Do this by reading one byte
buf
:=
make
([]
byte
,
length
)
// at a time until the requested number of bytes are attained. However,
n
,
err
:=
gc
.
port
.
Read
(
buf
)
// the serial port has been setup to timeout each read attempt. So if
if
err
!=
nil
{
// after N calls to read, we haven't yet read all N bytes, declare
return
nil
,
err
// a failure. The read is done this way to avoid an indefinite blocking
}
// situation when 0 bytes are returned by the GQ GMC. The only good thing
if
uint32
(
n
)
!=
length
{
// about this methodology is that the largest possible read is only 4K
return
nil
,
errors
.
New
(
"Short read"
)
// for the history data. So the read never really takes that much time.
}
//for(uint32_t i=0; i<retbytes; i++)
return
buf
,
nil
// rcvd += read(mUSB_serial, inp, 1);
// inp = &retdata[rcvd];
// if (rcvd >= retbytes) break;
return
nil
,
nil
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment