3737#include < LittleFileSystem.h>
3838#include < Arduino_DebugUtils.h>
3939
40+ #include " WiFi.h" /* WiFi from ArduinoCore-mbed */
41+ #include < SocketHelpers.h>
42+
4043/* *****************************************************************************
4144 * DEFINE
4245 ******************************************************************************/
@@ -81,6 +84,8 @@ class Arduino_Portenta_OTA
8184 OtaHeaderLength = -5 ,
8285 OtaHeaderCrc = -6 ,
8386 OtaHeaterMagicNumber = -7 ,
87+ CaStorageInit = -8 ,
88+ CaStorageOpen = -9 ,
8489 };
8590
8691 Arduino_Portenta_OTA (StorageTypePortenta const storage_type, uint32_t const data_offset);
@@ -95,7 +100,7 @@ class Arduino_Portenta_OTA
95100 /* This functionality is intended for usage with the Arduino IoT Cloud for
96101 * performing OTA firmware updates using the Arduino IoT Cloud servers.
97102 */
98- int download (const char * url, bool const is_https);
103+ int download (const char * url, bool const is_https, MbedSocketClass * socket = static_cast <MbedSocketClass*>(&WiFi) );
99104 int decompress ();
100105 void setFeedWatchdogFunc (ArduinoPortentaOtaWatchdogResetFuncPointer func);
101106 void feedWatchdog ();
@@ -106,6 +111,7 @@ class Arduino_Portenta_OTA
106111 StorageTypePortenta _storage_type;
107112 uint32_t _data_offset;
108113 uint32_t _program_length;
114+ mbed::BlockDevice * _bd_raw_qspi;
109115
110116 virtual bool init () = 0;
111117 virtual bool open () = 0;
@@ -115,6 +121,8 @@ class Arduino_Portenta_OTA
115121 private:
116122
117123 void write ();
124+ bool caStorageInit ();
125+ bool caStorageOpen ();
118126 ArduinoPortentaOtaWatchdogResetFuncPointer _feed_watchdog_func = 0 ;
119127
120128};
0 commit comments