FreeCalypso > hg > freecalypso-tools
diff rvinterf/asyncshell/oneshot.c @ 75:bbc41034f14c
fc-shell: added support for AT commands in one-shot mode
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Thu, 27 Oct 2016 02:13:38 +0000 |
parents | d43d82cbfb85 |
children | 8c7e86bc137e |
line wrap: on
line diff
--- a/rvinterf/asyncshell/oneshot.c Thu Oct 27 00:18:49 2016 +0000 +++ b/rvinterf/asyncshell/oneshot.c Thu Oct 27 02:13:38 2016 +0000 @@ -12,6 +12,7 @@ extern int cmd_poweroff(); extern int cmd_send_oneshot(); extern int cmd_sp_oneshot(); +extern int cmd_str_oneshot(); extern int cmd_tchdl_oneshot(); extern int cmd_tgtreset(); @@ -24,6 +25,7 @@ {"poweroff", 0, 0, cmd_poweroff}, {"send", 1, MAX_PKT_TO_TARGET, cmd_send_oneshot}, {"sp", 2, 2, cmd_sp_oneshot}, + {"str", 1, 1, cmd_str_oneshot}, {"tch-dl", 1, 1, cmd_tchdl_oneshot}, {"tgtreset", 0, 0, cmd_tgtreset}, {0, 0, 0, 0} @@ -34,6 +36,14 @@ { struct cmdtab *tp; + if (!strncmp(argv[0], "AT", 2) || !strncmp(argv[0], "at", 2)) { + if (argc != 1) { + fprintf(stderr, + "error: AT command must be a single argument\n"); + exit(ERROR_USAGE); + } + return oneshot_at_command(argv[0]); + } for (tp = cmdtab; tp->cmd; tp++) if (!strcmp(tp->cmd, argv[0])) break;