CTRE Phoenix 6 C++ 24.3.0
ctre::phoenix6::BaseStatusSignal Class Referenceabstract

Class that provides operations to retrieve information about a status signal. More...

#include <ctre/phoenix6/StatusSignal.hpp>

Inheritance diagram for ctre::phoenix6::BaseStatusSignal:
ctre::phoenix6::StatusSignal< units::angle::turn_t > ctre::phoenix6::StatusSignal< int > ctre::phoenix6::StatusSignal< units::angle::degree_t > ctre::phoenix6::StatusSignal< units::angular_velocity::degrees_per_second_t > ctre::phoenix6::StatusSignal< units::dimensionless::scalar_t > ctre::phoenix6::StatusSignal< T >

Classes

struct  is_all_status_signal
 Type trait to verify that all types passed in are subclasses of BaseStatusSignal. More...
 

Public Member Functions

virtual ~BaseStatusSignal ()=0
 
virtual ctre::phoenix::StatusCode SetUpdateFrequency (units::frequency::hertz_t frequencyHz, units::time::second_t timeoutSeconds=50_ms)=0
 Sets the rate at which the device will publish this signal. More...
 
virtual units::frequency::hertz_t GetAppliedUpdateFrequency () const =0
 Gets the rate at which the device will publish this signal. More...
 
const std::string & GetName () const
 Gets the name of this signal. More...
 
const std::string & GetUnits () const
 Gets the units for this signal. More...
 
double GetValueAsDouble () const
 Gets the value of this signal as a double. More...
 
const AllTimestampsGetAllTimestamps () const
 Get the timestamps of this signals. More...
 
const TimestampGetTimestamp () const
 Get the best timestamp available to this signal. More...
 
ctre::phoenix::StatusCode GetStatus () const
 Get the error code from when we last received this signal. More...
 
bool HasUpdated ()
 Check whether the signal has been updated since the last check. More...
 

Static Public Member Functions

template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static ctre::phoenix::StatusCode WaitForAll (units::time::second_t timeoutSeconds, Signals &... signals)
 Waits for new data on all provided signals up to timeout. More...
 
static ctre::phoenix::StatusCode WaitForAll (units::time::second_t timeoutSeconds, const std::vector< BaseStatusSignal * > &signals)
 Waits for new data on all provided signals up to timeout. More...
 
template<size_t N>
static ctre::phoenix::StatusCode WaitForAll (units::time::second_t timeoutSeconds, const std::array< BaseStatusSignal *, N > &signals)
 Waits for new data on all provided signals up to timeout. More...
 
template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static ctre::phoenix::StatusCode RefreshAll (Signals &... signals)
 Performs a non-blocking refresh on all provided signals. More...
 
static ctre::phoenix::StatusCode RefreshAll (const std::vector< BaseStatusSignal * > &signals)
 Performs a non-blocking refresh on all provided signals. More...
 
template<size_t N>
static ctre::phoenix::StatusCode RefreshAll (const std::array< BaseStatusSignal *, N > &signals)
 Performs a non-blocking refresh on all provided signals. More...
 
template<typename U , typename U_PER_SEC >
static U GetLatencyCompensatedValue (StatusSignal< U > &signal, StatusSignal< U_PER_SEC > &signalSlope, units::time::second_t maxLatencySeconds=0.300_s)
 Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation. More...
 
template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static bool IsAllGood (Signals &... signals)
 Checks if all signals have an OK error code. More...
 
static bool IsAllGood (const std::vector< BaseStatusSignal * > &signals)
 Checks if all signals have an OK error code. More...
 
template<size_t N>
static bool IsAllGood (const std::array< BaseStatusSignal *, N > &signals)
 Checks if all signals have an OK error code. More...
 
template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static ctre::phoenix::StatusCode SetUpdateFrequencyForAll (units::frequency::hertz_t frequencyHz, Signals &... signals)
 Sets the update frequency of all specified status signals to the provided common frequency. More...
 
static ctre::phoenix::StatusCode SetUpdateFrequencyForAll (units::frequency::hertz_t frequencyHz, const std::vector< BaseStatusSignal * > &signals)
 Sets the update frequency of all specified status signals to the provided common frequency. More...
 
template<size_t N>
static ctre::phoenix::StatusCode SetUpdateFrequencyForAll (units::frequency::hertz_t frequencyHz, const std::array< BaseStatusSignal *, N > &signals)
 Sets the update frequency of all specified status signals to the provided common frequency. More...
 

