Class that provides operations to retrieve information about a status signal.
More...
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
static ctre::phoenix::StatusCode | RefreshAll (const std::vector< BaseStatusSignal * > &signals) |
| Performs a non-blocking refresh on all provided signals.
|
|
template<size_t N> |
static ctre::phoenix::StatusCode | RefreshAll (const std::array< BaseStatusSignal *, N > &signals) |
| Performs a non-blocking refresh on all provided signals.
|
|
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.
|
|
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.
|
|
static bool | IsAllGood (const std::vector< BaseStatusSignal * > &signals) |
| Checks if all signals have an OK error code.
|
|
template<size_t N> |
static bool | IsAllGood (const std::array< BaseStatusSignal *, N > &signals) |
| Checks if all signals have an OK error code.
|
|
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.
|
|
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.
|
|
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.
|
|
|
static ctre::phoenix::StatusCode | Status_WaitForAll (BaseStatusSignal *const *signals, size_t count, const char *network, double timeoutSeconds) |
| Wait for multiple signals to arrive.
|
|
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.
|
|
static ctre::phoenix::StatusCode | Status_Get (BaseStatusSignal &signal, const char *network, bool bWaitForUpdate, double timeoutSeconds) |
| Get signal update.
|
|
template<typename Arr > |
static ctre::phoenix::StatusCode | WaitForAllImpl (const char *location, units::time::second_t timeoutSeconds, const Arr &signals) |
| Implementation of the WaitForAll API.
|
|
Class that provides operations to retrieve information about a status signal.
template<typename... Signals, typename = std::enable_if_t<is_all_status_signal_v<Signals...>>>
Performs a non-blocking refresh on all provided signals.
This provides a performance improvement over separately calling Refresh() on each signal.
- Parameters
-
signals | Signals 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.
ctre::phoenix::StatusCode ctre::phoenix6::BaseStatusSignal::SetUpdateFrequency |
( |
units::frequency::hertz_t | frequencyHz, |
|
|
units::time::second_t | timeoutSeconds = 100_ms ) |
|
inline |
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
-
frequencyHz | Rate to publish the signal in Hz. |
timeoutSeconds | Maximum amount of time to wait when performing the action |
- Returns
- Status code of setting the update frequency
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.100 seconds (100ms) for each signal.
- Parameters
-
frequencyHz | Rate to publish the signal in Hz. |
signals | Signals 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
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.100 seconds (100ms) for each signal.
- Parameters
-
frequencyHz | Rate to publish the signal in Hz. |
signals | Signals 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
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.100 seconds (100ms) for each signal.
- Parameters
-
frequencyHz | Rate to publish the signal in Hz. |
signals | Signals 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
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.
If a signal arrives multiple times while waiting, such as when not using CANivore Timesync, the newest signal data is fetched. Additionally, if this function times out, the newest signal data is fetched for all signals (when possible). We recommend checking the individual status codes using GetStatus() when this happens.
- Parameters
-
timeoutSeconds | Maximum time to wait for all the signals to arrive. Pass zero to refresh all signals without blocking. |
signals | Signals 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.
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.
If a signal arrives multiple times while waiting, such as when not using CANivore Timesync, the newest signal data is fetched. Additionally, if this function times out, the newest signal data is fetched for all signals (when possible). We recommend checking the individual status codes using GetStatus() when this happens.
- Parameters
-
timeoutSeconds | Maximum time to wait for all the signals to arrive. Pass zero to refresh all signals without blocking. |
signals | Signals 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.
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.
If a signal arrives multiple times while waiting, such as when not using CANivore Timesync, the newest signal data is fetched. Additionally, if this function times out, the newest signal data is fetched for all signals (when possible). We recommend checking the individual status codes using GetStatus() when this happens.
- Parameters
-
timeoutSeconds | Maximum time to wait for all the signals to arrive. Pass zero to refresh all signals without blocking. |
signals | Signals 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.