@@ -63,146 +63,20 @@ void ESP8266HTTPUpdate::setAuthorization(const String &auth)
6363 _auth = auth;
6464}
6565
66- #if HTTPUPDATE_1_2_COMPATIBLE
67- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& url, const String& currentVersion,
68- const String& httpsFingerprint, bool reboot)
69- {
70- rebootOnUpdate (reboot);
71- #pragma GCC diagnostic push
72- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
73- return update (url, currentVersion, httpsFingerprint);
74- #pragma GCC diagnostic pop
75- }
76-
77- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& url, const String& currentVersion)
78- {
79- HTTPClient http;
80- #pragma GCC diagnostic push
81- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
82- http.begin (url);
83- #pragma GCC diagnostic pop
84- return handleUpdate (http, currentVersion, false );
85- }
86-
87- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& url, const String& currentVersion,
88- const String& httpsFingerprint)
89- {
90- HTTPClient http;
91- #pragma GCC diagnostic push
92- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
93- http.begin (url, httpsFingerprint);
94- #pragma GCC diagnostic pop
95- return handleUpdate (http, currentVersion, false );
96- }
97-
98- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& url, const String& currentVersion,
99- const uint8_t httpsFingerprint[20 ])
100- {
101- HTTPClient http;
102- #pragma GCC diagnostic push
103- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
104- http.begin (url, httpsFingerprint);
105- #pragma GCC diagnostic pop
106- return handleUpdate (http, currentVersion, false );
107- }
108- #endif
109-
11066HTTPUpdateResult ESP8266HTTPUpdate::update (WiFiClient& client, const String& url, const String& currentVersion)
11167{
11268 HTTPClient http;
11369 http.begin (client, url);
11470 return handleUpdate (http, currentVersion, false );
11571}
11672
117- #if HTTPUPDATE_1_2_COMPATIBLE
118- HTTPUpdateResult ESP8266HTTPUpdate::updateSpiffs (const String& url, const String& currentVersion, const String& httpsFingerprint)
119- {
120- HTTPClient http;
121- #pragma GCC diagnostic push
122- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
123- http.begin (url, httpsFingerprint);
124- #pragma GCC diagnostic pop
125- return handleUpdate (http, currentVersion, true );
126- }
127-
128- HTTPUpdateResult ESP8266HTTPUpdate::updateSpiffs (const String& url, const String& currentVersion, const uint8_t httpsFingerprint[20 ])
129- {
130- HTTPClient http;
131- #pragma GCC diagnostic push
132- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
133- http.begin (url, httpsFingerprint);
134- #pragma GCC diagnostic pop
135- return handleUpdate (http, currentVersion, true );
136- }
137-
138- HTTPUpdateResult ESP8266HTTPUpdate::updateSpiffs (const String& url, const String& currentVersion)
139- {
140- HTTPClient http;
141- #pragma GCC diagnostic push
142- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
143- http.begin (url);
144- #pragma GCC diagnostic pop
145- return handleUpdate (http, currentVersion, true );
146- }
147- #endif
148-
14973HTTPUpdateResult ESP8266HTTPUpdate::updateFS (WiFiClient& client, const String& url, const String& currentVersion)
15074{
15175 HTTPClient http;
15276 http.begin (client, url);
15377 return handleUpdate (http, currentVersion, true );
15478}
15579
156- #if HTTPUPDATE_1_2_COMPATIBLE
157- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& host, uint16_t port, const String& uri, const String& currentVersion,
158- bool https, const String& httpsFingerprint, bool reboot)
159- {
160- (void )https;
161- rebootOnUpdate (reboot);
162- if (httpsFingerprint.length () == 0 ) {
163- #pragma GCC diagnostic push
164- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
165- return update (host, port, uri, currentVersion);
166- } else {
167- return update (host, port, uri, currentVersion, httpsFingerprint);
168- #pragma GCC diagnostic pop
169- }
170- }
171-
172- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& host, uint16_t port, const String& uri,
173- const String& currentVersion)
174- {
175- HTTPClient http;
176- #pragma GCC diagnostic push
177- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
178- http.begin (host, port, uri);
179- #pragma GCC diagnostic pop
180- return handleUpdate (http, currentVersion, false );
181- }
182-
183- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& host, uint16_t port, const String& url,
184- const String& currentVersion, const String& httpsFingerprint)
185- {
186- HTTPClient http;
187- #pragma GCC diagnostic push
188- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
189- http.begin (host, port, url, httpsFingerprint);
190- #pragma GCC diagnostic pop
191- return handleUpdate (http, currentVersion, false );
192- }
193-
194- HTTPUpdateResult ESP8266HTTPUpdate::update (const String& host, uint16_t port, const String& url,
195- const String& currentVersion, const uint8_t httpsFingerprint[20 ])
196- {
197- HTTPClient http;
198- #pragma GCC diagnostic push
199- #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
200- http.begin (host, port, url, httpsFingerprint);
201- #pragma GCC diagnostic pop
202- return handleUpdate (http, currentVersion, false );
203- }
204- #endif
205-
20680HTTPUpdateResult ESP8266HTTPUpdate::update (WiFiClient& client, const String& host, uint16_t port, const String& uri,
20781 const String& currentVersion)
20882{
0 commit comments