bluemurder / esp8266-ping

Arduino library handling ping messages for the esp8266 platform
MIT License
31 stars 11 forks source link

Timeout on last Ping corrupts AvgResponseTime #9

Open bhelterline opened 4 years ago

bhelterline commented 4 years ago

If the last ping received times out, the AvgResponseTime variable does not get properly calculated. It remains as the sum of all the previous response times and is never divided by the TotalReceivedResponses. This calculation is done in PingReceived() but needs to be duplicated in RequestTimeoutOccurred()