File Information
Library: IoT/Devices
Package: Generated
Header: IoT/Devices/SensorRemoteObject.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: ISensor, Poco::RemotingNG::RemoteObject
All Base Classes: IDevice, ISensor, Poco::OSP::Service, Poco::RefCountedObject, Poco::RemotingNG::Identifiable, Poco::RemotingNG::RemoteObject
Member Summary
Member Functions: clearValueChangedFilter, event__statusChanged, event__valueChanged, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, ready, remoting__enableEvents, remoting__enableRemoteEvents, remoting__hasEvents, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, setValueChangedHysteresisFilter, setValueChangedIsGreaterThanFilter, setValueChangedIsGreaterThanOrEqualToFilter, setValueChangedIsLessThanFilter, setValueChangedIsLessThanOrEqualToFilter, setValueChangedMinimumDeltaFilter, setValueChangedMinimumIntervalAndDeltaFilter, setValueChangedMinimumIntervalFilter, setValueChangedMinimumIntervalOrDeltaFilter, value
Inherited Functions: clearValueChangedFilter, duplicate, getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, isA, mutex, ready, referenceCount, release, remoting__enableEvents, remoting__enableRemoteEvents, remoting__getURI, remoting__hasEvents, remoting__objectId, remoting__setURI, remoting__typeId, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp, setValueChangedHysteresisFilter, setValueChangedIsGreaterThanFilter, setValueChangedIsGreaterThanOrEqualToFilter, setValueChangedIsLessThanFilter, setValueChangedIsLessThanOrEqualToFilter, setValueChangedMinimumDeltaFilter, setValueChangedMinimumIntervalAndDeltaFilter, setValueChangedMinimumIntervalFilter, setValueChangedMinimumIntervalOrDeltaFilter, type, value
Types Aliases
Ptr
using Ptr = Poco::AutoPtr < SensorRemoteObject >;
Constructors
SensorRemoteObject
SensorRemoteObject(
const Poco::RemotingNG::Identifiable::ObjectId & oid,
Poco::SharedPtr < IoT::Devices::Sensor > pServiceObject
);
Creates a SensorRemoteObject.
Destructor
~SensorRemoteObject
virtual ~SensorRemoteObject();
Destroys the SensorRemoteObject.
Member Functions
clearValueChangedFilter
void clearValueChangedFilter(
const std::string & subscriberURI
);
Clears the filter set for the valueChanged event.
getFeature
virtual bool getFeature(
const std::string & name
) const;
Returns true if the feature with the given name is enabled, or false otherwise.
See also: IoT::Devices::IDevice::getFeature()
getPropertyBool
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.
See also: IoT::Devices::IDevice::getPropertyBool()
getPropertyDouble
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 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.
See also: IoT::Devices::IDevice::getPropertyInt()
getPropertyInt16
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 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 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 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 bool hasFeature(
const std::string & name
) const;
Returns true if the feature with the given name is known, or false otherwise.
See also: IoT::Devices::IDevice::hasFeature()
hasProperty
virtual bool hasProperty(
const std::string & name
) const;
Returns true if the property with the given name exists, or false otherwise.
See also: IoT::Devices::IDevice::hasProperty()
ready
virtual bool ready() const;
Returns true if a valid value is available.
See also: IoT::Devices::ISensor::ready()
remoting__enableEvents
virtual std::string remoting__enableEvents(
Poco::RemotingNG::Listener::Ptr pListener,
bool enable = bool (true)
);
remoting__enableRemoteEvents
virtual void remoting__enableRemoteEvents(
const std::string & protocol
);
remoting__hasEvents
virtual bool remoting__hasEvents() const;
remoting__typeId
virtual const Poco::RemotingNG::Identifiable::TypeId & remoting__typeId() const;
setFeature
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.
See also: IoT::Devices::IDevice::setFeature()
setPropertyBool
virtual void setPropertyBool(
const std::string & name,
bool value
);
Sets a device property.
Which properties are supported is defined by the actual device implementation.
See also: IoT::Devices::IDevice::setPropertyBool()
setPropertyDouble
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 void setPropertyInt(
const std::string & name,
int value
);
Sets a device property.
Which properties are supported is defined by the actual device implementation.
See also: IoT::Devices::IDevice::setPropertyInt()
setPropertyInt16
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 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 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 void setPropertyTimestamp(
const std::string & name,
Poco::Timestamp value
);
Sets a device property.
Which properties are supported is defined by the actual device implementation.
setValueChangedHysteresisFilter
void setValueChangedHysteresisFilter(
const std::string & subscriberURI,
double lowerThreshold,
double upperThreshold
);
Sets a Poco::RemotingNG::HysteresisFilter for the valueChanged event.
setValueChangedIsGreaterThanFilter
void setValueChangedIsGreaterThanFilter(
const std::string & subscriberURI,
double limit
);
Sets a Poco::RemotingNG::GreaterThanFilter for the valueChanged event.
setValueChangedIsGreaterThanOrEqualToFilter
void setValueChangedIsGreaterThanOrEqualToFilter(
const std::string & subscriberURI,
double limit
);
Sets a Poco::RemotingNG::GreaterThanFilter for the valueChanged event.
setValueChangedIsLessThanFilter
void setValueChangedIsLessThanFilter(
const std::string & subscriberURI,
double limit
);
Sets a Poco::RemotingNG::LessThanFilter for the valueChanged event.
setValueChangedIsLessThanOrEqualToFilter
void setValueChangedIsLessThanOrEqualToFilter(
const std::string & subscriberURI,
double limit
);
Sets a Poco::RemotingNG::LessThanOrEqualToFilter for the valueChanged event.
setValueChangedMinimumDeltaFilter
void setValueChangedMinimumDeltaFilter(
const std::string & subscriberURI,
double delta
);
Sets a Poco::RemotingNG::MinimumDeltaFilter for the valueChanged event.
setValueChangedMinimumIntervalAndDeltaFilter
void setValueChangedMinimumIntervalAndDeltaFilter(
const std::string & subscriberURI,
long milliseconds,
double delta
);
Sets a Poco::RemotingNG::MinimumIntervalAndDeltaFilter for the valueChanged event.
setValueChangedMinimumIntervalFilter
void setValueChangedMinimumIntervalFilter(
const std::string & subscriberURI,
long milliseconds
);
Sets a Poco::RemotingNG::MinimumIntervalFilter for the valueChanged event.
setValueChangedMinimumIntervalOrDeltaFilter
void setValueChangedMinimumIntervalOrDeltaFilter(
const std::string & subscriberURI,
long milliseconds,
double delta
);
Sets a Poco::RemotingNG::MinimumIntervalOrDeltaFilter for the valueChanged event.
value
virtual double value() const;
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.
See also: IoT::Devices::ISensor::value()
event__statusChanged
void event__statusChanged(
const IoT::Devices::DeviceStatusChange & data
);
event__valueChanged
void event__valueChanged(
const double & data
);