IoT::Devices

class ISwitch

File Information

Library: IoT/Devices
Package: Generated
Header: IoT/Devices/ISwitch.h

Description

The base class for switchable things (that can be turned on and off).

A Switch has a current state and a target state. Depending upon the implementation, the current state and target state may be different for a short amount of time (e.g., while the device is powering on).

In addition to the methods defined in this interface, a Switch implementation should expose the following properties:

  • displayState (string, optional): The current state of the Switch, formatted as string for display purposes.

Inheritance

Direct Base Classes: IDevice

All Base Classes: IDevice, Poco::OSP::Service, Poco::RefCountedObject

Known Derived Classes: SwitchRemoteObject

Member Summary

Member Functions: getTargetState, isA, remoting__enableEvents, remoting__typeId, setTargetState, state, 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 < ISwitch >;

Constructors

ISwitch

ISwitch();

Creates a ISwitch.

Destructor

~ISwitch virtual

virtual ~ISwitch();

Destroys the ISwitch.

Member Functions

getTargetState virtual

virtual bool getTargetState() const = 0;

Returns the target state of the Switch.

isA virtual

bool isA(
    const std::type_info & otherType
) const;

Returns true if the class is a subclass of the class given by otherType.

remoting__enableEvents virtual

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

Enable or disable delivery of remote events.

The given Listener instance must implement the Poco::RemotingNG::EventListener interface, otherwise this method will fail with a RemotingException.

This method is only used with Proxy objects; calling this method on a RemoteObject will do nothing.

remoting__typeId static

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

Returns the TypeId of the class.

setTargetState virtual

virtual void setTargetState(
    bool newState
) = 0;

Sets the target state of the Switch.

state virtual

virtual bool state() const = 0;

Returns the current state of the Switch.

type virtual

const std::type_info & type() const;

Returns the type information for the object's class.

Variables

stateChanged

Poco::BasicEvent < const bool > stateChanged;

Securely control IoT edge devices from anywhere   Connect a Device