mirror of
https://github.com/hubaldv/bioz-icd-rs.git
synced 2026-03-09 22:10:31 +00:00
Change multi to sweep.
This commit is contained in:
18
src/lib.rs
18
src/lib.rs
@@ -14,7 +14,7 @@ pub enum ImpedanceInitError {
|
|||||||
|
|
||||||
pub type ImpedanceInitResult = Result<f32, ImpedanceInitError>;
|
pub type ImpedanceInitResult = Result<f32, ImpedanceInitError>;
|
||||||
|
|
||||||
pub type MultiImpedanceInitResult = Result<MultiImpedanceResult, ImpedanceInitError>;
|
pub type SweepImpedanceInitResult = Result<SweepImpedanceResult, ImpedanceInitError>;
|
||||||
|
|
||||||
endpoints! {
|
endpoints! {
|
||||||
list = ENDPOINT_LIST;
|
list = ENDPOINT_LIST;
|
||||||
@@ -25,9 +25,8 @@ endpoints! {
|
|||||||
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
| GetUniqueIdEndpoint | () | [u8; 12] | "get_id" |
|
||||||
| SetGreenLedEndpoint | f32 | () | "led/green" |
|
| SetGreenLedEndpoint | f32 | () | "led/green" |
|
||||||
| StartSingleImpedanceEndpoint | SingleImpedanceStartRequest | ImpedanceInitResult | "imp/start_single" |
|
| StartSingleImpedanceEndpoint | SingleImpedanceStartRequest | ImpedanceInitResult | "imp/start_single" |
|
||||||
| StopSingleImpedanceEndpoint | () | bool | "imp/stop_single" |
|
| StartSweepImpedanceEndpoint | SweepImpedanceStartRequest | SweepImpedanceInitResult | "imp/start_sweep" |
|
||||||
| StartMultiImpedanceEndpoint | MultiImpedanceStartRequest | MultiImpedanceInitResult | "imp/start_multi" |
|
| StopImpedanceEndpoint | () | bool | "imp/stop" |
|
||||||
| StopMultiImpedanceEndpoint | () | bool | "imp/stop_multi" |
|
|
||||||
}
|
}
|
||||||
|
|
||||||
topics! {
|
topics! {
|
||||||
@@ -44,7 +43,7 @@ topics! {
|
|||||||
| TopicTy | MessageTy | Path | Cfg |
|
| TopicTy | MessageTy | Path | Cfg |
|
||||||
| ------- | --------- | ---- | --- |
|
| ------- | --------- | ---- | --- |
|
||||||
| SingleImpedanceOutputTopic | SingleImpedanceOutput | "imp/single" | |
|
| SingleImpedanceOutputTopic | SingleImpedanceOutput | "imp/single" | |
|
||||||
| MultiImpedanceOutputTopic | MultiImpedanceOutput | "imp/multi" | |
|
| SweepImpedanceOutputTopic | SweepImpedanceOutput | "imp/sweep" | |
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
@@ -54,7 +53,7 @@ pub struct SingleImpedanceOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub struct MultiImpedanceOutput {
|
pub struct SweepImpedanceOutput {
|
||||||
pub points: MeasurementPointSet,
|
pub points: MeasurementPointSet,
|
||||||
pub magnitudes_8: Vec<f32, 8>,
|
pub magnitudes_8: Vec<f32, 8>,
|
||||||
pub phases_8: Vec<f32, 8>,
|
pub phases_8: Vec<f32, 8>,
|
||||||
@@ -63,13 +62,13 @@ pub struct MultiImpedanceOutput {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub struct MultiImpedanceOutput18 {
|
pub struct SweepImpedanceOutput18 {
|
||||||
pub magnitudes: Vec<f32, 18>,
|
pub magnitudes: Vec<f32, 18>,
|
||||||
pub phases: Vec<f32, 18>,
|
pub phases: Vec<f32, 18>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub struct MultiImpedanceResult {
|
pub struct SweepImpedanceResult {
|
||||||
pub points: MeasurementPointSet,
|
pub points: MeasurementPointSet,
|
||||||
pub periods_per_dft_8: Vec<f32, 8>,
|
pub periods_per_dft_8: Vec<f32, 8>,
|
||||||
pub periods_per_dft_18: Vec<f32, 18>,
|
pub periods_per_dft_18: Vec<f32, 18>,
|
||||||
@@ -136,6 +135,7 @@ impl MeasurementPointSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
#[derive(Serialize, Deserialize, Schema, Debug, PartialEq)]
|
||||||
pub struct MultiImpedanceStartRequest {
|
pub struct SweepImpedanceStartRequest {
|
||||||
|
pub lead_mode: BioImpedanceLeadMode,
|
||||||
pub points: MeasurementPointSet,
|
pub points: MeasurementPointSet,
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user