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 030bdf8

Browse files
committed
ping: fix timeout in case of count > 1
1 parent 46e6416 commit 030bdf8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

‎libraries/WiFiS3/src/WiFi.cpp‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,10 +572,13 @@ int CWifi::ping(const char* host, uint8_t ttl, uint8_t count) {
572572
/* -------------------------------------------------------------------------- */
573573
int ret = WL_PING_ERROR;
574574
modem.begin();
575+
/* ping timeout is 1s and interval another 1s */
576+
modem.timeout((count * 2000) + MODEM_TIMEOUT);
575577
string res = "";
576578
if (modem.write(string(PROMPT(_PING)), res, "%s,%s,%d,%d\r\n", CMD_WRITE(_PING), host, ttl, count)) {
577579
ret = atoi(res.c_str());
578580
}
581+
modem.timeout(MODEM_TIMEOUT);
579582
return ret;
580583
}
581584

0 commit comments

Comments
(0)

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