File tree Expand file tree Collapse file tree 3 files changed +20
-0
lines changed
Expand file tree Collapse file tree 3 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,18 @@ unsigned long arduino::WiFiClass::getTime() {
314314 return 0 ;
315315}
316316
317+ void arduino::WiFiClass::setFeedWatchdogFunc (ArduinoPortentaH7WiFiFeedWatchdogFuncPtr func)
318+ {
319+ _feed_watchdog_func = func;
320+ }
321+
322+ void arduino::WiFiClass::feedWatchdog ()
323+ {
324+ if (_feed_watchdog_func)
325+ _feed_watchdog_func ();
326+ }
327+
328+
317329#if defined(COMPONENT_4343W)
318330
319331#include " QSPIFBlockDevice.h"
Original file line number Diff line number Diff line change @@ -49,9 +49,12 @@ extern "C" {
4949#define DEFAULT_AP_CHANNEL 6
5050#endif
5151
52+ #define ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC
53+
5254namespace arduino {
5355
5456typedef void * (*voidPrtFuncPtr)(void );
57+ typedef void (*ArduinoPortentaH7WiFiFeedWatchdogFuncPtr)(void );
5558
5659class WiFiClass
5760{
@@ -296,6 +299,9 @@ class WiFiClass
296299
297300 NetworkInterface *getNetwork ();
298301
302+ void setFeedWatchdogFunc (ArduinoPortentaH7WiFiFeedWatchdogFuncPtr func);
303+ void feedWatchdog ();
304+
299305private:
300306
301307 EMACInterface* _softAP = nullptr ;
@@ -316,6 +322,7 @@ class WiFiClass
316322 bool isVisible (const char * ssid);
317323 arduino::IPAddress ipAddressFromSocketAddress (SocketAddress socketAddress);
318324 SocketAddress socketAddressFromIpAddress (arduino::IPAddress ip, uint16_t port);
325+ ArduinoPortentaH7WiFiFeedWatchdogFuncPtr _feed_watchdog_func = 0 ;
319326};
320327
321328}
Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ static FILE* target;
2323
2424void body_callback (const char * data, uint32_t data_len)
2525{
26+ WiFi.feedWatchdog ();
2627 fwrite (data, 1 , data_len, target);
2728}
2829
You can’t perform that action at this time.
0 commit comments