Skip to content

Commit 204a63a

Browse files
authored
update gomavlib (#42)
1 parent 59b57bf commit 204a63a

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.20
44

55
require (
66
github.com/alecthomas/kong v0.8.0
7-
github.com/bluenviron/gomavlib/v2 v2.0.4
7+
github.com/bluenviron/gomavlib/v2 v2.1.0
88
github.com/stretchr/testify v1.8.4
99
)
1010

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ github.com/alecthomas/assert/v2 v2.1.0 h1:tbredtNcQnoSd3QBhQWI7QZ3XHOVkw1Moklp2o
33
github.com/alecthomas/kong v0.8.0 h1:ryDCzutfIqJPnNn0omnrgHLbAggDQM2VWHikE1xqK7s=
44
github.com/alecthomas/kong v0.8.0/go.mod h1:n1iCIO2xS46oE8ZfYCNDqdR0b0wZNrXAIAqro/2132U=
55
github.com/alecthomas/repr v0.1.0 h1:ENn2e1+J3k09gyj2shc0dHr/yjaWSHRlrJ4DPMevDqE=
6-
github.com/bluenviron/gomavlib/v2 v2.0.4 h1:fXi4xY41Nk9avDdcb7/uqT5qu3QEwiSUfifUFzH5KZg=
7-
github.com/bluenviron/gomavlib/v2 v2.0.4/go.mod h1:omnSr00XvG6HVnDSM1vYgnvsVD/ihoPSV84cv/Km7rA=
6+
github.com/bluenviron/gomavlib/v2 v2.1.0 h1:Tilg+YJq98NjL8vYI7m0DarNyEl9xuyn2oU5/9lB8go=
7+
github.com/bluenviron/gomavlib/v2 v2.1.0/go.mod h1:omnSr00XvG6HVnDSM1vYgnvsVD/ihoPSV84cv/Km7rA=
88
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
99
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
1010
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=

main_test.go

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ func TestBroadcast(t *testing.T) {
6161
Z: 3.4,
6262
}
6363

64-
pub.WriteMessageAll(msg)
64+
err = pub.WriteMessageAll(msg)
65+
require.NoError(t, err)
6566

6667
<-sub.Events()
6768
evt = <-sub.Events()
@@ -124,17 +125,19 @@ func TestTarget(t *testing.T) {
124125
<-sub1.Events()
125126
<-sub2.Events()
126127

127-
sub1.WriteMessageAll(&common.MessageHeartbeat{
128+
err = sub1.WriteMessageAll(&common.MessageHeartbeat{
128129
Type: common.MAV_TYPE_GCS,
129130
SystemStatus: 4,
130131
MavlinkVersion: 3,
131132
})
133+
require.NoError(t, err)
132134

133-
sub2.WriteMessageAll(&common.MessageHeartbeat{
135+
err = sub2.WriteMessageAll(&common.MessageHeartbeat{
134136
Type: common.MAV_TYPE_GCS,
135137
SystemStatus: 4,
136138
MavlinkVersion: 3,
137139
})
140+
require.NoError(t, err)
138141

139142
for i := 0; i < 2; i++ {
140143
evt := <-pub.Events()
@@ -153,7 +156,8 @@ func TestTarget(t *testing.T) {
153156
Command: common.MAV_CMD_NAV_FOLLOW,
154157
}
155158

156-
pub.WriteMessageAll(msg)
159+
err = pub.WriteMessageAll(msg)
160+
require.NoError(t, err)
157161

158162
<-sub1.Events()
159163
evt := <-sub1.Events()
@@ -207,11 +211,12 @@ func TestTargetNotFound(t *testing.T) {
207211
<-pub.Events()
208212
<-sub.Events()
209213

210-
sub.WriteMessageAll(&common.MessageHeartbeat{
214+
err = sub.WriteMessageAll(&common.MessageHeartbeat{
211215
Type: common.MAV_TYPE_GCS,
212216
SystemStatus: 4,
213217
MavlinkVersion: 3,
214218
})
219+
require.NoError(t, err)
215220

216221
evt := <-pub.Events()
217222
eventFr, ok := evt.(*gomavlib.EventFrame)
@@ -228,7 +233,8 @@ func TestTargetNotFound(t *testing.T) {
228233
Command: common.MAV_CMD_NAV_FOLLOW,
229234
}
230235

231-
pub.WriteMessageAll(msg)
236+
err = pub.WriteMessageAll(msg)
237+
require.NoError(t, err)
232238

233239
evt = <-sub.Events()
234240
eventFr, ok = evt.(*gomavlib.EventFrame)

message_handler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,14 @@ func (mh *messageHandler) onEventFrame(evt *gomavlib.EventFrame) {
155155
if key.channel == evt.Channel {
156156
log.Printf("Warning: channel %s attempted to send message to itself, discarding", key.channel)
157157
} else {
158-
mh.node.WriteFrameTo(key.channel, evt.Frame)
158+
mh.node.WriteFrameTo(key.channel, evt.Frame) //nolint:errcheck
159159
return
160160
}
161161
}
162162
}
163163

164164
// otherwise, route message to every channel
165-
mh.node.WriteFrameExcept(evt.Channel, evt.Frame)
165+
mh.node.WriteFrameExcept(evt.Channel, evt.Frame) //nolint:errcheck
166166
}
167167

168168
func (mh *messageHandler) onEventChannelClose(evt *gomavlib.EventChannelClose) {

0 commit comments

Comments
 (0)