2022-01-10 23:37:21 +01:00
|
|
|
#pragma once
|
|
|
|
|
#include "Const.h"
|
|
|
|
|
#include "classes/NotAsync.h"
|
|
|
|
|
#include "Global.h"
|
2022-02-15 11:37:31 +01:00
|
|
|
#include "utils/WiFiUtils.h"
|
2022-02-22 20:16:33 +01:00
|
|
|
#include "EventsAndOrders.h"
|
2022-01-10 23:37:21 +01:00
|
|
|
|
|
|
|
|
void mqttInit();
|
|
|
|
|
void selectBroker();
|
2022-02-11 00:22:59 +01:00
|
|
|
void getMqttData();
|
2022-01-10 23:37:21 +01:00
|
|
|
void getMqttData2();
|
|
|
|
|
bool isSecondBrokerSet();
|
|
|
|
|
boolean mqttConnect();
|
|
|
|
|
void mqttReconnect();
|
|
|
|
|
void mqttLoop();
|
|
|
|
|
void mqttSubscribe();
|
2023-10-01 22:05:07 +03:00
|
|
|
bool mqttIsConnect();
|
2022-01-10 23:37:21 +01:00
|
|
|
|
|
|
|
|
boolean publish(const String& topic, const String& data);
|
|
|
|
|
boolean publishData(const String& topic, const String& data);
|
2022-09-11 14:13:58 +02:00
|
|
|
boolean publishChartMqtt(const String& topic, const String& data);
|
2022-12-04 01:37:27 +01:00
|
|
|
boolean publishJsonMqtt(const String& topic, const String& json);
|
2022-02-02 21:17:50 +01:00
|
|
|
boolean publishStatusMqtt(const String& topic, const String& data);
|
2022-01-10 23:37:21 +01:00
|
|
|
boolean publishEvent(const String& topic, const String& data);
|
2023-10-01 22:05:07 +03:00
|
|
|
void mqttSubscribeExternal(String topic, bool usePrefix);
|
2022-12-04 14:50:16 +01:00
|
|
|
|
2022-10-02 01:06:25 +02:00
|
|
|
bool publishChartFileToMqtt(String path, String id, int maxCount);
|
2022-01-10 23:37:21 +01:00
|
|
|
|
|
|
|
|
void publishWidgets();
|
|
|
|
|
|
|
|
|
|
void mqttCallback(char* topic, uint8_t* payload, size_t length);
|
2022-02-12 14:34:17 +01:00
|
|
|
void handleMqttStatus(bool send);
|
|
|
|
|
void handleMqttStatus(bool send, int state);
|
2022-08-25 00:45:17 +02:00
|
|
|
|
2022-02-12 03:09:57 +01:00
|
|
|
const String getStateStr(int e);
|
2022-02-22 16:40:46 +01:00
|
|
|
|
|
|
|
|
void mqttUptimeCalc();
|
|
|
|
|
void wifiUptimeCalc();
|