Browse Source

GCS_MAVLink: move try_send_message send_hwstatus up

master
Peter Barker 8 years ago committed by Francisco Ferreira
parent
commit
679bb7f7a5
  1. 1
      libraries/GCS_MAVLink/GCS.h
  2. 13
      libraries/GCS_MAVLink/GCS_Common.cpp

1
libraries/GCS_MAVLink/GCS.h

@ -290,6 +290,7 @@ protected: @@ -290,6 +290,7 @@ protected:
// message sending functions:
bool try_send_compass_message(enum ap_message id);
bool try_send_mission_message(enum ap_message id);
void send_hwstatus();
private:

13
libraries/GCS_MAVLink/GCS_Common.cpp

@ -2085,6 +2085,13 @@ bool GCS_MAVLINK::try_send_mission_message(const enum ap_message id) @@ -2085,6 +2085,13 @@ bool GCS_MAVLINK::try_send_mission_message(const enum ap_message id)
return ret;
}
void GCS_MAVLINK::send_hwstatus()
{
mavlink_msg_hwstatus_send(
chan,
hal.analogin->board_voltage()*1000,
0);
}
bool GCS_MAVLINK::try_send_message(const enum ap_message id)
{
@ -2096,6 +2103,12 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id) @@ -2096,6 +2103,12 @@ bool GCS_MAVLINK::try_send_message(const enum ap_message id)
switch(id) {
case MSG_HWSTATUS:
CHECK_PAYLOAD_SIZE(HWSTATUS);
send_hwstatus();
ret = true;
break;
case MSG_CURRENT_WAYPOINT:
/* fall through */
case MSG_MISSION_ITEM_REACHED:

Loading…
Cancel
Save