Refactor remote variable name.

This commit is contained in:
2019-10-21 23:39:04 +01:00
parent 8a0d073c27
commit a1398d1b2c
3 changed files with 29 additions and 29 deletions

View File

@@ -56,8 +56,8 @@ namespace DiscImageChef.Devices
public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout,
ScsiDirection direction, out double duration, out bool sense) ScsiDirection direction, out double duration, out bool sense)
{ {
if (!(remote is null)) if (!(_remote is null))
return remote.SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout, return _remote.SendScsiCommand(cdb, ref buffer, out senseBuffer, timeout,
direction, out duration, out sense); direction, out duration, out sense);
return Command.SendScsiCommand(PlatformId, FileHandle, cdb, ref buffer, out senseBuffer, timeout, direction, return Command.SendScsiCommand(PlatformId, FileHandle, cdb, ref buffer, out senseBuffer, timeout, direction,
@@ -86,8 +86,8 @@ namespace DiscImageChef.Devices
uint timeout, bool transferBlocks, uint timeout, bool transferBlocks,
out double duration, out bool sense) out double duration, out bool sense)
{ {
if (!(remote is null)) if (!(_remote is null))
return remote.SendAtaCommand(registers, out errorRegisters, return _remote.SendAtaCommand(registers, out errorRegisters,
protocol, transferRegister, protocol, transferRegister,
ref buffer, ref buffer,
timeout, transferBlocks, timeout, transferBlocks,
@@ -120,8 +120,8 @@ namespace DiscImageChef.Devices
uint timeout, bool transferBlocks, uint timeout, bool transferBlocks,
out double duration, out bool sense) out double duration, out bool sense)
{ {
if (!(remote is null)) if (!(_remote is null))
return remote.SendAtaCommand(registers, out errorRegisters, return _remote.SendAtaCommand(registers, out errorRegisters,
protocol, transferRegister, protocol, transferRegister,
ref buffer, ref buffer,
timeout, transferBlocks, timeout, transferBlocks,
@@ -154,8 +154,8 @@ namespace DiscImageChef.Devices
uint timeout, bool transferBlocks, uint timeout, bool transferBlocks,
out double duration, out bool sense) out double duration, out bool sense)
{ {
if (!(remote is null)) if (!(_remote is null))
return remote.SendAtaCommand(registers, out errorRegisters, return _remote.SendAtaCommand(registers, out errorRegisters,
protocol, transferRegister, protocol, transferRegister,
ref buffer, ref buffer,
timeout, transferBlocks, timeout, transferBlocks,
@@ -236,8 +236,8 @@ namespace DiscImageChef.Devices
} }
} }
if (!(remote is null)) if (!(_remote is null))
return remote.SendMmcCommand(command, write, isApplication, flags, return _remote.SendMmcCommand(command, write, isApplication, flags,
argument, argument,
blockSize, blocks, ref buffer, out response, blockSize, blocks, ref buffer, out response,
out duration, out sense, timeout); out duration, out sense, timeout);

View File

@@ -74,9 +74,9 @@ namespace DiscImageChef.Devices
var host = pieces[0]; var host = pieces[0];
devicePath = devicePath.Substring(host.Length); devicePath = devicePath.Substring(host.Length);
remote = new Remote.Remote(host); _remote = new Remote.Remote(host);
Error = !remote.Open(devicePath, out var errno); Error = !_remote.Open(devicePath, out var errno);
LastError = errno; LastError = errno;
} }
else else
@@ -162,7 +162,7 @@ namespace DiscImageChef.Devices
var scsiSense = true; var scsiSense = true;
if (remote is null) if (_remote is null)
{ {
// Windows is answering SCSI INQUIRY for all device types so it needs to be detected first // Windows is answering SCSI INQUIRY for all device types so it needs to be detected first
switch (PlatformId) switch (PlatformId)
@@ -400,7 +400,7 @@ namespace DiscImageChef.Devices
} }
else else
{ {
Type = remote.GetDeviceType(); Type = _remote.GetDeviceType();
switch (Type) switch (Type)
{ {
@@ -410,7 +410,7 @@ namespace DiscImageChef.Devices
break; break;
case DeviceType.SecureDigital: case DeviceType.SecureDigital:
case DeviceType.MMC: case DeviceType.MMC:
if (!remote.GetSdhciRegisters(out cachedCsd, out cachedCid, out cachedOcr, out cachedScr)) if (!_remote.GetSdhciRegisters(out cachedCsd, out cachedCid, out cachedOcr, out cachedScr))
{ {
Type = DeviceType.SCSI; Type = DeviceType.SCSI;
ScsiType = PeripheralDeviceTypes.DirectAccess; ScsiType = PeripheralDeviceTypes.DirectAccess;
@@ -451,7 +451,7 @@ namespace DiscImageChef.Devices
#region USB #region USB
if (remote is null) if (_remote is null)
{ {
switch (PlatformId) switch (PlatformId)
{ {
@@ -558,7 +558,7 @@ namespace DiscImageChef.Devices
} }
else else
{ {
if (remote.GetUsbData(out var remoteUsbDescriptors, out var remoteUsbVendor, if (_remote.GetUsbData(out var remoteUsbDescriptors, out var remoteUsbVendor,
out var remoteUsbProduct, out var remoteUsbManufacturer, out var remoteUsbProductString, out var remoteUsbProduct, out var remoteUsbManufacturer, out var remoteUsbProductString,
out var remoteUsbSerial)) out var remoteUsbSerial))
{ {
@@ -576,9 +576,9 @@ namespace DiscImageChef.Devices
#region FireWire #region FireWire
if (!(remote is null)) 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)) out firewireGuid, out var remoteFireWireVendorName, out var remoteFireWireModelName))
{ {
IsFireWire = true; IsFireWire = true;
@@ -656,7 +656,7 @@ namespace DiscImageChef.Devices
#region PCMCIA #region PCMCIA
if (remote is null) if (_remote is null)
{ {
if (PlatformId == PlatformID.Linux) if (PlatformId == PlatformID.Linux)
{ {
@@ -707,7 +707,7 @@ namespace DiscImageChef.Devices
} }
else else
{ {
if (remote.GetPcmciaData(out var cisBuf)) if (_remote.GetPcmciaData(out var cisBuf))
{ {
IsPcmcia = true; IsPcmcia = true;
Cis = cisBuf; Cis = cisBuf;

View File

@@ -218,14 +218,14 @@ namespace DiscImageChef.Devices
/// </summary> /// </summary>
public byte[] Cis { get; } public byte[] Cis { get; }
private readonly Remote.Remote remote; private readonly Remote.Remote _remote;
public bool IsRemote => remote != null; public bool IsRemote => _remote != null;
public string RemoteApplication => remote?.ServerApplication; public string RemoteApplication => _remote?.ServerApplication;
public string RemoteVersion => remote?.ServerVersion; public string RemoteVersion => _remote?.ServerVersion;
public string RemoteOperatingSystem => remote?.ServerOperatingSystem; public string RemoteOperatingSystem => _remote?.ServerOperatingSystem;
public string RemoteOperatingSystemVersion => remote?.ServerOperatingSystemVersion; public string RemoteOperatingSystemVersion => _remote?.ServerOperatingSystemVersion;
public string RemoteArchitecture => remote?.ServerArchitecture; public string RemoteArchitecture => _remote?.ServerArchitecture;
public int RemoteProtocolVersion => remote?.ServerProtocolVersion ?? 0; public int RemoteProtocolVersion => _remote?.ServerProtocolVersion ?? 0;
} }
} }