mirror of https://github.com/ArduPilot/ardupilot
HAL_Linux: inherit CAN stats structure
this allows for the last_transmit_us field
This commit is contained in:
parent
bc373354fc
commit
559e85df11
|
@ -281,10 +281,10 @@ void CANIface::_pollWrite()
|
||||||
stats.tx_success++;
|
stats.tx_success++;
|
||||||
stats.last_transmit_us = curr_time;
|
stats.last_transmit_us = curr_time;
|
||||||
} else if (res == 0) { // Not transmitted, nor is it an error
|
} else if (res == 0) { // Not transmitted, nor is it an error
|
||||||
stats.tx_full++;
|
stats.tx_overflow++;
|
||||||
break; // Leaving the loop, the frame remains enqueued for the next retry
|
break; // Leaving the loop, the frame remains enqueued for the next retry
|
||||||
} else { // Transmission error
|
} else { // Transmission error
|
||||||
stats.tx_write_fail++;
|
stats.tx_rejected++;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// hal.console->printf("TDEAD: %lu CURRT: %lu DEL: %lu\n", tx.deadline, curr_time, curr_time-tx.deadline);
|
// hal.console->printf("TDEAD: %lu CURRT: %lu DEL: %lu\n", tx.deadline, curr_time, curr_time-tx.deadline);
|
||||||
|
@ -592,8 +592,8 @@ bool CANIface::CANSocketEventSource::wait(uint16_t duration_us, AP_HAL::EventHan
|
||||||
void CANIface::get_stats(ExpandingString &str)
|
void CANIface::get_stats(ExpandingString &str)
|
||||||
{
|
{
|
||||||
str.printf("tx_requests: %u\n"
|
str.printf("tx_requests: %u\n"
|
||||||
"tx_write_fail: %u\n"
|
"tx_rejected: %u\n"
|
||||||
"tx_full: %u\n"
|
"tx_overflow: %u\n"
|
||||||
"tx_confirmed: %u\n"
|
"tx_confirmed: %u\n"
|
||||||
"tx_success: %u\n"
|
"tx_success: %u\n"
|
||||||
"tx_timedout: %u\n"
|
"tx_timedout: %u\n"
|
||||||
|
@ -606,8 +606,8 @@ void CANIface::get_stats(ExpandingString &str)
|
||||||
"num_poll_tx_events: %u\n"
|
"num_poll_tx_events: %u\n"
|
||||||
"num_poll_rx_events: %u\n",
|
"num_poll_rx_events: %u\n",
|
||||||
stats.tx_requests,
|
stats.tx_requests,
|
||||||
stats.tx_write_fail,
|
stats.tx_rejected,
|
||||||
stats.tx_full,
|
stats.tx_overflow,
|
||||||
stats.tx_confirmed,
|
stats.tx_confirmed,
|
||||||
stats.tx_success,
|
stats.tx_success,
|
||||||
stats.tx_timedout,
|
stats.tx_timedout,
|
||||||
|
|
|
@ -174,15 +174,8 @@ private:
|
||||||
std::unordered_multiset<uint32_t> _pending_loopback_ids;
|
std::unordered_multiset<uint32_t> _pending_loopback_ids;
|
||||||
std::vector<can_filter> _hw_filters_container;
|
std::vector<can_filter> _hw_filters_container;
|
||||||
|
|
||||||
struct {
|
struct bus_stats : public AP_HAL::CANIface::bus_stats_t {
|
||||||
uint32_t tx_requests;
|
|
||||||
uint32_t tx_full;
|
|
||||||
uint32_t tx_confirmed;
|
uint32_t tx_confirmed;
|
||||||
uint32_t tx_write_fail;
|
|
||||||
uint32_t tx_success;
|
|
||||||
uint32_t tx_timedout;
|
|
||||||
uint32_t rx_received;
|
|
||||||
uint32_t rx_errors;
|
|
||||||
uint32_t num_downs;
|
uint32_t num_downs;
|
||||||
uint32_t num_rx_poll_req;
|
uint32_t num_rx_poll_req;
|
||||||
uint32_t num_tx_poll_req;
|
uint32_t num_tx_poll_req;
|
||||||
|
|
Loading…
Reference in New Issue