10 #include "plotter_status.h"
12 struct log_plotter_status plotter_state;
14 int main(int argc, char *argv[])
16 struct plotter_config cfg;
17 int fd, baud, ret = 0;
19 bzero(&cfg, sizeof(cfg));
21 if (read_args(argc, argv, &cfg))
24 if (cfg.config_file_path)
25 populate_config_data_from_file(cfg.config_file_path, &cfg);
28 fd = open_at_baud(cfg.device_path, &baud);
32 if (baud != cfg.baudrate) {
33 pr_err("Failed to set baudrate to %d, only got %d\n",
39 init_data_parser(fd, &cfg);
41 while (plotter_state.system_status != SYSTEM_STATUS_NO_USB) {
44 if (plotter_state.old_system_status !=
45 plotter_state.system_status) {
46 pr_debug("Status changing from %s to %s\n",
47 state_to_str(plotter_state.old_system_status),
48 state_to_str(plotter_state.system_status));
50 plotter_state.old_system_status =
51 plotter_state.system_status;