Browse Source

GCS_MAVLink: move gps inject handling up

Also, make AP_GPS responsible for decoding inject packets
mission-4.1.18
Peter Barker 8 years ago committed by Francisco Ferreira
parent
commit
60ffe00164
  1. 2
      libraries/GCS_MAVLink/GCS.h
  2. 13
      libraries/GCS_MAVLink/GCS_Common.cpp

2
libraries/GCS_MAVLink/GCS.h

@ -263,8 +263,6 @@ protected: @@ -263,8 +263,6 @@ protected:
void handle_radio_status(mavlink_message_t *msg, DataFlash_Class &dataflash, bool log_radio);
void handle_serial_control(mavlink_message_t *msg, AP_GPS &gps);
void handle_gps_inject(const mavlink_message_t *msg, AP_GPS &gps);
void handle_common_message(mavlink_message_t *msg);
void handle_setup_signing(const mavlink_message_t *msg);
uint8_t handle_preflight_reboot(const mavlink_command_long_t &packet, bool disable_overrides);

13
libraries/GCS_MAVLink/GCS_Common.cpp

@ -755,17 +755,6 @@ mission_ack: @@ -755,17 +755,6 @@ mission_ack:
return mission_is_complete;
}
void
GCS_MAVLINK::handle_gps_inject(const mavlink_message_t *msg, AP_GPS &gps)
{
mavlink_gps_inject_data_t packet;
mavlink_msg_gps_inject_data_decode(msg, &packet);
//TODO: check target
gps.inject_data(packet.data, packet.len);
}
// send a message using mavlink, handling message queueing
void GCS_MAVLINK::send_message(enum ap_message id)
{
@ -1816,6 +1805,8 @@ void GCS_MAVLINK::handle_common_message(mavlink_message_t *msg) @@ -1816,6 +1805,8 @@ void GCS_MAVLINK::handle_common_message(mavlink_message_t *msg)
case MAVLINK_MSG_ID_GPS_INPUT:
/* fall through */
case MAVLINK_MSG_ID_HIL_GPS:
/* fall through */
case MAVLINK_MSG_ID_GPS_INJECT_DATA:
handle_common_gps_message(msg);
break;

Loading…
Cancel
Save