mirror of
https://github.com/esp8266/Arduino.git
synced 2025-04-25 20:02:37 +03:00
Fix build with -DHTTPCLIENT_1_1_COMPATIBLE=0 (#6597)
We need to disable HTTPUPDATE_1_2 support when HTTPCLIENT_1_1 compatibility is not desired to avoid using methods that are disabled.
This commit is contained in:
parent
fabd169abc
commit
8b16d9c1d1
@ -43,7 +43,7 @@ ESP8266HTTPUpdate::~ESP8266HTTPUpdate(void)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef HTTPUPDATE_1_2_COMPATIBLE
|
||||
#if HTTPUPDATE_1_2_COMPATIBLE
|
||||
HTTPUpdateResult ESP8266HTTPUpdate::update(const String& url, const String& currentVersion,
|
||||
const String& httpsFingerprint, bool reboot)
|
||||
{
|
||||
@ -94,7 +94,7 @@ HTTPUpdateResult ESP8266HTTPUpdate::update(WiFiClient& client, const String& url
|
||||
return handleUpdate(http, currentVersion, false);
|
||||
}
|
||||
|
||||
#ifdef HTTPUPDATE_1_2_COMPATIBLE
|
||||
#if HTTPUPDATE_1_2_COMPATIBLE
|
||||
HTTPUpdateResult ESP8266HTTPUpdate::updateSpiffs(const String& url, const String& currentVersion, const String& httpsFingerprint)
|
||||
{
|
||||
HTTPClient http;
|
||||
@ -133,7 +133,7 @@ HTTPUpdateResult ESP8266HTTPUpdate::updateSpiffs(WiFiClient& client, const Strin
|
||||
return handleUpdate(http, currentVersion, true);
|
||||
}
|
||||
|
||||
#ifdef HTTPUPDATE_1_2_COMPATIBLE
|
||||
#if HTTPUPDATE_1_2_COMPATIBLE
|
||||
HTTPUpdateResult ESP8266HTTPUpdate::update(const String& host, uint16_t port, const String& uri, const String& currentVersion,
|
||||
bool https, const String& httpsFingerprint, bool reboot)
|
||||
{
|
||||
|
@ -26,14 +26,16 @@
|
||||
#ifndef ESP8266HTTPUPDATE_H_
|
||||
#define ESP8266HTTPUPDATE_H_
|
||||
|
||||
#define HTTPUPDATE_1_2_COMPATIBLE
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <WiFiUdp.h>
|
||||
#include <ESP8266HTTPClient.h>
|
||||
|
||||
#ifndef HTTPUPDATE_1_2_COMPATIBLE
|
||||
#define HTTPUPDATE_1_2_COMPATIBLE HTTPCLIENT_1_1_COMPATIBLE
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ESP_HTTP_UPDATE
|
||||
#ifdef DEBUG_ESP_PORT
|
||||
#define DEBUG_HTTP_UPDATE(fmt, ...) DEBUG_ESP_PORT.printf_P( (PGM_P)PSTR(fmt), ## __VA_ARGS__ )
|
||||
@ -85,7 +87,7 @@ public:
|
||||
_ledOn = ledOn;
|
||||
}
|
||||
|
||||
#ifdef HTTPUPDATE_1_2_COMPATIBLE
|
||||
#if HTTPUPDATE_1_2_COMPATIBLE
|
||||
// This function is deprecated, use rebootOnUpdate and the next one instead
|
||||
t_httpUpdate_return update(const String& url, const String& currentVersion,
|
||||
const String& httpsFingerprint, bool reboot) __attribute__((deprecated));
|
||||
@ -97,7 +99,7 @@ public:
|
||||
#endif
|
||||
t_httpUpdate_return update(WiFiClient& client, const String& url, const String& currentVersion = "");
|
||||
|
||||
#ifdef HTTPUPDATE_1_2_COMPATIBLE
|
||||
#if HTTPUPDATE_1_2_COMPATIBLE
|
||||
// This function is deprecated, use one of the overloads below along with rebootOnUpdate
|
||||
t_httpUpdate_return update(const String& host, uint16_t port, const String& uri, const String& currentVersion,
|
||||
bool https, const String& httpsFingerprint, bool reboot) __attribute__((deprecated));
|
||||
@ -112,7 +114,7 @@ public:
|
||||
t_httpUpdate_return update(WiFiClient& client, const String& host, uint16_t port, const String& uri = "/",
|
||||
const String& currentVersion = "");
|
||||
|
||||
#ifdef HTTPUPDATE_1_2_COMPATIBLE
|
||||
#if HTTPUPDATE_1_2_COMPATIBLE
|
||||
// This function is deprecated, use rebootOnUpdate and the next one instead
|
||||
t_httpUpdate_return updateSpiffs(const String& url, const String& currentVersion,
|
||||
const String& httpsFingerprint, bool reboot) __attribute__((deprecated));
|
||||
|
Loading…
x
Reference in New Issue
Block a user