From a9b9362feaca143c1faffd963efdd3cde54a61c7 Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Wed, 1 Dec 2021 14:40:52 +0100 Subject: [PATCH] commander: handle system broadcast commands This changes the command handling logic to accept commands which are targeted at any system, signaled by target_system set to 0. --- src/modules/commander/Commander.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/commander/Commander.cpp b/src/modules/commander/Commander.cpp index 6c719ddd85..9480de2831 100644 --- a/src/modules/commander/Commander.cpp +++ b/src/modules/commander/Commander.cpp @@ -713,9 +713,9 @@ Commander::Commander() : bool Commander::handle_command(const vehicle_command_s &cmd) { - /* only handle commands that are meant to be handled by this system and component */ - if (cmd.target_system != _status.system_id || ((cmd.target_component != _status.component_id) - && (cmd.target_component != 0))) { // component_id 0: valid for all components + /* only handle commands that are meant to be handled by this system and component, or broadcast */ + if (((cmd.target_system != _status.system_id) && (cmd.target_system != 0)) + || ((cmd.target_component != _status.component_id) && (cmd.target_component != 0))) { return false; }