20#include "sensorring/platform/SensorringExport.hpp"
110 void comCallback(
const com::ComEndpoint source, std::uint8_t command,
const std::vector<uint8_t>& data)
override;
112 bool requestParameter(std::uint8_t command, std::vector<uint8_t>& data);
114 static constexpr std::chrono::milliseconds GET_PARAMETER_SLEEP = std::chrono::milliseconds(10);
115 static constexpr std::chrono::milliseconds GET_PARAMETER_TIMEOUT = std::chrono::milliseconds(100);
117 std::mutex _parameter_mutex;
118 std::mutex _state_mutex;
119 std::atomic<bool> _got_update =
false;
120 std::uint8_t _pending_parameter = 0;
121 std::vector<uint8_t> _parameter_data;
127 std::uint8_t red = 0;
128 std::uint8_t green = 0;
129 std::uint8_t blue = 0;
Interface type definition.
LightMode
Light mode enumeration.
Definition LightMode.hpp:24
@ Off
All LEDs off.
Definition LightMode.hpp:25
Abstract interface for light/LED actuator devices.
Parameter structure for the WS2812b LED strip.
Light(DeviceID id, com::ComInterface *interface, com::ComEndpoint target)
Construct a Light with Device params.
WS2812b_Device(WS2812b_Params params, com::ComInterface *interface, unsigned int idx)
Construct with a non-owning communication interface supplied by a subclass.
WS2812b_Device(WS2812b_Params params, com::ComInterfaceID interface, unsigned int idx)
Construct a new WS2812b device instance.
bool getDistanceMapRange(double &lower_m, double &upper_m)
Read the current distance map range from the board in meters.
const WS2812b_Params & getParams() const override
Get the parameters used to configure this device.
Definition WS2812b_Device.hpp:82
bool configure() override
Re-apply runtime configuration after board reset.
static void syncLight()
Synchronize pending light updates on all WS2812b devices.
void setLight(LightMode mode, std::uint8_t r, std::uint8_t g, std::uint8_t b) override
Set the light mode and color. Enqueues a per-device CAN command into the action queue.
bool getDistanceMapMaxBrightness(std::int64_t &brightness)
Read the current distance map peak channel brightness from the board.
bool setDistanceMapRange(double lower_m, double upper_m)
Set the distance map range in meters and verify it by reading it back.
bool setDistanceMapMaxBrightness(std::int64_t brightness)
Set distance map peak channel brightness and verify it by reading it back.
Uniquely identifies a communication endpoint as a (Direction, BoardAddress, DeviceId) tuple.
Definition ComEndpoint.hpp:37
Uniquely identifies a communication interface by type and name.
Definition ComInterfaceID.hpp:51
Parameter structure of the WS2812b LEDs.
Definition WS2812b_Params.hpp:25