Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder OTA error codes #24

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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