16#include "sensorring/device/hardware/ws2812b/WS2812b_Params.hpp"
18#include "sensorring/platform/SensorringExport.hpp"
24class WS2812b_DeviceImpl;
58 static bool setLight(
LightMode mode, std::uint8_t red, std::uint8_t green, std::uint8_t blue);
71 void comCallback(
const com::ComEndpoint source,
const std::vector<uint8_t>& data)
override;
73 void onResetSensorState()
override;
74 void onClearDataFlag()
override;
76 friend class WS2812b_DeviceImpl;
77 std::unique_ptr<WS2812b_DeviceImpl> _impl;
Base device combining IDevice and BaseSensor with device ID and state.
Interface type definition.
LightMode
Light mode enumeration.
Definition LightMode.hpp:22
Uniquely identifies a communication endpoint by its string ID.
Definition ComEndpoint.hpp:25
BaseDevice(DeviceID id, com::ComInterface *interface, com::ComEndpoint target, bool enable)
Constructs the device with the given ID, communication interface, endpoint, and enable flag.
static bool setLight(LightMode mode, std::uint8_t red, std::uint8_t green, std::uint8_t blue)
Set light mode and color for all WS2812b devices on the bus.
WS2812b_Device(WS2812b_Params params, com::ComInterfaceID interface, unsigned int idx)
Construct a new WS2812b device instance.
const WS2812b_Params & getParams() const
Get the parameters used to configure this device.
static bool syncLight()
Synchronize pending light updates on all WS2812b devices.
~WS2812b_Device()
Destructor.
Definition ComInterfaceID.hpp:32
Parameter structure of the sensor lights of a sensor board. Not all sensor boards have lights.
Definition WS2812b_Params.hpp:19