#include <ctre/phoenixpro/StatusSignalValue.hpp>
|
static ctre::phoenix::StatusCode | Status_WaitForAll (std::initializer_list< BaseStatusSignalValue * > signals, const char *network, units::time::second_t timeoutSeconds) |
| Wait for multiple signals to arrive. More...
|
|
static ctre::phoenix::StatusCode | Status_WaitForAll (const std::vector< BaseStatusSignalValue * > &signals, const char *network, units::time::second_t timeoutSeconds) |
| Wait for multiple signals to arrive. More...
|
|
static ctre::phoenix::StatusCode | Status_Get (const char *network, int deviceHash, uint32_t signal, bool bWaitForUpdate, units::time::second_t timeoutSeconds, double *outValue, std::string *units, double *hwtimestamp, double *swtimestamp, double *ecutimestamp, int32_t *timestampType) |
| Get signal update. More...
|
|
◆ BaseStatusSignalValue() [1/2]
ctre::phoenixpro::BaseStatusSignalValue::BaseStatusSignalValue |
( |
hardware::DeviceIdentifier |
deviceIdentifier, |
|
|
uint16_t |
spn, |
|
|
std::string |
signalName |
|
) |
| |
|
inlineprotected |
◆ BaseStatusSignalValue() [2/2]
ctre::phoenixpro::BaseStatusSignalValue::BaseStatusSignalValue |
( |
ctre::phoenix::StatusCode |
error | ) |
|
|
inlineprotected |
◆ ~BaseStatusSignalValue()
virtual ctre::phoenixpro::BaseStatusSignalValue::~BaseStatusSignalValue |
( |
| ) |
|
|
pure virtual |
◆ CopyFrom()
◆ GetAllTimestamps()
const AllTimestamps & ctre::phoenixpro::BaseStatusSignalValue::GetAllTimestamps |
( |
| ) |
const |
|
inline |
Get the timestamps of this signals.
- Returns
- All timestamps for this signal
◆ GetError()
ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::GetError |
( |
| ) |
const |
|
inline |
Get the error code from when we last received this signal.
- Returns
- Last cached Error Code
◆ GetLatencyCompensatedValue()
template<typename U , typename U_PER_SEC >
◆ GetTimestamp()
const Timestamp & ctre::phoenixpro::BaseStatusSignalValue::GetTimestamp |
( |
| ) |
const |
|
inline |
Get the best timestamp available to this signal.
- Returns
- Best available timestamp for this signal
◆ GetUnits()
const std::string & ctre::phoenixpro::BaseStatusSignalValue::GetUnits |
( |
| ) |
const |
|
inline |
Gets the units for this signal.
- Returns
- String representation of units for this signal
◆ IsAllGood()
static ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::IsAllGood |
( |
std::initializer_list< BaseStatusSignalValue * > |
signals | ) |
|
|
inlinestatic |
Check if all signals have an OK error code.
- Parameters
-
signals | Signals to check error code of. |
- Returns
- True if all signals are OK, false otherwise
◆ SetUpdateFrequency()
ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::SetUpdateFrequency |
( |
const char * |
canbus, |
|
|
uint32_t |
deviceHash, |
|
|
uint16_t |
spn, |
|
|
units::frequency::hertz_t |
frequencyHz, |
|
|
units::time::second_t |
timeoutSeconds |
|
) |
| |
|
protected |
◆ Status_Get()
static ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::Status_Get |
( |
const char * |
network, |
|
|
int |
deviceHash, |
|
|
uint32_t |
signal, |
|
|
bool |
bWaitForUpdate, |
|
|
units::time::second_t |
timeoutSeconds, |
|
|
double * |
outValue, |
|
|
std::string * |
units, |
|
|
double * |
hwtimestamp, |
|
|
double * |
swtimestamp, |
|
|
double * |
ecutimestamp, |
|
|
int32_t * |
timestampType |
|
) |
| |
|
staticprotected |
Get signal update.
Caller either get last received, or wait for an update.
- Parameters
-
network | Name of bus (can, canfd, canivore-name, future protocols) |
deviceHash | Hash id of the device (based on device id and model) |
signal | Signal to get |
bWaitForUpdate | If 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. |
timeoutSeconds | How long to wait or how old the signal can be before error'ing |
outValue | Value of the signal |
units | Unit that corresponds with signal |
hwtimestamp | Timestamp of the signal |
swtimestamp | Timestamp of the signal |
ecutimestamp | Timestamp of the signal |
timestampType | Which type of timestamp was gotten |
- Returns
- Status of the get
◆ Status_WaitForAll() [1/2]
static ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::Status_WaitForAll |
( |
const std::vector< BaseStatusSignalValue * > & |
signals, |
|
|
const char * |
network, |
|
|
units::time::second_t |
timeoutSeconds |
|
) |
| |
|
staticprotected |
Wait for multiple signals to arrive.
- Parameters
-
signals | Signals to wait for |
network | Network to wait for the signals on |
timeoutSeconds | Maximum time to wait for all these signals |
- Returns
- Status of the wait
◆ Status_WaitForAll() [2/2]
static ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::Status_WaitForAll |
( |
std::initializer_list< BaseStatusSignalValue * > |
signals, |
|
|
const char * |
network, |
|
|
units::time::second_t |
timeoutSeconds |
|
) |
| |
|
staticprotected |
Wait for multiple signals to arrive.
- Parameters
-
signals | Signals to wait for |
network | Network to wait for the signals on |
timeoutSeconds | Maximum time to wait for all these signals |
- Returns
- Status of the wait
◆ WaitForAll() [1/2]
static ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::WaitForAll |
( |
units::time::second_t |
timeoutSeconds, |
|
|
const std::vector< BaseStatusSignalValue * > & |
signals |
|
) |
| |
|
inlinestatic |
Wait for 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.
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.
- Parameters
-
timeoutSeconds | How long to wait for all the signals to arrive. Pass zero to just refresh all signals without blocking. |
signals | Signals to wait on, passed as vector 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. 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 GetError() on each signal to determine which ones failed.
◆ WaitForAll() [2/2]
static ctre::phoenix::StatusCode ctre::phoenixpro::BaseStatusSignalValue::WaitForAll |
( |
units::time::second_t |
timeoutSeconds, |
|
|
std::initializer_list< BaseStatusSignalValue * > |
signals |
|
) |
| |
|
inlinestatic |
Wait for 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.
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.
- Parameters
-
timeoutSeconds | How long to wait for all the signals to arrive. Pass zero to just refresh all signals without blocking. |
signals | Signals to wait on, passed as 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. 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 GetError() on each signal to determine which ones failed.
◆ StatusSignalValue
◆ baseValue
double ctre::phoenixpro::BaseStatusSignalValue::baseValue = 0 |
|
protected |
◆ deviceIdentifier
◆ error
◆ signalName
std::string ctre::phoenixpro::BaseStatusSignalValue::signalName |
|
protected |
◆ spn
uint16_t ctre::phoenixpro::BaseStatusSignalValue::spn |
|
protected |
◆ timestamps
AllTimestamps ctre::phoenixpro::BaseStatusSignalValue::timestamps {} |
|
protected |
◆ timestampType
int ctre::phoenixpro::BaseStatusSignalValue::timestampType |
|
protected |
◆ units
std::string ctre::phoenixpro::BaseStatusSignalValue::units |
|
protected |
The documentation for this class was generated from the following file: