From a4fd3980a871eb855d2b6c00d26fe186a5d3a581 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 6 Apr 2024 17:06:55 +0100 Subject: [PATCH] AP_HAL: UARTDriver: add getters for cumulative tx and rx counts --- libraries/AP_HAL/UARTDriver.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL/UARTDriver.h b/libraries/AP_HAL/UARTDriver.h index 67ad4b0dd1..39ae349985 100644 --- a/libraries/AP_HAL/UARTDriver.h +++ b/libraries/AP_HAL/UARTDriver.h @@ -233,7 +233,13 @@ protected: // discard incoming data on the port virtual bool _discard_input(void) = 0; - + +#if HAL_UART_STATS_ENABLED + // Getters for cumulative tx and rx counts + virtual uint32_t get_total_tx_bytes() const { return 0; } + virtual uint32_t get_total_rx_bytes() const { return 0; } +#endif + private: // option bits for port uint16_t _last_options;