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 ac55176 commit 610d8b5
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 @@ -61,6 +61,10 @@ struct Args {
/// The timeout duration (in seconds) after which inactive UDP clients will be discarded.
#[arg(long, default_value = "10")]
udp_server_timeout: i16,

/// 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 @@ -193,6 +197,11 @@ pub fn web_server() -> std::net::SocketAddrV4 {
MANAGER.clap_matches.web_server
}

#[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 610d8b5

Please sign in to comment.