GCS_MAVLink: send status_text messages to Frsky lib queue

This commit is contained in:
floaledm 2016-10-26 17:06:54 -05:00 committed by Andrew Tridgell
parent 8761ecca6c
commit 9f8d2f0506
3 changed files with 19 additions and 0 deletions

View File

@ -15,6 +15,7 @@
#include <AP_Mount/AP_Mount.h>
#include <AP_Avoidance/AP_Avoidance.h>
#include <AP_HAL/utility/RingBuffer.h>
#include <AP_Frsky_Telem/AP_Frsky_Telem.h>
// check if a message will fit in the payload space available
#define HAVE_PAYLOAD_SPACE(chan, id) (comm_get_txspace(chan) >= GCS_MAVLINK::packet_overhead_chan(chan)+MAVLINK_MSG_ID_ ## id ## _LEN)
@ -211,6 +212,13 @@ public:
dataflash_p = dataflash;
}
/*
set a frsky_telem pointer for queueing
*/
static void register_frsky_telemetry_callback(AP_Frsky_Telem *frsky_telemetry) {
frsky_telemetry_p = frsky_telemetry;
}
// update signing timestamp on GPS lock
static void update_signing_timestamp(uint64_t timestamp_usec);
@ -371,6 +379,9 @@ private:
// pointer to static dataflash for logging of text messages
static DataFlash_Class *dataflash_p;
// pointer to static frsky_telem for queueing of text messages
static AP_Frsky_Telem *frsky_telemetry_p;
static const AP_SerialManager *serialmanager_p;
// a vehicle can optionally snoop on messages for other systems

View File

@ -1346,6 +1346,11 @@ void GCS_MAVLINK::send_statustext(MAV_SEVERITY severity, uint8_t dest_bitmask, c
dataflash_p->Log_Write_Message(text);
}
// add statustext message to FrSky lib queue
if (frsky_telemetry_p != NULL) {
frsky_telemetry_p->queue_message(severity, text);
}
// filter destination ports to only allow active ports.
statustext_t statustext{};
statustext.bitmask = (mavlink_active | chan_is_streaming) & dest_bitmask;

View File

@ -44,6 +44,9 @@ MAVLink_routing GCS_MAVLINK::routing;
// static dataflash pointer to support logging text messages
DataFlash_Class *GCS_MAVLINK::dataflash_p;
// static frsky_telem pointer to support queueing text messages
AP_Frsky_Telem *GCS_MAVLINK::frsky_telemetry_p;
// static AP_SerialManager pointer
const AP_SerialManager *GCS_MAVLINK::serialmanager_p;