Rename Aaru.Console project to Aaru.Logging.

This commit is contained in:
2025-08-17 05:50:25 +01:00
parent 1a6f7a02c6
commit 02ec8a05d8
365 changed files with 5465 additions and 5347 deletions

View File

@@ -36,7 +36,7 @@
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru.CommonTypes\Aaru.CommonTypes.csproj"/>
<ProjectReference Include="..\Aaru.Console\Aaru.Console.csproj"/>
<ProjectReference Include="..\Aaru.Logging\Aaru.Logging.csproj"/>
<ProjectReference Include="..\Aaru.Decoders\Aaru.Decoders.csproj"/>
<ProjectReference Include="..\Aaru.Helpers\Aaru.Helpers.csproj"/>
</ItemGroup>

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
namespace Aaru.Devices;

View File

@@ -31,8 +31,8 @@
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
namespace Aaru.Devices;

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
namespace Aaru.Devices;

View File

@@ -31,8 +31,8 @@
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
namespace Aaru.Devices;

View File

@@ -33,7 +33,7 @@
using System;
using System.Runtime.InteropServices;
using Aaru.CommonTypes.Interop;
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;

View File

@@ -31,7 +31,7 @@
// ****************************************************************************/
using System;
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -206,7 +206,7 @@ public partial class Device
public bool Read(out byte[] buffer, out uint[] response, uint lba, uint blockSize, ushort transferLength,
bool byteAddressed, uint timeout, out double duration)
{
var sense = true;
bool sense = true;
buffer = null;
response = null;
duration = -1;
@@ -342,9 +342,9 @@ public partial class Device
ushort transferLength, bool byteAddressed, uint timeout, out double duration)
{
buffer = new byte[transferLength * blockSize];
var blockBuffer = new byte[blockSize];
byte[] blockBuffer = new byte[blockSize];
duration = 0;
var sense = true;
bool sense = true;
response = null;
for(uint i = 0; i < transferLength; i++)

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;

View File

@@ -32,7 +32,7 @@
// ****************************************************************************/
using System;
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -61,7 +61,7 @@ public partial class Device
out double duration)
{
buffer = new byte[8];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.AdaptecTranslate;
@@ -105,9 +105,9 @@ public partial class Device
public bool AdaptecSetErrorThreshold(byte threshold, out byte[] senseBuffer, bool drive1, uint timeout,
out double duration)
{
var buffer = new byte[1];
byte[] buffer = new byte[1];
buffer[0] = threshold;
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.AdaptecSetErrorThreshold;
@@ -149,7 +149,7 @@ public partial class Device
out double duration)
{
buffer = new byte[9];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.AdaptecTranslate;
@@ -180,10 +180,10 @@ public partial class Device
/// <param name="duration">Duration.</param>
public bool AdaptecWriteBuffer(byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
{
var oneKBuffer = new byte[1024];
byte[] oneKBuffer = new byte[1024];
Array.Copy(buffer, 0, oneKBuffer, 0, buffer.Length < 1024 ? buffer.Length : 1024);
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.AdaptecWriteBuffer;
@@ -211,7 +211,7 @@ public partial class Device
public bool AdaptecReadBuffer(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
{
buffer = new byte[1024];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.AdaptecReadBuffer;

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -48,7 +48,7 @@ public partial class Device
out double duration)
{
buffer = new byte[3];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.ArchiveRequestBlockAddress;
@@ -92,7 +92,7 @@ public partial class Device
out double duration)
{
byte[] buffer = [];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.ArchiveSeekBlock;

View File

@@ -31,7 +31,7 @@
// ****************************************************************************/
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -60,7 +60,7 @@ public partial class Device
public bool CertanceParkUnpark(out byte[] senseBuffer, bool park, uint timeout, out double duration)
{
byte[] buffer = [];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.CertanceParkUnpark;

View File

@@ -32,8 +32,8 @@
using System;
using System.Text;
using Aaru.Console;
using Aaru.Helpers;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -52,12 +52,12 @@ public partial class Device
string secondHalf, uint timeout, out double duration)
{
byte[] tmp;
var firstHalfBytes = new byte[8];
var secondHalfBytes = new byte[8];
var buffer = new byte[17];
var displayLen = false;
var halfMsg = false;
var cdb = new byte[10];
byte[] firstHalfBytes = new byte[8];
byte[] secondHalfBytes = new byte[8];
byte[] buffer = new byte[17];
bool displayLen = false;
bool halfMsg = false;
byte[] cdb = new byte[10];
if(!string.IsNullOrWhiteSpace(firstHalf))
{

View File

@@ -32,9 +32,9 @@
using System.Collections.Generic;
using Aaru.CommonTypes.Enums;
using Aaru.Console;
using Aaru.Decoders.DVD;
using Aaru.Helpers;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -60,7 +60,7 @@ public partial class Device
Read12(out _, out _, 0, false, false, false, false, lba, 2048, 0, 16, false, timeout, out duration);
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
buffer = new byte[2064 * transferLength];
uint cacheDataOffset = 0x80000000 + lba % 96 * 2064;
@@ -110,12 +110,12 @@ public partial class Device
static bool CheckSectorNumber(IReadOnlyList<byte> buffer, uint firstLba, uint transferLength, uint layerbreak,
bool otp)
{
for(var i = 0; i < transferLength; i++)
for(int i = 0; i < transferLength; i++)
{
byte layer = (byte)(buffer[0 + 2064 * i] & 0x1);
byte[] sectorBuffer = [0x0, buffer[1 + 2064 * i], buffer[2 + 2064 * i], buffer[3 + 2064 * i]];
var sectorNumber = BigEndianBitConverter.ToUInt32(sectorBuffer, 0);
uint sectorNumber = BigEndianBitConverter.ToUInt32(sectorBuffer, 0);
if(otp)
@@ -149,7 +149,7 @@ public partial class Device
{
if(layer != 1) return IsCorrectSlPsn(sectorNumber, lba);
return sectorNumber == (lba - layerbreak) + 0x30000;
return sectorNumber == lba - layerbreak + 0x30000;
}
/// <summary>

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -71,7 +71,7 @@ public partial class Device
ushort blockBytes, bool pba, bool sectorCount, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.ReadLong;

View File

@@ -31,7 +31,7 @@
// ****************************************************************************/
using System;
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -45,7 +45,7 @@ public partial class Device
public bool KreonDeprecatedUnlock(out byte[] senseBuffer, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.KreonCommand;
@@ -101,7 +101,7 @@ public partial class Device
public bool KreonSetLockState(out byte[] senseBuffer, KreonLockStates state, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.KreonCommand;
@@ -135,8 +135,8 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
var buffer = new byte[26];
byte[] cdb = new byte[10];
byte[] buffer = new byte[26];
features = 0;
cdb[0] = (byte)ScsiCommands.KreonCommand;
@@ -160,9 +160,9 @@ public partial class Device
if(buffer[0] != 0xA5 || buffer[1] != 0x5A || buffer[2] != 0x5A || buffer[3] != 0xA5) return true;
for(var i = 4; i < 26; i += 2)
for(int i = 4; i < 26; i += 2)
{
var feature = BitConverter.ToUInt16(buffer, i);
ushort feature = BitConverter.ToUInt16(buffer, i);
if(feature == 0x0000) break;
@@ -225,7 +225,7 @@ public partial class Device
byte requestNumber = 0x00)
{
buffer = new byte[2048];
var cdb = new byte[12];
byte[] cdb = new byte[12];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.KreonSsCommand;

View File

@@ -32,13 +32,13 @@
using System;
using Aaru.CommonTypes.Enums;
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
public partial class Device
{
private uint _bufferOffset = 0;
private uint _bufferOffset;
/// <summary>Reads a "raw" sector from DVD on Lite-On drives.</summary>
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer" /> contains the sense buffer.</returns>
@@ -115,7 +115,7 @@ public partial class Device
Read12(out _, out _, 0, false, false, false, false, lba, 2048, 0, 16, false, timeout, out duration);
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
buffer = new byte[transferLength];
@@ -268,10 +268,7 @@ public partial class Device
{
LiteOnReadBuffer(out byte[] buffer, out byte[] _, i * 2384, 2384, timeout, out double _, lba);
if(CheckSectorNumber(buffer, lba, 1, layerbreak, otp))
{
return (int)i;
}
if(CheckSectorNumber(buffer, lba, 1, layerbreak, otp)) return (int)i;
}
return -1;
@@ -288,14 +285,11 @@ public partial class Device
{
// TODO: Save ECC instead of just throwing it away
var deinterleaved = new byte[2064 * transferLength];
byte[] deinterleaved = new byte[2064 * transferLength];
for(var j = 0; j < transferLength; j++)
for(int j = 0; j < transferLength; j++)
{
for(var i = 0; i < 12; i++)
{
Array.Copy(buffer, (j * 2384) + (i * 182), deinterleaved, (j * 2064) + (i * 172), 172);
}
for(int i = 0; i < 12; i++) Array.Copy(buffer, j * 2384 + i * 182, deinterleaved, j * 2064 + i * 172, 172);
}
return deinterleaved;

View File

@@ -33,7 +33,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using System.Text;
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -79,7 +79,7 @@ public partial class Device
MmcGetConfigurationRt rt, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
buffer = new byte[8];
cdb[0] = (byte)ScsiCommands.GetConfiguration;
@@ -102,7 +102,7 @@ public partial class Device
if(sense) return true;
var confLength = (ushort)((buffer[2] << 8) + buffer[3] + 4);
ushort confLength = (ushort)((buffer[2] << 8) + buffer[3] + 4);
buffer = new byte[confLength];
cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(buffer.Length & 0xFF);
@@ -146,7 +146,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
buffer = new byte[8];
cdb[0] = (byte)ScsiCommands.ReadDiscStructure;
@@ -173,7 +173,7 @@ public partial class Device
if(sense) return true;
var strctLength = (ushort)((buffer[0] << 8) + buffer[1] + 2);
ushort strctLength = (ushort)((buffer[0] << 8) + buffer[1] + 2);
// WORKAROUND: Some drives return incorrect length information. As these structures are fixed length just apply known length.
if(mediaType == MmcDiscStructureMediaType.Bd)
@@ -313,7 +313,7 @@ public partial class Device
byte trackSessionNumber, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
byte[] tmpBuffer = (format & 0x0F) == 5 ? new byte[32768] : new byte[1536];
@@ -336,7 +336,7 @@ public partial class Device
Error = LastError != 0;
var strctLength = (uint)((tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
uint strctLength = (uint)((tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
buffer = new byte[strctLength];
if(buffer.Length <= tmpBuffer.Length)
@@ -407,8 +407,8 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
var tmpBuffer = new byte[804];
byte[] cdb = new byte[10];
byte[] tmpBuffer = new byte[804];
cdb[0] = (byte)ScsiCommands.ReadDiscInformation;
cdb[1] = (byte)dataType;
@@ -425,7 +425,7 @@ public partial class Device
Error = LastError != 0;
var strctLength = (uint)((tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
uint strctLength = (uint)((tmpBuffer[0] << 8) + tmpBuffer[1] + 2);
if(strctLength > tmpBuffer.Length) strctLength = (uint)tmpBuffer.Length;
@@ -466,7 +466,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.ReadCd;
cdb[1] = (byte)((byte)expectedSectorType << 2);
@@ -550,7 +550,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.ReadCdMsf;
cdb[1] = (byte)((byte)expectedSectorType << 2);
@@ -574,7 +574,7 @@ public partial class Device
cdb[10] = (byte)subchannel;
var transferLength = (uint)((cdb[6] - cdb[3]) * 60 * 75 + (cdb[7] - cdb[4]) * 75 + (cdb[8] - cdb[5]));
uint transferLength = (uint)((cdb[6] - cdb[3]) * 60 * 75 + (cdb[7] - cdb[4]) * 75 + (cdb[8] - cdb[5]));
buffer = new byte[blockSize * transferLength];
@@ -636,7 +636,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.PreventAllowMediumRemoval;
@@ -714,7 +714,7 @@ public partial class Device
bool changeFormatLayer, bool loadEject, bool start, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.StartStopUnit;
@@ -772,7 +772,7 @@ public partial class Device
public bool ReadMcn(out string mcn, out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
mcn = null;
cdb[0] = (byte)ScsiCommands.ReadSubChannel;
@@ -818,7 +818,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
isrc = null;
cdb[0] = (byte)ScsiCommands.ReadSubChannel;
@@ -866,7 +866,7 @@ public partial class Device
ushort writeSpeed, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.SetCdRomSpeed;
@@ -912,7 +912,7 @@ public partial class Device
uint address, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
buffer = new byte[48];
cdb[0] = (byte)ScsiCommands.ReadTrackInformation;

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -48,7 +48,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
buffer = new byte[length];
cdb[0] = (byte)ScsiCommands.MediaTekVendorCommand;

View File

@@ -32,7 +32,7 @@
// ReSharper disable InconsistentNaming
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -50,7 +50,7 @@ public partial class Device
{
const ushort transferLength = 2336;
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.MiniDiscReadDTOC;
@@ -86,7 +86,7 @@ public partial class Device
{
const ushort transferLength = 2336;
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.MiniDiscReadUTOC;
@@ -124,7 +124,7 @@ public partial class Device
{
const ushort transferLength = 4;
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.MiniDiscD5;
@@ -157,7 +157,7 @@ public partial class Device
public bool MiniDiscStopPlaying(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.MiniDiscStopPlay;
@@ -188,7 +188,7 @@ public partial class Device
{
const ushort transferLength = 4;
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.MiniDiscReadPosition;
@@ -222,7 +222,7 @@ public partial class Device
{
const ushort transferLength = 8;
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.MiniDiscGetType;

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -48,7 +48,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.NecReadCdDa;
cdb[2] = (byte)((lba & 0xFF000000) >> 24);

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Decoders.SCSI;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -62,7 +62,7 @@ public partial class Device
out uint foundBlocks, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
byte[] buffer = [];
foundLba = 0;
foundBlocks = 0;

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -50,7 +50,7 @@ public partial class Device
uint transferLength, PioneerSubchannel subchannel, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.ReadCdDa;
cdb[2] = (byte)((lba & 0xFF000000) >> 24);
@@ -93,7 +93,7 @@ public partial class Device
uint blockSize, PioneerSubchannel subchannel, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.ReadCdDaMsf;
cdb[3] = (byte)((startMsf & 0xFF0000) >> 16);
@@ -104,7 +104,7 @@ public partial class Device
cdb[9] = (byte)(endMsf & 0xFF);
cdb[10] = (byte)subchannel;
var transferLength = (uint)((cdb[7] - cdb[3]) * 60 * 75 + (cdb[8] - cdb[4]) * 75 + (cdb[9] - cdb[5]));
uint transferLength = (uint)((cdb[7] - cdb[3]) * 60 * 75 + (cdb[8] - cdb[4]) * 75 + (cdb[9] - cdb[5]));
buffer = new byte[blockSize * transferLength];
LastError = SendScsiCommand(cdb,
@@ -139,7 +139,7 @@ public partial class Device
bool errorFlags, bool wholeSector, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.ReadCdXa;
cdb[2] = (byte)((lba & 0xFF000000) >> 24);

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -92,7 +92,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.PlasmonReadSectorLocation;
cdb[2] = (byte)((address & 0xFF000000) >> 24);

View File

@@ -30,8 +30,8 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Helpers;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -51,7 +51,7 @@ public partial class Device
uint transferLength, PlextorSubchannel subchannel, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.ReadCdDa;
cdb[2] = (byte)((lba & 0xFF000000) >> 24);
@@ -102,7 +102,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
buffer = new byte[2064 * transferLength];
cdb[0] = (byte)ScsiCommands.ReadBuffer;
@@ -139,7 +139,7 @@ public partial class Device
{
buffer = new byte[256];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorReadEeprom;
cdb[8] = 1;
@@ -169,7 +169,7 @@ public partial class Device
{
buffer = new byte[512];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorReadEeprom;
cdb[8] = 2;
@@ -202,7 +202,7 @@ public partial class Device
{
buffer = new byte[blockSize];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorReadEeprom;
cdb[1] = 1;
@@ -236,9 +236,9 @@ public partial class Device
public bool PlextorGetSpeeds(out byte[] senseBuffer, out ushort selected, out ushort max, out ushort last,
uint timeout, out double duration)
{
var buf = new byte[10];
byte[] buf = new byte[10];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
selected = 0;
max = 0;
@@ -278,9 +278,9 @@ public partial class Device
public bool PlextorGetPoweRec(out byte[] senseBuffer, out bool enabled, out ushort speed, uint timeout,
out double duration)
{
var buf = new byte[8];
byte[] buf = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
enabled = false;
speed = 0;
@@ -319,7 +319,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[1] = (byte)PlextorSubCommands.GetMode;
@@ -352,7 +352,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[1] = (byte)PlextorSubCommands.GetMode;
@@ -386,7 +386,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[1] = (byte)PlextorSubCommands.GetMode;
@@ -423,7 +423,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[2] = (byte)PlextorSubCommands.SecuRec;
@@ -454,7 +454,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[1] = (byte)PlextorSubCommands.GetMode;
@@ -486,7 +486,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[1] = (byte)PlextorSubCommands.GetMode;
@@ -522,7 +522,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[1] = (byte)PlextorSubCommands.GetMode;
@@ -559,7 +559,7 @@ public partial class Device
{
buffer = new byte[8];
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.PlextorExtend;
cdb[1] = (byte)PlextorSubCommands.GetMode;

View File

@@ -31,7 +31,7 @@
// ****************************************************************************/
using System;
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -62,7 +62,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
cdb[0] = (byte)ScsiCommands.Read6;
cdb[1] = (byte)((lba & 0x1F0000) >> 16);
@@ -113,7 +113,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.Read10;
cdb[1] = (byte)((rdprotect & 0x07) << 5);
@@ -178,7 +178,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
cdb[0] = (byte)ScsiCommands.Read12;
cdb[1] = (byte)((rdprotect & 0x07) << 5);
@@ -246,7 +246,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[16];
byte[] cdb = new byte[16];
byte[] lbaBytes = BitConverter.GetBytes(lba);
cdb[0] = (byte)ScsiCommands.Read16;
@@ -308,7 +308,7 @@ public partial class Device
ushort transferBytes, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.ReadLong;
@@ -356,7 +356,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[16];
byte[] cdb = new byte[16];
byte[] lbaBytes = BitConverter.GetBytes(lba);
cdb[0] = (byte)ScsiCommands.ServiceActionIn;
@@ -399,7 +399,7 @@ public partial class Device
public bool Seek6(out byte[] senseBuffer, uint lba, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.Seek6;
@@ -430,7 +430,7 @@ public partial class Device
public bool Seek10(out byte[] senseBuffer, uint lba, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.Seek10;

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
namespace Aaru.Devices;
@@ -53,7 +53,7 @@ public partial class Device
uint timeout, out double duration)
{
buffer = new byte[256];
var cdb = new byte[16];
byte[] cdb = new byte[16];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.ReadAttribute;
@@ -84,7 +84,7 @@ public partial class Device
if(sense) return true;
var attrLen = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4);
uint attrLen = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4);
buffer = new byte[attrLen];
cdb[10] = (byte)((buffer.Length & 0xFF000000) >> 24);
cdb[11] = (byte)((buffer.Length & 0xFF0000) >> 16);

View File

@@ -32,7 +32,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using Aaru.Logging;
using PlatformID = Aaru.CommonTypes.Interop.PlatformID;
// ReSharper disable UnusedMember.Global
@@ -91,7 +91,7 @@ public partial class Device
if(sense) return true;
var pagesLength = (byte)(buffer[4] + 5);
byte pagesLength = (byte)(buffer[4] + 5);
cdb = [(byte)ScsiCommands.Inquiry, 0, 0, 0, pagesLength, 0];
@@ -174,7 +174,7 @@ public partial class Device
// This is because INQ was returned instead of EVPD
if(buffer[1] != page) return true;
var pagesLength = (byte)(buffer[3] + 4);
byte pagesLength = (byte)(buffer[3] + 4);
cdb = [(byte)ScsiCommands.Inquiry, 1, page, 0, pagesLength, 0];
@@ -260,7 +260,7 @@ public partial class Device
byte pageCode, byte subPageCode, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
buffer = new byte[254];
cdb[0] = (byte)ScsiCommands.ModeSense;
@@ -285,7 +285,7 @@ public partial class Device
if(sense) return true;
var modeLength = (byte)(buffer[0] + 1);
byte modeLength = (byte)(buffer[0] + 1);
if(modeLength % 2 != 0) modeLength++;
buffer = new byte[modeLength];
@@ -350,7 +350,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
buffer = new byte[4096];
cdb[0] = (byte)ScsiCommands.ModeSense10;
@@ -378,7 +378,7 @@ public partial class Device
if(sense) return true;
var modeLength = (ushort)((buffer[0] << 8) + buffer[1] + 2);
ushort modeLength = (ushort)((buffer[0] << 8) + buffer[1] + 2);
if(modeLength % 2 != 0) modeLength++;
buffer = new byte[modeLength];
@@ -438,7 +438,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.PreventAllowMediumRemoval;
@@ -481,7 +481,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
buffer = new byte[8];
cdb[0] = (byte)ScsiCommands.ReadCapacity;
@@ -534,7 +534,7 @@ public partial class Device
out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[16];
byte[] cdb = new byte[16];
buffer = new byte[32];
cdb[0] = (byte)ScsiCommands.ServiceActionIn;
@@ -583,7 +583,7 @@ public partial class Device
public bool ReadMediaSerialNumber(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[12];
byte[] cdb = new byte[12];
buffer = new byte[4];
cdb[0] = (byte)ScsiCommands.ReadSerialNumber;
@@ -605,7 +605,7 @@ public partial class Device
if(sense) return true;
var strctLength = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4);
uint strctLength = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4);
buffer = new byte[strctLength];
cdb[6] = (byte)((buffer.Length & 0xFF000000) >> 24);
cdb[7] = (byte)((buffer.Length & 0xFF0000) >> 16);
@@ -775,7 +775,7 @@ public partial class Device
return true;
}
var cdb = new byte[6];
byte[] cdb = new byte[6];
cdb[0] = (byte)ScsiCommands.ModeSelect;
@@ -832,7 +832,7 @@ public partial class Device
return true;
}
var cdb = new byte[10];
byte[] cdb = new byte[10];
cdb[0] = (byte)ScsiCommands.ModeSelect10;
@@ -874,7 +874,7 @@ public partial class Device
/// <returns><c>true</c> if the command failed.</returns>
public bool RequestSense(bool descriptor, out byte[] buffer, uint timeout, out double duration)
{
var cdb = new byte[6];
byte[] cdb = new byte[6];
buffer = new byte[252];
cdb[0] = (byte)ScsiCommands.RequestSense;

View File

@@ -32,7 +32,7 @@
using System;
using System.Diagnostics.CodeAnalysis;
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -74,7 +74,7 @@ public partial class Device
uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.LoadUnload;
@@ -160,7 +160,7 @@ public partial class Device
uint objectId, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
byte[] cdb = new byte[10];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.Locate;
@@ -258,7 +258,7 @@ public partial class Device
bool bam, byte partition, ulong identifier, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[16];
byte[] cdb = new byte[16];
byte[] buffer = [];
byte[] idBytes = BitConverter.GetBytes(identifier);
@@ -348,7 +348,7 @@ public partial class Device
uint blockSize, uint timeout, out double duration)
{
buffer = fixedLen ? new byte[blockSize * transferLen] : new byte[transferLen];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.Read6;
@@ -457,7 +457,7 @@ public partial class Device
ulong objectId, uint transferLen, uint objectSize, uint timeout, out double duration)
{
buffer = fixedLen ? new byte[objectSize * transferLen] : new byte[transferLen];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
byte[] idBytes = BitConverter.GetBytes(objectId);
@@ -503,7 +503,7 @@ public partial class Device
public bool ReadBlockLimits(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
{
buffer = new byte[6];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.ReadBlockLimits;
@@ -584,7 +584,7 @@ public partial class Device
_ => new byte[32]
};
var cdb = new byte[10];
byte[] cdb = new byte[10];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.ReadPosition;
@@ -661,7 +661,7 @@ public partial class Device
uint transferLen, uint blockSize, uint timeout, out double duration)
{
buffer = fixedLen ? new byte[blockSize * transferLen] : new byte[transferLen];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.ReadReverse;
@@ -806,7 +806,7 @@ public partial class Device
out double duration)
{
buffer = fixedLen ? new byte[objectSize * transferLen] : new byte[transferLen];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
byte[] idBytes = BitConverter.GetBytes(objectId);
@@ -888,7 +888,7 @@ public partial class Device
uint transferLen, uint blockSize, uint timeout, out double duration)
{
buffer = fixedLen ? new byte[blockSize * transferLen] : new byte[transferLen];
var cdb = new byte[6];
byte[] cdb = new byte[6];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.RecoverBufferedData;
@@ -945,7 +945,7 @@ public partial class Device
uint timeout, out double duration)
{
buffer = new byte[256];
var cdb = new byte[10];
byte[] cdb = new byte[10];
senseBuffer = new byte[64];
cdb[0] = (byte)ScsiCommands.ReportDensitySupport;
@@ -969,7 +969,7 @@ public partial class Device
if(sense) return true;
var availableLength = (ushort)((buffer[0] << 8) + buffer[1] + 2);
ushort availableLength = (ushort)((buffer[0] << 8) + buffer[1] + 2);
buffer = new byte[availableLength];
cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8);
cdb[8] = (byte)(buffer.Length & 0xFF);
@@ -1005,7 +1005,7 @@ public partial class Device
public bool Rewind(out byte[] senseBuffer, bool immediate, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.Rewind;
@@ -1036,7 +1036,7 @@ public partial class Device
public bool TrackSelect(out byte[] senseBuffer, byte track, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
cdb[0] = (byte)ScsiCommands.TrackSelect;
@@ -1067,7 +1067,7 @@ public partial class Device
public bool Space(out byte[] senseBuffer, SscSpaceCodes code, int count, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
byte[] cdb = new byte[6];
byte[] buffer = [];
byte[] countB = BitConverter.GetBytes(count);

View File

@@ -30,7 +30,7 @@
// Copyright © 2011-2025 Natalia Portillo
// ****************************************************************************/
using Aaru.Console;
using Aaru.Logging;
// ReSharper disable UnusedMember.Global
@@ -84,8 +84,8 @@ public partial class Device
bool inhibitDma, bool readLong, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[6];
bool sense;
byte[] cdb = new byte[6];
bool sense;
cdb[0] = (byte)ScsiCommands.Read6;
cdb[1] = (byte)((lba & 0x1F0000) >> 16);
@@ -170,8 +170,8 @@ public partial class Device
ushort transferLength, bool inhibitDma, bool readLong, uint timeout, out double duration)
{
senseBuffer = new byte[64];
var cdb = new byte[10];
bool sense;
byte[] cdb = new byte[10];
bool sense;
cdb[0] = (byte)ScsiCommands.Read10;
cdb[2] = (byte)((lba & 0xFF000000) >> 24);

View File

@@ -41,8 +41,8 @@ using System.Net.Sockets;
using System.Runtime.InteropServices;
using Aaru.CommonTypes.Enums;
using Aaru.CommonTypes.Interop;
using Aaru.Console;
using Aaru.Decoders.ATA;
using Aaru.Logging;
using Marshal = Aaru.Helpers.Marshal;
using Version = Aaru.CommonTypes.Interop.Version;
@@ -88,7 +88,7 @@ public class Remote : IDisposable
AaruConsole.WriteLine(Localization.Connected_to_0, uri.Host);
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
int len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -237,7 +237,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -330,7 +330,7 @@ public class Remote : IDisposable
return [];
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -450,7 +450,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -549,7 +549,7 @@ public class Remote : IDisposable
cmdPkt.hdr.len = (uint)(Marshal.SizeOf<AaruPacketCmdScsi>() + cmdPkt.cdb_len + cmdPkt.buf_len);
byte[] pktBuf = Marshal.StructureToByteArrayLittleEndian(cmdPkt);
var buf = new byte[cmdPkt.hdr.len];
byte[] buf = new byte[cmdPkt.hdr.len];
Array.Copy(pktBuf, 0, buf, 0, Marshal.SizeOf<AaruPacketCmdScsi>());
@@ -567,7 +567,7 @@ public class Remote : IDisposable
return -1;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -659,7 +659,7 @@ public class Remote : IDisposable
cmdPkt.hdr.len = (uint)(Marshal.SizeOf<AaruPacketCmdAtaChs>() + cmdPkt.buf_len);
byte[] pktBuf = Marshal.StructureToByteArrayLittleEndian(cmdPkt);
var buf = new byte[cmdPkt.hdr.len];
byte[] buf = new byte[cmdPkt.hdr.len];
Array.Copy(pktBuf, 0, buf, 0, Marshal.SizeOf<AaruPacketCmdAtaChs>());
@@ -674,7 +674,7 @@ public class Remote : IDisposable
return -1;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -765,7 +765,7 @@ public class Remote : IDisposable
cmdPkt.hdr.len = (uint)(Marshal.SizeOf<AaruPacketCmdAtaLba28>() + cmdPkt.buf_len);
byte[] pktBuf = Marshal.StructureToByteArrayLittleEndian(cmdPkt);
var buf = new byte[cmdPkt.hdr.len];
byte[] buf = new byte[cmdPkt.hdr.len];
Array.Copy(pktBuf, 0, buf, 0, Marshal.SizeOf<AaruPacketCmdAtaLba28>());
@@ -780,7 +780,7 @@ public class Remote : IDisposable
return -1;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -872,7 +872,7 @@ public class Remote : IDisposable
cmdPkt.hdr.len = (uint)(Marshal.SizeOf<AaruPacketCmdAtaLba48>() + cmdPkt.buf_len);
byte[] pktBuf = Marshal.StructureToByteArrayLittleEndian(cmdPkt);
var buf = new byte[cmdPkt.hdr.len];
byte[] buf = new byte[cmdPkt.hdr.len];
Array.Copy(pktBuf, 0, buf, 0, Marshal.SizeOf<AaruPacketCmdAtaLba48>());
@@ -887,7 +887,7 @@ public class Remote : IDisposable
return -1;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -985,7 +985,7 @@ public class Remote : IDisposable
cmdPkt.hdr.len = (uint)(Marshal.SizeOf<AaruPacketCmdSdhci>() + cmdPkt.command.buf_len);
byte[] pktBuf = Marshal.StructureToByteArrayLittleEndian(cmdPkt);
var buf = new byte[cmdPkt.hdr.len];
byte[] buf = new byte[cmdPkt.hdr.len];
Array.Copy(pktBuf, 0, buf, 0, Marshal.SizeOf<AaruPacketCmdSdhci>());
@@ -1000,7 +1000,7 @@ public class Remote : IDisposable
return -1;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1081,7 +1081,7 @@ public class Remote : IDisposable
return DeviceType.Unknown;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1160,7 +1160,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1286,7 +1286,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1378,7 +1378,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1459,7 +1459,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1514,7 +1514,7 @@ public class Remote : IDisposable
/// <returns>Retrieved number of bytes</returns>
static int Receive(Socket socket, byte[] buffer, int size, SocketFlags socketFlags)
{
var offset = 0;
int offset = 0;
while(size > 0)
{
@@ -1591,7 +1591,7 @@ public class Remote : IDisposable
}
};
var buf = new byte[packetSize];
byte[] buf = new byte[packetSize];
byte[] tmp = Marshal.StructureToByteArrayLittleEndian(packet);
Array.Copy(tmp, 0, buf, 0, tmp.Length);
@@ -1634,7 +1634,7 @@ public class Remote : IDisposable
return -1;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1685,7 +1685,7 @@ public class Remote : IDisposable
off = Marshal.SizeOf<AaruPacketMultiCmdSdhci>();
var error = 0;
int error = 0;
foreach(Devices.Device.MmcSingleCommand command in commands)
{
@@ -1727,7 +1727,7 @@ public class Remote : IDisposable
{
sense = false;
duration = 0;
var error = 0;
int error = 0;
foreach(Devices.Device.MmcSingleCommand command in commands)
{
@@ -1781,7 +1781,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);
@@ -1883,7 +1883,7 @@ public class Remote : IDisposable
return false;
}
var hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
byte[] hdrBuf = new byte[Marshal.SizeOf<AaruPacketHeader>()];
len = Receive(_socket, hdrBuf, hdrBuf.Length, SocketFlags.Peek);