diff --git a/src/lib/cli.rs b/src/lib/cli.rs index bc3473b..4fe63c9 100644 --- a/src/lib/cli.rs +++ b/src/lib/cli.rs @@ -74,6 +74,10 @@ struct Args { /// Sets the frequency of the MAVLink heartbeat message sent by the Mavlink Server #[arg(long, default_value = "1")] mavlink_heartbeat_frequency: f32, + + /// Sends a burst of initial heartbeats to the autopilot spaced by 0.1 seconds to wake up MAVLink connection (useful for PX4-like autopilots) + #[arg(long, default_value = "false")] + send_initial_heartbeats: bool, } #[instrument(level = "trace")] @@ -221,6 +225,11 @@ pub fn mavlink_heartbeat_frequency() -> f32 { MANAGER.clap_matches.mavlink_heartbeat_frequency } +#[instrument(level = "debug")] +pub fn send_initial_heartbeats() -> bool { + MANAGER.clap_matches.send_initial_heartbeats +} + #[cfg(test)] mod tests { use super::*;