Implemented SCSI EVPD 82h

This commit is contained in:
2016-10-13 04:01:39 +01:00
parent 61c7d68f85
commit c5e94dd9e9
4 changed files with 47 additions and 0 deletions

View File

@@ -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

View File

@@ -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);
}
}
}

View File

@@ -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:

View File

@@ -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)
{