kopia lustrzana https://github.com/lora-aprs/LoRa_APRS_iGate
refactor
rodzic
904b5990a4
commit
910c089968
|
@ -5,7 +5,7 @@
|
||||||
#include "TaskConfig.h"
|
#include "TaskConfig.h"
|
||||||
#include "configuration.h"
|
#include "configuration.h"
|
||||||
|
|
||||||
ConfigTask::ConfigTask() : Task(TASK_CONFIG, TaskConfig), _server(80), _config_filename("/is-cfg.json"), _setupDone(false) {
|
ConfigTask::ConfigTask() : Task(TASK_CONFIG, TaskConfig), _server(80), _config_filename("/is-cfg.json"), _setupDone(false), _httpServerInitDone(false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigTask::~ConfigTask() {
|
ConfigTask::~ConfigTask() {
|
||||||
|
@ -30,10 +30,9 @@ bool ConfigTask::setup(System &system) {
|
||||||
|
|
||||||
bool ConfigTask::loop(System &system) {
|
bool ConfigTask::loop(System &system) {
|
||||||
// we can start the http server just when we are connected to something
|
// we can start the http server just when we are connected to something
|
||||||
static bool httpServerInitDone = false;
|
if (system.isWifiEthConnected() && !_httpServerInitDone) {
|
||||||
if (system.isWifiEthConnected() && !httpServerInitDone) {
|
|
||||||
_server.begin();
|
_server.begin();
|
||||||
httpServerInitDone = true;
|
_httpServerInitDone = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_html.wasSaved()) {
|
if (_html.wasSaved()) {
|
||||||
|
|
|
@ -19,6 +19,7 @@ private:
|
||||||
AsyncWebServer _server;
|
AsyncWebServer _server;
|
||||||
const String _config_filename;
|
const String _config_filename;
|
||||||
bool _setupDone;
|
bool _setupDone;
|
||||||
|
bool _httpServerInitDone;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Ładowanie…
Reference in New Issue