Library for ESP8266 STM32 Nucleo F103RB L152RE
Dependents: mqtt_Autofaehrschiff MQTT_Nucleo_dht11 mqtt_Testprogramm_FritzBox mqtt_TestprogrammWorkshop ... more
Diff: PubSubClient.h
- Revision:
- 0:a655fd59ed71
- Child:
- 2:08ce999855c3
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PubSubClient.h Tue Jun 29 10:37:44 2021 +0000 @@ -0,0 +1,24 @@ +#include "mbed.h" +#include "ESP8266Interface.h" + + +// Library to use https://github.com/ARMmbed/mbed-mqtt +#include <MQTTClientMbedOs.h> + +class PubSubClient +{ + private: + ESP8266Interface *esp; + SocketAddress deviceIP; + SocketAddress MQTTBroker; + TCPSocket *socket; + MQTTClient *client; + MQTT::Message msg; + + public: + void init(); + PubSubClient(Callback< void()> func); + PubSubClient(); + bool connect(char* clientName); + int publish(const char* topic, const char* buf); +}; \ No newline at end of file