Skip to content

Commit 484bb31

Browse files
[WIP] introducing ping feature
1 parent 670dad5 commit 484bb31

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: libraries/WiFiS3/src/WiFi.cpp

+8-8
Original file line numberDiff line numberDiff line change
@@ -561,19 +561,19 @@ void CWifi::setTimeout(unsigned long timeout) {
561561
/* -------------------------------------------------------------------------- */
562562
float CWifi::ping(IPAddress ip, unsigned int count) {
563563
/* -------------------------------------------------------------------------- */
564-
return ping(ip.toString().c_str(), count);
564+
return ping(ip.toString().c_str(), count);
565565
}
566566

567567
/* -------------------------------------------------------------------------- */
568568
float CWifi::ping(const char* host, unsigned int count) {
569569
/* -------------------------------------------------------------------------- */
570-
modem.begin();
571-
string res = "";
572-
if (modem.write(string(PROMPT(_PINGNAME)),res, "%s,%s,%d\r\n", CMD_WRITE(_PINGNAME), host, count)) {
573-
String rsl = res.c_str();
574-
return rsl.toFloat();
575-
}
576-
return 0;
570+
modem.begin();
571+
string res = "";
572+
if (modem.write(string(PROMPT(_PING)), res, "%s,%s,%d\r\n", CMD_WRITE(_PING), host, count)) {
573+
String rsl = res.c_str();
574+
return rsl.toFloat();
575+
}
576+
return 0;
577577
}
578578

579579
CWifi WiFi;

0 commit comments

Comments
 (0)