#include <ELClientMqtt.h>

Public Member Functions | |
| ELClientMqtt (ELClient *elc) | |
| Constructor for ELClientMqtt. | |
| void | setup (void) |
| Setup mqtt. | |
| void | subscribe (const char *topic, uint8_t qos=0) |
| Subscribe to MQTT topic. | |
| void | subscribe (const __FlashStringHelper *topic, uint8_t qos=0) |
| Subscribe to MQTT topic. | |
| void | publish (const char *topic, const uint8_t *data, const uint16_t len, uint8_t qos=0, uint8_t retain=0) |
| Subscribe to MQTT topic. | |
| void | publish (const char *topic, const char *data, uint8_t qos=0, uint8_t retain=0) |
| Subscribe to MQTT topic. | |
| void | publish (const __FlashStringHelper *topic, const __FlashStringHelper *data, const uint16_t len, uint8_t qos=0, uint8_t retain=0) |
| Subscribe to MQTT topic. | |
| void | publish (const char *topic, const __FlashStringHelper *data, const uint16_t len, uint8_t qos=0, uint8_t retain=0) |
| Subscribe to MQTT topic. | |
| void | publish (const __FlashStringHelper *topic, const uint8_t *data, const uint16_t len, uint8_t qos=0, uint8_t retain=0) |
| Subscribe to MQTT topic. | |
| void | lwt (const char *topic, const char *message, uint8_t qos=0, uint8_t retain=0) |
| Set MQTT last will. | |
| void | lwt (const __FlashStringHelper *topic, const __FlashStringHelper *message, uint8_t qos=0, uint8_t retain=0) |
| Set MQTT last will. | |
Data Fields | |
| FP< void, void * > | connectedCb |
| FP< void, void * > | disconnectedCb |
| FP< void, void * > | publishedCb |
| FP< void, void * > | dataCb |
Definition at line 22 of file ELClientMqtt.h.
| ELClientMqtt::ELClientMqtt | ( | ELClient * | elc | ) |
Constructor for ELClientMqtt.
Definition at line 20 of file ELClientMqtt.cpp.
| void ELClientMqtt::lwt | ( | const __FlashStringHelper * | topic, |
| const __FlashStringHelper * | message, | ||
| uint8_t | qos = 0, |
||
| uint8_t | retain = 0 |
||
| ) |
Set MQTT last will.
Sends the "last will" to the ESP with the topic and message stored in program memory
| topic | Last will topic name |
| message | Last will message |
| qos | (optional) Requested qos level, default 0 |
| retain | (optional) Requested retain level, default 0 |
Definition at line 94 of file ELClientMqtt.cpp.

| void ELClientMqtt::lwt | ( | const char * | topic, |
| const char * | message, | ||
| uint8_t | qos = 0, |
||
| uint8_t | retain = 0 |
||
| ) |
Set MQTT last will.
lwt(const char* topic, const char* message, uint8_t qos, uint8_t retain)
Sends the "last will" to the ESP.
| topic | Last will topic name |
| message | Last will message |
| qos | (optional) Requested qos level, default 0 |
| retain | (optional) Requested retain level, default 0 |
Definition at line 68 of file ELClientMqtt.cpp.

| void ELClientMqtt::publish | ( | const __FlashStringHelper * | topic, |
| const __FlashStringHelper * | data, | ||
| const uint16_t | len, | ||
| uint8_t | qos = 0, |
||
| uint8_t | retain = 0 |
||
| ) |
Subscribe to MQTT topic.
Sends the MQTT subscription request to the ESP with the topic and data stored in program memory
| topic | Topic name |
| data | Pointer to data buffer |
| len | Size of data buffer |
| qos | (optional) Requested qos level, default 0 |
| retain | (optional) Requested retain level, default 0 |
Definition at line 230 of file ELClientMqtt.cpp.

