match serialport::new(port_name, baud_rate) // Use the selected baud rate .data_bits(DataBits::Seven) .stop_bits(StopBits::Two) .parity(Parity::Even) .flow_control(FlowControl::Software) .timeout(Duration::from_secs(8)) // Short timeout for read .open() {