diff --git a/orch-rs/Cargo.toml b/orch-rs/Cargo.toml index c1d5a8d..ed829ed 100644 --- a/orch-rs/Cargo.toml +++ b/orch-rs/Cargo.toml @@ -12,3 +12,5 @@ json-patch = "1.0" serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" tokio = { version = "1.27", features = ["full"] } +serial = "0.4.0" +serialport = "4.2.1" \ No newline at end of file diff --git a/orch-rs/src/groundstation.rs b/orch-rs/src/groundstation.rs index 30031b3..9a773c1 100644 --- a/orch-rs/src/groundstation.rs +++ b/orch-rs/src/groundstation.rs @@ -16,6 +16,7 @@ pub trait GroundStation { // fn subsribers(&mut self) // fn subscribe(&mut self, subsriber: &dyn Fn(GroundSationStatus)); // whatever else might be needed for this? + fn get_gps(&mut self); } // this stuff will probably get moved out to some sorta test module later @@ -47,6 +48,9 @@ impl GroundStation for MockGroundStation { self.orientation.1 += 0.1; self.orientation.1 %= 360.0; } + fn get_gps(&mut self) { + todo!() + } } pub struct MobileGroundStation {} @@ -59,6 +63,10 @@ impl GroundStation for MobileGroundStation { fn update(&mut self) { todo!() } + + fn get_gps(&mut self) { + todo!() + } } pub struct PhysicsGroundStation {} @@ -71,4 +79,9 @@ impl GroundStation for PhysicsGroundStation { fn update(&mut self) { todo!() } + + fn get_gps(&mut self) { + todo!() + } + } diff --git a/orch-rs/src/main.rs b/orch-rs/src/main.rs index 108fc1b..c66bd60 100644 --- a/orch-rs/src/main.rs +++ b/orch-rs/src/main.rs @@ -21,11 +21,11 @@ async fn main() { // TODO: setup logging - let ws_state = Arc::new(WsState::new()); + let ws_state: Arc = Arc::new(WsState::new()); // it should probably generate groundstations from a config file tokio::spawn({ - let ws_state = ws_state.clone(); + let ws_state: Arc = ws_state.clone(); async { let gs = MockGroundStation::new("test".into(), "nowhere".into(), (0., 0.)); groundstation_handler(gs, ws_state).await; @@ -44,6 +44,8 @@ async fn main() { .serve(app.into_make_service()) .await .unwrap(); + + } async fn ws_handler(