| void ELClientMqtt::publish | ( | const __FlashStringHelper * | topic, |
| const uint8_t * | data, | ||
| const uint16_t | len, | ||
| uint8_t | qos = 0, |
||
| uint8_t | retain = 0 |
||
| ) |
Subscribe to MQTT topic.
Sends the MQTT subscription request to the ESP with the topic stored in program memory
| topic | Topic name |
| data | Pointer to data buffer |
| len | Size of data buffer |
| qos | (optional) Requested qos level, default 0 |
| retain | (optional) Requested retain level, default 0 |
Definition at line 292 of file ELClientMqtt.cpp.

| void ELClientMqtt::publish | ( | const char * | topic, |
| const __FlashStringHelper * | data, | ||
| const uint16_t | len, | ||
| uint8_t | qos = 0, |
||
| uint8_t | retain = 0 |
||
| ) |
Subscribe to MQTT topic.
Sends the MQTT subscription request to the ESP with the data stored in program memory
| topic | Topic name |
| data | Pointer to data buffer |
| len | Size of data buffer |
| qos | (optional) Requested qos level, default 0 |
| retain | (optional) Requested retain level, default 0 |
Definition at line 261 of file ELClientMqtt.cpp.

| void ELClientMqtt::publish | ( | const char * | topic, |
| const char * | data, | ||
| uint8_t | qos = 0, |
||
| uint8_t | retain = 0 |
||
| ) |
Subscribe to MQTT topic.
publish(const char* topic, const char* data, uint8_t qos, uint8_t retain)
Sends the MQTT subscription request to the ESP. Data must be null-terminated
| topic | Topic name |
| data | Pointer to data buffer |
| qos | (optional) Requested qos level, default 0 |
| retain | (optional) Requested retain level, default 0 |
Definition at line 206 of file ELClientMqtt.cpp.

| void ELClientMqtt::publish | ( | const char * | topic, |
| const uint8_t * | data, | ||
| const uint16_t | len, | ||
| uint8_t | qos = 0, |
||
| uint8_t | retain = 0 |
||
| ) |
Subscribe to MQTT topic.
publish(const char* topic, const uint8_t* data, const uint16_t len, uint8_t qos, uint8_t retain)
Sends the MQTT subscription request to the ESP
| topic | Topic name |
| data | Pointer to data buffer |
| len | Size of data buffer |
| qos | (optional) Requested qos level, default 0 |
| retain | (optional) Requested retain level, default 0 |
Definition at line 173 of file ELClientMqtt.cpp.


| void ELClientMqtt::setup | ( | void | ) |
Setup mqtt.
Send callback functions for MQTT events to the ESP
Definition at line 34 of file ELClientMqtt.cpp.

| void ELClientMqtt::subscribe | ( | const __FlashStringHelper * | topic, |
| uint8_t | qos = 0 |
||
| ) |
Subscribe to MQTT topic.
subscribe(const __FlashStringHelper* topic, uint8_t qos)
Sends the MQTT subscription request to the ESP with the topic and message stored in program memory
| topic | Topic name |
| qos | (optional) Requested qos level, default 0 |
Definition at line 141 of file ELClientMqtt.cpp.

| void ELClientMqtt::subscribe | ( | const char * | topic, |
| uint8_t | qos = 0 |
||
| ) |
Subscribe to MQTT topic.
subscribe(const char* topic, uint8_t qos)
Sends the MQTT subscription request to the ESP
| topic | Topic name |
| qos | (optional) Requested qos level, default 0 |
Definition at line 121 of file ELClientMqtt.cpp.

| FP<void, void*> ELClientMqtt::connectedCb |
callback with no args when MQTT is connected
Definition at line 34 of file ELClientMqtt.h.
| FP<void, void*> ELClientMqtt::dataCb |
callback when a message is received, called with two arguments: the topic and the message (max ~110 bytes for both)
Definition at line 37 of file ELClientMqtt.h.
| FP<void, void*> ELClientMqtt::disconnectedCb |
callback with no args when MQTT is disconnected
Definition at line 35 of file ELClientMqtt.h.
| FP<void, void*> ELClientMqtt::publishedCb |
not yet implemented
Definition at line 36 of file ELClientMqtt.h.