diff options
author | Anton Babushkin <anton.babushkin@me.com> | 2014-07-19 17:37:13 +0200 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2014-07-23 08:19:24 +0200 |
commit | ef363edfcd810e3b153609f0a723f53db0cd3885 (patch) | |
tree | e223dd43a189a51442edb59de500c2d15e0f8b14 /src/modules/mavlink/mavlink_main.h | |
parent | b344b94d3039273a1659a4b5640e7dc197922767 (diff) | |
download | px4-firmware-ef363edfcd810e3b153609f0a723f53db0cd3885.tar.gz px4-firmware-ef363edfcd810e3b153609f0a723f53db0cd3885.tar.bz2 px4-firmware-ef363edfcd810e3b153609f0a723f53db0cd3885.zip |
mavlink: TX/RX rate counters added
Diffstat (limited to 'src/modules/mavlink/mavlink_main.h')
-rw-r--r-- | src/modules/mavlink/mavlink_main.h | 23 |
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 { |