Browse Source

GCS_MAVLINK: added set_dataflash() method

mission-4.1.18
Andrew Tridgell 9 years ago
parent
commit
5080201be6
  1. 10
      libraries/GCS_MAVLink/GCS.h
  2. 3
      libraries/GCS_MAVLink/GCS_MAVLink.cpp

10
libraries/GCS_MAVLink/GCS.h

@ -181,6 +181,13 @@ public: @@ -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: @@ -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);

3
libraries/GCS_MAVLink/GCS_MAVLink.cpp

@ -42,6 +42,9 @@ static uint8_t mavlink_locked_mask; @@ -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;

Loading…
Cancel
Save