diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-04-08 17:06:52 +0200 |
---|---|---|
committer | Julian Oes <julian@oes.ch> | 2014-04-18 22:05:46 +0200 |
commit | 03a3b1d67127af8681275a50e5604ea1b60814ea (patch) | |
tree | 673c984c32b5da56fd8cd89fd964a3ce6c257a68 | |
parent | 1c49f132a43cc8521fc0a9395b03911400c91435 (diff) | |
download | px4-firmware-03a3b1d67127af8681275a50e5604ea1b60814ea.tar.gz px4-firmware-03a3b1d67127af8681275a50e5604ea1b60814ea.tar.bz2 px4-firmware-03a3b1d67127af8681275a50e5604ea1b60814ea.zip |
commander: handle_command: filter commands by sysid and componentid
-rw-r--r-- | src/modules/commander/commander.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/modules/commander/commander.cpp b/src/modules/commander/commander.cpp index 662b98b35..e6de58563 100644 --- a/src/modules/commander/commander.cpp +++ b/src/modules/commander/commander.cpp @@ -395,6 +395,11 @@ bool handle_command(struct vehicle_status_s *status, const struct safety_s *safe enum VEHICLE_CMD_RESULT result = VEHICLE_CMD_RESULT_UNSUPPORTED; bool ret = false; + /* 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) { + return false; + } + /* only handle high-priority commands here */ /* request to set different system mode */ |