21 #include "LogConfiguration.h" 25 #include <PubSubClient.h> 45 myMQTT(String hostname,
const int BrokerIP1,
const int BrokerIP2,
const int BrokerIP3,
const int BrokerIP4,
const int BrokerPort);
53 void init(WiFiClient *myClient,
void (*pToCallback)(
char *,
unsigned char *,
unsigned int));
const int pBrokerPort
port to connect to MQTT
The Network class establishes a WLAN-Connection.
bool loop()
This should be called regularly to allow the client to process incoming messages and maintain its con...
void MQTTConnectionFailed()
Writes Error-Message about MQTT connection.
void connectToMQTT()
Connects to the MQTT-server.
Handels the MQTT connection.
myMQTT(String hostname, const int BrokerIP1, const int BrokerIP2, const int BrokerIP3, const int BrokerIP4, const int BrokerPort)
Construct a new my M Q T T object.
IPAddress pBrokerIP
the IP-address of the server/broker
String decodeMQTTstate(int errorcode)
Decodes the Error Values from MQTT state() and returns a description.
void init(WiFiClient *myClient, void(*pToCallback)(char *, unsigned char *, unsigned int))
bool unsubscribe(const String topic)
unsubsribes from MQTT topic on Server
bool subscribe(const String topic)
subsribes to MQTT topic on Server
PubSubClient myMQTTclient
instance of PubSubClient
String pHostname
Contains Hostname/Client ID.
bool publishMessage(const String topic, const String msg)
handles outgoing MQTT messages to Server