Protected Member Functions

void CopyFrom (const BaseStatusSignal &other)
 
 BaseStatusSignal (hardware::DeviceIdentifier deviceIdentifier, uint16_t spn, std::string signalName, std::function< void()> checkFirmVersFunction)
 
 BaseStatusSignal (ctre::phoenix::StatusCode error)
 

Static Protected Member Functions

static ctre::phoenix::StatusCode Status_WaitForAll (BaseStatusSignal *const *signals, size_t count, const char *network, double timeoutSeconds)
 Wait for multiple signals to arrive. More...
 
static ctre::phoenix::StatusCode Status_SetUpdateFrequency (const char *canbus, uint32_t deviceHash, uint16_t spn, double frequencyHz, double timeoutSeconds)
 
static ctre::phoenix::StatusCode Status_SetUpdateFrequencyForAll (BaseStatusSignal *const *signals, size_t count, double frequencyHz, double timeoutSeconds)
 
static double Status_GetAppliedUpdateFrequency (const char *canbus, uint32_t deviceHash, uint16_t spn)
 
static std::string Status_GetUnits (uint32_t signal)
 Gets signal units. More...
 
static ctre::phoenix::StatusCode Status_Get (const char *network, int deviceHash, uint32_t signal, bool bWaitForUpdate, double timeoutSeconds, double *outValue, double *hwtimestamp, double *swtimestamp, double *ecutimestamp)
 Get signal update. More...
 
template<typename Arr >
static ctre::phoenix::StatusCode WaitForAllImpl (const char *location, units::time::second_t timeoutSeconds, const Arr &signals)
 Implementation of the WaitForAll API. More...
 

Protected Attributes

hardware::DeviceIdentifier deviceIdentifier
 
uint16_t spn
 
std::string units
 
AllTimestamps timestamps {}
 
double baseValue = 0
 
ctre::phoenix::StatusCode error = ctre::phoenix::StatusCode::SigNotUpdated
 
std::string signalName
 
std::function< void()> _checkFirmVersFunction
 
units::time::second_t _lastTimestamp {0_s}
 

Static Protected Attributes

template<typename... Signals>
static constexpr bool is_all_status_signal_v = is_all_status_signal<Signals...>::value
 Whether all types passed in are subclasses of BaseStatusSignal. More...
 

Friends

template<typename T >
class StatusSignal
 

Detailed Description

Class that provides operations to retrieve information about a status signal.

Constructor & Destructor Documentation

◆ BaseStatusSignal() [1/2]

ctre::phoenix6::BaseStatusSignal::BaseStatusSignal ( hardware::DeviceIdentifier  deviceIdentifier,
uint16_t  spn,
std::string  signalName,
std::function< void()>  checkFirmVersFunction 
)
inlineprotected

◆ BaseStatusSignal() [2/2]

ctre::phoenix6::BaseStatusSignal::BaseStatusSignal ( ctre::phoenix::StatusCode  error)
inlineprotected

◆ ~BaseStatusSignal()

virtual ctre::phoenix6::BaseStatusSignal::~BaseStatusSignal ( )
pure virtual

Member Function Documentation

◆ CopyFrom()

void ctre::phoenix6::BaseStatusSignal::CopyFrom ( const BaseStatusSignal other)
inlineprotected

◆ GetAllTimestamps()

const AllTimestamps & ctre::phoenix6::BaseStatusSignal::GetAllTimestamps ( ) const
inline

Get the timestamps of this signals.

Returns
All timestamps for this signal

◆ GetAppliedUpdateFrequency()

virtual units::frequency::hertz_t ctre::phoenix6::BaseStatusSignal::GetAppliedUpdateFrequency ( ) const
pure virtual

Gets the rate at which the device will publish this signal.

This is typically the last value passed into SetUpdateFrequency. The returned value may be higher if another StatusSignal in the same status frame has been set to a higher update frequency.

Returns
Applied update frequency of the signal in Hz

Implemented in ctre::phoenix6::StatusSignal< T >, ctre::phoenix6::StatusSignal< units::angle::turn_t >, ctre::phoenix6::StatusSignal< int >, ctre::phoenix6::StatusSignal< units::angle::degree_t >, ctre::phoenix6::StatusSignal< units::angular_velocity::degrees_per_second_t >, and ctre::phoenix6::StatusSignal< units::dimensionless::scalar_t >.

