Included bode plot measurements, including different number of points.

This commit is contained in:
2025-10-08 15:41:22 +02:00
parent 26e9c4dcab
commit 66b799445f
9 changed files with 290 additions and 61 deletions

View File

@@ -5,10 +5,10 @@ use postcard_rpc::{
};
use std::convert::Infallible;
use bioz_icd_rs::{
GetUniqueIdEndpoint, InitImpedanceResult, PingEndpoint, SetGreenLedEndpoint, StartMultiImpedance, StartMultiImpedanceEndpoint, StartSingleImpedance, StartSingleImpedanceEndpoint, StopSingleImpedanceEndpoint
GetUniqueIdEndpoint, ImpedanceInitResult, MultiImpedanceInitResult, MultiImpedanceStartRequest, PingEndpoint, SetGreenLedEndpoint, SingleImpedanceStartRequest, StartMultiImpedanceEndpoint, StartSingleImpedanceEndpoint, StopSingleImpedanceEndpoint
};
use crate::icd::{IcdDftNum, NumberOfPoints};
use crate::icd::{IcdDftNum, MeasurementPointSet};
#[derive(Debug)]
pub struct WorkbookClient {
@@ -66,22 +66,21 @@ impl WorkbookClient {
&self,
frequency: u32,
dft_number: IcdDftNum,
) -> Result<InitImpedanceResult, WorkbookError<Infallible>> {
) -> Result<ImpedanceInitResult, WorkbookError<Infallible>> {
let response = self.client
.send_resp::<StartSingleImpedanceEndpoint>(&StartSingleImpedance { update_frequency: 60, sinus_frequency: frequency, dft_number})
.send_resp::<StartSingleImpedanceEndpoint>(&SingleImpedanceStartRequest { update_frequency: 60, sinus_frequency: frequency, dft_number})
.await?;
Ok(response)
}
pub async fn start_impedancemeter_multi(
&self,
dft_number: IcdDftNum,
number_of_points: NumberOfPoints,
) -> Result<(), WorkbookError<Infallible>> {
self.client
.send_resp::<StartMultiImpedanceEndpoint>(&StartMultiImpedance { dft_number, number_of_points })
points: MeasurementPointSet,
) -> Result<MultiImpedanceInitResult, WorkbookError<Infallible>> {
let response = self.client
.send_resp::<StartMultiImpedanceEndpoint>(&MultiImpedanceStartRequest { points })
.await?;
Ok(())
Ok(response)
}
pub async fn stop_impedancemeter(&self) -> Result<bool, WorkbookError<Infallible>> {