aboutsummaryrefslogtreecommitdiff
path: root/common/src/lib.rs
blob: 5dde0b97aed408485ff93e4307d442be8a182b73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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>),
}