14#include <units/frequency.h>
15#include <units/time.h>
27 ctre::phoenix::StatusCode SendRequest(
const char *network, uint32_t deviceHash, std::shared_ptr<ControlRequest> &req)
const override
29 if (req.get() !=
this)
31 auto const reqCast =
dynamic_cast<StaticBrake *
>(req.get());
32 if (reqCast !=
nullptr)
38 req = std::make_shared<StaticBrake>(*
this);
125 std::stringstream ss;
126 ss <<
"Control: StaticBrake" << std::endl;
127 ss <<
" UseTimesync: " <<
UseTimesync << std::endl;
138 std::map<std::string, std::string> controlInfo;
139 std::stringstream ss;
140 controlInfo[
"Name"] =
GetName();
141 ss <<
UseTimesync; controlInfo[
"UseTimesync"] = ss.str(); ss.str(std::string{});
CTREXPORT int c_ctre_phoenix6_RequestControlStaticBrake(const char *canbus, uint32_t ecuEncoding, double updateTime, bool UseTimesync)
Abstract Control Request class that other control requests extend for use.
Definition ControlRequest.hpp:29
std::string const & GetName() const
Definition ControlRequest.hpp:52
Applies full neutral-brake by shorting motor leads together.
Definition StaticBrake.hpp:26
std::map< std::string, std::string > GetControlInfo() const override
Gets information about this control request.
Definition StaticBrake.hpp:136
std::string ToString() const override
Returns a string representation of the object.
Definition StaticBrake.hpp:123
bool UseTimesync
Set to true to delay applying this control request until a timesync boundary (requires Phoenix Pro an...
Definition StaticBrake.hpp:56
StaticBrake()
Applies full neutral-brake by shorting motor leads together.
Definition StaticBrake.hpp:75
StaticBrake & WithUseTimesync(bool newUseTimesync)
Modifies this Control Request's UseTimesync parameter and returns itself for method-chaining and easi...
Definition StaticBrake.hpp:94
units::frequency::hertz_t UpdateFreqHz
The period at which this control will update at.
Definition StaticBrake.hpp:69
StaticBrake & WithUpdateFreqHz(units::frequency::hertz_t newUpdateFreqHz)
Sets the period at which this control will update at.
Definition StaticBrake.hpp:113
Status codes reported by APIs, including OK, warnings, and errors.
Definition StatusCodes.h:27
Definition StatusCodes.h:18