use displaydoc::Display;
use thiserror::Error;
use crate::{
Mmc,
mmc::{Cdb, MmcCommand, MmcError},
};
impl Mmc {
pub fn test_unit_ready(&self) -> Result<(), MmcTestUnitReadyError> {
let mut cdb = Cdb::default();
cdb[0] = MmcCommand::TestUnitReady as u8;
self.run_command(None, &mut [], cdb)?;
Ok(())
}
}
#[derive(Debug, Display, Error)]
pub struct MmcTestUnitReadyError {
#[from]
pub source: MmcError,
}
#[cfg(test)]
mod tests {
use super::*;
#[test_log::test(test)]
#[ignore = "requires a drive with mmc"]
fn test_unit_ready() {
Mmc::new().unwrap().test_unit_ready().unwrap();
}
}