Data Gator
Hardware and software documentation for the Data Gator project.
Loading...
Searching...
No Matches
MQTTMail Class Reference

An object that stores data from which a topic and message can be extracted for publishing to an MQTT broker. More...

#include <MQTTMailer.hpp>

Public Member Functions

 MQTTMail (std::string topic, std::string message)
 
std::string getMessage ()
 Convert the data fields to an MQTT message string which can be published.
 
std::string getTopic ()
 The topic/destination this MQTT object should be published to.
 
std::string to_string ()
 

Private Attributes

std::string topic
 
std::string message
 
PacketType_t packet_type = INVALID
 

Detailed Description

An object that stores data from which a topic and message can be extracted for publishing to an MQTT broker.

Member Function Documentation

◆ getMessage()

std::string MQTTMail::getMessage ( )

Convert the data fields to an MQTT message string which can be published.

Returns
String message for publishing, should be properly formatted as a JSON object

◆ getTopic()

std::string MQTTMail::getTopic ( )

The topic/destination this MQTT object should be published to.

Returns
String topic to publish to.

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