IoT::DeviceStatus

class IDeviceStatusService

File Information

Library: IoT/DeviceStatus
Package: Generated
Header: IoT/DeviceStatus/IDeviceStatusService.h

Description

The DeviceStatusService keeps track of the current operational status of a device.

Inheritance

Direct Base Classes: Poco::OSP::Service

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

Known Derived Classes: DeviceStatusServiceRemoteObject

Member Summary

Member Functions: acknowledge, acknowledgeUpTo, clearStatus, clearStatusOfSource, isA, messages, postStatus, postStatusAsync, remoting__enableEvents, remoting__typeId, remove, reset, status, statusOfSource, type

Inherited Functions: duplicate, isA, referenceCount, release, type

Types Aliases

Ptr

using Ptr = Poco::AutoPtr < IDeviceStatusService >;

Constructors

IDeviceStatusService

IDeviceStatusService();

Destructor

~IDeviceStatusService virtual

virtual ~IDeviceStatusService();

Destroys the IDeviceStatusService.

Member Functions

acknowledge virtual

virtual IoT::DeviceStatus::DeviceStatus acknowledge(
    Poco::Int64 id
) = 0;

Marks the message with the given ID as acknowledged, if it is acknowledgeable.

Returns the new device status.

acknowledgeUpTo virtual

virtual IoT::DeviceStatus::DeviceStatus acknowledgeUpTo(
    Poco::Int64 id
) = 0;

Marks all acknowledgeable messages up to (and including) the given ID as acknowledged.

Returns the new device status.

clearStatus virtual

virtual IoT::DeviceStatus::DeviceStatus clearStatus(
    const std::string & messageClass
) = 0;

Clears the status update with the given messageClass and removes it from the message history.

Returns the new device status.

clearStatusOfSource virtual

virtual IoT::DeviceStatus::DeviceStatus clearStatusOfSource(
    const std::string & source
) = 0;

Clears all status updates with the given source and removes them from the message history.

Returns the new device status.

isA virtual

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

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

messages virtual

virtual std::vector < IoT::DeviceStatus::StatusMessage > messages(
    int maxMessages = int (0)
) const = 0;

Retrieves stored status messages. If maxMessages is > 0, will at most return maxMessages messages.

postStatus virtual

virtual IoT::DeviceStatus::DeviceStatusChange postStatus(
    const IoT::DeviceStatus::StatusUpdate & statusUpdate
) = 0;

Updates the device status.

Returns a DeviceStatusChange structure.

postStatusAsync virtual

virtual void postStatusAsync(
    const IoT::DeviceStatus::StatusUpdate & statusUpdate
) = 0;

Updates the device status asynchronously.

The actual status update in the database will be done asynchronously in a separate thread.

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.

remove virtual

virtual IoT::DeviceStatus::DeviceStatus remove(
    Poco::Int64 id
) = 0;

Removes the message with the given ID from the message history.

Returns the new device status.

reset virtual

virtual void reset() = 0;

Resets the device status to DEVICE_STATUS_OK and removes all messages.

status virtual

virtual IoT::DeviceStatus::DeviceStatus status() const = 0;

Returns the current global device status.

Only unacknowledged status updates are considered in determining the current status.

statusOfSource virtual

virtual IoT::DeviceStatus::DeviceStatus statusOfSource(
    const std::string & source
) const = 0;

Returns the current source-specific device status, considering only status updates with the given source.

Only unacknowledged status updates are considered in determining the current status.

type virtual

const std::type_info & type() const;

Returns the type information for the object's class.

Variables

statusChanged

Poco::BasicEvent < const IoT::DeviceStatus::DeviceStatusChange > statusChanged;

statusUpdated

Poco::BasicEvent < const IoT::DeviceStatus::DeviceStatusChange > statusUpdated;

Securely control IoT edge devices from anywhere   Connect a Device