37
37
#include < LittleFileSystem.h>
38
38
#include < Arduino_DebugUtils.h>
39
39
40
+ #include " WiFi.h" /* WiFi from ArduinoCore-mbed */
41
+ #include < SocketHelpers.h>
42
+
40
43
/* *****************************************************************************
41
44
* DEFINE
42
45
******************************************************************************/
@@ -81,6 +84,8 @@ class Arduino_Portenta_OTA
81
84
OtaHeaderLength = -5 ,
82
85
OtaHeaderCrc = -6 ,
83
86
OtaHeaterMagicNumber = -7 ,
87
+ CaStorageInit = -8 ,
88
+ CaStorageOpen = -9 ,
84
89
};
85
90
86
91
Arduino_Portenta_OTA (StorageTypePortenta const storage_type, uint32_t const data_offset);
@@ -95,7 +100,7 @@ class Arduino_Portenta_OTA
95
100
/* This functionality is intended for usage with the Arduino IoT Cloud for
96
101
* performing OTA firmware updates using the Arduino IoT Cloud servers.
97
102
*/
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) );
99
104
int decompress ();
100
105
void setFeedWatchdogFunc (ArduinoPortentaOtaWatchdogResetFuncPointer func);
101
106
void feedWatchdog ();
@@ -106,6 +111,7 @@ class Arduino_Portenta_OTA
106
111
StorageTypePortenta _storage_type;
107
112
uint32_t _data_offset;
108
113
uint32_t _program_length;
114
+ mbed::BlockDevice * _bd_raw_qspi;
109
115
110
116
virtual bool init () = 0;
111
117
virtual bool open () = 0;
@@ -115,6 +121,8 @@ class Arduino_Portenta_OTA
115
121
private:
116
122
117
123
void write ();
124
+ bool caStorageInit ();
125
+ bool caStorageOpen ();
118
126
ArduinoPortentaOtaWatchdogResetFuncPointer _feed_watchdog_func = 0 ;
119
127
120
128
};
0 commit comments