EduArt Sensor Ring Library 4.0.0
Loading...
Searching...
No Matches
Light.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <cstdint>
13
17#include "sensorring/platform/SensorringExport.hpp"
18
19namespace eduart {
20
21namespace sensorring {
22
23namespace device {
24
34class SENSORRING_EXPORT Light : public Device {
35public:
42 Light(DeviceID id, com::ComInterface* interface, com::ComEndpoint target);
43
45 ~Light() override = default;
46
51 virtual const LightParams& getParams() const = 0;
52
60 virtual void setLight(LightMode mode, std::uint8_t r = 0, std::uint8_t g = 0, std::uint8_t b = 0) = 0;
61
73 static void setAllLights(const std::vector<Light*>& devices, LightMode mode, std::uint8_t red, std::uint8_t green, std::uint8_t blue);
74};
75
76} // namespace device
77
78} // namespace sensorring
79
80} // namespace eduart
Base class for all concrete sensor/actuator devices.
Light mode definition.
LightMode
Light mode enumeration.
Definition LightMode.hpp:24
Parameter structure for the Light.
Device(DeviceID id, com::ComInterface *interface, com::ComEndpoint target)
Construct the device with identity and communication link.
virtual void setLight(LightMode mode, std::uint8_t r=0, std::uint8_t g=0, std::uint8_t b=0)=0
Set the light mode and color.
Light(DeviceID id, com::ComInterface *interface, com::ComEndpoint target)
Construct a Light with Device params.
virtual const LightParams & getParams() const =0
Get the current light parameters.
static void setAllLights(const std::vector< Light * > &devices, LightMode mode, std::uint8_t red, std::uint8_t green, std::uint8_t blue)
Broadcast a mode+color command to ALL WS2812b devices on ALL interfaces.
~Light() override=default
Virtual destructor.
Uniquely identifies a communication endpoint as a (Direction, BoardAddress, DeviceId) tuple.
Definition ComEndpoint.hpp:37
Identifier for a device: type, human-readable name, and index.
Definition DeviceID.hpp:27
Parameter structure of the Light.
Definition LightParams.hpp:30