added support for locking the device
[ust.git] / config.def.h
1 /* software buffers */
2 const size_t wbuffsz = 1024;
3 const size_t rbuffsz = 1024;
4
5 /* scratch-pads for input processing */
6 const size_t scratchwsz = 256;
7 const size_t scratchrsz = 256;
8
9 /* `nanosleep()` values inside the read and write loops */
10 const long swritedelay = 0; /* seconds */
11 const long nswritedelay = 1000000; /* nanoseconds */
12
13 /* other names follow the same logic as above */
14
15 const long sreaddelay = 0;
16 const long nsreaddelay = 1000000;
17
18 /* `nanosleep()` values for the DTR pulse */
19 const long spulsedelay = 0;
20 const long nspulsedelay = 1000000;
21
22 /* lock the opened device */
23 const int exclusive = 1; /*(0|1)*/
24
25 /* escape character for interactive use */
26 const char escapechar = '~';
27
28 /* print additional info to stderr */
29 int verbose = 0; /*(0|1)*/
30
31 /*
32 * device name
33 *
34 * Linux:
35 * ttyS* - any standard serial port
36 * ttyUSB* - any USB serial port
37 *
38 * FreeBSD:
39 * cuau* - does not wait for DCD
40 * ttyu* - 'dial-in' device, waits for DCD
41 * cuaU* - USB variant
42 * ttyU* - USB variant
43 *
44 * OpenBSD:
45 * cua* - does not wait for DCD
46 * tty* - 'dial-in' device, waits for DCD
47 * cuaU* - USB variant
48 * ttyU* - USB variant
49 *
50 * NetBSD:
51 * dty* - opening does not block, does not wait for DCD
52 * tty* - 'dial-in' device, blocks opening until a connection is established
53 * ttyU* - USB variant
54 */
55 char line[16] = "/dev/cuau0";
56
57 /*
58 * baud is usually configurable to standard values only,
59 * custom speed requires both hardware and driver support
60 */
61 unsigned int ispeed = 9600;
62 unsigned int ospeed = 9600;
63
64 /*
65 * data bits: can be 8,7,6 or 5.
66 * 9 is not supported
67 */
68 char datab = '8';
69
70 /*
71 * stop bits: setting this to 1 enables 2 stop bits for all numbers of data bits
72 * except 5 - it's 1.5 in that case
73 */
74 int stopb = 0; /*(0|1)*/
75
76 /*
77 * local echo (half-duplex mode) and canonical mode
78 */
79 int half = 0; /*(0|1)*/
80 int canonical = 0; /*(0|1)*/
81
82
83 /*
84 * CR and LF (NL) translation options
85 */
86 CRLFOpt tropts = { 0 };
87 CRLFOpt itropts = { 0 };
88
89 /*
90 * backspace: setting to one makes `^H` the backspace character, `^?` otherwise
91 */
92 int backspace = 0; /*(0|1)*/
93
94 /*
95 * the minimum of characters input before sending them to the line
96 */
97 int minchars = 1; /*(>=1)*/
98
99 /*
100 * delay between single characters being sent if the buffer has
101 * more than 1 (redirected stdin, writing a file)
102 * in nanoseconds
103 */
104 long chardelay = 0;
105
106 /*
107 * XON/XOFF flow control
108 * can be enabled with hardware flow control simultaneously
109 */
110 int soft = 0; /*(0|1)*/
111
112 /*
113 * hardware flow control
114 * 1 - RTS/CTS
115 * 2 - DTR/DSR (not supported on some platforms)
116 * 3 - DCD
117 */
118 int hard = 0; /*(0|1|2|3)*/
119
120 /*
121 * 1 - even
122 * 2 - odd
123 */
124 int parity = 0; /*(0|1|2)*/