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

Converts MQTTMail objects into viable MQTT messages so that they can be published. More...

#include <MQTTMailer.hpp>

Public Member Functions

void mailMessage (PubSubClient *mqtt_client, std::string topic, std::string message, bool serial_debug=true)
 Publish an MQTT message to a topic hosted by a specific broker.
 
void reconnect (PubSubClient mqtt_client)
 Attempt to reconnect to MQTT broker every 5 seconds until successful.
 
std::string buildMessage (std::string *elements, int num_elements)
 Builds a message.
 

Static Public Member Functions

static MQTTMailer getInstance ()
 

Detailed Description

Converts MQTTMail objects into viable MQTT messages so that they can be published.

Member Function Documentation

◆ buildMessage()

std::string MQTTMailer::buildMessage ( std::string *  elements,
int  num_elements 
)

Builds a message.

Parameters
elementsThe elements
[in]num_elementsThe number elements
Returns
The message.

◆ mailMessage()

void MQTTMailer::mailMessage ( PubSubClient mqtt_client,
std::string  topic,
std::string  message,
bool  serial_debug = true 
)

Publish an MQTT message to a topic hosted by a specific broker.

Parameters
[in]topicThe topic/destination for the message
[in]messageThe message in string form

◆ reconnect()

void MQTTMailer::reconnect ( PubSubClient  mqtt_client)

Attempt to reconnect to MQTT broker every 5 seconds until successful.

Parameters
[in]mqtt_clientThe mqtt client

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