use serde::{Deserialize, Serialize};
#[derive(Debug, Serialize, Deserialize, Clone)]
#[serde(rename_all = "PascalCase")]
pub struct SerialInterface {
pub name: String,
interface_enabled: Option<bool>,
signal_type: Option<String>, bit_rate: Option<String>, parity: Option<String>, data_bits: Option<String>, stop_bits: Option<String>, flow_control: Option<String>, connector_type: Option<String>, pin_out: Option<String>, }
impl SerialInterface {
pub fn is_supermicro_default(&self) -> bool {
self.interface_enabled == Some(true)
&& self.signal_type.as_deref() == Some("Rs232")
&& self.bit_rate.as_deref() == Some("115200")
&& self.parity.as_deref() == Some("None")
&& self.data_bits.as_deref() == Some("8")
&& self.stop_bits.as_deref() == Some("1")
&& self.flow_control.as_deref() == Some("None")
&& self.connector_type.as_deref() == Some("RJ45")
&& self.pin_out.as_deref() == Some("Cyclades")
}
}