Beginning of 'ch3-cubsat-ground-station'
authorGreg Burri <greg.burri@gmail.com>
Mon, 5 Jul 2021 08:56:26 +0000 (10:56 +0200)
committerGreg Burri <greg.burri@gmail.com>
Mon, 5 Jul 2021 08:56:26 +0000 (10:56 +0200)
ch3-cubsat-ground-station/Cargo.lock [new file with mode: 0644]
ch3-cubsat-ground-station/Cargo.toml [new file with mode: 0644]
ch3-cubsat-ground-station/src/main.rs [new file with mode: 0644]

diff --git a/ch3-cubsat-ground-station/Cargo.lock b/ch3-cubsat-ground-station/Cargo.lock
new file mode 100644 (file)
index 0000000..525f21a
--- /dev/null
@@ -0,0 +1,7 @@
+# This file is automatically @generated by Cargo.
+# It is not intended for manual editing.
+version = 3
+
+[[package]]
+name = "ch3-cubsat-ground-station"
+version = "0.1.0"
diff --git a/ch3-cubsat-ground-station/Cargo.toml b/ch3-cubsat-ground-station/Cargo.toml
new file mode 100644 (file)
index 0000000..55d009f
--- /dev/null
@@ -0,0 +1,8 @@
+[package]
+name = "ch3-cubsat-ground-station"
+version = "0.1.0"
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
diff --git a/ch3-cubsat-ground-station/src/main.rs b/ch3-cubsat-ground-station/src/main.rs
new file mode 100644 (file)
index 0000000..b456ff8
--- /dev/null
@@ -0,0 +1,32 @@
+#![cfg_attr(debug_assertions, allow(unused_variables, dead_code))]
+
+#[derive(Debug)]
+enum StatusMessage {
+    Ok,
+}
+
+#[derive(Debug)]
+struct CubeSat {
+    id: u64,
+}
+
+fn check_status(sat_id: CubeSat) -> StatusMessage {
+    StatusMessage::Ok
+}
+
+fn main() {
+    let sat_a = CubeSat { id: 0 };
+    let sat_b = CubeSat { id: 1 };
+    let sat_c = CubeSat { id: 2 };
+
+    let a_status = check_status(sat_a);
+    let b_status = check_status(sat_b);
+    let c_status = check_status(sat_c);
+    println!("a: {:?}, b: {:?}, c: {:?}", a_status, b_status, c_status);
+
+
+    let a_status = check_status(sat_a);
+    let b_status = check_status(sat_b);
+    let c_status = check_status(sat_c);
+    println!("a: {:?}, b: {:?}, c: {:?}", a_status, b_status, c_status);
+}