Browse Source

Update app.h

pull/652/head
beegee3 2 years ago
committed by GitHub
parent
commit
139129ea8b
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      src/app.h

17
src/app.h

@ -18,10 +18,8 @@
#include "config/settings.h"
#include "defines.h"
#include "utils/crc.h"
#include "utils/ahoyTimer.h"
#include "utils/scheduler.h"
#include "hm/CircularBuffer.h"
#include "hm/hmSystem.h"
#include "hm/payload.h"
#include "wifi/ahoywifi.h"
@ -61,10 +59,6 @@ class app : public IApp, public ah::Scheduler {
void loopWifi(void);
void onWifi(bool gotIp);
void regularTickers(void);
void handleIntr(void);
void cbMqtt(char* topic, byte* payload, unsigned int length);
void saveValues(void);
bool getWifiApActive(void);
uint32_t getUptime() {
return Scheduler::getUptime();
@ -99,6 +93,10 @@ class app : public IApp, public ah::Scheduler {
mWifi.getAvailNetworks(obj);
}
void setOnUpdate() {
onWifi(false);
}
void setRebootFlag() {
once(std::bind(&app::tickReboot, this), 3, "rboot");
}
@ -206,6 +204,9 @@ class app : public IApp, public ah::Scheduler {
void tickReboot(void) {
DPRINTLN(DBG_INFO, F("Rebooting..."));
onWifi(false);
ah::Scheduler::resetTicker();
WiFi.disconnect();
ESP.restart();
}
@ -247,13 +248,9 @@ class app : public IApp, public ah::Scheduler {
settings_t *mConfig;
uint8_t mSendLastIvId;
uint8_t mSendTickerId;
statistics_t mStat;
// timer
uint32_t mRxTicker;
// mqtt
PubMqttType mMqtt;
bool mMqttReconnect;

Loading…
Cancel
Save