FreeCalypso > hg > freecalypso-sw
comparison rvinterf/asyncshell/usercmd.c @ 879:4661b84260a0
fc-shell: AT-over-RVTMUX command sending implemented
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 00:19:28 +0000 |
parents | dab341e172de |
children | 1b1683cda154 |
comparison
equal
deleted
inserted
replaced
878:89c70b89dca5 | 879:4661b84260a0 |
---|---|
11 | 11 |
12 extern char usercmd[]; | 12 extern char usercmd[]; |
13 | 13 |
14 extern void cmd_disable(); | 14 extern void cmd_disable(); |
15 extern void cmd_enable(); | 15 extern void cmd_enable(); |
16 extern void cmd_sendat(); | |
16 extern void cmd_sendsp(); | 17 extern void cmd_sendsp(); |
17 | 18 |
18 void | 19 void |
19 cmd_exit() | 20 cmd_exit() |
20 { | 21 { |
29 {"disable", cmd_disable}, | 30 {"disable", cmd_disable}, |
30 {"enable", cmd_enable}, | 31 {"enable", cmd_enable}, |
31 {"exit", cmd_exit}, | 32 {"exit", cmd_exit}, |
32 {"quit", cmd_exit}, | 33 {"quit", cmd_exit}, |
33 {"sp", cmd_sendsp}, | 34 {"sp", cmd_sendsp}, |
35 {"str", cmd_sendat}, | |
34 {0, 0} | 36 {0, 0} |
35 }; | 37 }; |
36 | 38 |
37 void | 39 void |
38 dispatch_user_cmd() | 40 dispatch_user_cmd() |
42 | 44 |
43 for (cp = usercmd; isspace(*cp); cp++) | 45 for (cp = usercmd; isspace(*cp); cp++) |
44 ; | 46 ; |
45 if (!*cp || *cp == '#') | 47 if (!*cp || *cp == '#') |
46 return; | 48 return; |
49 if (!strncmp(cp, "AT", 2) || !strncmp(cp, "at", 2)) { | |
50 cmd_sendat(cp); | |
51 return; | |
52 } | |
47 for (np = cp; *cp && !isspace(*cp); cp++) | 53 for (np = cp; *cp && !isspace(*cp); cp++) |
48 ; | 54 ; |
49 if (*cp) | 55 if (*cp) |
50 *cp++ = '\0'; | 56 *cp++ = '\0'; |
51 for (tp = cmdtab; tp->cmd; tp++) | 57 for (tp = cmdtab; tp->cmd; tp++) |