IoT::Devices

class LEDRemoteObject

File Information

Library: IoT/Devices
Package: Generated
Header: IoT/Devices/LEDRemoteObject.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: ILED, Poco::RemotingNG::RemoteObject

All Base Classes: IDevice, ILED, Poco::OSP::Service, Poco::RefCountedObject, Poco::RemotingNG::Identifiable, Poco::RemotingNG::RemoteObject

Member Summary

Member Functions: blink, event__statusChanged, getBrightness, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, off, on, remoting__enableEvents, remoting__enableRemoteEvents, remoting__hasEvents, remoting__typeId, setBrightness, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp

Inherited Functions: blink, duplicate, getBrightness, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, isA, mutex, off, on, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, setBrightness, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, type

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < LEDRemoteObject >;

Constructors

LEDRemoteObject

LEDRemoteObject(
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    Poco::SharedPtr < IoT::Devices::LED > pServiceObject
);

Creates a LEDRemoteObject.

Destructor

~LEDRemoteObject virtual

virtual ~LEDRemoteObject();

Destroys the LEDRemoteObject.

Member Functions

blink virtual inline

virtual void blink(
    int onMilliseconds,
    int offMilliseconds
);

Turns on blinking of the LED.

May not be supported by all implementations.

getBrightness virtual inline

virtual double getBrightness() const;

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.

getFeature virtual inline

virtual bool getFeature(
    const std::string & name
) const;

Returns true if the feature with the given name is enabled, or false otherwise.

getPropertyBool virtual inline

virtual bool getPropertyBool(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyDouble virtual inline

virtual double getPropertyDouble(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyInt virtual inline

virtual int getPropertyInt(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyInt16 virtual inline

virtual Poco::Int16 getPropertyInt16(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyInt64 virtual inline

virtual Poco::Int64 getPropertyInt64(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyString virtual inline

virtual std::string getPropertyString(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

getPropertyTimestamp virtual inline

virtual Poco::Timestamp getPropertyTimestamp(
    const std::string & name
) const;

Returns the value of the device property with the given name.

Throws a Poco::NotFoundException if the property with the given name is unknown.

hasFeature virtual inline

virtual bool hasFeature(
    const std::string & name
) const;

Returns true if the feature with the given name is known, or false otherwise.

hasProperty virtual inline

virtual bool hasProperty(
    const std::string & name
) const;

Returns true if the property with the given name exists, or false otherwise.

off virtual inline

virtual void off();

Convenience method that turns the LED off by calling setBrightness(0.0).

on virtual inline

virtual void on();

Convenience method that turns the LED on by calling setBrightness(1.0).

remoting__enableEvents virtual

virtual std::string remoting__enableEvents(
    Poco::RemotingNG::Listener::Ptr pListener,
    bool enable = bool (true)
);

remoting__enableRemoteEvents virtual

virtual void remoting__enableRemoteEvents(
    const std::string & protocol
);

remoting__hasEvents virtual

virtual bool remoting__hasEvents() const;

remoting__typeId virtual inline

virtual const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId() const;

setBrightness virtual inline

virtual void setBrightness(
    double brightness
);

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.

setFeature virtual inline

virtual void setFeature(
    const std::string & name,
    bool enable
);

Enables or disables the feature with the given name.

Which features are supported is defined by the actual device implementation.

setPropertyBool virtual inline

virtual void setPropertyBool(
    const std::string & name,
    bool value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyDouble virtual inline

virtual void setPropertyDouble(
    const std::string & name,
    double value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyInt virtual inline

virtual void setPropertyInt(
    const std::string & name,
    int value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyInt16 virtual inline

virtual void setPropertyInt16(
    const std::string & name,
    Poco::Int16 value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyInt64 virtual inline

virtual void setPropertyInt64(
    const std::string & name,
    Poco::Int64 value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyString virtual inline

virtual void setPropertyString(
    const std::string & name,
    const std::string & value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

setPropertyTimestamp virtual inline

virtual void setPropertyTimestamp(
    const std::string & name,
    Poco::Timestamp value
);

Sets a device property.

Which properties are supported is defined by the actual device implementation.

event__statusChanged protected

void event__statusChanged(
    const IoT::Devices::DeviceStatusChange & data
);

Securely control IoT edge devices from anywhere   Connect a Device