diff --git a/src/app.cpp b/src/app.cpp index 9ec6ff26..4d775473 100644 --- a/src/app.cpp +++ b/src/app.cpp @@ -82,6 +82,8 @@ void app::setup() { mPubSerial.setup(mConfig, &mSys, &mTimestamp); + mImprov.setup(mConfig->sys.deviceName, mVersion); + regularTickers(); @@ -169,6 +171,7 @@ void app::regularTickers(void) { if (mConfig->plugin.display.type != 0) everySec(std::bind(&DisplayType::tickerSecond, &mDisplay), "disp"); every(std::bind(&PubSerialType::tick, &mPubSerial), mConfig->serial.interval, "uart"); + everySec(std::bind(&Improv::tickSerial, &mImprov), "impro"); } //----------------------------------------------------------------------------- diff --git a/src/app.h b/src/app.h index 5ea40968..146e2210 100644 --- a/src/app.h +++ b/src/app.h @@ -22,6 +22,7 @@ #include "utils/crc.h" #include "utils/dbg.h" #include "utils/scheduler.h" +#include "utils/improv.h" #include "web/RestApi.h" #include "web/web.h" #include "wifi/ahoywifi.h" @@ -243,20 +244,6 @@ class app : public IApp, public ah::Scheduler { void tickMinute(void); void tickZeroValues(void); void tickMidnight(void); - /*void tickSerial(void) { - if(Serial.available() == 0) - return; - - uint8_t buf[80]; - uint8_t len = Serial.readBytes(buf, 80); - DPRINTLN(DBG_INFO, "got serial data, len: " + String(len)); - for(uint8_t i = 0; i < len; i++) { - if((0 != i) && (i % 8 == 0)) - DBGPRINTLN(""); - DBGPRINT(String(buf[i], HEX) + " "); - } - DBGPRINTLN(""); - }*/ innerLoopCb mInnerLoopCb; @@ -269,6 +256,7 @@ class app : public IApp, public ah::Scheduler { PayloadType mPayload; MiPayloadType mMiPayload; PubSerialType mPubSerial; + Improv mImprov; char mVersion[12]; settings mSettings; diff --git a/src/hm/hmRadio.h b/src/hm/hmRadio.h index c37ab7d0..602d76a1 100644 --- a/src/hm/hmRadio.h +++ b/src/hm/hmRadio.h @@ -1,6 +1,6 @@ //----------------------------------------------------------------------------- // 2023 Ahoy, https://github.com/lumpapu/ahoy -// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/ +// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/4.0/deed //----------------------------------------------------------------------------- #ifndef __RADIO_H__