File tree 2 files changed +26
-10
lines changed
2 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 32
32
33
33
#include " esp32FOTA.hpp"
34
34
35
- #include " mbedtls/pk.h"
36
- #include " mbedtls/md.h"
37
- #include " mbedtls/md_internal.h"
35
+ // arduino-esp32 core 2.x => 3.x migration
36
+ #if __has_include("md_wrap.h")
37
+ #include " md_wrap.h"
38
+ #else
39
+ #include " mbedtls/pk.h"
40
+ #include " mbedtls/md.h"
41
+ #include " mbedtls/md_internal.h"
42
+ #endif
43
+ // arduino-esp32 core 2.x => 3.x migration
44
+ #if !defined SPI_FLASH_SEC_SIZE
45
+ #include " spi_flash_mmap.h"
46
+ #endif
47
+
38
48
#include " esp_ota_ops.h"
39
49
40
50
#pragma GCC diagnostic push
41
51
#pragma GCC diagnostic ignored "-Wmissing-field-initializers"
42
52
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
43
53
44
-
45
-
46
54
static int64_t getHTTPStream ( esp32FOTA* fota, int partition );
47
55
static int64_t getFileStream ( esp32FOTA* fota, int partition );
48
56
static int64_t getSerialStream ( esp32FOTA* fota, int partition );
Original file line number Diff line number Diff line change @@ -38,7 +38,17 @@ extern "C" {
38
38
}
39
39
40
40
#include < map>
41
- #include < WiFiClientSecure.h>
41
+ #include < WiFi.h>
42
+
43
+ // arduino-esp32 core 2.x => 3.x migration
44
+ #if __has_include(<NetworkClientSecure.h>)
45
+ #include < NetworkClientSecure.h>
46
+ #define ClientSecure NetworkClientSecure
47
+ #else
48
+ #include < WiFiClientSecure.h>
49
+ #define ClientSecure WiFiClientSecure
50
+ #endif
51
+
42
52
#include < HTTPClient.h>
43
53
#include < ArduinoJson.h>
44
54
#include < FS.h>
@@ -86,8 +96,6 @@ extern "C" {
86
96
#endif
87
97
88
98
89
-
90
-
91
99
#if __has_include(<flashz.hpp>)
92
100
#pragma message "Using FlashZ as Update agent"
93
101
#include < flashz.hpp>
@@ -325,7 +333,7 @@ class esp32FOTA
325
333
FOTAConfig_t getConfig () { return _cfg; };
326
334
FOTAStreamType_t getStreamType () { return _stream_type; }
327
335
HTTPClient* getHTTPCLient () { return &_http; }
328
- WiFiClientSecure* getWiFiClient () { return &_client; }
336
+ ClientSecure* getWiFiClient () { return &_client; }
329
337
fs::File* getFotaFilePtr () { return &_file; }
330
338
Stream* getFotaStreamPtr () { return _stream; }
331
339
fs::FS* getFotaFS () { return _fs; }
@@ -341,7 +349,7 @@ class esp32FOTA
341
349
private:
342
350
343
351
HTTPClient _http;
344
- WiFiClientSecure _client;
352
+ ClientSecure _client;
345
353
Stream *_stream;
346
354
fs::File _file;
347
355
You can’t perform that action at this time.
0 commit comments