We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8dfadb commit f11beaeCopy full SHA for f11beae
UNOR4USBBridge/ping.cpp
@@ -24,9 +24,15 @@ static void ping_timeout(esp_ping_handle_t hdl, void *args) {
24
}
25
26
static void ping_end(esp_ping_handle_t hdl, void *args) {
27
- _stats.status = ping_status::SUCCESS;
28
esp_ping_stop(hdl);
29
esp_ping_delete_session(hdl);
+ if(_stats.success_count == 0) {
30
+ // all ping request have timed out
31
+ _stats.status = ping_status::TIMEOUT;
32
+ } else {
33
+ // at least one ping as succeded and we can return rtt value
34
+ _stats.status = ping_status::SUCCESS;
35
+ }
36
37
38
ping_statistics execute_ping(const char* address, uint8_t ttl, uint8_t count) {
0 commit comments