ark::serial::SerialStatsTracker

Defined in header “ark/serial/serial_stats_tracker.hh”.


Thread safe class for computing the stats.

Methods

  • void set_device_path(std::string device)
    Sets the path associated with the device.

  • void set_opened(bool opened)
    Set whether this device has been opened or not.

  • void packet_received(size_t size)
    Update the statistics based on the received packet information.

  • void packet_sent(size_t size)
    Update the statistics based on the sent packet information.

  • SerialStats get_stats(std::chrono::steady_clock::time_point ts)
    Get the current statistics structure computing rates based on the provided time and the previous time this function was called.