mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Store MMC GET CONFIGURATION response in device report.
This commit is contained in:
5
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
5
.idea/.idea.DiscImageChef/.idea/contentModel.xml
generated
@@ -326,6 +326,8 @@
|
|||||||
<e p="20181224172147_FixUsbIdsAndIndexes.cs" t="Include" />
|
<e p="20181224172147_FixUsbIdsAndIndexes.cs" t="Include" />
|
||||||
<e p="20181225002740_AddCdOffsets.Designer.cs" t="Include" />
|
<e p="20181225002740_AddCdOffsets.Designer.cs" t="Include" />
|
||||||
<e p="20181225002740_AddCdOffsets.cs" t="Include" />
|
<e p="20181225002740_AddCdOffsets.cs" t="Include" />
|
||||||
|
<e p="20181225152947_StoreMmcGetConfigurationResponse.Designer.cs" t="Include" />
|
||||||
|
<e p="20181225152947_StoreMmcGetConfigurationResponse.cs" t="Include" />
|
||||||
<e p="DicContextModelSnapshot.cs" t="Include" />
|
<e p="DicContextModelSnapshot.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="Models" t="Include">
|
<e p="Models" t="Include">
|
||||||
@@ -1827,6 +1829,9 @@
|
|||||||
<e p="201812250223002_AddCdOffsets.Designer.cs" t="Include" />
|
<e p="201812250223002_AddCdOffsets.Designer.cs" t="Include" />
|
||||||
<e p="201812250223002_AddCdOffsets.cs" t="Include" />
|
<e p="201812250223002_AddCdOffsets.cs" t="Include" />
|
||||||
<e p="201812250223002_AddCdOffsets.resx" t="Include" />
|
<e p="201812250223002_AddCdOffsets.resx" t="Include" />
|
||||||
|
<e p="201812251556377_StoreMmcGetConfigurationResponse.Designer.cs" t="Include" />
|
||||||
|
<e p="201812251556377_StoreMmcGetConfigurationResponse.cs" t="Include" />
|
||||||
|
<e p="201812251556377_StoreMmcGetConfigurationResponse.resx" t="Include" />
|
||||||
<e p="Configuration.cs" t="Include" />
|
<e p="Configuration.cs" t="Include" />
|
||||||
</e>
|
</e>
|
||||||
<e p="Models" t="Include">
|
<e p="Models" t="Include">
|
||||||
|
|||||||
@@ -1032,6 +1032,8 @@ namespace DiscImageChef.CommonTypes.Metadata
|
|||||||
public bool SupportsWriteInhibitDCB { get; set; }
|
public bool SupportsWriteInhibitDCB { get; set; }
|
||||||
public bool SupportsWriteProtectPAC { get; set; }
|
public bool SupportsWriteProtectPAC { get; set; }
|
||||||
public ushort? VolumeLevels { get; set; }
|
public ushort? VolumeLevels { get; set; }
|
||||||
|
public byte[] BinaryData { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public short? BlocksPerReadableUnitSql
|
public short? BlocksPerReadableUnitSql
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -42,6 +42,26 @@ namespace DiscImageChef.Core.Devices.Report
|
|||||||
{
|
{
|
||||||
public partial class DeviceReport
|
public partial class DeviceReport
|
||||||
{
|
{
|
||||||
|
static byte[] ClearMmcFeatures(byte[] response)
|
||||||
|
{
|
||||||
|
uint offset = 8;
|
||||||
|
|
||||||
|
while(offset + 4 < response.Length)
|
||||||
|
{
|
||||||
|
ushort code = (ushort)((response[offset + 0] << 8) + response[offset + 1]);
|
||||||
|
|
||||||
|
if(code != 0x0108) continue;
|
||||||
|
|
||||||
|
byte[] data = new byte[response[offset + 3] + 4];
|
||||||
|
|
||||||
|
if(data.Length + offset > response.Length) data = new byte[response.Length - offset];
|
||||||
|
Array.Copy(data, 4, response, offset + 4, data.Length - 4);
|
||||||
|
offset += (uint)data.Length;
|
||||||
|
}
|
||||||
|
|
||||||
|
return response;
|
||||||
|
}
|
||||||
|
|
||||||
public MmcFeatures ReportMmcFeatures()
|
public MmcFeatures ReportMmcFeatures()
|
||||||
{
|
{
|
||||||
DicConsole.WriteLine("Querying MMC GET CONFIGURATION...");
|
DicConsole.WriteLine("Querying MMC GET CONFIGURATION...");
|
||||||
@@ -52,7 +72,7 @@ namespace DiscImageChef.Core.Devices.Report
|
|||||||
Features.SeparatedFeatures ftr = Features.Separate(buffer);
|
Features.SeparatedFeatures ftr = Features.Separate(buffer);
|
||||||
if(ftr.Descriptors == null || ftr.Descriptors.Length <= 0) return null;
|
if(ftr.Descriptors == null || ftr.Descriptors.Length <= 0) return null;
|
||||||
|
|
||||||
MmcFeatures report = new MmcFeatures();
|
MmcFeatures report = new MmcFeatures {BinaryData = ClearMmcFeatures(buffer)};
|
||||||
foreach(Features.FeatureDescriptor desc in ftr.Descriptors)
|
foreach(Features.FeatureDescriptor desc in ftr.Descriptors)
|
||||||
switch(desc.Code)
|
switch(desc.Code)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,6 +86,8 @@
|
|||||||
<Compile Include="Migrations\20181224172147_FixUsbIdsAndIndexes.Designer.cs" />
|
<Compile Include="Migrations\20181224172147_FixUsbIdsAndIndexes.Designer.cs" />
|
||||||
<Compile Include="Migrations\20181225002740_AddCdOffsets.cs" />
|
<Compile Include="Migrations\20181225002740_AddCdOffsets.cs" />
|
||||||
<Compile Include="Migrations\20181225002740_AddCdOffsets.Designer.cs" />
|
<Compile Include="Migrations\20181225002740_AddCdOffsets.Designer.cs" />
|
||||||
|
<Compile Include="Migrations\20181225152947_StoreMmcGetConfigurationResponse.cs" />
|
||||||
|
<Compile Include="Migrations\20181225152947_StoreMmcGetConfigurationResponse.Designer.cs" />
|
||||||
<Compile Include="Migrations\DicContextModelSnapshot.cs" />
|
<Compile Include="Migrations\DicContextModelSnapshot.cs" />
|
||||||
<Compile Include="Models\CdOffset.cs" />
|
<Compile Include="Models\CdOffset.cs" />
|
||||||
<Compile Include="Models\Command.cs" />
|
<Compile Include="Models\Command.cs" />
|
||||||
|
|||||||
1427
DiscImageChef.Database/Migrations/20181225152947_StoreMmcGetConfigurationResponse.Designer.cs
generated
Normal file
1427
DiscImageChef.Database/Migrations/20181225152947_StoreMmcGetConfigurationResponse.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Database.Migrations
|
||||||
|
{
|
||||||
|
// TODO: Find how to permanently create indexes
|
||||||
|
public partial class StoreMmcGetConfigurationResponse : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropIndex("IX_UsbVendors_ModifiedWhen", "UsbVendors");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex("IX_UsbProducts_ModifiedWhen", "UsbProducts");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex("IX_UsbProducts_ProductId", "UsbProducts");
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<byte[]>("BinaryData", "MmcFeatures", nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn("BinaryData", "MmcFeatures");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_UsbVendors_ModifiedWhen", "UsbVendors", "ModifiedWhen");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_UsbProducts_ModifiedWhen", "UsbProducts", "ModifiedWhen");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex("IX_UsbProducts_ProductId", "UsbProducts", "ProductId");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -132,6 +132,8 @@ namespace DiscImageChef.Database.Migrations
|
|||||||
|
|
||||||
b.Property<byte?>("AGIDs");
|
b.Property<byte?>("AGIDs");
|
||||||
|
|
||||||
|
b.Property<byte[]>("BinaryData");
|
||||||
|
|
||||||
b.Property<byte?>("BindingNonceBlocks");
|
b.Property<byte?>("BindingNonceBlocks");
|
||||||
|
|
||||||
b.Property<ushort?>("BlocksPerReadableUnit");
|
b.Property<ushort?>("BlocksPerReadableUnit");
|
||||||
@@ -1163,10 +1165,6 @@ namespace DiscImageChef.Database.Migrations
|
|||||||
|
|
||||||
b.HasIndex("VendorId");
|
b.HasIndex("VendorId");
|
||||||
|
|
||||||
b.HasIndex("ProductId");
|
|
||||||
|
|
||||||
b.HasIndex("ModifiedWhen");
|
|
||||||
|
|
||||||
b.ToTable("UsbProducts");
|
b.ToTable("UsbProducts");
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1182,8 +1180,6 @@ namespace DiscImageChef.Database.Migrations
|
|||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
|
|
||||||
b.HasIndex("ModifiedWhen");
|
|
||||||
|
|
||||||
b.ToTable("UsbVendors");
|
b.ToTable("UsbVendors");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -229,6 +229,10 @@
|
|||||||
<Compile Include="Migrations\201812250223002_AddCdOffsets.Designer.cs">
|
<Compile Include="Migrations\201812250223002_AddCdOffsets.Designer.cs">
|
||||||
<DependentUpon>201812250223002_AddCdOffsets.cs</DependentUpon>
|
<DependentUpon>201812250223002_AddCdOffsets.cs</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="Migrations\201812251556377_StoreMmcGetConfigurationResponse.cs" />
|
||||||
|
<Compile Include="Migrations\201812251556377_StoreMmcGetConfigurationResponse.Designer.cs">
|
||||||
|
<DependentUpon>201812251556377_StoreMmcGetConfigurationResponse.cs</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="Migrations\Configuration.cs" />
|
<Compile Include="Migrations\Configuration.cs" />
|
||||||
<Compile Include="Models\CdOffset.cs" />
|
<Compile Include="Models\CdOffset.cs" />
|
||||||
<Compile Include="Models\Command.cs" />
|
<Compile Include="Models\Command.cs" />
|
||||||
@@ -339,6 +343,9 @@
|
|||||||
<EmbeddedResource Include="Migrations\201812250223002_AddCdOffsets.resx">
|
<EmbeddedResource Include="Migrations\201812250223002_AddCdOffsets.resx">
|
||||||
<DependentUpon>201812250223002_AddCdOffsets.cs</DependentUpon>
|
<DependentUpon>201812250223002_AddCdOffsets.cs</DependentUpon>
|
||||||
</EmbeddedResource>
|
</EmbeddedResource>
|
||||||
|
<EmbeddedResource Include="Migrations\201812251556377_StoreMmcGetConfigurationResponse.resx">
|
||||||
|
<DependentUpon>201812251556377_StoreMmcGetConfigurationResponse.cs</DependentUpon>
|
||||||
|
</EmbeddedResource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||||
|
|||||||
29
DiscImageChef.Server/Migrations/201812251556377_StoreMmcGetConfigurationResponse.Designer.cs
generated
Normal file
29
DiscImageChef.Server/Migrations/201812251556377_StoreMmcGetConfigurationResponse.Designer.cs
generated
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
// <auto-generated />
|
||||||
|
namespace DiscImageChef.Server.Migrations
|
||||||
|
{
|
||||||
|
using System.CodeDom.Compiler;
|
||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
using System.Data.Entity.Migrations.Infrastructure;
|
||||||
|
using System.Resources;
|
||||||
|
|
||||||
|
[GeneratedCode("EntityFramework.Migrations", "6.2.0-61023")]
|
||||||
|
public sealed partial class StoreMmcGetConfigurationResponse : IMigrationMetadata
|
||||||
|
{
|
||||||
|
private readonly ResourceManager Resources = new ResourceManager(typeof(StoreMmcGetConfigurationResponse));
|
||||||
|
|
||||||
|
string IMigrationMetadata.Id
|
||||||
|
{
|
||||||
|
get { return "201812251556377_StoreMmcGetConfigurationResponse"; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Source
|
||||||
|
{
|
||||||
|
get { return null; }
|
||||||
|
}
|
||||||
|
|
||||||
|
string IMigrationMetadata.Target
|
||||||
|
{
|
||||||
|
get { return Resources.GetString("Target"); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
namespace DiscImageChef.Server.Migrations
|
||||||
|
{
|
||||||
|
public partial class StoreMmcGetConfigurationResponse : DbMigration
|
||||||
|
{
|
||||||
|
public override void Up()
|
||||||
|
{
|
||||||
|
AddColumn("dbo.MmcFeatures", "BinaryData", c => c.Binary());
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Down()
|
||||||
|
{
|
||||||
|
DropColumn("dbo.MmcFeatures", "BinaryData");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user