The base class for LEDs.
Each instance of the LED class represents a single physical LED. Some LED devices support different brightness levels, this is accounted for by allowing to specify a brightness level in range 0.0 to 1.0, where 0.0 turns the LED off and 1.0 is the maximum brightness.
Some implementations may also support blinking LEDs. This is exposed via the "blinkOn" and "blinkOff" properties, which take as values the time in milliseconds the LED should be on, or off, respectively. There is also a shortcut method, blink(), which allows setting both properties at once.
To turn on blinking, both "blinkOn" and "blinkOff" must be set to a non-zero value. Furthermore, the brightness must be non-zero.
Direct Base Classes: Device
All Base Classes: Device
Inherited Functions: getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp
Creates the LED.
Destroys the LED.
virtual void blink(
) = 0;
Turns on blinking of the LED.
May not be supported by all implementations.
virtual double getBrightness() const = 0;
Returns the current brightness of the LED in range 0.0 to 1.0.
0.0 means off, every value > 0.0 means on, with 1.0 being the maximum brightness level.
Note that most LED devices do not support different brightness levels and can only be turned on or off.
virtual void off() = 0;
virtual void on() = 0;
virtual void setBrightness(
) = 0;