Skip to content

Commit 51762a8

Browse files
wyr-7xiaoxiang781216
authored andcommitted
nsh cmd rptun: add rptun ping useage description
Signed-off-by: wangyongrong <[email protected]>
1 parent d9f467d commit 51762a8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

nshlib/nsh_command.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@ static const struct cmdmap_s g_cmdmap[] =
514514
#endif
515515

516516
#if defined(CONFIG_RPTUN) && !defined(CONFIG_NSH_DISABLE_RPTUN)
517-
CMD_MAP("rptun", cmd_rptun, 3, 7,
517+
CMD_MAP("rptun", cmd_rptun, 2, 7,
518518
"<start|stop|reset|panic|dump|ping> <path|all>"
519519
" [value|times length ack sleep]"),
520520
#endif

nshlib/nsh_syscmds.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,6 +605,27 @@ static int cmd_rptun_recursive(FAR struct nsh_vtbl_s *vtbl,
605605

606606
int cmd_rptun(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
607607
{
608+
if (argc >= 2 && strcmp(argv[1], "-h") == 0)
609+
{
610+
nsh_output(vtbl, "usage:\n");
611+
nsh_output(vtbl, " rptun <start|stop|reset|panic|dump> <path> "
612+
"<value>\n");
613+
nsh_output(vtbl, " rptun <reset> <path> <resetvalue>\n");
614+
nsh_output(vtbl, " rptun ping <path> <times> <length> <ack> "
615+
"<period(ms)>\n\n");
616+
nsh_output(vtbl, " <path> Rptun device path.\n");
617+
nsh_output(vtbl, " <times> Times of rptun ping.\n");
618+
nsh_output(vtbl, " <length> The length of each ping packet.\n");
619+
nsh_output(vtbl, " <ack> Whether the peer acknowlege or "
620+
"check data.\n");
621+
nsh_output(vtbl, " 0 - No acknowledge and check.\n");
622+
nsh_output(vtbl, " 1 - Acknowledge, no data check.\n");
623+
nsh_output(vtbl, " 2 - Acknowledge and data check.\n");
624+
nsh_output(vtbl, " <period(ms)> ping period (ms) \n\n");
625+
626+
return OK;
627+
}
628+
608629
if (argc < 3)
609630
{
610631
nsh_output(vtbl, g_fmtargrequired, argv[0]);

0 commit comments

Comments
 (0)