|
ESP8266 Door Access Control System
|
Combined WiFi and MQTT client abstraction. More...
#include <WiFiMqttClient.h>
Public Member Functions | |
| WifiMqttClient () | |
| Default constructor. | |
| void | begin (const char *wifiSsid, const char *wifiPass, const char *mqttHost, uint16_t mqttPort, const char *mqttUser, const char *mqttPass, const char *deviceId, const char *site) |
| Initializes WiFi and MQTT configuration. | |
| void | loop () |
| Main service loop. | |
| bool | connected () |
| Checks whether the MQTT client is currently connected. | |
| bool | publishJson (const char *topicSuffix, const JsonDocument &data) |
| Publishes a JSON document to an MQTT topic. | |
| void | setCallback (MQTT_CALLBACK_SIGNATURE) |
| Sets the MQTT message callback. | |
| bool | subscribe (const char *topic) |
| Subscribes to a topic. | |
| bool | unsubscribe (const char *topic) |
| Unsubscribes from a topic. | |
| String | makeTopic (const char *suffix) const |
| Constructs a fully qualified MQTT topic. | |
Combined WiFi and MQTT client abstraction.
This class wraps an Arduino WiFiClient and PubSubClient to provide:
Typical base topic structure: <mqttUser>/<site>/<deviceId>/<suffix>
Definition at line 39 of file WiFiMqttClient.h.