WPILibC++ 2027.0.0-alpha-2
Loading...
Searching...
No Matches
frc::sim::AddressableLEDSim Class Reference

Class to control a simulated addressable LED. More...

#include <frc/simulation/AddressableLEDSim.h>

Public Member Functions

 AddressableLEDSim (int channel)
 Constructs an addressable LED for a specific channel.
 
 AddressableLEDSim (const AddressableLED &addressableLED)
 Constructs from an AddressableLED object.
 
std::unique_ptr< CallbackStoreRegisterInitializedCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the Initialized property.
 
bool GetInitialized () const
 Check if initialized.
 
void SetInitialized (bool initialized)
 Change the Initialized value of the LED strip.
 
std::unique_ptr< CallbackStoreRegisterStartCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the start.
 
int GetStart () const
 Get the start.
 
void SetStart (int start)
 Change the start.
 
std::unique_ptr< CallbackStoreRegisterLengthCallback (NotifyCallback callback, bool initialNotify)
 Register a callback on the length.
 
int GetLength () const
 Get the length of the LED strip.
 
void SetLength (int length)
 Change the length of the LED strip.
 
int GetData (struct HAL_AddressableLEDData *data) const
 Get the LED data.
 
void SetData (struct HAL_AddressableLEDData *data)
 Change the LED data.
 

Static Public Member Functions

static std::unique_ptr< CallbackStoreRegisterDataCallback (ConstBufferCallback callback, bool initialNotify)
 Register a callback on the LED data.
 
static int GetGlobalData (int start, int length, struct HAL_AddressableLEDData *data)
 Get the global LED data.
 
static void SetGlobalData (int start, int length, struct HAL_AddressableLEDData *data)
 Change the global LED data.
 

Detailed Description

Class to control a simulated addressable LED.

Constructor & Destructor Documentation

◆ AddressableLEDSim() [1/2]

frc::sim::AddressableLEDSim::AddressableLEDSim ( int channel)
explicit

Constructs an addressable LED for a specific channel.

Parameters
channeloutput channel

◆ AddressableLEDSim() [2/2]

frc::sim::AddressableLEDSim::AddressableLEDSim ( const AddressableLED & addressableLED)
explicit

Constructs from an AddressableLED object.

Parameters
addressableLEDAddressableLED to simulate

Member Function Documentation

◆ GetData()

int frc::sim::AddressableLEDSim::GetData ( struct HAL_AddressableLEDData * data) const

Get the LED data.

Parameters
dataoutput parameter to fill with LED data
Returns
the length of the LED data

◆ GetGlobalData()

static int frc::sim::AddressableLEDSim::GetGlobalData ( int start,
int length,
struct HAL_AddressableLEDData * data )
static

Get the global LED data.

Parameters
startthe start of the LED data
lengththe length of the LED data
dataoutput parameter to fill with LED data
Returns
the length of the LED data

◆ GetInitialized()

bool frc::sim::AddressableLEDSim::GetInitialized ( ) const

Check if initialized.

Returns
true if initialized

◆ GetLength()

int frc::sim::AddressableLEDSim::GetLength ( ) const

Get the length of the LED strip.

Returns
the length

◆ GetStart()

int frc::sim::AddressableLEDSim::GetStart ( ) const

Get the start.

Returns
the start

◆ RegisterDataCallback()

static std::unique_ptr< CallbackStore > frc::sim::AddressableLEDSim::RegisterDataCallback ( ConstBufferCallback callback,
bool initialNotify )
staticnodiscard

Register a callback on the LED data.

Parameters
callbackthe callback that will be called whenever the LED data is changed
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterInitializedCallback()

std::unique_ptr< CallbackStore > frc::sim::AddressableLEDSim::RegisterInitializedCallback ( NotifyCallback callback,
bool initialNotify )
nodiscard

Register a callback on the Initialized property.

Parameters
callbackthe callback that will be called whenever the Initialized property is changed
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object storing this callback

◆ RegisterLengthCallback()

std::unique_ptr< CallbackStore > frc::sim::AddressableLEDSim::RegisterLengthCallback ( NotifyCallback callback,
bool initialNotify )
nodiscard

Register a callback on the length.

Parameters
callbackthe callback that will be called whenever the length is changed
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ RegisterStartCallback()

std::unique_ptr< CallbackStore > frc::sim::AddressableLEDSim::RegisterStartCallback ( NotifyCallback callback,
bool initialNotify )
nodiscard

Register a callback on the start.

Parameters
callbackthe callback that will be called whenever the start is changed
initialNotifyif true, the callback will be run on the initial value
Returns
the CallbackStore object associated with this callback

◆ SetData()

void frc::sim::AddressableLEDSim::SetData ( struct HAL_AddressableLEDData * data)

Change the LED data.

Parameters
datathe new data

◆ SetGlobalData()

static void frc::sim::AddressableLEDSim::SetGlobalData ( int start,
int length,
struct HAL_AddressableLEDData * data )
static

Change the global LED data.

Parameters
startthe start of the LED data
lengththe length of the LED data
datathe new data

◆ SetInitialized()

void frc::sim::AddressableLEDSim::SetInitialized ( bool initialized)

Change the Initialized value of the LED strip.

Parameters
initializedthe new value

◆ SetLength()

void frc::sim::AddressableLEDSim::SetLength ( int length)

Change the length of the LED strip.

Parameters
lengththe new value

◆ SetStart()

void frc::sim::AddressableLEDSim::SetStart ( int start)

Change the start.

Parameters
startthe new start

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