Skip to content

Commit

Permalink
src: lib: cli: Add --send-initial-heartbeats
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoantoniocardoso committed Nov 13, 2024
1 parent 4f757e1 commit 034d897
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/lib/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand Down Expand Up @@ -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::*;
Expand Down

0 comments on commit 034d897

Please sign in to comment.