add MQTT stuff
This commit is contained in:
38
MqttClient.h
Normal file
38
MqttClient.h
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* MqttClient.h
|
||||
*
|
||||
* Created on: 08.05.2015
|
||||
* Author: wn
|
||||
*/
|
||||
|
||||
#ifndef MQTTCLIENT_H_
|
||||
#define MQTTCLIENT_H_
|
||||
|
||||
#include <Ethernet.h>
|
||||
#include <PubSubClient.h>
|
||||
#include "mBusDialog.h"
|
||||
|
||||
|
||||
const String MQTT_BROKER = "172.16.2.16";
|
||||
const uint16_t MQTT_PORT = 1883;
|
||||
|
||||
class MqttClient : public ResponseCallback {
|
||||
public:
|
||||
MqttClient(RequestSender *meterBusMaster);
|
||||
void begin();
|
||||
void exec();
|
||||
virtual void sendResponse(uint8_t *responseBuffer, uint16_t responseBufferLength);
|
||||
virtual void sendError(uint8_t code);
|
||||
private:
|
||||
EthernetClient m_client;
|
||||
PubSubClient m_mqttClient;
|
||||
RequestSender *m_meterBusMaster;
|
||||
uint8_t m_disconnectState;
|
||||
uint32_t m_disconnectTime;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
#endif /* MQTTCLIENT_H_ */
|
Reference in New Issue
Block a user