11 #include "plotter_status.h"
13 struct log_plotter_status plotter_state;
15 int main(int argc, char *argv[])
17 struct plotter_options options;
18 struct plotter_config cfg;
19 int fd, baud, ret = 0;
21 bzero(&cfg, sizeof(cfg));
23 if (read_args(argc, argv, &options))
26 if (options.config_file_path)
27 populate_config_data_from_file(options.config_file_path, &cfg);
29 baud = options.baud_rate;
30 fd = open_at_baud(options.device_path, &baud);
34 if (baud != options.baud_rate) {
35 pr_err("Failed to set baudrate to %d, only got %d\n",
36 options.baud_rate, baud);
41 init_data_parser(fd, &cfg);
43 while (plotter_state.system_status != SYSTEM_STATUS_NO_USB) {
46 if (plotter_state.old_system_status !=
47 plotter_state.system_status) {
48 pr_debug("Status changing from %s to %s",
49 state_to_str(plotter_state.old_system_status),
50 state_to_str(plotter_state.system_status));
52 plotter_state.old_system_status =
53 plotter_state.system_status;