mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-09 09:28:31 -04:00
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;
|
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;
|
bool send_relay_status() const;
|
||||||
|
|
||||||
static bool command_long_stores_location(const MAV_CMD command);
|
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);
|
result = handle_command_request_message(packet);
|
||||||
break;
|
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:
|
case MAV_CMD_DO_FLIGHTTERMINATION:
|
||||||
result = handle_flight_termination(packet);
|
result = handle_flight_termination(packet);
|
||||||
break;
|
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);
|
return handle_command_mag_cal(packet);
|
||||||
#endif
|
#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
|
#if AP_SCRIPTING_ENABLED
|
||||||
case MAV_CMD_SCRIPTING:
|
case MAV_CMD_SCRIPTING:
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
#if AP_SERVORELAYEVENTS_ENABLED
|
#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();
|
AP_ServoRelayEvents *handler = AP::servorelayevents();
|
||||||
if (handler == nullptr) {
|
if (handler == nullptr) {
|
||||||
@ -48,4 +48,4 @@ MAV_RESULT GCS_MAVLINK::handle_servorelay_message(const mavlink_command_long_t &
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif // AP_SERVORELAYEVENTS_ENABLED
|
||||||
|
Loading…
Reference in New Issue
Block a user