2 Config file dumprest.cfg or $HOME/.dumprest.cfg
5 0 if 1 stop bit or 1 if two stop bits
24 The 2f8 is base address of port and 3 is the irq
48 { "19200",19200,B19200
}
50 ,{ "38400",38400,B38400
}
53 ,{ "57600",57600,B57600
}
56 ,{ "115200",115200,B115200
}
59 ,{ "230400",230400,B230400
}
62 ,{ "460800",460800,B460800
}
68 #if defined(_STDC_) || defined(PC)
69 void setup_config(long *,int *,char *);
72 void setup_config(baud
,two_stop
,serial_dev
)
85 config
= fopen("dumprest.cfg","r");
87 home
= getenv("HOME");
91 strcat(homeloc
,".dumprest.cfg");
92 config
= fopen(homeloc
,"r");
95 printf("Unable to open dumprest.cfg or $HOME/.dumprest.cfg\n");
100 fscanf(config
,"%ld",baud
);
102 fscanf(config
,"%s",baud_rate
);
104 for (cntr
= 0; cntr
< ARRAYSIZE(baud_lookup
) && *baud
== B0
; cntr
++) {
105 if (strcmp(baud_lookup
[cntr
].baud_str
,baud_rate
) == 0) {
106 *baud
= baud_lookup
[cntr
].baud_val
;
110 printf("Unknown baud rate %s\n",baud_rate
);
114 fscanf(config
,"%d",two_stop
);
115 fscanf(config
,"%s",serial_dev
);