blob: eef233d647c3bf4a76c509172ecbd222ba57d032 (
plain)
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
|
/**
* Most of the data recorder functionality lives in the library now; this just enables
* stdout by default if no record file is specified.
*/
#include <stdio.h>
#include <string.h>
#include <survive.h>
int main(int argc, char **argv) {
SurviveContext *ctx = survive_init(argc, argv);
if (ctx == 0) // implies -help or similiar
return 0;
const char *dataout_file = survive_configs(ctx, "record", SC_SETCONFIG, "");
if (strlen(dataout_file) == 0) {
survive_configi(ctx, "record-stdout", SC_SET | SC_OVERRIDE, 1);
}
survive_startup(ctx);
if (survive_configi(ctx, "calibrate", SC_GET, 1)) {
SV_INFO("Installing calibration");
survive_cal_install(ctx);
}
while (survive_poll(ctx) == 0) {
}
survive_close(ctx);
return 0;
}
|