From 9e3ff41722716a4bf227bc66d67e835b4e2aa20d Mon Sep 17 00:00:00 2001 From: Emanuele Goldoni Date: Tue, 17 Oct 2023 13:08:47 +0200 Subject: [PATCH] Correct documentation re: non-failure return value of `WiFiClass::ping` The original implementation of WiFiClass::ping only returned a result type code when a ping was successful. It was later changed to return the RTT when the ping operation did not error, only returning a result type code when the ping operation failed. The RTT can be programmatically differentiated from the result type code because the codes use negative numbers, while a RTT will always be positive. --- docs/api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.md b/docs/api.md index d59d397..f75bef3 100644 --- a/docs/api.md +++ b/docs/api.md @@ -891,7 +891,7 @@ host: the host to ping (string) ttl: Time of live (optional, defaults to 128). Maximum number of routers the request can be forwarded to. #### Returns -WL_PING_SUCCESS when the ping was successful +the RTT value (>=0) when the ping was successful WL_PING_DEST_UNREACHABLE when the destination (IP or host is unreachable) WL_PING_TIMEOUT when the ping times out WL_PING_UNKNOWN_HOST when the host cannot be resolved via DNS