IoT::Devices

class BooleanSensor

File Information

Library: IoT/Devices
Package: Devices
Header: IoT/Devices/BooleanSensor.h

Description

The base class for two-state sensors measuring on/off or open/closed state.

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

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

Inheritance

Direct Base Classes: Device

All Base Classes: Device

Known Derived Classes: Trigger

Member Summary

Member Functions: state

Inherited Functions: getFeature, getPropertyBool, getPropertyDouble, getPropertyInt, getPropertyInt16, getPropertyInt64, getPropertyString, getPropertyTimestamp, hasFeature, hasProperty, setFeature, setPropertyBool, setPropertyDouble, setPropertyInt, setPropertyInt16, setPropertyInt64, setPropertyString, setPropertyTimestamp

Constructors

BooleanSensor

BooleanSensor();

Creates the BooleanSensor.

Destructor

~BooleanSensor virtual

~BooleanSensor();

Destroys the BooleanSensor.

Member Functions

state virtual

virtual bool state() const = 0;

Returns the current state of the trigger.

Variables

stateChanged

Poco::BasicEvent < const bool > stateChanged;

Fired when the state of the sensor has changed.

Actual behavior of this event (e.g., minimum interval between fires) are implementation specific and can be configured via properties.

Securely control IoT edge devices from anywhere   Connect a Device