mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.Console/DicConsole.cs:
Added methods without formatting. * DiscImageChef.Decoders/ATA.cs: Typo. * DiscImageChef.Decoders/SCSI.cs: Don't try to decode Version Descriptors if there are none. Also there are devices on the wild with less than 8 VDs. * DiscImageChef/Commands/DeviceInfo.cs: Use a format-less output.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DicConsole.cs:
|
||||
Added methods without formatting.
|
||||
|
||||
2015-10-18 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DicConsole.cs:
|
||||
|
||||
@@ -156,6 +156,31 @@ namespace DiscImageChef.Console
|
||||
if (DebugWriteEvent != null)
|
||||
DebugWriteEvent("", null);
|
||||
}
|
||||
|
||||
public static void WriteLine(string format)
|
||||
{
|
||||
if (WriteLineEvent != null)
|
||||
WriteLineEvent(format, null);
|
||||
}
|
||||
|
||||
public static void ErrorWriteLine(string format)
|
||||
{
|
||||
if (ErrorWriteLineEvent != null)
|
||||
ErrorWriteLineEvent(format, null);
|
||||
}
|
||||
|
||||
public static void VerboseWriteLine(string format)
|
||||
{
|
||||
if (VerboseWriteLineEvent != null)
|
||||
VerboseWriteLineEvent(format, null);
|
||||
}
|
||||
|
||||
public static void DebugWriteLine(string module, string format)
|
||||
{
|
||||
if (DebugWriteLineEvent != null)
|
||||
DebugWriteLineEvent("DEBUG (" + module + "): " + format, null);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1853,7 +1853,7 @@ namespace DiscImageChef.Decoders
|
||||
|
||||
public static IdentifyDevice? DecodeIdentifyDevice(byte[] IdentifyDeviceResponse)
|
||||
{
|
||||
if (IdentifyDeviceResponse != null)
|
||||
if (IdentifyDeviceResponse == null)
|
||||
return null;
|
||||
|
||||
if (IdentifyDeviceResponse.Length != 512)
|
||||
|
||||
@@ -1,3 +1,12 @@
|
||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* ATA.cs:
|
||||
Typo.
|
||||
|
||||
* SCSI.cs:
|
||||
Don't try to decode Version Descriptors if there are none.
|
||||
Also there are devices on the wild with less than 8 VDs.
|
||||
|
||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* ATA.cs:
|
||||
|
||||
@@ -1989,13 +1989,19 @@ namespace DiscImageChef.Decoders
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 58)
|
||||
decoded.Reserved4 = SCSIInquiryResponse[57];
|
||||
if (SCSIInquiryResponse.Length >= 60)
|
||||
{
|
||||
int descriptorsNo;
|
||||
|
||||
if (SCSIInquiryResponse.Length >= 74)
|
||||
descriptorsNo = 8;
|
||||
else
|
||||
descriptorsNo = (SCSIInquiryResponse.Length - 58) / 2;
|
||||
|
||||
decoded.VersionDescriptors = new ushort[descriptorsNo];
|
||||
for (int i = 0; i < descriptorsNo; i++)
|
||||
{
|
||||
decoded.VersionDescriptors = new ushort[8];
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
for (int i = 0; i < 8; i++)
|
||||
{
|
||||
decoded.VersionDescriptors[i] = BigEndianBitConverter.ToUInt16(SCSIInquiryResponse, 58 + (i * 2));
|
||||
decoded.VersionDescriptors[i] = BitConverter.ToUInt16(SCSIInquiryResponse, 58 + (i * 2));
|
||||
}
|
||||
}
|
||||
if (SCSIInquiryResponse.Length >= 75 && SCSIInquiryResponse.Length < 96)
|
||||
@@ -2273,6 +2279,8 @@ namespace DiscImageChef.Decoders
|
||||
break;
|
||||
}
|
||||
|
||||
if (response.VersionDescriptors != null)
|
||||
{
|
||||
foreach (UInt16 VersionDescriptor in response.VersionDescriptors)
|
||||
{
|
||||
switch (VersionDescriptor)
|
||||
@@ -3689,6 +3697,7 @@ namespace DiscImageChef.Decoders
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if DEBUG
|
||||
if(response.DeviceTypeModifier != 0)
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/DeviceInfo.cs:
|
||||
Use a format-less output.
|
||||
|
||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/Decode.cs:
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DicConsole.WriteLine("SCSI OK");
|
||||
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.PrettifySCSIInquiry(inqBuf));
|
||||
DicConsole.WriteLine(Decoders.SCSI.PrettifySCSIInquiry(inqBuf));
|
||||
|
||||
Structs.AtaErrorRegistersCHS errorRegisters;
|
||||
|
||||
@@ -116,7 +116,7 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("ATAPI OK");
|
||||
DicConsole.WriteLine("{0}", Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
DicConsole.WriteLine(Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -137,7 +137,7 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("ATA OK");
|
||||
DicConsole.WriteLine("{0}", Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
DicConsole.WriteLine(Decoders.ATA.PrettifyIdentifyDevice(ataBuf));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user