Skip to content

Commit

Permalink
Reorder and rename OTA error codes
Browse files Browse the repository at this point in the history
  • Loading branch information
pennam committed Oct 24, 2023
1 parent 31220c2 commit 48b60b0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/Arduino_ESP32_OTA.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,13 @@ int Arduino_ESP32_OTA::download(const char * ota_url)
port = 443;
} else {
DEBUG_ERROR("%s: Failed to parse OTA URL %s", __FUNCTION__, ota_url);
return static_cast<int>(Error::UrlParseError);
return static_cast<int>(Error::UrlParse);
}

if (!_client->connect(url.host_.c_str(), port))
{
DEBUG_ERROR("%s: Connection failure with OTA storage server %s", __FUNCTION__, url.host_.c_str());
return static_cast<int>(Error::ServerConnectError);
return static_cast<int>(Error::ServerConnect);
}

_client->println(String("GET ") + url.path_.c_str() + " HTTP/1.1");
Expand Down Expand Up @@ -172,7 +172,7 @@ int Arduino_ESP32_OTA::download(const char * ota_url)
if (!is_header_complete)
{
DEBUG_ERROR("%s: Error receiving HTTP header %s", __FUNCTION__, is_http_header_timeout ? "(timeout)":"");
return static_cast<int>(Error::HttpHeaderError);
return static_cast<int>(Error::HttpHeader);
}

/* Check HTTP response status code */
Expand Down
16 changes: 8 additions & 8 deletions src/Arduino_ESP32_OTA.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ class Arduino_ESP32_OTA
None = 0,
NoOtaStorage = -2,
OtaStorageInit = -3,
OtaStorageEnd = -4,
UrlParseError = -5,
ServerConnectError = -6,
HttpHeaderError = -7,
OtaHeaderLength = -5,
OtaHeaderCrc = -6,
OtaHeaterMagicNumber = -7,
ParseHttpHeader = -8,
OtaHeaderLength = -9,
OtaHeaderCrc = -10,
OtaHeaterMagicNumber = -11,
UrlParse = -9,
ServerConnect = -10,
HttpHeader = -11,
OtaDownload = -12,
OtaHeaderTimeout = -13,
HttpResponse = -14
HttpResponse = -14,
OtaStorageEnd = -15,
};

Arduino_ESP32_OTA();
Expand Down

0 comments on commit 48b60b0

Please sign in to comment.