Uniot Core
0.8.1
Loading...
Searching...
No Matches
uniot::MQTTPath Class Reference

#include <MQTTPath.h>

Public Member Functions

 MQTTPath (const Credentials &credentials)
 Constructs an MQTTPath instance with device credentials.
 
const String & getDeviceId () const
 Gets the device ID from the credentials.
 
const String & getOwnerId () const
 Gets the owner ID from the credentials.
 
String buildDevicePath (const String &topic) const
 Builds an MQTT topic path for device-specific communication.
 
String buildGroupPath (const String &groupId, const String &topic) const
 Builds an MQTT topic path for group-level communication.
 
String buildPublicPath (const String &topic) const
 Builds an MQTT topic path for public communication.
 
const CredentialsgetCredentials () const
 Gets the credentials object used by this instance.
 

Constructor & Destructor Documentation

◆ MQTTPath()

uniot::MQTTPath::MQTTPath ( const Credentials & credentials)
inline

Constructs an MQTTPath instance with device credentials.

Parameters
credentialsDevice credentials containing owner and device identifiers

Member Function Documentation

◆ buildDevicePath()

String uniot::MQTTPath::buildDevicePath ( const String & topic) const
inline

Builds an MQTT topic path for device-specific communication.

Creates a topic path with the structure: PUBLIC_UNIOT/users/{ownerId}/devices/{deviceId}/{topic}

Parameters
topicThe specific subtopic for the device
Return values
pathThe complete MQTT topic path

◆ buildGroupPath()

String uniot::MQTTPath::buildGroupPath ( const String & groupId,
const String & topic ) const
inline

Builds an MQTT topic path for group-level communication.

Creates a topic path with the structure: PUBLIC_UNIOT/users/{ownerId}/groups/{groupId}/{topic}

Parameters
groupIdThe identifier for the device group
topicThe specific subtopic for the group
Return values
pathThe complete MQTT topic path

◆ buildPublicPath()

String uniot::MQTTPath::buildPublicPath ( const String & topic) const
inline

Builds an MQTT topic path for public communication.

Creates a topic path with the structure: PUBLIC_UNIOT/{topic}

Parameters
topicThe specific public topic
Return values
pathThe complete MQTT topic path

◆ getCredentials()

const Credentials * uniot::MQTTPath::getCredentials ( ) const
inline

Gets the credentials object used by this instance.

Return values
Credentials*Pointer to the credentials object

◆ getDeviceId()

const String & uniot::MQTTPath::getDeviceId ( ) const
inline

Gets the device ID from the credentials.

Return values
String&Reference to the device ID string

◆ getOwnerId()

const String & uniot::MQTTPath::getOwnerId ( ) const
inline

Gets the owner ID from the credentials.

Return values
String&Reference to the owner ID string

The documentation for this class was generated from the following file: