Crates.io | scsir |
lib.rs | scsir |
version | 0.2.0 |
source | src |
created_at | 2023-03-31 18:24:18.084333 |
updated_at | 2024-08-04 04:58:50.7697 |
description | A simple library for issuing SCSI commands |
homepage | |
repository | https://github.com/maboroshinokiseki/scsir |
max_upload_size | |
id | 826637 |
size | 569,539 |
A simple library for issuing SCSI commands.
fn main() -> scsir::Result<()> {
// Open a scsi device
let scsi = scsir::Scsi::new("/dev/sdX")?;
// Issue a simple command
scsi.test_unit_ready().issue()?;
// Issue a command with parameters(fields)
scsi.read()
.logical_block_address(0)
.logical_block_size(512)
.transfer_length(1)
.issue_16()?;
// Issue a command with data out buffer parameters
scsi.verify()
.byte_check(0b01)
.logical_block_address(0)
.parameter(&[0; 512])
.issue_16()?;
}