GCS_MAVLINK: added set_dataflash() method

This commit is contained in:
Andrew Tridgell 2016-02-22 11:05:49 +11:00
parent 119cf6bb13
commit 5080201be6
2 changed files with 13 additions and 0 deletions

View File

@ -181,6 +181,13 @@ public:
*/
static bool find_by_mavtype(uint8_t mav_type, uint8_t &sysid, uint8_t &compid, mavlink_channel_t &channel) { return routing.find_by_mavtype(mav_type, sysid, compid, channel); }
/*
set a dataflash pointer for logging
*/
static void set_dataflash(DataFlash_Class *dataflash) {
dataflash_p = dataflash;
}
private:
void handleMessage(mavlink_message_t * msg);
@ -280,6 +287,9 @@ private:
// mavlink routing object
static MAVLink_routing routing;
// pointer to static dataflash for logging of text messages
static DataFlash_Class *dataflash_p;
// a vehicle can optionally snoop on messages for other systems
static void (*msg_snoop)(const mavlink_message_t* msg);

View File

@ -42,6 +42,9 @@ static uint8_t mavlink_locked_mask;
// routing table
MAVLink_routing GCS_MAVLINK::routing;
// static dataflash pointer to support logging text messages
DataFlash_Class *GCS_MAVLINK::dataflash_p;
// snoop function for vehicle types that want to see messages for
// other targets
void (*GCS_MAVLINK::msg_snoop)(const mavlink_message_t* msg) = NULL;