-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathconfig.h
159 lines (115 loc) · 5.36 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
#define VERSION "ALDL-IO v0.8b"
/************ SCOPE *********************************
Static #define's that apply to the entire program.
****************************************************/
/* ----------- FILE CONFIG ----------------------------*/
/* path to the root config file */
#define ROOT_CONFIG_FILE "/etc/aldl/aldl.conf"
/* this compacts the configuration data after parsing it. there should be no
reason to undefine it, unless initial load speed is more important than
memory use. */
#define REDUCE_CONFIG_MEMORY
/* ----------- DEBUG OUTPUT --------------------------*/
/* enable some checks for retarded values being passed to things */
#undef RETARDED
/* generally verbose behavior */
#undef VERBLOSITY
/* debug structural functions, such as record link list management */
#undef DEBUGSTRUCT
/* debug configuration file loading */
#undef DEBUGCONFIG
/* print debugging info for memory */
#undef DEBUGMEM
/* verbosity levels in raw serial handlers */
#undef SERIAL_VERBOSE
#undef SERIAL_SUPERVERBOSE
/* verbose aldl protocol level comms on stdout */
#undef ALDL_VERBOSE
/* verbose networking */
#define NET_VERBOSE
/* --------- GLOBAL FEATURE CONFIG -----------------*/
/* support multiple packets, required by some definition files,
undefining this avoids a small amount of overhead and works
for most ECMs */
#undef ALDL_MULTIPACKET
/* maximum size of listen/skip buffer. if a listen or skip attempt is larger
than this value, an emergency realloc is done, which is a waste of time, but
fairly safe. set this larger than any possible listen/skip req. to trade
memory for cpu time. */
#define ALDL_COMMBUFFER 2048
/* --------- TIMING CONSTANTS ------------------------*/
/* define for more aggressive timing behavior in an attempt to increase packet
rate, at a higher risk of dropped packets and increased cpu usage */
#undef AGGRESSIVE
/* a static delay in microseconds. used for waiting in between grabbing
serial chunks, and other throttling. if AGGRESSIVE is defined, this is
generally ignored ... */
#define SLEEPYTIME 200
/* a theoretical maximum multiplier per byte that the ECM may take to generate
data under any circumstance ... */
#define ECMLAGTIME 0.35
/* a constant theoretical amount of bytes per millisecond that can be
moved at the baud rate; generally 1 / baud * 1000 */
#define SERIAL_BYTES_PER_MS 0.98
/* defining this provides a linear decrease in the frequency of reconnect
attempts. this is for 'always-on' dashboard systems that might just sit
there for hours at a time with no connection available. this only works
with 'chatterwait' mode enabled ... */
#define NICE_RECONNECT
/* max delay in milliseconds */
#define NICE_RECON_MAXDELAY 1000
/* when waiting for idle chatter, give up after this many iterations. this is
times 10 milliseconds of wait time if NICE_RECONNECT isn't set, and becomes
variable if it is. undef this to wait forever. this has no effect if the
wait for idle chatter routine is disabled. */
#define GIVEUPWAITING 1500
/* this is added to actual message length, incl. header and checksum, to
determine packet length byte (byte 2 of most aldl messages). so far, no
known ecms use a constant other than 0x52 */
#define MSGLENGTH_MAGICNUMBER 0x52
/* --------- DATA ACQ. CONFIG ----------------------*/
/* increase the priority of the main acq thread so plugins dont screw with
it. may reduce tendancy for timing errors on some platforms, or may not
be supported on your platform at all. undefine if you want equal
thread priority. */
#define ACQ_PRIORITY 1
/* track packet retrieval rate */
#define TRACK_PKTRATE
/* number of seconds to average retrieval rate. reccommend at least 5. */
#define PKTRATE_DURATION 5
/* extra check for bad message header. checksum should be sufficient.. */
#define CHECK_HEADER_SANITY
/* track connection state for expiry of disable comms mode */
#define LAGCHECK
/* attempt to handle cases where runtime may exceed ULONG_MAX by wrapping back
to zero. this is at least 49 days of runtime or more depending on host
system; so the check should not be necessary ... and results are undefined */
#define TIMESTAMP_WRAPAROUND
/* ------- FTDI DRIVER CONFIG ------------------------*/
/* the baud rate to set for the ftdi usb userland driver. reccommend 8192. */
#define FTDI_BAUD 8192
/* the maximum number of ftdi devices attached to a system, it'll puke if more
than this number of devices is found ... */
#define FTDI_AUTO_MAXDEVS 100
/* if the device isn't connected, try again. this is mostly for systems with
no keyboard or input device, so you can go 'oh shit, it's unpluged' without
rebooting. */
#define FTDI_RETRY_USB
#define FTDI_RETRY_DELAY 3
/* if this many io operations fail, consider the interface failed and attempt
reconnection. */
#define FTDI_ATTEMPT_RECOVERY
#define FTDI_MAXFAIL 3
/* ------- DUMMY DRIVER CONFIG ----------------------*/
/* simulate random corruption in dummy packets */
#define DUMMY_CORRUPTION_ENABLE
/* 0-100, rough percentage of corrupted packets */
#define DUMMY_CORRPUTION_RATE 3
/* 0-100, strength of corruption */
#define DUMMY_CORRUPTION_AMOUNT 3
/* ------- MISC CONSTANTS ---------------------------*/
/* bad chars that can't be used in things such as unit of measure strings or
unique identifier names. */
#define CONFIG_BAD_CHARS "(),\"'"
/* use units of measure in consoleif */
#undef CONSOLEIF_UOM