◆ GetLatencyCompensatedValue()

template<typename U , typename U_PER_SEC >
static U ctre::phoenix6::BaseStatusSignal::GetLatencyCompensatedValue ( StatusSignal< U > &  signal,
StatusSignal< U_PER_SEC > &  signalSlope,
units::time::second_t  maxLatencySeconds = 0.300_s 
)
inlinestatic

Performs latency compensation on signal using the signalSlope and signal's latency to determine the magnitude of compensation.

The caller must refresh these StatusSignals beforehand; this function only does the math required for latency compensation.

Example usage:

units::turn_t compensatedTurns = BaseStatusSignal::GetLatencyCompensatedValue(fx.GetPosition(), fx.GetVelocity());
static U GetLatencyCompensatedValue(StatusSignal< U > &signal, StatusSignal< U_PER_SEC > &signalSlope, units::time::second_t maxLatencySeconds=0.300_s)
Performs latency compensation on signal using the signalSlope and signal's latency to determine the m...
Definition: StatusSignal.hpp:386
Template Parameters
UType of signal's underlying type. This is the type that the function will return.
U_PER_SECType of signalSlope's underlying type. This must be the derivative of U.
Parameters
signalSignal to be latency compensated. Caller must make sure this signal is up to date either by calling Refresh() or WaitForUpdate().
signalSlopeDerivative of signal that informs compensation magnitude. Caller must make sure this signal is up to date either by calling Refresh() or WaitForUpdate().
maxLatencySecondsThe maximum amount of latency to compensate for in seconds. A negative or zero value disables the max latency cap. This is used to cap the contribution of latency compensation for stale signals, such as after the device has been disconnected from the CAN bus.
Returns
Latency compensated value from the signal StatusSignal.

◆ GetName()

const std::string & ctre::phoenix6::BaseStatusSignal::GetName ( ) const
inline

Gets the name of this signal.

Returns
Name of this signal

◆ GetStatus()

ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::GetStatus ( ) const
inline

Get the error code from when we last received this signal.

Returns
Last cached Error Code

◆ GetTimestamp()

const Timestamp & ctre::phoenix6::BaseStatusSignal::GetTimestamp ( ) const
inline

Get the best timestamp available to this signal.

Returns
Best available timestamp for this signal

◆ GetUnits()

const std::string & ctre::phoenix6::BaseStatusSignal::GetUnits ( ) const
inline

Gets the units for this signal.

Returns
String representation of units for this signal

◆ GetValueAsDouble()

double ctre::phoenix6::BaseStatusSignal::GetValueAsDouble ( ) const
inline

Gets the value of this signal as a double.

Returns
Value of this signal as a double instead of the generic type

◆ HasUpdated()

bool ctre::phoenix6::BaseStatusSignal::HasUpdated ( )
inline

Check whether the signal has been updated since the last check.

Note that the signal must be refreshed before calling this routine.

Returns
true if the signal has updated since the previous call of this routine

◆ IsAllGood() [1/3]

template<size_t N>
static bool ctre::phoenix6::BaseStatusSignal::IsAllGood ( const std::array< BaseStatusSignal *, N > &  signals)
inlinestatic

Checks if all signals have an OK error code.

Parameters
signalsSignals to check error code of, passed as an array of signal addresses.
Returns
True if all signals are OK, false otherwise

◆ IsAllGood() [2/3]

static bool ctre::phoenix6::BaseStatusSignal::IsAllGood ( const std::vector< BaseStatusSignal * > &  signals)
inlinestatic

Checks if all signals have an OK error code.

Parameters
signalsSignals to check error code of, passed as a vector or initializer list of signal addresses.
Returns
True if all signals are OK, false otherwise

◆ IsAllGood() [3/3]

template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static bool ctre::phoenix6::BaseStatusSignal::IsAllGood ( Signals &...  signals)
inlinestatic

Checks if all signals have an OK error code.

Parameters
signalsSignals to check error code of, passed as a comma-separated list of signal references.
Returns
True if all signals are OK, false otherwise

◆ RefreshAll() [1/3]

template<size_t N>
static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::RefreshAll ( const std::array< BaseStatusSignal *, N > &  signals)
inlinestatic

Performs a non-blocking refresh on all provided signals.

This provides a performance improvement over separately calling Refresh() on each signal.

