pub struct Identity { /* private fields */ }Expand description
A drive’s identity: the standard INQUIRY response, the boot banner at
layout::BANNER and the identity descriptor at layout::DESCRIPTOR.
Implementations§
Source§impl Identity
impl Identity
Sourcepub fn parse(inquiry: &[u8], banner: &[u8], descriptor: &[u8]) -> Option<Self>
pub fn parse(inquiry: &[u8], banner: &[u8], descriptor: &[u8]) -> Option<Self>
Decode an INQUIRY response (at least INQUIRY_LEN bytes), a boot
banner and an identity descriptor. Short banner and descriptor reads
are zero-padded. Returns None if the INQUIRY is short.
Sourcepub fn device_type(&self) -> u8
pub fn device_type(&self) -> u8
Peripheral device type; 0x05 for an optical drive.
The boot banner, e.g. MT1959 Boot BU5, up to its first NUL or
non-printable byte.
Sourcepub fn has_descriptor(&self) -> bool
pub fn has_descriptor(&self) -> bool
true when the descriptor carries an MTEKMT19xx identity tag.
Sourcepub fn descriptor_model(&self) -> &str
pub fn descriptor_model(&self) -> &str
Model from the identity descriptor; "" without a descriptor.
Sourcepub fn sku(&self) -> &str
pub fn sku(&self) -> &str
Vendor-specific SKU code from the identity descriptor, e.g. N003600;
"" without a descriptor.
Sourcepub fn chip(&self) -> Option<Chip>
pub fn chip(&self) -> Option<Chip>
The controller generation, decided by the drive’s boot banner
(Chip::from_banner) and nothing else. The MTEKMT19xx identity tag
is a stale vendor label and is never consulted. None for a drive whose
banner names no supported generation.
Sourcepub fn class(&self) -> Option<DriveClass>
pub fn class(&self) -> Option<DriveClass>
The update dialect this drive speaks: DriveClass::Mt19 for a drive
that names an MT1959 or MT1939 chip, else None.
Sourcepub fn inquiry_bytes(&self) -> &[u8; 36]
pub fn inquiry_bytes(&self) -> &[u8; 36]
The raw INQUIRY response.
The raw boot banner.
Sourcepub fn descriptor_bytes(&self) -> &[u8; 256]
pub fn descriptor_bytes(&self) -> &[u8; 256]
The raw identity descriptor.