File Information
Library: IoT/Devices
Package: Generated
Header: IoT/Devices/ILED.h
Description
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.
Inheritance
Direct Base Classes: IDevice
All Base Classes: IDevice, Poco::OSP::Service, Poco::RefCountedObject
Known Derived Classes: LEDRemoteObject
Member Summary
Member Functions: blink, getBrightness, isA, off, on, remoting__typeId, setBrightness, type
Inherited Functions: duplicate, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, isA, referenceCount, release, remoting__enableEvents, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, type
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < ILED >;
Constructors
ILED
ILED();
Creates a ILED.
Destructor
~ILED
virtual ~ILED();
Destroys the ILED.
Member Functions
blink
virtual void blink(
int onMilliseconds,
int offMilliseconds
) = 0;
Turns on blinking of the LED.
May not be supported by all implementations.
getBrightness
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.
isA
bool isA(
const std::type_info & otherType
) const;
Returns true if the class is a subclass of the class given by otherType.
See also: IoT::Devices::IDevice::isA()
off
virtual void off() = 0;
Convenience method that turns the LED off by calling setBrightness(0.0).
on
virtual void on() = 0;
Convenience method that turns the LED on by calling setBrightness(1.0).
remoting__typeId
static const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId();
Returns the TypeId of the class.
setBrightness
virtual void setBrightness(
double brightness
) = 0;
Sets the brightness of the LED.
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.
type
const std::type_info & type() const;
Returns the type information for the object's class.
See also: IoT::Devices::IDevice::type()