aboutsummaryrefslogtreecommitdiff
path: root/common/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/lib.rs')
-rw-r--r--common/src/lib.rs32
1 files changed, 32 insertions, 0 deletions
diff --git a/common/src/lib.rs b/common/src/lib.rs
new file mode 100644
index 0000000..5dde0b9
--- /dev/null
+++ b/common/src/lib.rs
@@ -0,0 +1,32 @@
+#![no_std]
+
+extern crate alloc;
+
+use alloc::vec::Vec;
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)]
+pub enum Uplink {
+ Ping,
+}
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)]
+pub enum Downlink {
+ Pong,
+ Sensor(Sensor),
+}
+
+#[derive(Debug, Clone, PartialEq, PartialOrd, serde::Serialize, serde::Deserialize)]
+pub enum Sensor {
+ Gas {
+ temp_c: f32,
+ pressure: f32,
+ },
+ Lux {
+ lux: f32,
+ },
+ IMU {
+ accel: na::Vector3<f32>,
+ gyro: na::Vector3<f32>,
+ },
+ Pdm(Vec<u8>),
+}