aboutsummaryrefslogtreecommitdiff
path: root/src/modules/mavlink/mavlink_main.h
diff options
context:
space:
mode:
authorAnton Babushkin <anton.babushkin@me.com>2014-07-19 17:37:13 +0200
committerAnton Babushkin <anton.babushkin@me.com>2014-07-19 17:37:34 +0200
commit41003a243793e465a71e9b142e7c9aac132d3923 (patch)
tree40c61ceb4aeadc1814dfed3e32f7ecd8e0b22f57 /src/modules/mavlink/mavlink_main.h
parent52a9513e64dacf1004fd0e11df3daf5eb607b0f2 (diff)
downloadpx4-firmware-41003a243793e465a71e9b142e7c9aac132d3923.tar.gz
px4-firmware-41003a243793e465a71e9b142e7c9aac132d3923.tar.bz2
px4-firmware-41003a243793e465a71e9b142e7c9aac132d3923.zip
mavlink: TX/RX rate counters added
Diffstat (limited to 'src/modules/mavlink/mavlink_main.h')
-rw-r--r--src/modules/mavlink/mavlink_main.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/modules/mavlink/mavlink_main.h b/src/modules/mavlink/mavlink_main.h
index d51120462..70d13acb0 100644
--- a/src/modules/mavlink/mavlink_main.h
+++ b/src/modules/mavlink/mavlink_main.h
@@ -233,6 +233,21 @@ public:
void count_txerr();
/**
+ * Count transmitted bytes
+ */
+ void count_txbytes(unsigned n) { _bytes_tx += n; };
+
+ /**
+ * Count bytes not transmitted because of errors
+ */
+ void count_txerrbytes(unsigned n) { _bytes_txerr += n; };
+
+ /**
+ * Count received bytes
+ */
+ void count_rxbytes(unsigned n) { _bytes_rx += n; };
+
+ /**
* Get the receive status of this MAVLink link
*/
struct telemetry_status_s& get_rx_status() { return _rstatus; }
@@ -293,6 +308,14 @@ private:
bool _flow_control_enabled;
+ unsigned _bytes_tx;
+ unsigned _bytes_txerr;
+ unsigned _bytes_rx;
+ uint64_t _bytes_timestamp;
+ float _rate_tx;
+ float _rate_txerr;
+ float _rate_rx;
+
struct telemetry_status_s _rstatus; ///< receive status
struct mavlink_message_buffer {