Skip to content

Commit 48b60b0

Browse files
committed
Reorder and rename OTA error codes
1 parent 31220c2 commit 48b60b0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

Diff for: src/Arduino_ESP32_OTA.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ int Arduino_ESP32_OTA::download(const char * ota_url)
136136
port = 443;
137137
} else {
138138
DEBUG_ERROR("%s: Failed to parse OTA URL %s", __FUNCTION__, ota_url);
139-
return static_cast<int>(Error::UrlParseError);
139+
return static_cast<int>(Error::UrlParse);
140140
}
141141

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

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

178178
/* Check HTTP response status code */

Diff for: src/Arduino_ESP32_OTA.h

+8-8
Original file line numberDiff line numberDiff line change
@@ -63,17 +63,17 @@ class Arduino_ESP32_OTA
6363
None = 0,
6464
NoOtaStorage = -2,
6565
OtaStorageInit = -3,
66-
OtaStorageEnd = -4,
67-
UrlParseError = -5,
68-
ServerConnectError = -6,
69-
HttpHeaderError = -7,
66+
OtaHeaderLength = -5,
67+
OtaHeaderCrc = -6,
68+
OtaHeaterMagicNumber = -7,
7069
ParseHttpHeader = -8,
71-
OtaHeaderLength = -9,
72-
OtaHeaderCrc = -10,
73-
OtaHeaterMagicNumber = -11,
70+
UrlParse = -9,
71+
ServerConnect = -10,
72+
HttpHeader = -11,
7473
OtaDownload = -12,
7574
OtaHeaderTimeout = -13,
76-
HttpResponse = -14
75+
HttpResponse = -14,
76+
OtaStorageEnd = -15,
7777
};
7878

7979
Arduino_ESP32_OTA();

0 commit comments

Comments
 (0)