From 0b3ae523971cd3bfae93dbffe202285e5a435520 Mon Sep 17 00:00:00 2001 From: "Michael J. Chudobiak" Date: Mon, 13 Aug 2012 20:54:45 -0400 Subject: let parser handle command prompt generation --- parser.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'parser.c') diff --git a/parser.c b/parser.c index 631d948..a39fcce 100644 --- a/parser.c +++ b/parser.c @@ -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) -- cgit