diff options
author | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-13 20:54:45 -0400 |
---|---|---|
committer | Michael J. Chudobiak <mjc@avtechpulse.com> | 2012-08-13 20:54:45 -0400 |
commit | 0b3ae523971cd3bfae93dbffe202285e5a435520 (patch) | |
tree | 20d7562036e603cc4c44c7715d3867cb9275b106 /parser.c | |
parent | fc17e46aefc3b5f4e2d4dda8e09f9fa6533377be (diff) |
let parser handle command prompt generation
Diffstat (limited to 'parser.c')
-rw-r--r-- | parser.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -557,8 +557,6 @@ void Parser_main (char *in, int interactive_terminal, void(*cbfunc)(gpointer, gc int channel;
int with_id_code;
-//printf ("decoding this input: %s\n\r",in);
-
// fixme - delete enclosing loop and re-indent
if (1) {
strcpy(in+strlen(in)," "); /* add white space to the end of the input string */
@@ -715,7 +713,7 @@ void Parser_main (char *in, int interactive_terminal, void(*cbfunc)(gpointer, gc switch (routine_num) {
case 0:
- response = g_strdup_printf("routine_num: %d, channel: %d, parameter: %s, units: %s, command type: %d\n\r",routine_num,channel,parameter,units,command_type);
+ response = g_strdup_printf("routine_num: %d, channel: %d, parameter: %s, units: %s, command type: %d",routine_num,channel,parameter,units,command_type);
error_num=Unrecognized;
break;
case 11:
@@ -735,7 +733,7 @@ void Parser_main (char *in, int interactive_terminal, void(*cbfunc)(gpointer, gc default:
/* valid but not implemented yet */
- response = g_strdup_printf("routine_num: %d, channel: %d, parameter: %s, units: %s, command type: %d\n\r",routine_num,channel,parameter,units,command_type);
+ response = g_strdup_printf("routine_num: %d, channel: %d, parameter: %s, units: %s, command type: %d",routine_num,channel,parameter,units,command_type);
break;
}
@@ -771,6 +769,11 @@ void Parser_main (char *in, int interactive_terminal, void(*cbfunc)(gpointer, gc /* re-run error_check to update min/max values based on actual settings, not proposed settings */
Error_check(globals.ChannelState);
}
+
+ // trigger a prompt
+ if (interactive_terminal) {
+ (*cbfunc)(user_data, "");
+ }
}
static int Parser_channel (int *channel,int with_id_code,int routine_num)
|