mirror of
https://github.com/hubaldv/bioz-icd-rs.git
synced 2025-12-06 05:31:17 +00:00
Included LED RPC.
This commit is contained in:
22
src/lib.rs
22
src/lib.rs
@@ -6,9 +6,6 @@ use serde::{Deserialize, Serialize};
|
|||||||
|
|
||||||
// ---
|
// ---
|
||||||
|
|
||||||
pub type SingleLedSetResult = Result<(), BadPositionError>;
|
|
||||||
pub type AllLedArray = [Rgb8; 24];
|
|
||||||
|
|
||||||
endpoints! {
|
endpoints! {
|
||||||
list = ENDPOINT_LIST;
|
list = ENDPOINT_LIST;
|
||||||
omit_std = true;
|
omit_std = true;
|
||||||
@@ -16,8 +13,7 @@ endpoints! {
|
|||||||
| ---------- | --------- | ---------- | ---- |
|
| ---------- | --------- | ---------- | ---- |
|
||||||
| PingEndpoint | u32 | u32 | "ping" |
|
| PingEndpoint | u32 | u32 | "ping" |
|
||||||
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
||||||
| SetSingleLedEndpoint | SingleLed | SingleLedSetResult | "led/set_one" |
|
| SetGreenLedEndpoint | f32 | () | "led/green" |
|
||||||
| SetAllLedEndpoint | AllLedArray | () | "led/set_all" |
|
|
||||||
| StartAccelerationEndpoint | StartAccel | () | "accel/start" |
|
| StartAccelerationEndpoint | StartAccel | () | "accel/start" |
|
||||||
| StopAccelerationEndpoint | () | bool | "accel/stop" |
|
| StopAccelerationEndpoint | () | bool | "accel/stop" |
|
||||||
}
|
}
|
||||||
@@ -37,22 +33,6 @@ topics! {
|
|||||||
| AccelTopic | Acceleration | "accel/data" | |
|
| AccelTopic | Acceleration | "accel/data" | |
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
|
||||||
pub struct SingleLed {
|
|
||||||
pub position: u32,
|
|
||||||
pub rgb: Rgb8,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq, Copy, Clone)]
|
|
||||||
pub struct Rgb8 {
|
|
||||||
pub r: u8,
|
|
||||||
pub g: u8,
|
|
||||||
pub b: u8,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
|
||||||
pub struct BadPositionError;
|
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub struct Acceleration {
|
pub struct Acceleration {
|
||||||
pub x: i16,
|
pub x: i16,
|
||||||
|
|||||||
Reference in New Issue
Block a user