Wombat Environmental Node 1.0
An environmental node for SDI-12 and digital sensors.
Loading...
Searching...
No Matches
mqtt_stack.cpp File Reference
#include "Utils.h"
#include "DeviceConfig.h"
#include "SparkFun_u-blox_SARA-R5_Arduino_Library.h"
#include "globals.h"
#include "cli/CLI.h"
Include dependency graph for mqtt_stack.cpp:

Macros

#define TAG   "mqtt_stack"
 
#define MAX_RSP   64
 

Functions

void mqttCmdCallback (int cmd, int result)
 
bool mqtt_login (void)
 
bool mqtt_logout (void)
 
bool mqtt_publish (String &topic, const char *const msg, size_t msg_len)
 
bool mqtt_publish_file (const String &topic, const String &filename)
 

Variables

static char rsp [MAX_RSP+1]
 
char * script = nullptr
 
static CommandURCVector< SARA_R5_mqtt_command_opcode_t > urcs
 

Macro Definition Documentation

◆ MAX_RSP

#define MAX_RSP   64

◆ TAG

#define TAG   "mqtt_stack"

Function Documentation

◆ mqtt_login()

bool mqtt_login ( void  )

◆ mqtt_logout()

bool mqtt_logout ( void  )

◆ mqtt_publish()

bool mqtt_publish ( String &  topic,
const char *  msg,
size_t  msg_len 
)

Publish a message to the MQTT broker.

Parameters
topicthe topic to publish to.
msgthe message to send - this is expected to be a UTF-8 text message.
msg_lenthe length of the message in units of uint8_t.
Returns
true if the message was published, otherwise false.

◆ mqtt_publish_file()

bool mqtt_publish_file ( const String &  topic,
const String &  filename 
)

Publish a message from a file on the modem filesystem.

Parameters
topicthe topic to publish to.
filenamethe filename on the modem filesystem containing the message to publish.
Returns
true if the message was published, otherwise false.

◆ mqttCmdCallback()

void mqttCmdCallback ( int  cmd,
int  result 
)

Variable Documentation

◆ rsp

char rsp[MAX_RSP+1]
static

◆ script

char* script = nullptr

◆ urcs

CommandURCVector<SARA_R5_mqtt_command_opcode_t> urcs
static