forked from Archive/PX4-Autopilot
commander: handle_command: filter commands by sysid and componentid
This commit is contained in:
parent
0930a3c1b6
commit
a6215b7bda
|
@ -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;
|
enum VEHICLE_CMD_RESULT result = VEHICLE_CMD_RESULT_UNSUPPORTED;
|
||||||
bool ret = false;
|
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 */
|
/* only handle high-priority commands here */
|
||||||
|
|
||||||
/* request to set different system mode */
|
/* request to set different system mode */
|
||||||
|
|
Loading…
Reference in New Issue