48 int main(
int argc,
char **argv)
52 printf(
"Usage: log_scans DEVICE BAUD_RATE FILENAME\n");
55 FILE *log = fopen(argv[3],
"w");
58 fprintf(stderr,
"couldn't open logfile %s\n", argv[3]);
61 string lms_dev = argv[1];
65 printf(
"bad baud rate. must be one of {9600, 19200, 38400, 500000}\n");
70 uint32_t num_values = 0;
78 printf(
"initialize failed! are you using the correct device path?\n");
86 int inc = num_values / 11;
87 printf(
"%5d %5d %5d %5d %5d %5d %5d %5d %5d %5d %5d %5d\n",
88 values[0], values[inc],
89 values[2*inc], values[3*inc],
90 values[4*inc], values[5*inc],
91 values[6*inc], values[7*inc],
92 values[8*inc], values[9*inc],
93 values[10*inc], values[num_values-1]);
96 for (
unsigned i = 0; i < num_values; i++)
97 fprintf(log,
"%d ", values[i]);
103 printf(
"woah! error!\n");
111 printf(
"error during uninitialize\n");
115 printf(
"success.\n");
int main(int argc, char **argv)