Parameters
signalsSignals to refresh, passed as an array of signal addresses.
Returns
An InvalidParamValue if signals array is empty, InvalidNetwork if signals are on different CAN bus networks. An OK status code means that all signals are OK.

Any other value represents the StatusCode of the first failed signal. Call GetStatus() on each signal to determine which ones failed.

◆ RefreshAll() [2/3]

static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::RefreshAll ( const std::vector< BaseStatusSignal * > &  signals)
inlinestatic

Performs a non-blocking refresh on all provided signals.

This provides a performance improvement over separately calling Refresh() on each signal.

Parameters
signalsSignals to refresh, passed as a vector or initializer list of signal addresses.
Returns
An InvalidParamValue if signals array is empty, InvalidNetwork if signals are on different CAN bus networks. An OK status code means that all signals are OK.

Any other value represents the StatusCode of the first failed signal. Call GetStatus() on each signal to determine which ones failed.

◆ RefreshAll() [3/3]

template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::RefreshAll ( Signals &...  signals)
inlinestatic

Performs a non-blocking refresh on all provided signals.

This provides a performance improvement over separately calling Refresh() on each signal.

Parameters
signalsSignals to refresh, passed as a comma-separated list of signal references.
Returns
An InvalidParamValue if signals array is empty, InvalidNetwork if signals are on different CAN bus networks. An OK status code means that all signals are OK.

Any other value represents the StatusCode of the first failed signal. Call GetStatus() on each signal to determine which ones failed.

◆ SetUpdateFrequency()

virtual ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::SetUpdateFrequency ( units::frequency::hertz_t  frequencyHz,
units::time::second_t  timeoutSeconds = 50_ms 
)
pure virtual

Sets the rate at which the device will publish this signal.

A frequency of 0 Hz will turn off the signal. Otherwise, the minimum supported signal frequency is 4 Hz, and the maximum is 1000 Hz.

If other StatusSignals in the same status frame have been set to an update frequency, the fastest requested update frequency will be applied to the frame.

Parameters
frequencyHzRate to publish the signal in Hz.
timeoutSecondsMaximum amount of time to wait when performing the action
Returns
Status code of setting the update frequency

Implemented in ctre::phoenix6::StatusSignal< T >, ctre::phoenix6::StatusSignal< units::angle::turn_t >, ctre::phoenix6::StatusSignal< int >, ctre::phoenix6::StatusSignal< units::angle::degree_t >, ctre::phoenix6::StatusSignal< units::angular_velocity::degrees_per_second_t >, and ctre::phoenix6::StatusSignal< units::dimensionless::scalar_t >.

◆ SetUpdateFrequencyForAll() [1/3]

template<size_t N>
static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::SetUpdateFrequencyForAll ( units::frequency::hertz_t  frequencyHz,
const std::array< BaseStatusSignal *, N > &  signals 
)
inlinestatic

Sets the update frequency of all specified status signals to the provided common frequency.

A frequency of 0 Hz will turn off the signal. Otherwise, the minimum supported signal frequency is 4 Hz, and the maximum is 1000 Hz.

If other StatusSignals in the same status frame have been set to an update frequency, the fastest requested update frequency will be applied to the frame.

This will wait up to 0.050 seconds (50ms) for each signal.

Parameters
frequencyHzRate to publish the signal in Hz.
signalsSignals to apply the update frequency to, passed as an array of signal addresses.
Returns
Status code of the first failed update frequency set call, or OK if all succeeded

◆ SetUpdateFrequencyForAll() [2/3]

static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::SetUpdateFrequencyForAll ( units::frequency::hertz_t  frequencyHz,
const std::vector< BaseStatusSignal * > &  signals 
)
inlinestatic

Sets the update frequency of all specified status signals to the provided common frequency.

A frequency of 0 Hz will turn off the signal. Otherwise, the minimum supported signal frequency is 4 Hz, and the maximum is 1000 Hz.

If other StatusSignals in the same status frame have been set to an update frequency, the fastest requested update frequency will be applied to the frame.

This will wait up to 0.050 seconds (50ms) for each signal.

Parameters
frequencyHzRate to publish the signal in Hz.
signalsSignals to apply the update frequency to, passed as a vector or initializer list of signal addresses.
Returns
Status code of the first failed update frequency set call, or OK if all succeeded

◆ SetUpdateFrequencyForAll() [3/3]

template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::SetUpdateFrequencyForAll ( units::frequency::hertz_t  frequencyHz,
Signals &...  signals 
)
inlinestatic

