From fec1109b3d21ddd204ac5de2ce13aeaff34e4ee6 Mon Sep 17 00:00:00 2001 From: pennam Date: Fri, 22 Nov 2024 15:46:20 +0100 Subject: [PATCH] ping: add missing method --- libraries/WiFiS3/src/WiFi.cpp | 7 +++++++ libraries/WiFiS3/src/WiFi.h | 1 + 2 files changed, 8 insertions(+) diff --git a/libraries/WiFiS3/src/WiFi.cpp b/libraries/WiFiS3/src/WiFi.cpp index a7f5047e..0a3a80c8 100644 --- a/libraries/WiFiS3/src/WiFi.cpp +++ b/libraries/WiFiS3/src/WiFi.cpp @@ -567,6 +567,13 @@ int CWifi::ping(IPAddress ip, uint8_t ttl, uint8_t count) { return ping(ip.toString().c_str(), ttl, count); } +/* -------------------------------------------------------------------------- */ +int CWifi::ping(const String &hostname, uint8_t ttl, uint8_t count) +/* -------------------------------------------------------------------------- */ +{ + return ping(hostname.c_str(), ttl); +} + /* -------------------------------------------------------------------------- */ int CWifi::ping(const char* host, uint8_t ttl, uint8_t count) { /* -------------------------------------------------------------------------- */ diff --git a/libraries/WiFiS3/src/WiFi.h b/libraries/WiFiS3/src/WiFi.h index 356bc1e4..bbacc5f1 100644 --- a/libraries/WiFiS3/src/WiFi.h +++ b/libraries/WiFiS3/src/WiFi.h @@ -62,6 +62,7 @@ class CWifi { * PING */ int ping(IPAddress ip, uint8_t ttl = 128, uint8_t count = 1); + int ping(const String &hostname, uint8_t ttl = 128, uint8_t count = 1); int ping(const char* host, uint8_t ttl = 128, uint8_t count = 1); /*