mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-22 17:07:34 +08:00
Merge pull request #815 from PX4/commander_handle_command
commander: handle_command: filter commands by sysid and componentid
This commit is contained in:
@@ -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) && (cmd->target_component != 0))) { // component_id 0: valid for all components
|
||||
return false;
|
||||
}
|
||||
|
||||
/* only handle high-priority commands here */
|
||||
|
||||
/* request to set different system mode */
|
||||
|
||||
Reference in New Issue
Block a user