mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2026-03-10 04:10:31 +00:00
Included bode plot measurements, including different number of points.
This commit is contained in:
@@ -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>> {
|
||||
|
||||
Reference in New Issue
Block a user