mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
On debug show status of tried commands and save buffers to
disk.
This commit is contained in:
@@ -468,12 +468,27 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (6)...");
|
||||
mediaTest.SupportsRead = !dev.Read6(out buffer, out senseBuffer, 0, mediaTest.BlockSize, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read6", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer);
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (10)...");
|
||||
mediaTest.SupportsRead10 = !dev.Read10(out buffer, out senseBuffer, 0, false, true, false, false, 0, mediaTest.BlockSize, 0, 1, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead10);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read10", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer);
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (12)...");
|
||||
mediaTest.SupportsRead12 = !dev.Read12(out buffer, out senseBuffer, 0, false, true, false, false, 0, mediaTest.BlockSize, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead12);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read12", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer);
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (16)...");
|
||||
mediaTest.SupportsRead16 = !dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0, mediaTest.BlockSize, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead16);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read16", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer);
|
||||
|
||||
mediaTest.LongBlockSize = mediaTest.BlockSize;
|
||||
DicConsole.WriteLine("Trying SCSI READ LONG (10)...");
|
||||
@@ -573,12 +588,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, i, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
if(debug)
|
||||
{
|
||||
FileStream bingo = new FileStream(string.Format("{0}_readlong.bin", mediaTest.MediumTypeName), FileMode.Create);
|
||||
bingo.Write(buffer, 0, buffer.Length);
|
||||
bingo.Close();
|
||||
}
|
||||
mediaTest.LongBlockSize = i;
|
||||
mediaTest.LongBlockSizeSpecified = true;
|
||||
break;
|
||||
@@ -588,6 +597,13 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
}
|
||||
}
|
||||
|
||||
if(debug && mediaTest.SupportsReadLong && mediaTest.LongBlockSizeSpecified && mediaTest.LongBlockSize != mediaTest.BlockSize)
|
||||
{
|
||||
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)mediaTest.LongBlockSize, timeout, out duration);
|
||||
if(!sense)
|
||||
DataFile.WriteTo("SCSI Report", "readlong10", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
mediaTest.CanReadMediaSerialSpecified = true;
|
||||
DicConsole.WriteLine("Trying SCSI READ MEDIA SERIAL NUMBER...");
|
||||
mediaTest.CanReadMediaSerial = !dev.ReadMediaSerialNumber(out buffer, out senseBuffer, timeout, out duration);
|
||||
@@ -669,12 +685,27 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (6)...");
|
||||
report.SCSI.ReadCapabilities.SupportsRead = !dev.Read6(out buffer, out senseBuffer, 0, report.SCSI.ReadCapabilities.BlockSize, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read6", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer);
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (10)...");
|
||||
report.SCSI.ReadCapabilities.SupportsRead10 = !dev.Read10(out buffer, out senseBuffer, 0, false, true, false, false, 0, report.SCSI.ReadCapabilities.BlockSize, 0, 1, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead10);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read10", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer);
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (12)...");
|
||||
report.SCSI.ReadCapabilities.SupportsRead12 = !dev.Read12(out buffer, out senseBuffer, 0, false, true, false, false, 0, report.SCSI.ReadCapabilities.BlockSize, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead12);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read12", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer);
|
||||
|
||||
DicConsole.WriteLine("Trying SCSI READ (16)...");
|
||||
report.SCSI.ReadCapabilities.SupportsRead16 = !dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0, report.SCSI.ReadCapabilities.BlockSize, 0, 1, false, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead16);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "read16", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer);
|
||||
|
||||
report.SCSI.ReadCapabilities.LongBlockSize = report.SCSI.ReadCapabilities.BlockSize;
|
||||
DicConsole.WriteLine("Trying SCSI READ LONG (10)...");
|
||||
@@ -788,6 +819,13 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
if(debug && report.SCSI.ReadCapabilities.SupportsReadLong && report.SCSI.ReadCapabilities.LongBlockSizeSpecified && report.SCSI.ReadCapabilities.LongBlockSize != report.SCSI.ReadCapabilities.BlockSize)
|
||||
{
|
||||
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)report.SCSI.ReadCapabilities.LongBlockSize, timeout, out duration);
|
||||
if(!sense)
|
||||
DataFile.WriteTo("SCSI Report", "readlong10", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user