summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:40:04 -0500
committerroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:40:04 -0500
commitc587cacfa55a7d3c4e24cc398594a4412bb36ee3 (patch)
tree11358806ab4fda199c7023794760f3dc6a80b6d3 /parser.c
parentca3514ba254ef3d51b40f9e9b7c0afb9c8980261 (diff)
allow attenuators to be disabled for amplitude calibrationt
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c39
1 files changed, 37 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index cfb3bbb..6d3ae2e 100644
--- a/parser.c
+++ b/parser.c
@@ -116,6 +116,7 @@ static int Go_avrq_ampl(gchar** response, int channel, char *parameter,char *uni
static int Go_cal_100(gchar** response, int channel, char *parameter,char *units,int command_type);
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 Parser_id_word(char *id_me, int *channel, int *with_id_code)
{
@@ -351,6 +352,8 @@ static int Parser_id_word(char *id_me, int *channel, int *with_id_code)
id_code = 107;
} else if (!strcmp(id_me,"reset") || !strcmp(id_me,"res")) {
id_code = 108;
+ } else if (!strcmp(id_me,"attenuator") || !strcmp(id_me,"att")) {
+ id_code = 109;
} else {
id_code = 9999;
}
@@ -476,6 +479,7 @@ static int Parser_find_commands(int commands[], int command_depth)
{88,107|optional}, /* calibration:all - 100 */
{88,37}, /* calibration:frequency - 101 */
{23,57,108}, /* diag:eprom:reset - 102 */
+ {23,109,16|optional}, /* diag:attenuator:state - 103 */
};
@@ -1044,7 +1048,9 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer
case 102:
error_num=Go_eprom_reset_102(&response,channel,parameter,units,command_type);
break;
-
+ case 103:
+ error_num=Go_atten_103(&response,channel,parameter,units,command_type);
+ break;
case 9999:
// was only whitespace, ignore
break;
@@ -3267,7 +3273,7 @@ static int Parse_chan_list(int channel,char *parameter,int *primary_selected, in
}
n = atoi(digits->str);
- g_string_free (digits, TRUE);
+ g_string_free (digits, TRUE);
if (error_num) {
return error_num;
@@ -4029,3 +4035,32 @@ static int Go_cal_interval_101(gchar** response, int channel, char *parameter,ch
return ThisShouldntHappen;
}
+
+
+static int Go_atten_103(gchar** response, int channel, char *parameter,char *units,int command_type)
+{
+ int on_off, status;
+
+ switch (command_type) {
+ case command_withparam:
+ if (status=process_on_off (parameter, &on_off)) {
+ return status;
+ }
+ globals.Flags.attenuators_enabled = on_off;
+
+ return OK;
+ break;
+
+ case query_simple:
+ return query_int (response, globals.Flags.attenuators_enabled);
+ break;
+
+ default:
+ return SyntaxError;
+ break;
+ }
+
+ return ThisShouldntHappen;
+}
+
+