mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-07-03 03:01:44 +00:00
[hal] Change usage reporting to string-based (#7763)
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -276,7 +276,6 @@ class RobotBase {
|
||||
|
||||
static std::thread::id m_threadId;
|
||||
NT_Listener connListenerHandle;
|
||||
bool m_dashboardDetected = false;
|
||||
};
|
||||
|
||||
} // namespace frc
|
||||
|
||||
Reference in New Issue
Block a user