diff --git a/Cargo.lock b/Cargo.lock index b4a1344..1b9e0ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -99,6 +99,14 @@ version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" +[[package]] +name = "send-igntion-command" +version = "0.1.0" +dependencies = [ + "protocols", + "tokio", +] + [[package]] name = "serde" version = "1.0.228" diff --git a/Cargo.toml b/Cargo.toml index 22e5aa0..acb7780 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,7 +4,7 @@ [workspace] resolver = "3" -members = ["avionics-mock", "flight-computer", "introduction", "protocols"] +members = ["avionics-mock", "flight-computer", "introduction", "protocols", "send-igntion-command"] # Lints are like automatic code reviews and should be treated as such. [workspace.lints.clippy] diff --git a/send-igntion-command/Cargo.toml b/send-igntion-command/Cargo.toml new file mode 100644 index 0000000..9b95b10 --- /dev/null +++ b/send-igntion-command/Cargo.toml @@ -0,0 +1,11 @@ +[package] +name = "send-igntion-command" +version = "0.1.0" +edition = "2024" + +[dependencies] +tokio = { version = "1.48.0", features = ["macros", "rt-multi-thread"] } +protocols = { version = "0.1.0", path = "../protocols" } + +[lints] +workspace = true diff --git a/send-igntion-command/src/main.rs b/send-igntion-command/src/main.rs new file mode 100644 index 0000000..07ed61c --- /dev/null +++ b/send-igntion-command/src/main.rs @@ -0,0 +1,10 @@ +use protocols::{api::TelemetryCommandMessage, client::MessageSender}; + +#[tokio::main] +async fn main() -> Result<(), Box> { + let mut sender = MessageSender::::connect().await?; + + sender.send(&TelemetryCommandMessage::StartIgntion).await?; + + Ok(()) +} diff --git a/terminal_history.md b/terminal_history.md index 28df794..ef67fb7 100644 --- a/terminal_history.md +++ b/terminal_history.md @@ -40,3 +40,5 @@ The new few messages create the mission control crate and then run the specific - `.>` `cargo add --package mission-control --path protocols` - `.>` `cargo add --package mission-control tokio --features macros,rt` - `.>` `cargo run --bin send_ignition_command` +- `.>` `cargo new send-igntion-command` +- `.>` `cargo add --package send-igntion-command tokio --features macros,rt`