# HG changeset patch # User Michiel Broek # Date 1586512300 -7200 # Node ID 3b18344828992075eb43b677b2d627a05a0ed2ca # Parent 20c14b06f255d5a7f0dbe0480014b89393a3511c Version 0.2.5. Added interval to the NBIRTH json data. Added global define 60 seconds. diff -r 20c14b06f255 -r 3b1834482899 CMakeLists.txt --- a/CMakeLists.txt Mon Apr 06 20:01:51 2020 +0200 +++ b/CMakeLists.txt Fri Apr 10 11:51:40 2020 +0200 @@ -2,7 +2,7 @@ # in this exact order for cmake to work correctly cmake_minimum_required(VERSION 3.5) -set(PROJECT_VER "0.2.4") +set(PROJECT_VER "0.2.5") set(PROJECT_NAME "co2meter") include($ENV{IDF_PATH}/tools/cmake/project.cmake) diff -r 20c14b06f255 -r 3b1834482899 main/config.h --- a/main/config.h Mon Apr 06 20:01:51 2020 +0200 +++ b/main/config.h Fri Apr 10 11:51:40 2020 +0200 @@ -59,6 +59,9 @@ #include "updates.h" +#define MAINLOOP_TIMER 60 ///< Mainloop interval + + /** * @brief Mainloop 1 timed actions. */ diff -r 20c14b06f255 -r 3b1834482899 main/task_mqtt.c --- a/main/task_mqtt.c Mon Apr 06 20:01:51 2020 +0200 +++ b/main/task_mqtt.c Fri Apr 10 11:51:40 2020 +0200 @@ -201,8 +201,10 @@ payload = payload_header(); payload = xstrcat(payload, (char *)"{\"uuid\":\""); payload = xstrcat(payload, config.uuid); - payload = xstrcat(payload, (char *)"\","); - payload = xstrcat(payload, (char *)"\"properties\":{\"hardwaremake\":\"Unknown\",\"hardwaremodel\":\""); + payload = xstrcat(payload, (char *)"\",\"interval\":"); + sprintf(buf, "%d", MAINLOOP_TIMER); + payload = xstrcat(payload, buf); + payload = xstrcat(payload, (char *)",\"properties\":{\"hardwaremake\":\"Unknown\",\"hardwaremodel\":\""); sprintf(buf, "ESP32 %d cores rev %d, WiFi bgn", chip_info.cores, chip_info.revision); payload = xstrcat(payload, buf); payload = xstrcat(payload, (char *)"\",\"os\":\"esp-idf\",\"os_version\":\""); diff -r 20c14b06f255 -r 3b1834482899 main/task_user.c --- a/main/task_user.c Mon Apr 06 20:01:51 2020 +0200 +++ b/main/task_user.c Fri Apr 10 11:51:40 2020 +0200 @@ -66,7 +66,7 @@ void TimerCallback(void *arg) { SecsCount++; - if ((SecsCount % 60) == 0) { + if ((SecsCount % MAINLOOP_TIMER) == 0) { if (Main_Loop1 == ML1_DONE && update_running == 0) Main_Loop1 = ML1_INIT; }