Skip to content

Commit

Permalink
corrected incorrect merge with master
Browse files Browse the repository at this point in the history
  • Loading branch information
hmueller01 committed Sep 9, 2023
1 parent 09c8497 commit 20aa17e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
1 change: 1 addition & 0 deletions libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ HTTPUpdateResult ESP8266HTTPUpdate::handleUpdate(HTTPClient& http, const String&
DEBUG_HTTP_UPDATE("[httpUpdate] ESP8266 info:\n");
DEBUG_HTTP_UPDATE("[httpUpdate] - free Space: %d\n", ESP.getFreeSketchSpace());
DEBUG_HTTP_UPDATE("[httpUpdate] - current Sketch Size: %d\n", ESP.getSketchSize());
DEBUG_HTTP_UPDATE("[httpUpdate] - current Sketch MD5: %s\n", ESP.getSketchMD5().c_str());

if(currentVersion && currentVersion[0] != 0x00) {
DEBUG_HTTP_UPDATE("[httpUpdate] - current version: %s\n", currentVersion.c_str() );
Expand Down
29 changes: 16 additions & 13 deletions libraries/ESP8266httpUpdate/src/ESP8266httpUpdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,18 @@
#endif

/// note we use HTTP client errors too so we start at 100
//TODO - in v3.0.0 make this an enum
constexpr int HTTP_UE_TOO_LESS_SPACE = (-100);
constexpr int HTTP_UE_SERVER_NOT_REPORT_SIZE = (-101);
constexpr int HTTP_UE_SERVER_FILE_NOT_FOUND = (-102);
constexpr int HTTP_UE_SERVER_FORBIDDEN = (-103);
constexpr int HTTP_UE_SERVER_WRONG_HTTP_CODE = (-104);
constexpr int HTTP_UE_SERVER_FAULTY_MD5 = (-105);
constexpr int HTTP_UE_BIN_VERIFY_HEADER_FAILED = (-106);
constexpr int HTTP_UE_BIN_FOR_WRONG_FLASH = (-107);
constexpr int HTTP_UE_SERVER_UNAUTHORIZED = (-108);
enum HTTPUpdateError {
HTTP_UE_SERVER_NOT_REPORT_VERSION = -109, // server did not respond with a firmware version
HTTP_UE_SERVER_UNAUTHORIZED, // -108
HTTP_UE_BIN_FOR_WRONG_FLASH, // -107
HTTP_UE_BIN_VERIFY_HEADER_FAILED, // -106
HTTP_UE_SERVER_FAULTY_MD5, // -105
HTTP_UE_SERVER_WRONG_HTTP_CODE, // -104
HTTP_UE_SERVER_FORBIDDEN, // -103
HTTP_UE_SERVER_FILE_NOT_FOUND, // -102
HTTP_UE_SERVER_NOT_REPORT_SIZE, // -101
HTTP_UE_TOO_LESS_SPACE // -100
};

enum HTTPUpdateResult {
HTTP_UPDATE_FAILED,
Expand Down Expand Up @@ -122,7 +124,9 @@ class ESP8266HTTPUpdate
t_httpUpdate_return updateFS(WiFiClient& client, const String& url, const String& currentVersion = "");
t_httpUpdate_return update(HTTPClient& httpClient, const String& currentVersion = "");
t_httpUpdate_return updateFS(HTTPClient& httpClient, const String& currentVersion = "");


t_httpUpdate_return getAvailableVersion(WiFiClient& client, const String& host, uint16_t port, const String& uri, const String& current_version, String& available_version);

// Notification callbacks
void onStart(HTTPUpdateStartCB cbOnStart) { _cbStart = cbOnStart; }
void onEnd(HTTPUpdateEndCB cbOnEnd) { _cbEnd = cbOnEnd; }
Expand Down Expand Up @@ -153,10 +157,9 @@ class ESP8266HTTPUpdate
String _password;
String _auth;
String _md5Sum;
private:
int _httpClientTimeout;
followRedirects_t _followRedirects = HTTPC_DISABLE_FOLLOW_REDIRECTS;

private:
// Callbacks
HTTPUpdateStartCB _cbStart;
HTTPUpdateEndCB _cbEnd;
Expand Down

0 comments on commit 20aa17e

Please sign in to comment.