IoT::Devices

class IO

File Information

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

Description

The interface for general purpose input/output (GPIO) ports.

This class represents a single GPIO pin. Mapping to physical pins is configured when setting up the specific IO implementation class, typically using a configuration file.

Implementations supporting dynamically changing pin directions should expose a string property named "direction" that takes the values "in" and "out".

Inheritance

Direct Base Classes: Device

All Base Classes: Device

Member Summary

Member Functions: set, state, toggle

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

Constructors

IO

IO();

Creates the IO.

Destructor

~IO virtual

~IO();

Destroys the IO.

Member Functions

set virtual

virtual void set(
    bool state
) = 0;

Sets the state of an output pin to the given state.

state virtual

virtual bool state() const = 0;

Returns the current state of the pin.

toggle virtual

virtual bool toggle() = 0;

Toggles the state of an output pin and returns the new state.

Variables

stateChanged

Poco::BasicEvent < const bool > stateChanged;

Fired when the state of the interrupt-capable input pin has changed.

For this event to be fired, the I/O device must support interrupt-capable input pins, and those pins must be configured to trigger interrupts, by an implementation-specific means.

Only a pin configured as input will trigger the event.

Securely control IoT edge devices from anywhere   Connect a Device