mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Implemented decoding mode page 06h.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2015-10-30 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* SCSI/Modes.cs:
|
||||||
|
Implemented decoding mode page 06h.
|
||||||
|
|
||||||
2015-10-30 Natalia Portillo <claunia@claunia.com>
|
2015-10-30 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* SCSI/Modes.cs:
|
* SCSI/Modes.cs:
|
||||||
|
|||||||
@@ -3427,6 +3427,70 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
#endregion Mode Page 0x07: Verify error recovery page for MultiMedia Devices
|
#endregion Mode Page 0x07: Verify error recovery page for MultiMedia Devices
|
||||||
|
|
||||||
|
#region Mode Page 0x06: Optical memory page
|
||||||
|
/// <summary>
|
||||||
|
/// Optical memory page
|
||||||
|
/// Page code 0x06
|
||||||
|
/// 4 bytes in SCSI-2
|
||||||
|
/// </summary>
|
||||||
|
public struct ModePage_06
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Parameters can be saved
|
||||||
|
/// </summary>
|
||||||
|
public bool PS;
|
||||||
|
/// <summary>
|
||||||
|
/// Report updated block read
|
||||||
|
/// </summary>
|
||||||
|
public bool RUBR;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ModePage_06? DecodeModePage_06(byte[] pageResponse)
|
||||||
|
{
|
||||||
|
if (pageResponse == null)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x3F) != 0x06)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (pageResponse[1] + 2 != pageResponse.Length)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (pageResponse.Length < 4)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
ModePage_06 decoded = new ModePage_06();
|
||||||
|
|
||||||
|
decoded.PS |= (pageResponse[0] & 0x80) == 0x80;
|
||||||
|
decoded.RUBR |= (pageResponse[2] & 0x01) == 0x01;
|
||||||
|
|
||||||
|
return decoded;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string PrettifyModePage_06(byte[] pageResponse)
|
||||||
|
{
|
||||||
|
return PrettifyModePage_06(DecodeModePage_06(pageResponse));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string PrettifyModePage_06(ModePage_06? modePage)
|
||||||
|
{
|
||||||
|
if (!modePage.HasValue)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
ModePage_06 page = modePage.Value;
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
sb.AppendLine("SCSI optical memory:");
|
||||||
|
|
||||||
|
if (page.PS)
|
||||||
|
sb.AppendLine("\tParameters can be saved");
|
||||||
|
if (page.RUBR)
|
||||||
|
sb.AppendLine("\tOn reading an updated block drive will return RECOVERED ERROR");
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
#endregion Mode Page 0x06: Optical memory page
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user