Dependencies:   mbed-mqtt-GSOE1

Dependents:   mqtt_Autofaehrschiff MQTT_Nucleo_dht11 mqtt_Testprogramm_FritzBox mqtt_TestprogrammWorkshop ... more

PubSubClient.h

Committer:
jack1930
Date:
2021-06-29
Revision:
0:a655fd59ed71
Child:
2:08ce999855c3

File content as of revision 0:a655fd59ed71:

#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);
};