ESP32-PaxCounter/include/mqttclient.h

25 lines
649 B
C
Raw Normal View History

2020-05-16 23:49:34 +02:00
#ifndef _MQTTCLIENT_H
#define _MQTTCLIENT_H
#include "globals.h"
#include "rcommand.h"
#include <ETH.h>
#include <PubSubClient.h>
2020-05-17 23:07:38 +02:00
#define MQTT_CLIENT "paxcounter"
#define MQTT_INTOPIC "pax_IN"
#define MQTT_OUTTOPIC "pax_OUT"
2020-05-16 23:49:34 +02:00
#define MQTT_PORT 1883
2020-05-17 23:07:38 +02:00
#define MQTT_SERVER "broker.hivemq.com"
2020-05-16 23:49:34 +02:00
extern TaskHandle_t mqttTask;
void mqtt_enqueuedata(MessageBuffer_t *message);
void mqtt_queuereset(void);
void mqtt_client_task(void *param);
2020-05-17 23:07:38 +02:00
int mqtt_connect(IPAddress mqtt_host, uint16_t mqtt_port);
2020-05-16 23:49:34 +02:00
void mqtt_callback(char *topic, byte *payload, unsigned int length);
void WiFiEvent(WiFiEvent_t event);
esp_err_t mqtt_init(void);
#endif // _MQTTCLIENT_H