Add DVD region report to device info

This commit is contained in:
Rebecca Wallander
2021-01-24 18:25:48 +01:00
parent beca676da1
commit 0eafb95e00
4 changed files with 27 additions and 2 deletions

View File

@@ -28,6 +28,7 @@
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2021 Natalia Portillo
// Copyright © 2021 Rebecca Wallander
// ****************************************************************************/
using System;
@@ -36,7 +37,10 @@ using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Decoders.DVD;
using Aaru.Decoders.SCSI;
using Aaru.Decryption;
using DVDDecryption = Aaru.Decryption.DVD.Dump;
using Aaru.Devices;
using Aaru.Helpers;
using Inquiry = Aaru.CommonTypes.Structs.Devices.SCSI.Inquiry;
@@ -255,6 +259,20 @@ namespace Aaru.Core.Devices.Info
if(!sense)
MmcConfiguration = confBuf;
var dvdDecrypt = new DVDDecryption(dev);
sense = dvdDecrypt.ReadRpc(out byte[] cmdBuf, out _, DvdCssKeyClass.DvdCssCppmOrCprm,
dev.Timeout, out _);
if(!sense)
{
CSS_CPRM.RegionalPlaybackControlState? rpc =
CSS_CPRM.DecodeRegionalPlaybackControlState(cmdBuf);
if(rpc.HasValue)
RPC = rpc;
}
// TODO: DVD drives respond correctly to BD status.
// While specification says if no medium is present
// it should inform all possible capabilities,

View File

@@ -34,6 +34,7 @@ using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Structs.Devices.SCSI;
using Aaru.Decoders.ATA;
using Aaru.Decoders.DVD;
using Aaru.Decoders.SCSI;
using Aaru.Decoders.SCSI.SSC;
using Aaru.Devices;
@@ -88,5 +89,6 @@ namespace Aaru.Core.Devices.Info
public bool IsCompactFlash { get; }
public bool IsPcmcia { get; }
public byte[] Cis { get; }
public CSS_CPRM.RegionalPlaybackControlState? RPC { get; }
}
}