From 3a849b6e915c3a100e63ec4603ff9463927c8af0 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 3 May 2018 10:32:39 -0400 Subject: add diag:eprom:resize to copy old 10-point data into new 32-point arrays --- parser.c | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 121 insertions(+) diff --git a/parser.c b/parser.c index ebee94f..b3492f9 100644 --- a/parser.c +++ b/parser.c @@ -116,6 +116,7 @@ static int Go_cal_100(gchar** response, int channel, char *parameter,char *units static int Go_cal_interval_101(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_eprom_reset_102(gchar** response, int channel, char *parameter,char *units,int command_type); static int Go_atten_103(gchar** response, int channel, char *parameter,char *units,int command_type); +static int Go_eprom_resize_105(gchar** response, int channel, char *parameter,char *units,int command_type); static int Parser_id_word(char *id_me, int *channel, int *with_id_code) { @@ -355,6 +356,8 @@ static int Parser_id_word(char *id_me, int *channel, int *with_id_code) id_code = 109; } else if (!strcmp(id_me,"distort")) { id_code = 110; + } else if (!strcmp(id_me,"resize")) { + id_code = 111; } else { id_code = 9999; } @@ -482,6 +485,7 @@ static int Parser_find_commands(int commands[], int command_depth) {23,57,108}, /* diag:eprom:reset - 102 */ {23,109,16|optional}, /* diag:attenuator:state - 103 */ {23,32,110,88,93}, /* diag:ampl:distort:calib:point - 104 */ + {23,57,111}, /* diag:eprom:resize - 105 */ }; @@ -1053,6 +1057,9 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer case 104: error_num=Go_amp_pnt_83(&response,channel,parameter,units,command_type,pwl_distort_values); break; + case 105: + error_num=Go_eprom_resize_105(&response,channel,parameter,units,command_type); + break; case 9999: // was only whitespace, ignore @@ -4058,3 +4065,117 @@ static int Go_atten_103(gchar** response, int channel, char *parameter,char *uni } +static int Go_eprom_resize_105(gchar** response, int channel, char *parameter,char *units,int command_type) +{ + /* copies data from old ten-point-ranges into new-style (May 2018) 32-point ranges */ + + int i, j, k, l; + + if (channel) { + return InvalidChannel; + } + + switch (command_type) { + case command_simple: + + for (i=0;i