добавление логирования

This commit is contained in:
Dmitry Borisenko
2022-08-25 00:45:17 +02:00
parent 1dc7e4f9ea
commit b63d163432
11 changed files with 140 additions and 11 deletions

View File

@@ -35,6 +35,8 @@
#define USE_LITTLEFS false
#endif
#define START_DATETIME 1640995200 // 01.01.2022 00:00:00 константа для сокрацения unix time
#define MIN_DATETIME 1575158400
#define LEAP_YEAR(Y) (((1970 + Y) > 0) && !((1970 + Y) % 4) && (((1970 + Y) % 100) || !((1970 + Y) % 400)))

View File

@@ -130,6 +130,8 @@ struct Time_t {
};
extern unsigned long unixTime;
extern unsigned long unixTimeShort;
extern bool isTimeSynch;
extern Time_t _time_local;
extern Time_t _time_utc;

View File

@@ -31,6 +31,9 @@ void publishState();
void mqttCallback(char* topic, uint8_t* payload, size_t length);
void handleMqttStatus(bool send);
void handleMqttStatus(bool send, int state);
void sendAllFilesToMQTT();
void sendLogData(String file, String topic);
const String getStateStr(int e);
void mqttUptimeCalc();

View File

@@ -10,4 +10,6 @@ extern const String addFileLn(const String& filename, const String& str);
extern const String readFile(const String& filename, size_t max_size);
extern const String filepath(const String& filename);
extern bool cutFile(const String& src, const String& dst);
extern size_t countLines(const String filename);
void removeFile(const String& filename);
extern void onFlashWrite();