* 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:
2016-10-12 06:16:41 +01:00
parent 12daf68c1f
commit 8b8fe9a9cc
9 changed files with 113 additions and 1 deletions

View File

@@ -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;
}
}
}