Included LED RPC.

This commit is contained in:
2025-08-06 12:48:15 +02:00
parent 52ad70867b
commit b50576a7ff

View File

@@ -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,