pub fn create_bus(name: &str) {
    let output = Command::new("sudo")
        .arg("ip")
        .arg("link")
        .arg("add")
        .arg("dev")
        .arg(name)
        .arg("type")
        .arg("vcan")
        .output()
        .expect("failed to execute process");

    if !output.stderr.is_empty() {
        io::stderr().write_all(&output.stderr).unwrap();
    }

    let output = Command::new("sudo")
        .arg("ip")
        .arg("link")
        .arg("set")
        .arg(name)
        .arg("up")
        .output()
        .expect("failed to execute process");

    if !output.stderr.is_empty() {
        io::stderr().write_all(&output.stderr).unwrap();
        panic!("Unable to bring up bus {}", name)
    }
}
/// Create a vcan bus using the following commands:
/// sudo ip link add dev <name> type vcan
/// sudo ip link set up <name>
/// This function will panic if errors are returned
Create a vcan bus using the following commands:
sudo ip link add dev  type vcan
sudo ip link set up 
This function will panic if errors are returned
Create a vcan bus using the following commands : sudo ip link add dev type vcan sudo ip link set up This function will panic if errors are returned
pub fn create_bus(name: &str) {
    let output = Command::new("sudo")
        .arg("ip")
        .arg("link")
        .arg("add")
        .arg("dev")
        .arg(name)
        .arg("type")
        .arg("vcan")
        .output()
        .expect("failed to execute process");
    if !output.stderr.is_empty() {
        io::stderr().write_all(&output.stderr).unwrap();
    }
    let output = Command::new("sudo")
        .arg("ip")
        .arg("link")
        .arg("set")
        .arg(name)
        .arg("up")
        .output()
        .expect("failed to execute process");
    if !output.stderr.is_empty() {
        io::stderr().write_all(&output.stderr).unwrap();
        panic!("Unable to bring up bus {}", name)
    }
}
pub fn create_bus ( name : & str ) { let output = Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( name ) . arg ( " " ) . arg ( " " ) . output ( ) . expect ( " " ) ; if ! output . stderr . is_empty ( ) { io :: stderr ( ) . write_all ( & output . stderr ) . unwrap ( ) ; } let output = Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . arg ( " " ) . arg ( name ) . arg ( " " ) . output ( ) . expect ( " " ) ; if ! output . stderr . is_empty ( ) { io :: stderr ( ) . write_all ( & output . stderr ) . unwrap ( ) ; panic ! ( " " name ) } }
Create a vcan bus using the following commands:
sudo ip link add dev <name> type vcan
sudo ip link set up <name>
This function will panic if errors are returned
Create a vcan bus using the following commands : sudo ip link add dev <name > type vcan sudo ip link set up <name > This function will panic if errors are returned
name
&str
name
&str