Skip to content

Commit cfe7e01

Browse files
Jeroen88me-no-dev
Jeroen88
authored andcommitted
Remove F() macro's (#2121)
1 parent fcd734a commit cfe7e01

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

Diff for: libraries/HTTPUpdate/src/HTTPUpdate.cpp

+23-23
Original file line numberDiff line numberDiff line change
@@ -93,31 +93,31 @@ String HTTPUpdate::getLastErrorString(void)
9393
StreamString error;
9494
Update.printError(error);
9595
error.trim(); // remove line ending
96-
return String(F("Update error: ")) + error;
96+
return String("Update error: ") + error;
9797
}
9898

9999
// error from http client
100100
if(_lastError > -100) {
101-
return String(F("HTTP error: ")) + HTTPClient::errorToString(_lastError);
101+
return String("HTTP error: ") + HTTPClient::errorToString(_lastError);
102102
}
103103

104104
switch(_lastError) {
105105
case HTTP_UE_TOO_LESS_SPACE:
106-
return F("Not Enough space");
106+
return "Not Enough space";
107107
case HTTP_UE_SERVER_NOT_REPORT_SIZE:
108-
return F("Server Did Not Report Size");
108+
return "Server Did Not Report Size";
109109
case HTTP_UE_SERVER_FILE_NOT_FOUND:
110-
return F("File Not Found (404)");
110+
return "File Not Found (404)";
111111
case HTTP_UE_SERVER_FORBIDDEN:
112-
return F("Forbidden (403)");
112+
return "Forbidden (403)";
113113
case HTTP_UE_SERVER_WRONG_HTTP_CODE:
114-
return F("Wrong HTTP Code");
114+
return "Wrong HTTP Code";
115115
case HTTP_UE_SERVER_FAULTY_MD5:
116-
return F("Wrong MD5");
116+
return "Wrong MD5";
117117
case HTTP_UE_BIN_VERIFY_HEADER_FAILED:
118-
return F("Verify Bin Header Failed");
118+
return "Verify Bin Header Failed";
119119
case HTTP_UE_BIN_FOR_WRONG_FLASH:
120-
return F("New Binary Does Not Fit Flash Size");
120+
return "New Binary Does Not Fit Flash Size";
121121
}
122122

123123
return String();
@@ -164,29 +164,29 @@ HTTPUpdateResult HTTPUpdate::handleUpdate(HTTPClient& http, const String& curren
164164
// use HTTP/1.0 for update since the update handler not support any transfer Encoding
165165
http.useHTTP10(true);
166166
http.setTimeout(_httpClientTimeout);
167-
http.setUserAgent(F("ESP32-http-Update"));
168-
http.addHeader(F("Cache-Control"), F("no-cache"));
169-
http.addHeader(F("x-ESP32-STA-MAC"), WiFi.macAddress());
170-
http.addHeader(F("x-ESP32-AP-MAC"), WiFi.softAPmacAddress());
171-
http.addHeader(F("x-ESP32-free-space"), String(ESP.getFreeSketchSpace()));
172-
http.addHeader(F("x-ESP32-sketch-size"), String(ESP.getSketchSize()));
173-
// To do http.addHeader(F("x-ESP32-sketch-md5"), String(ESP.getSketchMD5()));
167+
http.setUserAgent("ESP32-http-Update");
168+
http.addHeader("Cache-Control", "no-cache");
169+
http.addHeader("x-ESP32-STA-MAC", WiFi.macAddress());
170+
http.addHeader("x-ESP32-AP-MAC", WiFi.softAPmacAddress());
171+
http.addHeader("x-ESP32-free-space", String(ESP.getFreeSketchSpace()));
172+
http.addHeader("x-ESP32-sketch-size", String(ESP.getSketchSize()));
173+
// To do http.addHeader("x-ESP32-sketch-md5", String(ESP.getSketchMD5()));
174174
// Sketch MD5 is not supported by the core, but SHA256 is, so add a SHA256 instead
175175
String sketchSHA256 = getSketchSHA256();
176176
if(sketchSHA256.length() != 0) {
177-
http.addHeader(F("x-ESP32-sketch-sha256"), sketchSHA256);
177+
http.addHeader("x-ESP32-sketch-sha256", sketchSHA256);
178178
}
179-
http.addHeader(F("x-ESP32-chip-size"), String(ESP.getFlashChipSize()));
180-
http.addHeader(F("x-ESP32-sdk-version"), ESP.getSdkVersion());
179+
http.addHeader("x-ESP32-chip-size", String(ESP.getFlashChipSize()));
180+
http.addHeader("x-ESP32-sdk-version", ESP.getSdkVersion());
181181

182182
if(spiffs) {
183-
http.addHeader(F("x-ESP32-mode"), F("spiffs"));
183+
http.addHeader("x-ESP32-mode", "spiffs");
184184
} else {
185-
http.addHeader(F("x-ESP32-mode"), F("sketch"));
185+
http.addHeader("x-ESP32-mode", "sketch");
186186
}
187187

188188
if(currentVersion && currentVersion[0] != 0x00) {
189-
http.addHeader(F("x-ESP32-version"), currentVersion);
189+
http.addHeader("x-ESP32-version", currentVersion);
190190
}
191191

192192
const char * headerkeys[] = { "x-MD5" };

0 commit comments

Comments
 (0)