IoT::Devices

class ISensor

File Information

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

Description

The base class for analog sensors, such as temperature or ambient light sensors.

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

  • physicalQuantity (string): The physical quantity that is being measured by the sensor, e.g. "temperature".
  • physicalUnit (string): The physical unit the measured value is being represented in (e.g. "Cel" for degree Celsius). This should use the "c/s" symbols from the Unified Code for Units of Measure (http://unitsofmeasure.org/ucum.html). See the PHYSICAL_UNIT_* strings for predefined values.
  • displayValue (string, optional): The current value of the sensor, formatted as string for display purposes.

Inheritance

Direct Base Classes: IDevice

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

Known Derived Classes: SensorRemoteObject

Member Summary

Member Functions: clearValueChangedFilter, isA, ready, remoting__enableEvents, remoting__typeId, setValueChangedHysteresisFilter, setValueChangedIsGreaterThanFilter, setValueChangedIsGreaterThanOrEqualToFilter, setValueChangedIsLessThanFilter, setValueChangedIsLessThanOrEqualToFilter, setValueChangedMinimumDeltaFilter, setValueChangedMinimumIntervalAndDeltaFilter, setValueChangedMinimumIntervalFilter, setValueChangedMinimumIntervalOrDeltaFilter, type, value

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 < ISensor >;

Constructors

ISensor

ISensor();

Creates a ISensor.

Destructor

~ISensor virtual

virtual ~ISensor();

Destroys the ISensor.

Member Functions

clearValueChangedFilter virtual

virtual void clearValueChangedFilter(
    const std::string & subscriberURI
) = 0;

Clears the filter set for the valueChanged event.

isA virtual

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

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

ready virtual

virtual bool ready() const = 0;

Returns true if a valid value is available.

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.

setValueChangedHysteresisFilter virtual

virtual void setValueChangedHysteresisFilter(
    const std::string & subscriberURI,
    double lowerThreshold,
    double upperThreshold
) = 0;

Sets a Poco::RemotingNG::HysteresisFilter for the valueChanged event.

setValueChangedIsGreaterThanFilter virtual

virtual void setValueChangedIsGreaterThanFilter(
    const std::string & subscriberURI,
    double limit
) = 0;

Sets a Poco::RemotingNG::GreaterThanFilter for the valueChanged event.

setValueChangedIsGreaterThanOrEqualToFilter virtual

virtual void setValueChangedIsGreaterThanOrEqualToFilter(
    const std::string & subscriberURI,
    double limit
) = 0;

Sets a Poco::RemotingNG::GreaterThanFilter for the valueChanged event.

setValueChangedIsLessThanFilter virtual

virtual void setValueChangedIsLessThanFilter(
    const std::string & subscriberURI,
    double limit
) = 0;

Sets a Poco::RemotingNG::LessThanFilter for the valueChanged event.

setValueChangedIsLessThanOrEqualToFilter virtual

virtual void setValueChangedIsLessThanOrEqualToFilter(
    const std::string & subscriberURI,
    double limit
) = 0;

Sets a Poco::RemotingNG::LessThanOrEqualToFilter for the valueChanged event.

setValueChangedMinimumDeltaFilter virtual

virtual void setValueChangedMinimumDeltaFilter(
    const std::string & subscriberURI,
    double delta
) = 0;

Sets a Poco::RemotingNG::MinimumDeltaFilter for the valueChanged event.

setValueChangedMinimumIntervalAndDeltaFilter virtual

virtual void setValueChangedMinimumIntervalAndDeltaFilter(
    const std::string & subscriberURI,
    long milliseconds,
    double delta
) = 0;

Sets a Poco::RemotingNG::MinimumIntervalAndDeltaFilter for the valueChanged event.

setValueChangedMinimumIntervalFilter virtual

virtual void setValueChangedMinimumIntervalFilter(
    const std::string & subscriberURI,
    long milliseconds
) = 0;

Sets a Poco::RemotingNG::MinimumIntervalFilter for the valueChanged event.

setValueChangedMinimumIntervalOrDeltaFilter virtual

virtual void setValueChangedMinimumIntervalOrDeltaFilter(
    const std::string & subscriberURI,
    long milliseconds,
    double delta
) = 0;

Sets a Poco::RemotingNG::MinimumIntervalOrDeltaFilter for the valueChanged event.

type virtual

const std::type_info & type() const;

Returns the type information for the object's class.

value virtual

virtual double value() const = 0;

Returns the current value measured by the sensor.

Some sensors may not be able to immediately report a valid value. Therefore, before calling value() the first time, ready() should be called to check if a valid value is available.

Variables

valueChanged

Poco::BasicEvent < const double > valueChanged;

Securely control IoT edge devices from anywhere   Connect a Device