ark::usb::UsbStatsTracker

Defined in header “ark/usb/usb_stats_tracker.hh”.


Thread-safe class for computing statistics over a USB device.

Methods

  • void set_address(std::string address)
    Sets the address 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.

  • UsbStats 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.