GCS_MAVLink: send status_text messages to Frsky lib queue
This commit is contained in:
parent
8761ecca6c
commit
9f8d2f0506
@ -15,6 +15,7 @@
|
|||||||
#include <AP_Mount/AP_Mount.h>
|
#include <AP_Mount/AP_Mount.h>
|
||||||
#include <AP_Avoidance/AP_Avoidance.h>
|
#include <AP_Avoidance/AP_Avoidance.h>
|
||||||
#include <AP_HAL/utility/RingBuffer.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
|
// 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)
|
#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;
|
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
|
// update signing timestamp on GPS lock
|
||||||
static void update_signing_timestamp(uint64_t timestamp_usec);
|
static void update_signing_timestamp(uint64_t timestamp_usec);
|
||||||
|
|
||||||
@ -371,6 +379,9 @@ private:
|
|||||||
// pointer to static dataflash for logging of text messages
|
// pointer to static dataflash for logging of text messages
|
||||||
static DataFlash_Class *dataflash_p;
|
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;
|
static const AP_SerialManager *serialmanager_p;
|
||||||
|
|
||||||
// a vehicle can optionally snoop on messages for other systems
|
// a vehicle can optionally snoop on messages for other systems
|
||||||
|
@ -1346,6 +1346,11 @@ void GCS_MAVLINK::send_statustext(MAV_SEVERITY severity, uint8_t dest_bitmask, c
|
|||||||
dataflash_p->Log_Write_Message(text);
|
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.
|
// filter destination ports to only allow active ports.
|
||||||
statustext_t statustext{};
|
statustext_t statustext{};
|
||||||
statustext.bitmask = (mavlink_active | chan_is_streaming) & dest_bitmask;
|
statustext.bitmask = (mavlink_active | chan_is_streaming) & dest_bitmask;
|
||||||
|
@ -44,6 +44,9 @@ MAVLink_routing GCS_MAVLINK::routing;
|
|||||||
// static dataflash pointer to support logging text messages
|
// static dataflash pointer to support logging text messages
|
||||||
DataFlash_Class *GCS_MAVLINK::dataflash_p;
|
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
|
// static AP_SerialManager pointer
|
||||||
const AP_SerialManager *GCS_MAVLINK::serialmanager_p;
|
const AP_SerialManager *GCS_MAVLINK::serialmanager_p;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user