From 5f17ec1fa2be1eb950d9afb997260aee5c0ad9cc Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 27 May 2015 08:25:26 -0600 Subject: [PATCH] Enhanced output to NSH ping command from Max Neklyudov --- nshlib/nsh_netcmds.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nshlib/nsh_netcmds.c b/nshlib/nsh_netcmds.c index 5f8b0e080..7339b7d59 100644 --- a/nshlib/nsh_netcmds.c +++ b/nshlib/nsh_netcmds.c @@ -1291,6 +1291,17 @@ int cmd_ping(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) DEFAULT_PING_DATALEN, staddr, seqno, elapsed); replies++; } + else if (seqno < 0) + { + if (seqno == -ETIMEDOUT) + { + nsh_output(vtbl, "seq=%d Request timeout\n", i); + } + else if (seqno == -ENETUNREACH) + { + nsh_output(vtbl, "seq=%d Network is unreachable\n", i); + } + } /* Wait for the remainder of the interval. If the last seqno