You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/04/01 09:37:00 UTC

[incubator-nuttx-apps] 03/06: rptun: add rptun dump support

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit e0e5652de42f39d0122d03f0ddf3ecee3e8a7469
Author: ligd <li...@xiaomi.com>
AuthorDate: Wed Jan 19 21:07:59 2022 +0800

    rptun: add rptun dump support
    
    Signed-off-by: ligd <li...@xiaomi.com>
---
 nshlib/nsh_command.c | 3 ++-
 nshlib/nsh_syscmds.c | 4 ++++
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c
index 5bc7ab0..2e41997 100644
--- a/nshlib/nsh_command.c
+++ b/nshlib/nsh_command.c
@@ -470,7 +470,8 @@ static const struct cmdmap_s g_cmdmap[] =
 #endif
 
 #if defined(CONFIG_RPTUN) && !defined(CONFIG_NSH_DISABLE_RPTUN)
-  { "rptun",    cmd_rptun,    3, 4, "start|stop|reset|panic <dev-path> [value]" },
+  { "rptun",    cmd_rptun,    3, 4,
+    "start|stop|reset|panic|dump <dev-path> [value]" },
 #endif
 
 #ifndef CONFIG_NSH_DISABLE_SET
diff --git a/nshlib/nsh_syscmds.c b/nshlib/nsh_syscmds.c
index ce63a2a..b903f49 100644
--- a/nshlib/nsh_syscmds.c
+++ b/nshlib/nsh_syscmds.c
@@ -377,6 +377,10 @@ int cmd_rptun(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
     {
       cmd = RPTUNIOC_PANIC;
     }
+  else if (strcmp(argv[1], "dump") == 0)
+    {
+      cmd = RPTUNIOC_DUMP;
+    }
   else
     {
       nsh_output(vtbl, g_fmtarginvalid, argv[1]);