29bool serial_set_options_raw(serial_port_t* port)
31 if (not serial_get_options(port))
34 port->options.input.ignore_break =
false;
35 port->options.input.signal_break =
false;
36 port->options.input.mark_errors =
false;
37 port->options.input.strip_8th_bit =
false;
38 port->options.input.map_nl_to_cr =
false;
39 port->options.input.ignore_cr =
false;
40 port->options.input.map_cr_to_nl =
false;
41 port->options.input.enable_start_stop_out =
false;
43 port->options.output.enable_processing =
false;
46 port->options.control.enable_parity =
false;
48 port->options.local.enable_signals =
false;
49 port->options.local.canonical =
false;
50 port->options.local.echo =
false;
51 port->options.local.echo_nl =
false;
52 port->options.local.enable_processing =
false;
55 port->options.control_characters.timeout = 0;
56 port->options.control_characters.minimum = 1;
62bool serial_set_options_speed(serial_port_t* port, int64_t speed_bps)
64 speed_t speed = serial_encode_baudrate(speed_bps);
68 log_error(
"%" PRIi64
" is not a valid baudrate, refer to termios(3) for further details", speed_bps);
71 if (not serial_get_options(port))
73 port->options.input_speed = speed;
74 port->options.output_speed = speed;
75 port->options.input._dont_modify_speed =
false;
76 port->options.control._speed_4lsb = speed;
77 port->options.control._speed_is_extra = speed >> 12;