mirror of
https://github.com/aaru-dps/Aaru.Decoders.git
synced 2025-12-16 19:24:32 +00:00
Code restyling.
This commit is contained in:
12
SCSI/EVPD.cs
12
SCSI/EVPD.cs
@@ -252,12 +252,12 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
switch(definition)
|
||||
{
|
||||
case ScsiDefinitions.Current: return"";
|
||||
case ScsiDefinitions.CCS: return"CCS";
|
||||
case ScsiDefinitions.SCSI1: return"SCSI-1";
|
||||
case ScsiDefinitions.SCSI2: return"SCSI-2";
|
||||
case ScsiDefinitions.SCSI3: return"SCSI-3";
|
||||
default: return$"Unknown definition code {(byte)definition}";
|
||||
case ScsiDefinitions.Current: return "";
|
||||
case ScsiDefinitions.CCS: return "CCS";
|
||||
case ScsiDefinitions.SCSI1: return "SCSI-1";
|
||||
case ScsiDefinitions.SCSI2: return "SCSI-2";
|
||||
case ScsiDefinitions.SCSI3: return "SCSI-3";
|
||||
default: return $"Unknown definition code {(byte)definition}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -295,9 +295,9 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
for(int i = 0; i < (AACSLBAExtsResponse.Length - 4) / 16; i++)
|
||||
{
|
||||
decoded.Extents[i].Reserved = new byte[8];
|
||||
Array.Copy(AACSLBAExtsResponse, 0 + i * 16 + 4, decoded.Extents[i].Reserved, 0, 8);
|
||||
decoded.Extents[i].StartLBA = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 8 + i * 16 + 4);
|
||||
decoded.Extents[i].LBACount = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 12 + i * 16 + 4);
|
||||
Array.Copy(AACSLBAExtsResponse, 0 + (i * 16) + 4, decoded.Extents[i].Reserved, 0, 8);
|
||||
decoded.Extents[i].StartLBA = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 8 + (i * 16) + 4);
|
||||
decoded.Extents[i].LBACount = BigEndianBitConverter.ToUInt32(AACSLBAExtsResponse, 12 + (i * 16) + 4);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
||||
@@ -96,16 +96,17 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
decoded.OPCTablesNumber = response[33];
|
||||
|
||||
if(decoded.OPCTablesNumber <= 0 ||
|
||||
response.Length != decoded.OPCTablesNumber * 8 + 34)
|
||||
response.Length != (decoded.OPCTablesNumber * 8) + 34)
|
||||
return decoded;
|
||||
|
||||
decoded.OPCTables = new OPCTable[decoded.OPCTablesNumber];
|
||||
|
||||
for(int i = 0; i < decoded.OPCTablesNumber; i++)
|
||||
{
|
||||
decoded.OPCTables[i].Speed = (ushort)((response[34 + i * 8 + 0] << 16) + response[34 + i * 8 + 1]);
|
||||
decoded.OPCTables[i].Speed = (ushort)((response[34 + (i * 8) + 0] << 16) + response[34 + (i * 8) + 1]);
|
||||
|
||||
decoded.OPCTables[i].OPCValues = new byte[6];
|
||||
Array.Copy(response, 34 + i * 8 + 2, decoded.OPCTables[i].OPCValues, 0, 6);
|
||||
Array.Copy(response, 34 + (i * 8) + 2, decoded.OPCTables[i].OPCValues, 0, 6);
|
||||
}
|
||||
|
||||
return decoded;
|
||||
|
||||
@@ -64,7 +64,7 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
};
|
||||
|
||||
for(int i = 0; i < (FormatLayersResponse.Length - 6) / 2; i++)
|
||||
decoded.FormatLayers[i] = BigEndianBitConverter.ToUInt16(FormatLayersResponse, i * 2 + 6);
|
||||
decoded.FormatLayers[i] = BigEndianBitConverter.ToUInt16(FormatLayersResponse, (i * 2) + 6);
|
||||
|
||||
return decoded;
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
for(int i = 0; i < response.FormatLayers.Length; i++)
|
||||
switch(response.FormatLayers[i])
|
||||
{
|
||||
case(ushort)FormatLayerTypeCodes.BDLayer:
|
||||
case (ushort)FormatLayerTypeCodes.BDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type Blu-ray", i).AppendLine();
|
||||
|
||||
@@ -96,7 +96,7 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
break;
|
||||
}
|
||||
|
||||
case(ushort)FormatLayerTypeCodes.CDLayer:
|
||||
case (ushort)FormatLayerTypeCodes.CDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type CD", i).AppendLine();
|
||||
|
||||
@@ -109,7 +109,7 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
break;
|
||||
}
|
||||
|
||||
case(ushort)FormatLayerTypeCodes.DVDLayer:
|
||||
case (ushort)FormatLayerTypeCodes.DVDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type DVD", i).AppendLine();
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
break;
|
||||
}
|
||||
|
||||
case(ushort)FormatLayerTypeCodes.HDDVDLayer:
|
||||
case (ushort)FormatLayerTypeCodes.HDDVDLayer:
|
||||
{
|
||||
sb.AppendFormat("Layer {0} is of type HD DVD", i).AppendLine();
|
||||
|
||||
|
||||
@@ -139,8 +139,7 @@ namespace Aaru.Decoders.SCSI
|
||||
string UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
|
||||
string UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
|
||||
|
||||
string UnrecECCAbortData =
|
||||
"\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
|
||||
string UnrecECCAbortData = "\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
|
||||
|
||||
string UnrecCIRCAbortData =
|
||||
"\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
|
||||
|
||||
@@ -86,11 +86,9 @@ namespace Aaru.Decoders.SCSI
|
||||
decoded.Heads = pageResponse[5];
|
||||
decoded.WritePrecompCylinder = (uint)((pageResponse[6] << 16) + (pageResponse[7] << 8) + pageResponse[8]);
|
||||
|
||||
decoded.WriteReduceCylinder =
|
||||
(uint)((pageResponse[9] << 16) + (pageResponse[10] << 8) + pageResponse[11]);
|
||||
decoded.WriteReduceCylinder = (uint)((pageResponse[9] << 16) + (pageResponse[10] << 8) + pageResponse[11]);
|
||||
|
||||
decoded.DriveStepRate =
|
||||
(ushort)((pageResponse[12] << 8) + pageResponse[13]);
|
||||
decoded.DriveStepRate = (ushort)((pageResponse[12] << 8) + pageResponse[13]);
|
||||
|
||||
decoded.LandingCylinder = (pageResponse[14] << 16) + (pageResponse[15] << 8) + pageResponse[16];
|
||||
decoded.RPL = (byte)(pageResponse[17] & 0x03);
|
||||
|
||||
@@ -104,8 +104,7 @@ namespace Aaru.Decoders.SCSI
|
||||
string UnrecECCNotAbort = "\tUnrecovered ECC errors will not abort the transfer.";
|
||||
string UnrecCIRCNotAbort = "\tUnrecovered CIRC errors will not abort the transfer.";
|
||||
|
||||
string UnrecECCAbortData =
|
||||
"\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
|
||||
string UnrecECCAbortData = "\tUnrecovered ECC errors will return CHECK CONDITION and the uncorrected data.";
|
||||
|
||||
string UnrecCIRCAbortData =
|
||||
"\tUnrecovered CIRC errors will return CHECK CONDITION and the uncorrected data.";
|
||||
|
||||
@@ -44,18 +44,24 @@ namespace Aaru.Decoders.SCSI
|
||||
public enum PartitionSizeUnitOfMeasures : byte
|
||||
{
|
||||
/// <summary>Partition size is measures in bytes</summary>
|
||||
Bytes = 0, /// <summary>Partition size is measures in Kilobytes</summary>
|
||||
Kilobytes = 1, /// <summary>Partition size is measures in Megabytes</summary>
|
||||
Megabytes = 2, /// <summary>Partition size is 10eUNITS bytes</summary>
|
||||
Bytes = 0,
|
||||
/// <summary>Partition size is measures in Kilobytes</summary>
|
||||
Kilobytes = 1,
|
||||
/// <summary>Partition size is measures in Megabytes</summary>
|
||||
Megabytes = 2,
|
||||
/// <summary>Partition size is 10eUNITS bytes</summary>
|
||||
Exponential = 3
|
||||
}
|
||||
|
||||
public enum MediumFormatRecognitionValues : byte
|
||||
{
|
||||
/// <summary>Logical unit is incapable of format or partition recognition</summary>
|
||||
Incapable = 0, /// <summary>Logical unit is capable of format recognition only</summary>
|
||||
FormatCapable = 1, /// <summary>Logical unit is capable of partition recognition only</summary>
|
||||
PartitionCapable = 2, /// <summary>Logical unit is capable of both format and partition recognition</summary>
|
||||
Incapable = 0,
|
||||
/// <summary>Logical unit is capable of format recognition only</summary>
|
||||
FormatCapable = 1,
|
||||
/// <summary>Logical unit is capable of partition recognition only</summary>
|
||||
PartitionCapable = 2,
|
||||
/// <summary>Logical unit is capable of both format and partition recognition</summary>
|
||||
Capable = 3
|
||||
}
|
||||
|
||||
|
||||
@@ -140,8 +140,8 @@ namespace Aaru.Decoders.SCSI
|
||||
if(page.PS)
|
||||
sb.AppendLine("\tParameters can be saved");
|
||||
|
||||
if(page.Standby && page.StandbyTimer > 0 ||
|
||||
page.Standby_Y && page.StandbyTimer_Y > 0)
|
||||
if((page.Standby && page.StandbyTimer > 0) ||
|
||||
(page.Standby_Y && page.StandbyTimer_Y > 0))
|
||||
{
|
||||
if(page.Standby &&
|
||||
page.StandbyTimer > 0)
|
||||
@@ -154,9 +154,9 @@ namespace Aaru.Decoders.SCSI
|
||||
else
|
||||
sb.AppendLine("\tDrive will not enter standy mode");
|
||||
|
||||
if(page.Idle && page.IdleTimer > 0 ||
|
||||
page.Idle_B && page.IdleTimer_B > 0 ||
|
||||
page.Idle_C && page.IdleTimer_C > 0)
|
||||
if((page.Idle && page.IdleTimer > 0) ||
|
||||
(page.Idle_B && page.IdleTimer_B > 0) ||
|
||||
(page.Idle_C && page.IdleTimer_C > 0))
|
||||
{
|
||||
if(page.Idle &&
|
||||
page.IdleTimer > 0)
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace Aaru.Decoders.SCSI
|
||||
return
|
||||
"ECMA-59 & ANSI X3.121-1984: 200 mm Flexible Disk Cartridge using Two-Frequency Recording at 13262 ftprad on Both Sides";
|
||||
case MediumTypes.ECMA69:
|
||||
return"ECMA-69: 200 mm Flexible Disk Cartridge using MFM Recording at 13262 ftprad on Both Sides";
|
||||
return "ECMA-69: 200 mm Flexible Disk Cartridge using MFM Recording at 13262 ftprad on Both Sides";
|
||||
case MediumTypes.ECMA66:
|
||||
return
|
||||
"ECMA-66: 130 mm Flexible Disk Cartridge using Two-Frequency Recording at 7958 ftprad on One Side";
|
||||
@@ -75,16 +75,16 @@ namespace Aaru.Decoders.SCSI
|
||||
case MediumTypes.Unspecified_DS:
|
||||
return "Unspecified double sided flexible disk";
|
||||
*/
|
||||
case MediumTypes.X3_73: return"ANSI X3.73-1980: 200 mm, 6631 ftprad, 1,9 Tracks per mm, 1 side";
|
||||
case MediumTypes.X3_73_DS: return"ANSI X3.73-1980: 200 mm, 6631 ftprad, 1,9 Tracks per mm, 2 sides";
|
||||
case MediumTypes.X3_82: return"ANSI X3.80-1980: 130 mm, 3979 ftprad, 1,9 Tracks per mm, 1 side";
|
||||
case MediumTypes.X3_73: return "ANSI X3.73-1980: 200 mm, 6631 ftprad, 1,9 Tracks per mm, 1 side";
|
||||
case MediumTypes.X3_73_DS: return "ANSI X3.73-1980: 200 mm, 6631 ftprad, 1,9 Tracks per mm, 2 sides";
|
||||
case MediumTypes.X3_82: return "ANSI X3.80-1980: 130 mm, 3979 ftprad, 1,9 Tracks per mm, 1 side";
|
||||
case MediumTypes.Type3Floppy:
|
||||
return"3.5-inch, 135 tpi, 12362 bits/radian, double-sided MFM (aka 1.25Mb)";
|
||||
case MediumTypes.HDFloppy: return"3.5-inch, 135 tpi, 15916 bits/radian, double-sided MFM (aka 1.44Mb)";
|
||||
case MediumTypes.ReadOnly: return"a Read-only optical";
|
||||
case MediumTypes.WORM: return"a Write-once Read-many optical";
|
||||
case MediumTypes.Erasable: return"a Erasable optical";
|
||||
case MediumTypes.RO_WORM: return"a combination of read-only and write-once optical";
|
||||
return "3.5-inch, 135 tpi, 12362 bits/radian, double-sided MFM (aka 1.25Mb)";
|
||||
case MediumTypes.HDFloppy: return "3.5-inch, 135 tpi, 15916 bits/radian, double-sided MFM (aka 1.44Mb)";
|
||||
case MediumTypes.ReadOnly: return "a Read-only optical";
|
||||
case MediumTypes.WORM: return "a Write-once Read-many optical";
|
||||
case MediumTypes.Erasable: return "a Erasable optical";
|
||||
case MediumTypes.RO_WORM: return "a combination of read-only and write-once optical";
|
||||
|
||||
// These magneto-opticals were never manufactured
|
||||
/*
|
||||
@@ -94,9 +94,9 @@ namespace Aaru.Decoders.SCSI
|
||||
case MediumTypes.WORM_RW:
|
||||
return "a combination of write-once and erasable optical";
|
||||
*/
|
||||
case MediumTypes.DOW: return"a direct-overwrite optical";
|
||||
case MediumTypes.HiMD: return"a Sony Hi-MD disc";
|
||||
default: return$"Unknown medium type 0x{(byte)type:X2}";
|
||||
case MediumTypes.DOW: return "a direct-overwrite optical";
|
||||
case MediumTypes.HiMD: return "a Sony Hi-MD disc";
|
||||
default: return $"Unknown medium type 0x{(byte)type:X2}";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
1525
SCSI/Sense.cs
1525
SCSI/Sense.cs
File diff suppressed because it is too large
Load Diff
1598
SCSI/VendorString.cs
1598
SCSI/VendorString.cs
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user