Skip to content

Commit

Permalink
rename request streams flags
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed May 27, 2019
1 parent ebbb19b commit 14e668b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ Flags:
recommended to set a different system
id for each router in the network
--hb-period=5 set period of heartbeats
--apreqstream-disable do not request streams to Ardupilot
--streamreq-disable do not request streams to Ardupilot
devices, that need an explicit request
in order to emit telemetry streams.
this task is usually delegated to the
router, to avoid conflicts when
router, in order to avoid conflicts when
multiple ground stations are active
--apreqstream-frequency=4 set the stream frequency to request
--streamreq-frequency=4 set the stream frequency to request
Args:
[<endpoints>] Space-separated list of endpoints. At least 2
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module mavp2p

require (
github.com/gswly/gomavlib v0.0.0-20190527131251-d908918fbc3c
github.com/gswly/gomavlib v0.0.0-20190527133924-35003b01a680
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZq
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gswly/gomavlib v0.0.0-20190527131251-d908918fbc3c h1:aqNvmJNfA/ZrPJv+dapaZYHEMXPGyhvqiuw7cgpHez4=
github.com/gswly/gomavlib v0.0.0-20190527131251-d908918fbc3c/go.mod h1:1xQWxU9I/Y19PPQg8rJh+Wxk0TC1qvZR3btjKYH5WC4=
github.com/gswly/gomavlib v0.0.0-20190527133924-35003b01a680 h1:fJBOQry2VCwy3iZNazTdaqyI1kr7ZZFSjULUjde3Ywc=
github.com/gswly/gomavlib v0.0.0-20190527133924-35003b01a680/go.mod h1:1xQWxU9I/Y19PPQg8rJh+Wxk0TC1qvZR3btjKYH5WC4=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
Expand Down
16 changes: 8 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ func main() {
"it is recommended to set a different system id for each router in the network.").Default("125").Int()
hbPeriod := kingpin.Flag("hb-period", "set period of heartbeats").Default("5").Int()

aprsDisable := kingpin.Flag("apreqstream-disable", "do not request streams to Ardupilot devices, "+
streamReqDisable := kingpin.Flag("streamreq-disable", "do not request streams to Ardupilot devices, "+
"that need an explicit request in order to emit telemetry streams. "+
"this task is usually delegated to the router, to avoid conflicts when "+
"this task is usually delegated to the router, in order to avoid conflicts when "+
"multiple ground stations are active.").Bool()
aprsFrequency := kingpin.Flag("apreqstream-frequency", "set the stream frequency to request").Default("4").Int()
streamReqFrequency := kingpin.Flag("streamreq-frequency", "set the stream frequency to request").Default("4").Int()

desc := "Space-separated list of endpoints. At least 2 endpoints are required. " +
"Possible endpoints are:\n\n"
Expand Down Expand Up @@ -138,10 +138,10 @@ func main() {
// decode/encode only a minimal set of messages.
// other messages change too frequently and cannot be integrated into a static tool.
msgs := []gomavlib.Message{}
if *hbDisable == false || *aprsDisable == false {
if *hbDisable == false || *streamReqDisable == false {
msgs = append(msgs, &common.MessageHeartbeat{})
}
if *aprsDisable == false {
if *streamReqDisable == false {
msgs = append(msgs, &common.MessageRequestDataStream{})
}
dialect, err := gomavlib.NewDialect(3, msgs)
Expand All @@ -161,8 +161,8 @@ func main() {
OutSystemId: byte(*hbSystemId),
HeartbeatDisable: *hbDisable,
HeartbeatPeriod: (time.Duration(*hbPeriod) * time.Second),
StreamRequestEnable: !*aprsDisable,
StreamRequestFrequency: *aprsFrequency,
StreamRequestEnable: !*streamReqDisable,
StreamRequestFrequency: *streamReqFrequency,
})
if err != nil {
initError(err.Error())
Expand Down Expand Up @@ -210,7 +210,7 @@ func main() {
nh.onEventFrame(evt)

// if automatic stream requests are enabled, block manual stream requests
if *aprsDisable == false {
if *streamReqDisable == false {
if _, ok := evt.Message().(*common.MessageRequestDataStream); ok {
continue
}
Expand Down

0 comments on commit 14e668b

Please sign in to comment.