From f0a95182becfc2d90dbd6f901e32d20fec8b1534 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 7 Nov 2018 12:06:47 +1100 Subject: [PATCH] GCS_MAVLink: add is_active and is_streaming methods --- libraries/GCS_MAVLink/GCS.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/GCS_MAVLink/GCS.h b/libraries/GCS_MAVLink/GCS.h index d864105ef8..62a08e6948 100644 --- a/libraries/GCS_MAVLink/GCS.h +++ b/libraries/GCS_MAVLink/GCS.h @@ -152,6 +152,13 @@ public: // return true if this channel has hardware flow control bool have_flow_control(); + bool is_active() const { + return GCS_MAVLINK::active_channel_mask() & (1 << (chan-MAVLINK_COMM_0)); + } + bool is_streaming() const { + return GCS_MAVLINK::streaming_channel_mask() & (1 << (chan-MAVLINK_COMM_0)); + } + mavlink_channel_t get_chan() const { return chan; } uint32_t get_last_heartbeat_time() const { return last_heartbeat_time; };