mirror of
https://github.com/hubaldv/bioz-icd-rs.git
synced 2025-12-06 05:31:17 +00:00
Included impedance topic.
This commit is contained in:
34
src/lib.rs
34
src/lib.rs
@@ -9,13 +9,13 @@ use serde::{Deserialize, Serialize};
|
|||||||
endpoints! {
|
endpoints! {
|
||||||
list = ENDPOINT_LIST;
|
list = ENDPOINT_LIST;
|
||||||
omit_std = true;
|
omit_std = true;
|
||||||
| EndpointTy | RequestTy | ResponseTy | Path |
|
| EndpointTy | RequestTy | ResponseTy | Path |
|
||||||
| ---------- | --------- | ---------- | ---- |
|
| ---------- | --------- | ---------- | ---- |
|
||||||
| PingEndpoint | u32 | u32 | "ping" |
|
| PingEndpoint | u32 | u32 | "ping" |
|
||||||
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
||||||
| SetGreenLedEndpoint | f32 | () | "led/green" |
|
| SetGreenLedEndpoint | f32 | () | "led/green" |
|
||||||
| StartAccelerationEndpoint | StartAccel | () | "accel/start" |
|
| StartImpedanceEndpoint | StartImpedance | () | "imp/start" |
|
||||||
| StopAccelerationEndpoint | () | bool | "accel/stop" |
|
| StopImpedanceEndpoint | () | bool | "imp/stop" |
|
||||||
}
|
}
|
||||||
|
|
||||||
topics! {
|
topics! {
|
||||||
@@ -30,26 +30,16 @@ topics! {
|
|||||||
direction = TopicDirection::ToClient;
|
direction = TopicDirection::ToClient;
|
||||||
| TopicTy | MessageTy | Path | Cfg |
|
| TopicTy | MessageTy | Path | Cfg |
|
||||||
| ------- | --------- | ---- | --- |
|
| ------- | --------- | ---- | --- |
|
||||||
| AccelTopic | Acceleration | "accel/data" | |
|
| ImpedanceTopic | Impedance | "imp/data" | |
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub struct Acceleration {
|
pub struct Impedance {
|
||||||
pub x: i16,
|
pub magnitude: f32,
|
||||||
pub y: i16,
|
pub phase: f32,
|
||||||
pub z: i16,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub enum AccelRange {
|
pub struct StartImpedance {
|
||||||
G2,
|
|
||||||
G4,
|
|
||||||
G8,
|
|
||||||
G16,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
|
||||||
pub struct StartAccel {
|
|
||||||
pub interval_ms: u32,
|
pub interval_ms: u32,
|
||||||
pub range: AccelRange,
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user