mavlink_core/connection/direct_serial/
config.rs1use core::fmt::Display;
2
3#[derive(Debug, Clone)]
14pub struct SerialConfig {
15 pub(crate) port_name: String,
16 pub(crate) baud_rate: u32,
17}
18
19impl SerialConfig {
20 pub fn new(port_name: String, baud_rate: u32) -> Self {
22 Self {
23 port_name,
24 baud_rate,
25 }
26 }
27}
28
29impl Display for SerialConfig {
30 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
31 write!(f, "serial:{}:{}", self.port_name, self.baud_rate)
32 }
33}