27 auto mav_status = link->get_status();
28 auto iostat = link->get_iostat();
30 stat.
addf(
"Received packets:",
"%u", mav_status.packet_rx_success_count);
31 stat.
addf(
"Dropped packets:",
"%u", mav_status.packet_rx_drop_count);
32 stat.
addf(
"Buffer overruns:",
"%u", mav_status.buffer_overrun);
33 stat.
addf(
"Parse errors:",
"%u", mav_status.parse_error);
34 stat.
addf(
"Rx sequence number:",
"%u", mav_status.current_rx_seq);
35 stat.
addf(
"Tx sequence number:",
"%u", mav_status.current_tx_seq);
37 stat.
addf(
"Rx total bytes:",
"%u", iostat.rx_total_bytes);
38 stat.
addf(
"Tx total bytes:",
"%u", iostat.tx_total_bytes);
39 stat.
addf(
"Rx speed:",
"%f", iostat.rx_speed);
40 stat.
addf(
"Tx speed:",
"%f", iostat.tx_speed);
43 stat.
summaryf(1,
"%d packeges dropped since last report",
49 stat.
summary(1,
"not connected");
53 stat.
summary(2,
"not connected");
void summary(unsigned char lvl, const std::string s)
mavconn::MAVConnInterface::WeakPtr weak_link
void addf(const std::string &key, const char *format,...)
void summaryf(unsigned char lvl, const char *format,...)
std::atomic< bool > is_connected
unsigned int last_drop_count
MavlinkDiag(std::string name)
void run(diagnostic_updater::DiagnosticStatusWrapper &stat)