comparison rvinterf/asyncshell/oneshot.c @ 1012:93f4fc26b204

fc-shell: arbitrary send command implemented in one-shot mode
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Sun, 20 Mar 2016 22:06:11 +0000
parents bd873572ef2c
children 0511507bf6e7
comparison
equal deleted inserted replaced
1011:820d34f3f3d7 1012:93f4fc26b204
4 4
5 #include <stdio.h> 5 #include <stdio.h>
6 #include <string.h> 6 #include <string.h>
7 #include <strings.h> 7 #include <strings.h>
8 #include <stdlib.h> 8 #include <stdlib.h>
9 #include "limits.h"
9 10
10 extern int cmd_poweroff(); 11 extern int cmd_poweroff();
12 extern int cmd_send_oneshot();
11 extern int cmd_sp_oneshot(); 13 extern int cmd_sp_oneshot();
12 extern int cmd_tgtreset(); 14 extern int cmd_tgtreset();
13 15
14 static struct cmdtab { 16 static struct cmdtab {
15 char *cmd; 17 char *cmd;
16 int minargs; 18 int minargs;
17 int maxargs; 19 int maxargs;
18 int (*func)(); 20 int (*func)();
19 } cmdtab[] = { 21 } cmdtab[] = {
20 {"poweroff", 0, 0, cmd_poweroff}, 22 {"poweroff", 0, 0, cmd_poweroff},
23 {"send", 1, MAX_PKT_TO_TARGET, cmd_send_oneshot},
21 {"sp", 2, 2, cmd_sp_oneshot}, 24 {"sp", 2, 2, cmd_sp_oneshot},
22 {"tgtreset", 0, 0, cmd_tgtreset}, 25 {"tgtreset", 0, 0, cmd_tgtreset},
23 {0, 0, 0, 0} 26 {0, 0, 0, 0}
24 }; 27 };
25 28