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 <mazhuang@xiaomi.com>
This commit is contained in:
mazhuang 2024-10-23 15:35:57 +08:00 • committed by Xiang Xiao
parent 1512f9c6e5
commit 9c4103d496
2 changed files with 8 additions and 2 deletions

View file

@ -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

View file

@ -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]);