Skip to content

Commit

Permalink
Mavlink: Correct packet filtering to include componentID
Browse files Browse the repository at this point in the history
  • Loading branch information
stephendade committed Nov 11, 2024
1 parent e162051 commit 96f9bae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mavlink/mavManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ class mavManager {
// set the target system/comp ID if needed
// ensure it's NOT a GCS, as mavlink-router will sometimes route
// messages from connected GCS's
if (this.targetSystem === null && packet.header.msgid === minimal.Heartbeat.MSG_ID && data.type !== 6) {
if (this.targetSystem === null && packet.header.msgid === minimal.Heartbeat.MSG_ID && data.type !== 6
&& data.type !== 18) {
console.log('Vehicle is S/C: ' + packet.header.sysid + '/' + packet.header.compid)
winston.info('Vehicle is S/C: ' + packet.header.sysid + '/' + packet.header.compid)
this.targetSystem = packet.header.sysid
Expand All @@ -113,7 +114,7 @@ class mavManager {
packet.header.msgid === common.CommandLong.MSG_ID) {
console.log('Received CommandLong addressed to attached camera')

} else if (this.targetSystem !== packet.header.sysid) {
} else if (this.targetSystem !== packet.header.sysid || this.targetComponent !== packet.header.compid) {
// don't use packets from other systems or components in Rpanion-server
return
}
Expand Down

0 comments on commit 96f9bae

Please sign in to comment.