mavlink: TX/RX rate counters added

This commit is contained in:
Anton Babushkin
2014-07-23 08:19:24 +02:00
committed by Lorenz Meier
parent b344b94d30
commit ef363edfcd
3 changed files with 54 additions and 0 deletions
+23
View File
@@ -232,6 +232,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
*/
@@ -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 {