mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* CICMMetadata:
Updated to last upstream. * DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs: Added DDS-2, DDS-3, DDS-4 with no medium type code. * DiscImageChef.Devices/Device/ScsiCommands/SPC.cs: Added REQUEST SENSE command. * DiscImageChef.Devices/Device/ScsiCommands/SSC.cs: Added SPACE command. * DiscImageChef.Devices/Enums.cs: Added enumeration for SPACE command codes. * DiscImageChef.Metadata/MediaType.cs: Added support for DDS, DDS-2, DDS-3, DDS-4.
This commit is contained in:
@@ -774,6 +774,34 @@ namespace DiscImageChef.Devices
|
||||
|
||||
return sense;
|
||||
}
|
||||
|
||||
public bool RequestSense(out byte[] buffer, uint timeout, out double duration)
|
||||
{
|
||||
return RequestSense(false, out buffer, timeout, out duration);
|
||||
}
|
||||
|
||||
public bool RequestSense(bool descriptor, out byte[] buffer, uint timeout, out double duration)
|
||||
{
|
||||
byte[] senseBuffer = new byte[32];
|
||||
byte[] cdb = new byte[6];
|
||||
buffer = new byte[252];
|
||||
bool sense;
|
||||
|
||||
cdb[0] = (byte)ScsiCommands.RequestSense;
|
||||
if(descriptor)
|
||||
cdb[1] = 0x01;
|
||||
cdb[2] = 0;
|
||||
cdb[3] = 0;
|
||||
cdb[4] = (byte)buffer.Length;
|
||||
cdb[5] = 0;
|
||||
|
||||
lastError = SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, ScsiDirection.In, out duration, out sense);
|
||||
error = lastError != 0;
|
||||
|
||||
DicConsole.DebugWriteLine("SCSI Device", "REQUEST SENSE took {0} ms.", duration);
|
||||
|
||||
return sense;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user