Fix crashbug in ota

This commit is contained in:
Magnus Persson
2022-03-20 15:35:37 +01:00
parent 169798e0eb
commit 8637b0f72d
2 changed files with 14 additions and 25 deletions

View File

@ -24,6 +24,12 @@ SOFTWARE.
#ifndef SRC_WIFI_HPP_
#define SRC_WIFI_HPP_
#if defined(ESP8266)
#include <ESP8266HTTPClient.h>
#else // defined (ESP32)
#include <HTTPClient.h>
#endif
#define WIFI_DEFAULT_SSID "GravityMon" // Name of created SSID
#define WIFI_DEFAULT_PWD "password" // Password for created SSID
#define WIFI_MDNS "gravitymon" // Prefix for MDNS name
@ -35,7 +41,7 @@ class WifiConnection {
// OTA
bool _newFirmware = false;
bool parseFirmwareVersionString(int (&num)[3], const char* version);
void downloadFile(const char* fname);
void downloadFile(HTTPClient& http, String& fname);
void connectAsync();
bool waitForConnection(int maxTime = 20);