Function mavlink::connect

source ยท
pub fn connect<M>(
    address: &str,
) -> Result<Box<dyn MavConnection<M> + Sync + Send>, Error>
where M: Message,
Expand description

Connect to a MAVLink node by address string.

The address must be in one of the following formats:

  • tcpin:<addr>:<port> to create a TCP server, listening for incoming connections
  • tcpout:<addr>:<port> to create a TCP client
  • udpin:<addr>:<port> to create a UDP server, listening for incoming packets
  • udpout:<addr>:<port> to create a UDP client
  • udpbcast:<addr>:<port> to create a UDP broadcast
  • serial:<port>:<baudrate> to create a serial connection
  • file:<path> to extract file data

The type of the connection is determined at runtime based on the address type, so the connection is returned as a trait object.