mirror of
https://github.com/hubaldv/bioz-host-rs.git
synced 2025-12-06 05:11:17 +00:00
Included impedance topic.
This commit is contained in:
@@ -5,8 +5,8 @@ use postcard_rpc::{
|
||||
};
|
||||
use std::convert::Infallible;
|
||||
use bioz_icd_rs::{
|
||||
AccelRange, PingEndpoint, GetUniqueIdEndpoint, SetGreenLedEndpoint, StartAccel, StartAccelerationEndpoint,
|
||||
StopAccelerationEndpoint,
|
||||
PingEndpoint, GetUniqueIdEndpoint, SetGreenLedEndpoint, StartImpedance, StartImpedanceEndpoint,
|
||||
StopImpedanceEndpoint,
|
||||
};
|
||||
|
||||
#[derive(Debug)]
|
||||
@@ -80,22 +80,21 @@ impl WorkbookClient {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn start_accelerometer(
|
||||
pub async fn start_impedancemeter(
|
||||
&self,
|
||||
interval_ms: u32,
|
||||
range: AccelRange,
|
||||
) -> Result<(), WorkbookError<Infallible>> {
|
||||
self.client
|
||||
.send_resp::<StartAccelerationEndpoint>(&StartAccel { interval_ms, range })
|
||||
.send_resp::<StartImpedanceEndpoint>(&StartImpedance { interval_ms })
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub async fn stop_accelerometer(&self) -> Result<bool, WorkbookError<Infallible>> {
|
||||
pub async fn stop_impedancemeter(&self) -> Result<bool, WorkbookError<Infallible>> {
|
||||
let res = self
|
||||
.client
|
||||
.send_resp::<StopAccelerationEndpoint>(&())
|
||||
.send_resp::<StopImpedanceEndpoint>(&())
|
||||
.await?;
|
||||
|
||||
Ok(res)
|
||||
|
||||
Reference in New Issue
Block a user