File Information
Library: IoT/Devices
Package: Generated
Header: IoT/Devices/DeviceServerHelper.h
Description
The base class for all devices and sensors.
This class defines a generic interface for setting and querying device properties and features.
The class also defines an event for notifications about changes to the device status.
Every implementation of Device should expose the following properties:
- symbolicName: A name in reverse DNS notation that identifies the specific implementation of the device type.
- type (string): A name in reverse DNS notation that identifies the generic device type (e.g., "io.macchina.serial").
- name (string): A human-readable device type (e.g., "Serial Port").
- status (int): Current device status (DeviceStatus); optional.
The following generic device types are currently defined:
- io.macchina.composite (Composite)
- io.macchina.accelerometer (Accelerometer)
- io.macchina.barcode (BarcodeReader)
- io.macchina.gnss (GNSSSensor)
- io.macchina.gyroscope (Gyroscope)
- io.macchina.io (IO)
- io.macchina.led (LED)
- io.macchina.magnetometer (Magnetometer)
- io.macchina.rotary (RotaryEncoder)
- io.macchina.sensor (Sensor)
- io.macchina.boolean (BooleanSensor)
- io.macchina.counter (Counter)
- io.macchina.serial (SerialDevice)
- io.macchina.switch (Switch)
- io.macchina.trigger (Trigger)
- io.macchina.datapoint (Datapoint)
- io.macchina.datapoint.scalar (ScalarDatapoint)
- io.macchina.datapoint.vector (VectorDatapoint)
- io.macchina.datapoint.counter (CounterDatapoint)
- io.macchina.datapoint.boolean (BooleanDatapoint)
- io.macchina.datapoint.string (StringDatapoint)
- io.macchina.datapoint.enum (EnumDatapoint)
- io.macchina.datapoint.flags (FlagsDatapoint)
Member Summary
Member Functions: createRemoteObject, enableEvents, registerObject, registerRemoteObject, shutdown, unregisterObject
Types Aliases
Service
using Service = IoT::Devices::Device;
Constructors
DeviceServerHelper
Creates a DeviceServerHelper.
Destructor
~DeviceServerHelper
Destroys the DeviceServerHelper.
Member Functions
createRemoteObject
static Poco::AutoPtr < IoT::Devices::DeviceRemoteObject > createRemoteObject(
Poco::SharedPtr < IoT::Devices::Device > pServiceObject,
const Poco::RemotingNG::Identifiable::ObjectId & oid
);
Creates and returns a RemoteObject wrapper for the given IoT::Devices::Device instance.
enableEvents
static void enableEvents(
const std::string & uri,
const std::string & protocol
);
Enables remote events for the RemoteObject identified by the given URI.
Events will be delivered using the Transport for the given protocol. Can be called multiple times for the same URI with different protocols.
registerObject
static std::string registerObject(
Poco::SharedPtr < IoT::Devices::Device > pServiceObject,
const Poco::RemotingNG::Identifiable::ObjectId & oid,
const std::string & listenerId
);
Creates a RemoteObject wrapper for the given IoT::Devices::Device instance and registers it with the ORB and the Listener instance uniquely identified by the Listener's ID.
Returns the URI created for the object.
registerRemoteObject
static std::string registerRemoteObject(
Poco::AutoPtr < IoT::Devices::DeviceRemoteObject > pRemoteObject,
const std::string & listenerId
);
Registers the given RemoteObject with the ORB and the Listener instance uniquely identified by the Listener's ID.
Returns the URI created for the object.
shutdown
static void shutdown();
Removes the Skeleton for IoT::Devices::Device from the ORB.
unregisterObject
static void unregisterObject(
const std::string & uri
);
Unregisters a service object identified by URI from the ORB.