From e970a6cb5d9322feb1951765b80e8a41d96f62c4 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sat, 6 Apr 2024 17:07:31 +0100 Subject: [PATCH] AP_HAL_SITL: UARTDriver: add getters for cumulative tx and rx counts --- libraries/AP_HAL_SITL/UARTDriver.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libraries/AP_HAL_SITL/UARTDriver.h b/libraries/AP_HAL_SITL/UARTDriver.h index 3352826385..88803c9ddb 100644 --- a/libraries/AP_HAL_SITL/UARTDriver.h +++ b/libraries/AP_HAL_SITL/UARTDriver.h @@ -145,6 +145,12 @@ protected: void _flush() override; bool _discard_input() override; +#if HAL_UART_STATS_ENABLED + // Getters for cumulative tx and rx counts + uint32_t get_total_tx_bytes() const override { return _tx_stats_bytes; } + uint32_t get_total_rx_bytes() const override { return _rx_stats_bytes; } +#endif + private: void handle_writing_from_writebuffer_to_device(); void handle_reading_from_device_to_readbuffer();