mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Implemented SCSI EVPD 82h
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2016-10-13 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* EVPD.cs: Implemented SCSI EVPD 82h
|
||||
|
||||
2016-10-13 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Modes.cs: Added support for SCSI MODE PAGEs 11h, 12h, 13h
|
||||
|
||||
@@ -104,6 +104,29 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
return StringHandlers.CToString(ascii);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decodes VPD page 0x82: ASCII implemented operating definition
|
||||
/// </summary>
|
||||
/// <returns>ASCII implemented operating definition.</returns>
|
||||
/// <param name="page">Page 0x82.</param>
|
||||
public static string DecodePage82(byte[] page)
|
||||
{
|
||||
if(page == null)
|
||||
return null;
|
||||
|
||||
if(page[1] != 0x82)
|
||||
return null;
|
||||
|
||||
if(page.Length != page[3] + 4)
|
||||
return null;
|
||||
|
||||
byte[] ascii = new byte[page.Length - 4];
|
||||
|
||||
Array.Copy(page, 4, ascii, 0, page.Length - 4);
|
||||
|
||||
return StringHandlers.CToString(ascii);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2016-10-13 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/DeviceInfo.cs:
|
||||
Implemented SCSI EVPD 82h
|
||||
|
||||
2016-10-13 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/DeviceInfo.cs:
|
||||
|
||||
@@ -210,7 +210,9 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine(Decoders.SCSI.Inquiry.Prettify(inq));
|
||||
|
||||
bool scsi80 = false;
|
||||
bool scsi82 = false;
|
||||
string scsiSerial = null;
|
||||
string scsiAsciiOperatingDefs = null;
|
||||
StringBuilder sb = null;
|
||||
|
||||
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, 0x00);
|
||||
@@ -246,6 +248,17 @@ namespace DiscImageChef.Commands
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
|
||||
}
|
||||
}
|
||||
else if(page == 0x82)
|
||||
{
|
||||
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
||||
if(!sense)
|
||||
{
|
||||
scsi82 = true;
|
||||
scsiAsciiOperatingDefs = Decoders.SCSI.EVPD.DecodePage82(inqBuf);
|
||||
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(page != 0x00)
|
||||
@@ -265,6 +278,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(scsi80)
|
||||
DicConsole.WriteLine("Unit Serial Number: {0}", scsiSerial);
|
||||
if(scsi82)
|
||||
DicConsole.WriteLine("ASCII implemented operating definitions: {0}", scsiAsciiOperatingDefs);
|
||||
|
||||
if(sb != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user