From ee3702e44de1782f689535f84690154d59fac58e Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 19 Oct 2019 18:28:05 +0100 Subject: [PATCH] Fix returning from remote commands. --- DiscImageChef.Devices/Device/Commands.cs | 13 +++++++++---- DiscImageChef.Devices/Device/Constructor.cs | 4 ++-- DiscImageChef.Devices/Remote/Remote.cs | 18 +++++++++--------- DiscImageChef.sln.DotSettings | 1 + 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/DiscImageChef.Devices/Device/Commands.cs b/DiscImageChef.Devices/Device/Commands.cs index 0bfc131e7..1e5d9a117 100644 --- a/DiscImageChef.Devices/Device/Commands.cs +++ b/DiscImageChef.Devices/Device/Commands.cs @@ -86,7 +86,12 @@ namespace DiscImageChef.Devices uint timeout, bool transferBlocks, out double duration, out bool sense) { - if (!(remote is null)) throw new NotImplementedException("Remote CHS ATA commands not yet implemented..."); + if (!(remote is null)) + return remote.SendAtaCommand(registers, out errorRegisters, + protocol, transferRegister, + ref buffer, + timeout, transferBlocks, + out duration, out sense); return Command.SendAtaCommand(PlatformId, FileHandle, registers, out errorRegisters, protocol, transferRegister, @@ -116,7 +121,7 @@ namespace DiscImageChef.Devices out double duration, out bool sense) { if (!(remote is null)) - remote.SendAtaCommand(registers, out errorRegisters, + return remote.SendAtaCommand(registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, @@ -150,7 +155,7 @@ namespace DiscImageChef.Devices out double duration, out bool sense) { if (!(remote is null)) - remote.SendAtaCommand(registers, out errorRegisters, + return remote.SendAtaCommand(registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, @@ -232,7 +237,7 @@ namespace DiscImageChef.Devices } if (!(remote is null)) - remote.SendMmcCommand(command, write, isApplication, flags, + return remote.SendMmcCommand(command, write, isApplication, flags, argument, blockSize, blocks, ref buffer, out response, out duration, out sense, timeout); diff --git a/DiscImageChef.Devices/Device/Constructor.cs b/DiscImageChef.Devices/Device/Constructor.cs index f23c040d3..91742536d 100644 --- a/DiscImageChef.Devices/Device/Constructor.cs +++ b/DiscImageChef.Devices/Device/Constructor.cs @@ -578,7 +578,7 @@ namespace DiscImageChef.Devices if (!(remote is null)) { - if (remote.GetFirewireData(out firewireVendor, out firewireModel, + if (remote.GetFireWireData(out firewireVendor, out firewireModel, out firewireGuid, out var remoteFireWireVendorName, out var remoteFireWireModelName)) { IsFireWire = true; @@ -656,7 +656,7 @@ namespace DiscImageChef.Devices #region PCMCIA - if(remote is null) + if (remote is null) { if (PlatformId == PlatformID.Linux) { diff --git a/DiscImageChef.Devices/Remote/Remote.cs b/DiscImageChef.Devices/Remote/Remote.cs index b26a437c9..aec0bb48b 100644 --- a/DiscImageChef.Devices/Remote/Remote.cs +++ b/DiscImageChef.Devices/Remote/Remote.cs @@ -248,9 +248,9 @@ namespace DiscImageChef.Devices.Remote return devices.ToArray(); } - public bool Open(string devicePath, out int LastError) + public bool Open(string devicePath, out int lastError) { - LastError = 0; + lastError = 0; var cmdPkt = new DicPacketCommandOpenDevice { @@ -271,7 +271,7 @@ namespace DiscImageChef.Devices.Remote if (len != buf.Length) { DicConsole.ErrorWriteLine("Could not write to the network..."); - LastError = -1; + lastError = -1; return false; } @@ -282,7 +282,7 @@ namespace DiscImageChef.Devices.Remote if (len < hdrBuf.Length) { DicConsole.ErrorWriteLine("Could not read from the network..."); - LastError = -1; + lastError = -1; return false; } @@ -291,7 +291,7 @@ namespace DiscImageChef.Devices.Remote if (hdr.id != Consts.PacketId) { DicConsole.ErrorWriteLine("Received data is not a DIC Remote Packet..."); - LastError = -1; + lastError = -1; return false; } @@ -299,7 +299,7 @@ namespace DiscImageChef.Devices.Remote { DicConsole.ErrorWriteLine("Expected List Devices Response Packet, got packet type {0}...", hdr.packetType); - LastError = -1; + lastError = -1; return false; } @@ -309,7 +309,7 @@ namespace DiscImageChef.Devices.Remote if (len < buf.Length) { DicConsole.ErrorWriteLine("Could not read from the network..."); - LastError = -1; + lastError = -1; return false; } @@ -324,7 +324,7 @@ namespace DiscImageChef.Devices.Remote } DicConsole.ErrorWriteLine($"{nop.reason}"); - LastError = nop.errno; + lastError = nop.errno; return false; } @@ -1038,7 +1038,7 @@ namespace DiscImageChef.Devices.Remote return true; } - public bool GetFirewireData(out uint idVendor, out uint idProduct, + public bool GetFireWireData(out uint idVendor, out uint idProduct, out ulong guid, out string vendor, out string model) { idVendor = 0; diff --git a/DiscImageChef.sln.DotSettings b/DiscImageChef.sln.DotSettings index 7ee47182f..2d744b001 100644 --- a/DiscImageChef.sln.DotSettings +++ b/DiscImageChef.sln.DotSettings @@ -188,5 +188,6 @@ True True True + True True True \ No newline at end of file