mirror of https://github.com/ArduPilot/ardupilot
GCS_MAVLink: handle servo/relay events as both command_long and command_int
This commit is contained in:
parent
d197ad6a90
commit
fe512f7074
|
@ -765,7 +765,7 @@ private:
|
|||
|
||||
virtual void handleMessage(const mavlink_message_t &msg) = 0;
|
||||
|
||||
MAV_RESULT handle_servorelay_message(const mavlink_command_long_t &packet);
|
||||
MAV_RESULT handle_servorelay_message(const mavlink_command_int_t &packet);
|
||||
bool send_relay_status() const;
|
||||
|
||||
static bool command_long_stores_location(const MAV_CMD command);
|
||||
|
|
|
@ -4843,15 +4843,6 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t
|
|||
result = handle_command_request_message(packet);
|
||||
break;
|
||||
|
||||
#if AP_SERVORELAYEVENTS_ENABLED
|
||||
case MAV_CMD_DO_SET_SERVO:
|
||||
case MAV_CMD_DO_REPEAT_SERVO:
|
||||
case MAV_CMD_DO_SET_RELAY:
|
||||
case MAV_CMD_DO_REPEAT_RELAY:
|
||||
result = handle_servorelay_message(packet);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case MAV_CMD_DO_FLIGHTTERMINATION:
|
||||
result = handle_flight_termination(packet);
|
||||
break;
|
||||
|
@ -5148,6 +5139,14 @@ MAV_RESULT GCS_MAVLINK::handle_command_int_packet(const mavlink_command_int_t &p
|
|||
return handle_command_mag_cal(packet);
|
||||
#endif
|
||||
|
||||
#if AP_SERVORELAYEVENTS_ENABLED
|
||||
case MAV_CMD_DO_SET_SERVO:
|
||||
case MAV_CMD_DO_REPEAT_SERVO:
|
||||
case MAV_CMD_DO_SET_RELAY:
|
||||
case MAV_CMD_DO_REPEAT_RELAY:
|
||||
return handle_servorelay_message(packet);
|
||||
#endif
|
||||
|
||||
#if AP_SCRIPTING_ENABLED
|
||||
case MAV_CMD_SCRIPTING:
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
#if AP_SERVORELAYEVENTS_ENABLED
|
||||
|
||||
MAV_RESULT GCS_MAVLINK::handle_servorelay_message(const mavlink_command_long_t &packet)
|
||||
MAV_RESULT GCS_MAVLINK::handle_servorelay_message(const mavlink_command_int_t &packet)
|
||||
{
|
||||
AP_ServoRelayEvents *handler = AP::servorelayevents();
|
||||
if (handler == nullptr) {
|
||||
|
@ -48,4 +48,4 @@ MAV_RESULT GCS_MAVLINK::handle_servorelay_message(const mavlink_command_long_t &
|
|||
return result;
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif // AP_SERVORELAYEVENTS_ENABLED
|
||||
|
|
Loading…
Reference in New Issue