Sets the update frequency of all specified status signals to the provided common frequency.

A frequency of 0 Hz will turn off the signal. Otherwise, the minimum supported signal frequency is 4 Hz, and the maximum is 1000 Hz.

If other StatusSignals in the same status frame have been set to an update frequency, the fastest requested update frequency will be applied to the frame.

This will wait up to 0.050 seconds (50ms) for each signal.

Parameters
frequencyHzRate to publish the signal in Hz.
signalsSignals to apply the update frequency to, passed as a comma-separated list of signal references.
Returns
Status code of the first failed update frequency set call, or OK if all succeeded

◆ Status_Get()

static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::Status_Get ( const char *  network,
int  deviceHash,
uint32_t  signal,
bool  bWaitForUpdate,
double  timeoutSeconds,
double *  outValue,
double *  hwtimestamp,
double *  swtimestamp,
double *  ecutimestamp 
)
staticprotected

Get signal update.

Caller either get last received, or wait for an update.

Parameters
networkName of bus (can, canfd, canivore-name, future protocols)
deviceHashHash id of the device (based on device id and model)
signalSignal to get
bWaitForUpdateIf true, API will wait up to timeoutSeconds for an update. If false, routine will poll last received and use timeoutSeconds to return error code if too old.
timeoutSecondsHow long to wait or how old the signal can be before error'ing
outValueValue of the signal
hwtimestampTimestamp of the signal
swtimestampTimestamp of the signal
ecutimestampTimestamp of the signal
Returns
Status of the get

◆ Status_GetAppliedUpdateFrequency()

static double ctre::phoenix6::BaseStatusSignal::Status_GetAppliedUpdateFrequency ( const char *  canbus,
uint32_t  deviceHash,
uint16_t  spn 
)
staticprotected

◆ Status_GetUnits()

static std::string ctre::phoenix6::BaseStatusSignal::Status_GetUnits ( uint32_t  signal)
staticprotected

Gets signal units.

Parameters
signalSignal to get
Returns
Units of the signal

◆ Status_SetUpdateFrequency()

static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::Status_SetUpdateFrequency ( const char *  canbus,
uint32_t  deviceHash,
uint16_t  spn,
double  frequencyHz,
double  timeoutSeconds 
)
staticprotected

◆ Status_SetUpdateFrequencyForAll()

static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::Status_SetUpdateFrequencyForAll ( BaseStatusSignal *const *  signals,
size_t  count,
double  frequencyHz,
double  timeoutSeconds 
)
staticprotected

◆ Status_WaitForAll()

static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::Status_WaitForAll ( BaseStatusSignal *const *  signals,
size_t  count,
const char *  network,
double  timeoutSeconds 
)
staticprotected

Wait for multiple signals to arrive.

Parameters
signalsSignals to wait for
countNumber of signals
networkNetwork to wait for the signals on
timeoutSecondsMaximum time to wait for all these signals
Returns
Status of the wait

◆ WaitForAll() [1/3]

template<size_t N>
static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::WaitForAll ( units::time::second_t  timeoutSeconds,
const std::array< BaseStatusSignal *, N > &  signals 
)
inlinestatic

Waits for new data on all provided signals up to timeout.

This API is typically used with CANivore Bus signals as they will be synced using the CANivore Timesync feature and arrive simultaneously. Signals on a roboRIO bus cannot be synced and may require a significantly longer blocking call to receive all signals.

Note that CANivore Timesync requires Phoenix Pro.

This can also be used with a timeout of zero to refresh many signals at once, which is faster than calling Refresh() on every signal. This is equivalent to calling RefreshAll.

Parameters
timeoutSecondsMaximum time to wait for all the signals to arrive. Pass zero to refresh all signals without blocking.
signalsSignals to wait on, passed as an array of signal addresses.
Returns
An InvalidParamValue if signals array is empty, InvalidNetwork if signals are on different CAN bus networks, RxTimeout if it took longer than timeoutSeconds to receive all the signals, MultiSignalNotSupported if using the roboRIO bus with more than one signal and a non-zero timeout. An OK status code means that all signals arrived within timeoutSeconds and they are all OK.

Any other value represents the StatusCode of the first failed signal. Call GetStatus() on each signal to determine which ones failed.

◆ WaitForAll() [2/3]

