You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
601 B

7 years ago
#ifndef _MYMQTT_H
#define _MYMQTT_H
#include <WiFiClientSecure.h>
#include <MQTTClient.h>
#include "config.h"
class MyMQTT {
public:
MyMQTT(void);
void connect(void);
void loop(void);
void subscribe(void);
void publish(char* topic, char* payload);
void publish(char* topic, String payload);
// static void onMqttMessage(String &topic, String &payload);
private:
const char* host;
const uint32_t port;
const char* endpoint;
const char* username;
const char* password;
WiFiClientSecure net;
MQTTClient mqttClient;
};
#endif /* _MYMQTT_H */