autd3-rs 0.2.0

Core async client library for the AUTD3 phased-array kit.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use crate::error::Error;

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Response {
    pub data: Vec<u8>,
}

impl Response {
    pub fn check(&self) -> Result<(), Error> {
        match self.data.iter().enumerate().find(|&(_, &d)| d != 0) {
            None => Ok(()),
            Some((device, &code)) => Err(Error::DeviceError { device, code }),
        }
    }
}