summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:49:54 -0500
committerroot <root@avtech.domain.avtechpulse.com>1999-12-31 19:49:54 -0500
commit6f54d6f2efeb88630e69cd673f5be55e16735f22 (patch)
tree5a4757adfb20e2fe9b7fe66bb3b9135389cb4774
parent26fbe0556b9260c29ac1aa082d7ce3baacadb665 (diff)
removed parity and databit settings, because they are now automatic
-rw-r--r--device-functions.c8
-rw-r--r--device-functions.h2
-rw-r--r--flash.c4
-rw-r--r--globals.h14
-rw-r--r--instr-daemon.c2
-rw-r--r--menus.c111
-rw-r--r--parser.c95
7 files changed, 38 insertions, 198 deletions
diff --git a/device-functions.c b/device-functions.c
index 90a5f92..4753b28 100644
--- a/device-functions.c
+++ b/device-functions.c
@@ -4622,14 +4622,12 @@ void Main_update_shift_registers()
}
-int IO_Setup_RS232(int baud, char parity, char stopbits, char databits, char hardhand, char echo, gboolean update_flash)
+int IO_Setup_RS232(int baud, char stopbits, char hardhand, char echo, gboolean update_flash)
{
// debugging
- printf ("baud: %d, parity %d, stop bits %d, data bits %d, handshaking %d, echo %d\n\r",
+ printf ("baud: %d, stop bits %d, handshaking %d, echo %d\n\r",
baud,
- parity, // 0 = none, 1 = odd, 2 = even
stopbits,
- databits,
hardhand, // 0 = none, 1 = hard
echo);
@@ -4645,9 +4643,7 @@ int IO_Setup_RS232(int baud, char parity, char stopbits, char databits, char har
if (1) { // FIXME if changes are successful
globals.Flash.baud = baud;
- globals.Flash.parity = parity;
globals.Flash.stopbits = stopbits;
- globals.Flash.databits = databits;
globals.Flash.hardhand = hardhand;
globals.Flash.echo = echo;
diff --git a/device-functions.h b/device-functions.h
index de4f1b8..c676a2e 100644
--- a/device-functions.h
+++ b/device-functions.h
@@ -71,6 +71,6 @@ void Set_Sav(int setting_num);
void Main_update_shift_registers();
-int IO_Setup_RS232(int baud, char parity, char stopbits, char databits, char handshake, char echo, gboolean update_flash);
+int IO_Setup_RS232(int baud, char stopbits, char handshake, char echo, gboolean update_flash);
#endif
diff --git a/flash.c b/flash.c
index 34f6e7f..d2e7bcd 100644
--- a/flash.c
+++ b/flash.c
@@ -358,9 +358,9 @@ static void initFlashValues(FlashStruct *mem)
mem->telnet_logon_timeout=30; /* thirty seconds */
mem->baud = 1200;
- mem->parity = rs232_parity_none;
+ mem->parity = rs232_parity_none; // no longer used
mem->stopbits = 1;
- mem->databits = 8;
+ mem->databits = 8; // no longer used
mem->hardhand = 1;
mem->echo = 1;
diff --git a/globals.h b/globals.h
index 9e008dc..a630c15 100644
--- a/globals.h
+++ b/globals.h
@@ -195,9 +195,9 @@
#define ROUTE_PRIMARY 0
#define ROUTE_SECONDARY 1
-#define rs232_parity_none 0
-#define rs232_parity_odd 1
-#define rs232_parity_even 2
+#define rs232_parity_none 0 // no longer used
+#define rs232_parity_odd 1 // no longer used
+#define rs232_parity_even 2 // no longer used
#define smallest_allowed_number 1.0e-18
#define zero_equiv_timing 1e-10
@@ -252,8 +252,8 @@
#define Submenu2_load 1500
#define Submenu2_rs232 1600
#define Submenu2_rs232_baud 1700
-#define Submenu2_rs232_databits 1800
-#define Submenu2_rs232_parity 1900
+#define Submenu2_rs232_databits 1800 // no longer used
+#define Submenu2_rs232_parity 1900 // no longer used
#define Submenu2_rs232_stopbits 2000
#define Submenu2_rs232_hardhand 2100
#define Submenu2_rs232_echo 2200
@@ -407,9 +407,9 @@ typedef struct {
char warn_even_if_output_off; /* 129 */
int baud; /* 130 */
- char parity;
+ char parity; // no longer used
char stopbits;
- char databits;
+ char databits; // no longer used
char hardhand;
char echo;
diff --git a/instr-daemon.c b/instr-daemon.c
index 021eb62..eaf0b07 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -231,9 +231,7 @@ int main(int argc, char **argv)
GPIB_initialize();
IO_Setup_RS232( globals.Flash.baud,
- globals.Flash.parity,
globals.Flash.stopbits,
- globals.Flash.databits,
globals.Flash.hardhand,
globals.Flash.echo,
FALSE);
diff --git a/menus.c b/menus.c
index 874f120..aa231ea 100644
--- a/menus.c
+++ b/menus.c
@@ -1583,23 +1583,6 @@ static void Submenu_Display(int change_selection)
Submenu_Structure[3]=mode_9600;
break;
- case Submenu2_rs232_databits:
- title = g_strdup ("Data Bits:");
- Submenu_max_entry=1;
-
- Submenu_Structure[0]=mode_7bits;
- Submenu_Structure[1]=mode_8bits;
- break;
-
- case Submenu2_rs232_parity:
- title = g_strdup ("Parity:");
- Submenu_max_entry=2;
-
- Submenu_Structure[0]=mode_par_none;
- Submenu_Structure[1]=mode_par_even;
- Submenu_Structure[2]=mode_par_odd;
- break;
-
case Submenu2_rs232_stopbits:
title = g_strdup ("Stop Bits:");
Submenu_max_entry=1;
@@ -1977,36 +1960,6 @@ static void Submenu_Display(int change_selection)
current_operating_mode=i;
}
break;
- case mode_7bits:
- strcpy(mode_name[i],"7 bits");
- if (globals.Flash.databits==7) {
- current_operating_mode=i;
- }
- break;
- case mode_8bits:
- strcpy(mode_name[i],"8 bits");
- if (globals.Flash.databits==8) {
- current_operating_mode=i;
- }
- break;
- case mode_par_none:
- strcpy(mode_name[i],"None");
- if (globals.Flash.parity==rs232_parity_none) {
- current_operating_mode=i;
- }
- break;
- case mode_par_even:
- strcpy(mode_name[i],"Even");
- if (globals.Flash.parity==rs232_parity_even) {
- current_operating_mode=i;
- }
- break;
- case mode_par_odd:
- strcpy(mode_name[i],"Odd");
- if (globals.Flash.parity==rs232_parity_odd) {
- current_operating_mode=i;
- }
- break;
case mode_1bit:
strcpy(mode_name[i],"1 bit");
if (globals.Flash.stopbits==1) {
@@ -2763,11 +2716,11 @@ static void Nonstd_menu_default_rs232(void)
LCD_clear(); /*0123456789012345678901234567890123456789*/
LCD_write(0,0,"The RS232 settings are now: 1200 baud, ");
- LCD_write(1,0,"8 data bits, no parity, 1 stop bit,");
- LCD_write(2,0,"hardware handshaking on, and echo on.");
+ LCD_write(1,0,"1 stop bit, hardware handshaking on, ");
+ LCD_write(2,0,"and echo on.");
LCD_write(3,0,Press_Change_Message);
- IO_Setup_RS232(1200, rs232_parity_none, 1, 8, 1, 1, TRUE);
+ IO_Setup_RS232(1200, 1, 1, 1, TRUE);
Menu_Clear_Buttons();
@@ -3254,8 +3207,8 @@ static int Submenu_Implement_Changes(void)
Submenu_Display(NO);
break;
case mode_default_rs232:
+ call_new_submenu=YES;
Nonstd_menu_default_rs232();
- globals.MenuStatus.Selected_Submenu=Submenu1_setup;
break;
case mode_model_info:
call_new_submenu=YES;
@@ -3287,89 +3240,59 @@ static int Submenu_Implement_Changes(void)
break;
case mode_1200:
// FIXME: check that serial menus actually work
- IO_Setup_RS232(1200, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
- globals.MenuStatus.Selected_Submenu=Submenu2_rs232_databits;
+ IO_Setup_RS232(1200, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
+ globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits;
call_new_submenu=YES;
Submenu_Display(NO);
break;
case mode_2400:
- IO_Setup_RS232(2400, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
- globals.MenuStatus.Selected_Submenu=Submenu2_rs232_databits;
- call_new_submenu=YES;
- Submenu_Display(NO);
- break;
- case mode_4800:
- IO_Setup_RS232(4800, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
- globals.MenuStatus.Selected_Submenu=Submenu2_rs232_databits;
- call_new_submenu=YES;
- Submenu_Display(NO);
- break;
- case mode_9600:
- IO_Setup_RS232(9600, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
- globals.MenuStatus.Selected_Submenu=Submenu2_rs232_databits;
- call_new_submenu=YES;
- Submenu_Display(NO);
- break;
- case mode_7bits:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, 7, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
- globals.MenuStatus.Selected_Submenu=Submenu2_rs232_parity;
- call_new_submenu=YES;
- Submenu_Display(NO);
- break;
- case mode_8bits:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, 8, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
- globals.MenuStatus.Selected_Submenu=Submenu2_rs232_parity;
- call_new_submenu=YES;
- Submenu_Display(NO);
- break;
- case mode_par_none:
- IO_Setup_RS232(globals.Flash.baud, rs232_parity_none, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
+ IO_Setup_RS232(2400, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits;
call_new_submenu=YES;
Submenu_Display(NO);
break;
- case mode_par_odd:
- IO_Setup_RS232(globals.Flash.baud, rs232_parity_odd, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
+ case mode_4800:
+ IO_Setup_RS232(4800, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits;
call_new_submenu=YES;
Submenu_Display(NO);
break;
- case mode_par_even:
- IO_Setup_RS232(globals.Flash.baud, rs232_parity_even, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
+ case mode_9600:
+ IO_Setup_RS232(9600, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
globals.MenuStatus.Selected_Submenu=Submenu2_rs232_stopbits;
call_new_submenu=YES;
Submenu_Display(NO);
break;
case mode_1bit:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, 1, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
+ IO_Setup_RS232(globals.Flash.baud, 1, globals.Flash.hardhand, globals.Flash.echo, FALSE);
globals.MenuStatus.Selected_Submenu=Submenu2_rs232_hardhand;
call_new_submenu=YES;
Submenu_Display(NO);
break;
case mode_2bits:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, 2, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, FALSE);
+ IO_Setup_RS232(globals.Flash.baud, 2, globals.Flash.hardhand, globals.Flash.echo, FALSE);
globals.MenuStatus.Selected_Submenu=Submenu2_rs232_hardhand;
call_new_submenu=YES;
Submenu_Display(NO);
break;
case mode_hand_hard:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, 1, globals.Flash.echo, FALSE);
+ IO_Setup_RS232(globals.Flash.baud, globals.Flash.stopbits, 1, globals.Flash.echo, FALSE);
globals.MenuStatus.Selected_Submenu=Submenu2_rs232_echo;
call_new_submenu=YES;
Submenu_Display(NO);
break;
case mode_hand_off:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, 0, globals.Flash.echo, FALSE);
+ IO_Setup_RS232(globals.Flash.baud, globals.Flash.stopbits, 0, globals.Flash.echo, FALSE);
globals.MenuStatus.Selected_Submenu=Submenu2_rs232_echo;
call_new_submenu=YES;
Submenu_Display(NO);
break;
case mode_echo_on:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, 1, TRUE);
+ IO_Setup_RS232(globals.Flash.baud, globals.Flash.stopbits, globals.Flash.hardhand, 1, TRUE);
globals.MenuStatus.Selected_Submenu=Submenu1_setup;
break;
case mode_echo_off:
- IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, 0, TRUE);
+ IO_Setup_RS232(globals.Flash.baud, globals.Flash.stopbits, globals.Flash.hardhand, 0, TRUE);
globals.MenuStatus.Selected_Submenu=Submenu1_setup;
break;
}
diff --git a/parser.c b/parser.c
index 54bae16..046ff22 100644
--- a/parser.c
+++ b/parser.c
@@ -144,9 +144,9 @@ static int Parser_id_word(char *id_me, int *channel, int *with_id_code)
}
- if (!strcmp(id_me,"") ) {
- id_code = 0;
- } else if (!strcmp(id_me,"*cls") ) {
+ if (!strcmp(id_me,"") ) {
+ id_code = 0;
+ } else if (!strcmp(id_me,"*cls") ) {
id_code = 1;
} else if (!strcmp(id_me,"*ese") ) {
id_code = 2;
@@ -443,8 +443,8 @@ static int Parser_find_commands(int commands[], int command_depth)
{23,67,45}, /* diag:test:delay - 58 */
{13,68,70,69}, /* syst:comm:gpib:addr - 59 */
{13,68,71,72|optional,73}, /* syst:comm:ser:rec:baud - 60 */
- {13,68,71,72|optional,74,75|optional}, /* syst:comm:ser:rec:parity - 61 */
- {13,68,71,72|optional,76}, /* syst:comm:ser:rec:bits - 62 */
+ {13,68,71,72|optional,74,75|optional}, /* syst:comm:ser:rec:parity - 61 - not used */
+ {13,68,71,72|optional,76}, /* syst:comm:ser:rec:bits - 62 - not used */
{13,68,71,72|optional,77}, /* syst:comm:ser:rec:sbits - 63 */
{13,68,71,80,79}, /* syst:comm:ser:control:rts - 64 */
{13,68,71,72|optional,78}, /* syst:comm:ser:rec:echo - 65 */
@@ -945,12 +945,6 @@ void Parser_main (char *raw_in, int interactive_terminal, void(*cbfunc)(gpointer
case 60:
error_num=Go_ser_baud_60(&response,channel,parameter,units,command_type);
break;
- case 61:
- error_num=Go_ser_par_61(&response,channel,parameter,units,command_type);
- break;
- case 62:
- error_num=Go_ser_bits_62(&response,channel,parameter,units,command_type);
- break;
case 63:
error_num=Go_ser_sbits_63(&response,channel,parameter,units,command_type);
break;
@@ -2748,7 +2742,7 @@ static int Go_ser_baud_60(gchar** response, int channel, char *parameter,char *u
if (status = process_int_param (parameter, &new_baud, 4, valid_choices, NO_ON_OFF)) {
return status;
}
- return IO_Setup_RS232(new_baud, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, TRUE);
+ return IO_Setup_RS232(new_baud, globals.Flash.stopbits, globals.Flash.hardhand, globals.Flash.echo, TRUE);
break;
case query_simple:
@@ -2769,77 +2763,6 @@ static int Go_ser_baud_60(gchar** response, int channel, char *parameter,char *u
}
-static int Go_ser_par_61(gchar** response, int channel, char *parameter,char *units,int command_type)
-{
-
- int new_parity;
-
- switch (command_type) {
- case command_withparam:
- if (!strcmp(parameter,"even")) {
- new_parity = rs232_parity_even;
- } else if (!strcmp(parameter,"odd")) {
- new_parity = rs232_parity_odd;
- } else if (!strcmp(parameter,"none")) {
- new_parity = rs232_parity_none;
- } else {
- return IllegalParameter;
- }
-
- return IO_Setup_RS232(globals.Flash.baud, (char) new_parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, TRUE);
- break;
-
- case query_simple:
- if (globals.Flash.parity==rs232_parity_even) {
- return query_string(response, "EVEN");
- } else if (globals.Flash.parity==rs232_parity_odd) {
- return query_string(response, "ODD");
- } else if (globals.Flash.parity==rs232_parity_none) {
- return query_string(response, "NONE");
- }
- return OK;
- break;
-
- default:
- return SyntaxError;
- break;
- }
-
- return ThisShouldntHappen;
-}
-
-
-static int Go_ser_bits_62(gchar** response, int channel, char *parameter,char *units,int command_type)
-{
- int new_databits;
- int status;
-
- switch (command_type) {
- case command_withparam:
- if (status=process_two_ints (parameter, &new_databits, 7, 8)) {
- return status;
- }
-
- return IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, globals.Flash.stopbits, (char) new_databits, globals.Flash.hardhand, globals.Flash.echo, TRUE);
- break;
-
- case query_simple:
- return query_int (response, globals.Flash.databits);
- break;
-
- case query_param:
- return query_min_max_int (response, parameter, 7, 8);
- break;
-
- default:
- return SyntaxError;
- break;
- }
-
- return ThisShouldntHappen;
-}
-
-
static int Go_ser_sbits_63(gchar** response, int channel, char *parameter,char *units,int command_type)
{
int new_stopbits;
@@ -2851,7 +2774,7 @@ static int Go_ser_sbits_63(gchar** response, int channel, char *parameter,char *
return status;
}
- return IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, (char) new_stopbits, globals.Flash.databits, globals.Flash.hardhand, globals.Flash.echo, TRUE);
+ return IO_Setup_RS232(globals.Flash.baud, (char) new_stopbits, globals.Flash.hardhand, globals.Flash.echo, TRUE);
break;
case query_simple:
@@ -2889,7 +2812,7 @@ static int Go_ser_rts_64(gchar** response, int channel, char *parameter,char *un
return IllegalParameter;
}
- return IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, new_hardhand, globals.Flash.echo, TRUE);
+ return IO_Setup_RS232(globals.Flash.baud, globals.Flash.stopbits, new_hardhand, globals.Flash.echo, TRUE);
break;
case query_simple:
@@ -2922,7 +2845,7 @@ static int Go_ser_echo_65(gchar** response, int channel, char *parameter,char *u
if (status=process_on_off (parameter, &new_echo)) {
return status;
}
- return IO_Setup_RS232(globals.Flash.baud, globals.Flash.parity, globals.Flash.stopbits, globals.Flash.databits, globals.Flash.hardhand, (char) new_echo, TRUE);
+ return IO_Setup_RS232(globals.Flash.baud, globals.Flash.stopbits, globals.Flash.hardhand, (char) new_echo, TRUE);
break;
case query_simple: