Skip to content

Commit

Permalink
Correct documentation re: non-failure return value of WiFiClass::ping
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
emanueleg authored and per1234 committed Oct 19, 2023
1 parent 1634ec2 commit 9e3ff41
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9e3ff41

Please sign in to comment.