static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::WaitForAll ( units::time::second_t  timeoutSeconds,
const std::vector< BaseStatusSignal * > &  signals 
)
inlinestatic

Waits for new data on all provided signals up to timeout.

This API is typically used with CANivore Bus signals as they will be synced using the CANivore Timesync feature and arrive simultaneously. Signals on a roboRIO bus cannot be synced and may require a significantly longer blocking call to receive all signals.

Note that CANivore Timesync requires Phoenix Pro.

This can also be used with a timeout of zero to refresh many signals at once, which is faster than calling Refresh() on every signal. This is equivalent to calling RefreshAll.

Parameters
timeoutSecondsMaximum time to wait for all the signals to arrive. Pass zero to refresh all signals without blocking.
signalsSignals to wait on, passed as a vector or initializer list of signal addresses.
Returns
An InvalidParamValue if signals array is empty, InvalidNetwork if signals are on different CAN bus networks, RxTimeout if it took longer than timeoutSeconds to receive all the signals, MultiSignalNotSupported if using the roboRIO bus with more than one signal and a non-zero timeout. An OK status code means that all signals arrived within timeoutSeconds and they are all OK.

Any other value represents the StatusCode of the first failed signal. Call GetStatus() on each signal to determine which ones failed.

◆ WaitForAll() [3/3]

template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::WaitForAll ( units::time::second_t  timeoutSeconds,
Signals &...  signals 
)
inlinestatic

Waits for new data on all provided signals up to timeout.

This API is typically used with CANivore Bus signals as they will be synced using the CANivore Timesync feature and arrive simultaneously. Signals on a roboRIO bus cannot be synced and may require a significantly longer blocking call to receive all signals.

Note that CANivore Timesync requires Phoenix Pro.

This can also be used with a timeout of zero to refresh many signals at once, which is faster than calling Refresh() on every signal. This is equivalent to calling RefreshAll.

Parameters
timeoutSecondsMaximum time to wait for all the signals to arrive. Pass zero to refresh all signals without blocking.
signalsSignals to wait on, passed as a comma-separated list of signal references.
Returns
An InvalidParamValue if signals array is empty, InvalidNetwork if signals are on different CAN bus networks, RxTimeout if it took longer than timeoutSeconds to receive all the signals, MultiSignalNotSupported if using the roboRIO bus with more than one signal and a non-zero timeout. An OK status code means that all signals arrived within timeoutSeconds and they are all OK.

Any other value represents the StatusCode of the first failed signal. Call GetStatus() on each signal to determine which ones failed.

◆ WaitForAllImpl()

template<typename Arr >
static ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::WaitForAllImpl ( const char *  location,
units::time::second_t  timeoutSeconds,
const Arr &  signals 
)
inlinestaticprotected

Implementation of the WaitForAll API.

Template Parameters
Arrstd::array or std::vector of BaseStatusSignal*
Parameters
locationLocation of the calling function
timeoutSecondsMaximum time to wait for all the signals
signalsSignals to wait on
Returns
Status of the wait

Friends And Related Function Documentation

◆ StatusSignal

template<typename T >
friend class StatusSignal
friend

Member Data Documentation

◆ _checkFirmVersFunction

std::function<void()> ctre::phoenix6::BaseStatusSignal::_checkFirmVersFunction
protected

◆ _lastTimestamp

units::time::second_t ctre::phoenix6::BaseStatusSignal::_lastTimestamp {0_s}
protected

◆ baseValue

double ctre::phoenix6::BaseStatusSignal::baseValue = 0
protected

◆ deviceIdentifier

hardware::DeviceIdentifier ctre::phoenix6::BaseStatusSignal::deviceIdentifier
protected

◆ error

ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::error = ctre::phoenix::StatusCode::SigNotUpdated
protected

◆ is_all_status_signal_v

template<typename... Signals>
constexpr bool ctre::phoenix6::BaseStatusSignal::is_all_status_signal_v = is_all_status_signal<Signals...>::value
staticconstexprprotected

Whether all types passed in are subclasses of BaseStatusSignal.

◆ signalName

std::string ctre::phoenix6::BaseStatusSignal::signalName
protected

◆ spn

uint16_t ctre::phoenix6::BaseStatusSignal::spn
protected

◆ timestamps

AllTimestamps ctre::phoenix6::BaseStatusSignal::timestamps {}
protected

◆ units

std::string ctre::phoenix6::BaseStatusSignal::units
protected

The documentation for this class was generated from the following file: