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:36:58 UTC

[incubator-nuttx-apps] 01/06: apps: add rptun /dev/rptun/xx panic cmd

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 c57677c3ced5e0e0c5c299c0830aa9cabb4a383b
Author: ligd <li...@xiaomi.com>
AuthorDate: Wed Dec 22 19:50:48 2021 +0800

    apps: add rptun /dev/rptun/xx panic cmd
    
    Signed-off-by: ligd <li...@xiaomi.com>
---
 nshlib/nsh_command.c | 2 +-
 nshlib/nsh_syscmds.c | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c
index a251c1a..318ac2a 100644
--- a/nshlib/nsh_command.c
+++ b/nshlib/nsh_command.c
@@ -470,7 +470,7 @@ static const struct cmdmap_s g_cmdmap[] =
 #endif
 
 #if defined(CONFIG_RPTUN) && !defined(CONFIG_NSH_DISABLE_RPTUN)
-  { "rptun",    cmd_rptun,    3, 3, "start|stop <dev-path>" },
+  { "rptun",    cmd_rptun,    3, 3, "start|stop|panic <dev-path>" },
 #endif
 
 #ifndef CONFIG_NSH_DISABLE_SET
diff --git a/nshlib/nsh_syscmds.c b/nshlib/nsh_syscmds.c
index 471131c..9470b2c 100644
--- a/nshlib/nsh_syscmds.c
+++ b/nshlib/nsh_syscmds.c
@@ -363,6 +363,10 @@ int cmd_rptun(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv)
     {
       cmd = RPTUNIOC_STOP;
     }
+  else if (strcmp(argv[1], "panic") == 0)
+    {
+      cmd = RPTUNIOC_PANIC;
+    }
   else
     {
       nsh_output(vtbl, g_fmtarginvalid, argv[1]);