[hal] Change usage reporting to string-based (#7763)

This commit is contained in:
Peter Johnson
2025-02-07 12:37:23 -08:00
committed by GitHub
parent bfff891b5c
commit 764ada9b66
188 changed files with 637 additions and 2298 deletions

View File

@@ -119,6 +119,8 @@ class PneumaticHub : public PneumaticsBase {
int reverseChannel) override;
Compressor MakeCompressor() override;
void ReportUsage(std::string_view device, std::string_view data) override;
/** Version and device data received from a REV PH. */
struct Version {
/** The firmware major version. */

View File

@@ -5,6 +5,7 @@
#pragma once
#include <memory>
#include <string_view>
#include <units/current.h>
#include <units/pressure.h>
@@ -255,6 +256,14 @@ class PneumaticsBase {
*/
virtual Compressor MakeCompressor() = 0;
/**
* Report usage.
*
* @param device device and channel as appropriate
* @param data arbitrary usage data
*/
virtual void ReportUsage(std::string_view device, std::string_view data) = 0;
/**
* For internal use to get a module for a specific type.
*

View File

@@ -190,6 +190,8 @@ class PneumaticsControlModule : public PneumaticsBase {
int reverseChannel) override;
Compressor MakeCompressor() override;
void ReportUsage(std::string_view device, std::string_view data) override;
private:
class DataStore;
friend class DataStore;

View File

@@ -276,7 +276,6 @@ class RobotBase {
static std::thread::id m_threadId;
NT_Listener connListenerHandle;
bool m_dashboardDetected = false;
};
} // namespace frc