Skip to content

Commit 0e9eda5

Browse files
committed
Some cleanup and typos fixed.
1 parent 1f01513 commit 0e9eda5

3 files changed

Lines changed: 13 additions & 24 deletions

File tree

cmd/deviceparameter/deviceparameter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ type Options struct {
149149
Int32 string `long:"i32" description:"Set value, type is int32"`
150150
Int64 string `long:"i64" description:"Set value, type is int64"`
151151

152-
Debug []bool `short:"D" long:"debug" description:"Debug mode, print raw packets"`
153152
Quiet []bool `short:"Q" long:"quiet" description:"Quiet mode, print only values"`
153+
Debug []bool `short:"D" long:"debug" description:"Debug mode, print raw packets"`
154154
ShowVersion func() `short:"V" long:"version" description:"Show application version"`
155155
}
156156

cmd/deviceparameters/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ and it will be updated according to the information received from the node.
6868

6969
* `raw`:
7070
Values of the raw type are treated as hex strings and converted to binary.
71-
The value must have a length that is devisible by 2 and only contain symbols
71+
The value must have a length that is divisible by 2 and only contain symbols
7272
[0-9abcdef]. Value is not case sensitive.
7373
* `str`:
7474
String values are converted to binary using the ASCII encoding. For transmitting
@@ -82,13 +82,13 @@ and it will be updated according to the information received from the node.
8282
* `u64`:
8383
The value is converted to an unsigned 64-bit big-endian integer.
8484
* `i8`:
85-
The value is converted to an signed 8-bit big-endian integer.
85+
The value is converted to a signed 8-bit big-endian integer.
8686
* `i16`:
87-
The value is converted to an signed 16-bit big-endian integer.
87+
The value is converted to a signed 16-bit big-endian integer.
8888
* `i32`:
89-
The value is converted to an signed 32-bit big-endian integer.
89+
The value is converted to a signed 32-bit big-endian integer.
9090
* `i64`:
91-
The value is converted to an signed 64-bit big-endian integer.
91+
The value is converted to a signed 64-bit big-endian integer.
9292
* `nil`:
9393
The nil type can be used to set the length of variable length parameters
9494
(`raw` and `str`) to 0.
@@ -125,11 +125,11 @@ Options control connection parameters:
125125

126126
* `-g`, `--group`:
127127
option is used to set the ActiveMessage group. The default is 22,
128-
the value is trated as a hex string (0x22).
128+
the value is parsed as a hex string (0x22).
129129

130130
* `-a`, `--address`:
131131
option is used to set the source ActiveMessage address.
132-
The default is 5678, the value is treated as a hex string (0x5678).
132+
The default is 5678, the value is parsed as a hex string (0x5678).
133133

134134
Options for controlling task processing timings:
135135

cmd/deviceparameters/deviceparameters.go

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ import "log"
99
import "time"
1010
import "os/signal"
1111

12-
//import "errors"
13-
//import "encoding/hex"
14-
//import "encoding/binary"
15-
//import "strconv"
16-
//import "bytes"
17-
1812
import "github.com/jessevdk/go-flags"
1913
import "github.com/proactivity-lab/go-loggers"
2014
import "github.com/proactivity-lab/go-moteconnection"
@@ -44,7 +38,6 @@ type Options struct {
4438
Retries uint8 `long:"retries" default:"3" description:"Get/set action retries"`
4539

4640
Debug []bool `short:"D" long:"debug" description:"Debug mode, print raw packets"`
47-
Quiet []bool `short:"Q" long:"quiet" description:"Quiet mode, print only values"`
4841
ShowVersion func() `short:"V" long:"version" description:"Show application version"`
4942
}
5043

@@ -93,12 +86,10 @@ func main() {
9386

9487
time.Sleep(5 * time.Second)
9588

96-
if len(opts.Quiet) == 0 {
97-
if conn.Connected() {
98-
logger.Info.Printf("Connected with %s\n", cs)
99-
} else {
100-
logger.Info.Printf("Not (yet?) connected with %s\n", cs)
101-
}
89+
if conn.Connected() {
90+
logger.Info.Printf("Connected with %s\n", cs)
91+
} else {
92+
logger.Info.Printf("Not (yet?) connected with %s\n", cs)
10293
}
10394

10495
success := false
@@ -135,9 +126,7 @@ func main() {
135126
time.Sleep(100 * time.Millisecond)
136127

137128
if success {
138-
if len(opts.Quiet) == 0 {
139-
logger.Info.Printf("Done")
140-
}
129+
logger.Info.Printf("Done")
141130
os.Exit(0)
142131
} else {
143132
os.Exit(1)

0 commit comments

Comments
 (0)