Parent class for all devices.
More...
#include <ctre/phoenix6/hardware/ParentDevice.hpp>
|
virtual void | ReportIfTooOld ()=0 |
|
virtual ctre::phoenix::StatusCode | SetControlPrivate (controls::ControlRequest &request) |
|
template<typename T > |
StatusSignal< T > & | LookupStatusSignal (uint16_t spn, std::string signalName, bool reportOnConstruction) |
|
template<typename T > |
StatusSignal< T > & | LookupStatusSignal (uint16_t spn, uint16_t mapper_iter, std::function< std::map< int, StatusSignal< T > >()> map_filler, std::string signalName, bool reportOnConstruction) |
|
template<typename T , typename U > |
StatusSignal< T > | LookupDimensionlessStatusSignal (uint16_t spn, std::string signalName) |
| Returns a unitless version of the StatusSignal by value. More...
|
|
void | ReportIfTooOld (int minMajor, int minMinor, int minBugfix, int minBuild) |
|
Parent class for all devices.
◆ ParentDevice()
ctre::phoenix6::hardware::ParentDevice::ParentDevice |
( |
int |
deviceID, |
|
|
std::string |
model, |
|
|
std::string |
canbus |
|
) |
| |
|
inline |
◆ GetAppliedControl() [1/2]
Get the latest applied control.
This returns a shared pointer to avoid becoming a dangling pointer due to parallel operations changing the underlying data. Make sure to save the shared_ptr to a variable before chaining function calls, otherwise the data may be freed early.
- Returns
- Latest applied control
◆ GetAppliedControl() [2/2]
Get the latest applied control.
This returns a shared pointer to avoid becoming a dangling pointer due to parallel operations changing the underlying data.
- Returns
- Latest applied control
◆ GetCANBus()
const std::string & ctre::phoenix6::hardware::ParentDevice::GetCANBus |
( |
| ) |
const |
|
inline |
- Returns
- name of the CAN bus this device is on.
◆ GetDeviceID()
int ctre::phoenix6::hardware::ParentDevice::GetDeviceID |
( |
| ) |
const |
|
inline |
- Returns
- the device ID of this device [0,62].
◆ LookupDimensionlessStatusSignal()
template<typename T , typename U >
StatusSignal< T > ctre::phoenix6::hardware::ParentDevice::LookupDimensionlessStatusSignal |
( |
uint16_t |
spn, |
|
|
std::string |
signalName |
|
) |
| |
|
inlineprotected |
Returns a unitless version of the StatusSignal by value.
Do not store the result in a reference.
◆ LookupStatusSignal() [1/2]
template<typename T >
StatusSignal< T > & ctre::phoenix6::hardware::ParentDevice::LookupStatusSignal |
( |
uint16_t |
spn, |
|
|
std::string |
signalName, |
|
|
bool |
reportOnConstruction |
|
) |
| |
|
inlineprotected |
◆ LookupStatusSignal() [2/2]
template<typename T >
StatusSignal< T > & ctre::phoenix6::hardware::ParentDevice::LookupStatusSignal |
( |
uint16_t |
spn, |
|
|
uint16_t |
mapper_iter, |
|
|
std::function< std::map< int, StatusSignal< T > >()> |
map_filler, |
|
|
std::string |
signalName, |
|
|
bool |
reportOnConstruction |
|
) |
| |
|
inlineprotected |
◆ ReportIfTooOld() [1/2]
virtual void ctre::phoenix6::hardware::ParentDevice::ReportIfTooOld |
( |
| ) |
|
|
protectedpure virtual |
◆ ReportIfTooOld() [2/2]
void ctre::phoenix6::hardware::ParentDevice::ReportIfTooOld |
( |
int |
minMajor, |
|
|
int |
minMinor, |
|
|
int |
minBugfix, |
|
|
int |
minBuild |
|
) |
| |
|
protected |
◆ SetControlPrivate()
virtual ctre::phoenix::StatusCode ctre::phoenix6::hardware::ParentDevice::SetControlPrivate |
( |
controls::ControlRequest & |
request | ) |
|
|
protectedvirtual |
◆ deviceIdentifier
◆ kDefaultControlRatePeriodsSec
constexpr double ctre::phoenix6::hardware::ParentDevice::kDefaultControlRatePeriodsSec = 0.010 |
|
staticconstexpr |
The documentation for this class was generated from the following file: