IoT::MQTT

class MQTTClientServerHelper

File Information

Library: IoT/MQTT
Package: Generated
Header: IoT/MQTT/MQTTClientServerHelper.h

Description

The interface for MQTT clients.

Implementations are expected to receive their client ID and server URI via an implementation defined configuration mechanism. Once configured, a MQTTClient always uses the same client ID and connects to the same server. A MQTT client should automatically attempt to reconnect if the connection to the server is lost.

A single client instance can either support MQTT version 3.1/3.1.1 or version 5. Which MQTT version is supported by the client is determined when configuring the client.

Users of the class must call the appropriate methods supporting the client's configured MQTT version.

Member Summary

Member Functions: createRemoteObject, enableEvents, registerObject, registerRemoteObject, shutdown, unregisterObject

Types Aliases

Service

using Service = IoT::MQTT::MQTTClient;

Constructors

MQTTClientServerHelper

MQTTClientServerHelper();

Destructor

~MQTTClientServerHelper

~MQTTClientServerHelper();

Destroys the MQTTClientServerHelper.

Member Functions

createRemoteObject static inline

static Poco::AutoPtr < IoT::MQTT::MQTTClientRemoteObject > createRemoteObject(
    Poco::SharedPtr < IoT::MQTT::MQTTClient > pServiceObject,
    const Poco::RemotingNG::Identifiable::ObjectId & oid
);

Creates and returns a RemoteObject wrapper for the given IoT::MQTT::MQTTClient instance.

enableEvents static inline

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 inline

static std::string registerObject(
    Poco::SharedPtr < IoT::MQTT::MQTTClient > pServiceObject,
    const Poco::RemotingNG::Identifiable::ObjectId & oid,
    const std::string & listenerId
);

Creates a RemoteObject wrapper for the given IoT::MQTT::MQTTClient 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 inline

static std::string registerRemoteObject(
    Poco::AutoPtr < IoT::MQTT::MQTTClientRemoteObject > 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

static void shutdown();

Removes the Skeleton for IoT::MQTT::MQTTClient from the ORB.

unregisterObject static inline

static void unregisterObject(
    const std::string & uri
);

Unregisters a service object identified by URI from the ORB.

Securely control IoT edge devices from anywhere   Connect a Device