10 int main(int argc, char *argv[])
12 struct plotter_options options;
13 int fd, baud, ret = 0, out_fd = 0;
15 if (read_args(argc, argv, &options))
18 baud = options.baud_rate;
19 fd = open_at_baud(options.device_path, &baud);
23 if (baud != options.baud_rate) {
24 pr_err("Failed to set baudrate to %d, only got %d\n",
25 options.baud_rate, baud);
30 if (options.output_path) {
31 pr_debug("Opening %s for writing the log file\n",
34 out_fd = open(options.output_path,
35 O_CREAT | O_APPEND | O_WRONLY, 0664);
37 pr_err("Failed to open file %s for writing: %m\n",
44 read_data(fd, out_fd);