Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7bce7fc

Browse files
Merge pull request #258 from pennam/wifi-wdog-feed
Add API to WiFi class to configure wdog feed function
2 parents 2f95bc3 + 28bae3e commit 7bce7fc

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

‎libraries/WiFi/src/WiFi.cpp‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff 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"

‎libraries/WiFi/src/WiFi.h‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
5254
namespace arduino {
5355

5456
typedef void* (*voidPrtFuncPtr)(void);
57+
typedef void (*ArduinoPortentaH7WiFiFeedWatchdogFuncPtr)(void);
5558

5659
class WiFiClass
5760
{
@@ -296,6 +299,9 @@ class WiFiClass
296299

297300
NetworkInterface *getNetwork();
298301

302+
void setFeedWatchdogFunc(ArduinoPortentaH7WiFiFeedWatchdogFuncPtr func);
303+
void feedWatchdog();
304+
299305
private:
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
}

‎libraries/WiFi/src/WiFiHelpers.cpp‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ static FILE* target;
2323

2424
void body_callback(const char* data, uint32_t data_len)
2525
{
26+
WiFi.feedWatchdog();
2627
fwrite(data, 1, data_len, target);
2728
}
2829

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /