diff options
-rw-r--r-- | globals.h | 2 | ||||
-rw-r--r-- | parser.c | 25 |
2 files changed, 24 insertions, 3 deletions
@@ -18,10 +18,12 @@ typedef struct { } ChannelStruct; typedef struct { + char flash_start; char* aux_error_message; int channels; char enable_avrq_extra_ampls; char ChanKey_frequency; + char flash_end; } FlashStruct; @@ -32,12 +32,15 @@ static int Parser_find_commands(int commands[], int command_depth); static gchar* filter_input (gchar *raw_in); static int Parser_get_unit(char **parameter, char **units); static int Parser_channel (int *channel,int with_id_code,int routine_num); -static int Go_freq_32_33(gchar** response, int channel, char *parameter,char *units,int command_type); static int Handle_Units(float *mult,char *units, char *base); static int Is_Min_Command(char *text); static int Is_Max_Command(char *text); + +static int Go_freq_32_33(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_syst_err_11(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_syst_errcnt66(gchar** response, int channel, char *parameter,char *units,int command_type); +static int Go_eprom_siz_86(gchar** response, int channel, int command_type); + static int Parser_id_word(char *id_me, int *channel, int *with_id_code) { @@ -531,7 +534,7 @@ static gchar* filter_input (gchar *raw_in) // remove leading spaces, colons, semicolons GRegex *leading = g_regex_new ("^[\\s:;]*", 0, 0, NULL); gchar *step5 = g_regex_replace_literal (leading, step4, -1, 0, "", 0, NULL); - g_regex_unref (end_semi); + g_regex_unref (leading); g_free (step4); // last step may leave hanging whitespace at end @@ -730,7 +733,9 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer case 66: error_num=Go_syst_errcnt66(&response,channel,parameter,units,command_type); break; - + case 86: + error_num=Go_eprom_siz_86(&response,channel,command_type); + break; case 9999: // was only whitespace, ignore break; @@ -855,6 +860,20 @@ static int Go_freq_32_33(gchar** response, int channel, char *parameter,char *un } +static int Go_eprom_siz_86(gchar** response, int channel, int command_type) +{ + switch (command_type) { + case query_simple: + return query_int (response, sizeof(globals.Flash)); + break; + + default: + return SyntaxError; + break; + } +} + + static int Handle_Units(float *mult,char *units, char *in_base) { int len_base, len_all, pos; |