diff --git a/commandline.c b/commandline.c index d838ade8..300a2104 100644 --- a/commandline.c +++ b/commandline.c @@ -819,6 +819,8 @@ int app_mdp_ping(int argc, const char *const *argv, struct command_line_option * if (cli_arg(argc, argv, o, "count", &count, NULL, "0") == -1) return -1; + // assume we wont hear any responses + int ret=-1; int icount=atoi(count); overlay_mdp_frame mdp; @@ -906,6 +908,7 @@ int app_mdp_ping(int argc, const char *const *argv, struct command_line_option * mdp.packetTypeAndFlags&MDP_NOSIGN?"":" SIGNED"); // TODO Put duplicate pong detection here so that stats work properly. rx_count++; + ret=0; rx_ms+=delay; if (rx_mintime>delay||rx_mintime==-1) rx_mintime=delay; if (delay>rx_maxtime) rx_maxtime=delay; @@ -919,36 +922,34 @@ int app_mdp_ping(int argc, const char *const *argv, struct command_line_option * } } now=gettime_ms(); - if (servalShutdown) { - - float rx_stddev=0; - float rx_mean=rx_ms*1.0/rx_count; - int samples=rx_count; - if (samples>1024) samples=1024; - int i; - for(i=0;i1024) samples=1024; + int i; + for(i=0;i