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/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 9c4103d49 nsh_syscmds/rpmsg: add rpmsg test command support
9c4103d49 is described below

commit 9c4103d496fb5ab6324906e19c98ab16976cf390
Author: mazhuang <[email protected]>
AuthorDate: Wed Oct 23 15:35:57 2024 +0800

    nsh_syscmds/rpmsg: add rpmsg test command support
    
    User can use rpmsg test /dev/rpmsg/<cpuname> to test the rpmsg
    channel
    
    Signed-off-by: mazhuang <[email protected]>
---
 nshlib/nsh_command.c | 2 +-
 nshlib/nsh_syscmds.c | 8 +++++++-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c
index 2f05557cb..629949753 100644
--- a/nshlib/nsh_command.c
+++ b/nshlib/nsh_command.c
@@ -535,7 +535,7 @@ static const struct cmdmap_s g_cmdmap[] =
 
 #if defined(CONFIG_RPTUN) && !defined(CONFIG_NSH_DISABLE_RPTUN)
   CMD_MAP("rptun",    cmd_rptun,    2, 7,
-    "<start|stop|reset|panic|dump|ping> <path|all>"
+    "<start|stop|reset|panic|dump|ping|test> <path|all>"
     " [value|times length ack sleep]"),
 #endif
 
diff --git a/nshlib/nsh_syscmds.c b/nshlib/nsh_syscmds.c
index 3541156ef..88db8c913 100644
--- a/nshlib/nsh_syscmds.c
+++ b/nshlib/nsh_syscmds.c
@@ -591,6 +591,12 @@ static int cmd_rpmsg_once(FAR struct nsh_vtbl_s *vtbl,
       cmd = RPMSGIOC_PING;
       val = (unsigned long)&ping;
     }
+#endif
+#ifdef CONFIG_RPMSG_TEST
+  else if (strcmp(argv[1], "test") == 0)
+    {
+      cmd = RPMSGIOC_TEST;
+    }
 #endif
   else if (rpmsg_cb && rpmsg_cb(&cmd, &val, argv) == OK)
     {
@@ -642,7 +648,7 @@ static int cmd_rpmsg_recursive(FAR struct nsh_vtbl_s *vtbl,
 static int cmd_rpmsg_help(FAR struct nsh_vtbl_s *vtbl, int argc,
                           FAR char **argv)
 {
-  nsh_output(vtbl, "%s <panic|dump> <path>\n", argv[0]);
+  nsh_output(vtbl, "%s <panic|dump|test> <path>\n", argv[0]);
 #ifdef CONFIG_RPMSG_PING
   nsh_output(vtbl, "%s ping <path> <times> <length> <cmd> "
              "<period(ms)>\n\n", argv[0]);

Reply via email to