// /*************************************************************************** // The Disc Image Chef // ---------------------------------------------------------------------------- // // Filename : Variables.cs // Author(s) : Natalia Portillo // // Component : Direct device access. // // --[ Description ] ---------------------------------------------------------- // // Contains various device variables. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2019 Natalia Portillo // ****************************************************************************/ using DiscImageChef.CommonTypes.Enums; using DiscImageChef.CommonTypes.Interop; using DiscImageChef.Decoders.SCSI; namespace DiscImageChef.Devices { public partial class Device { readonly ushort usbVendor; readonly ushort usbProduct; readonly ulong firewireGuid; readonly uint firewireModel; readonly uint firewireVendor; // MMC and SecureDigital, values that need to be get with card idle, something that may // not be possible to do but usually is already done by the SDHCI driver. readonly byte[] cachedCsd; readonly byte[] cachedCid; readonly byte[] cachedScr; readonly byte[] cachedOcr; /// /// Gets the Platform ID for this device /// /// The Platform ID public PlatformID PlatformId { get; } /// /// Gets the file handle representing this device /// /// The file handle public object FileHandle { get; private set; } /// /// Gets or sets the standard timeout for commands sent to this device /// /// The timeout in seconds public uint Timeout { get; } /// /// Gets a value indicating whether this is in error. /// /// true if error; otherwise, false. public bool Error { get; private set; } /// /// Gets the last error number. /// /// The last error. public int LastError { get; private set; } /// /// Gets the device type. /// /// The device type. public DeviceType Type { get; } /// /// Gets the device's manufacturer /// /// The manufacturer. public string Manufacturer { get; } /// /// Gets the device model /// /// The model. public string Model { get; } /// /// Gets the device's revision. /// /// The revision. public string Revision { get; } /// /// Gets the device's serial number. /// /// The serial number. public string Serial { get; } /// /// Gets the device's SCSI peripheral device type /// /// The SCSI peripheral device type. public PeripheralDeviceTypes ScsiType { get; } /// /// Gets a value indicating whether this device's media is removable. /// /// true if this device's media is removable; otherwise, false. public bool IsRemovable { get; } /// /// Gets a value indicating whether this device is attached via USB. /// /// true if this device is attached via USB; otherwise, false. public bool IsUsb { get; } /// /// Gets the USB vendor ID. /// /// The USB vendor ID. public ushort UsbVendorId => usbVendor; /// /// Gets the USB product ID. /// /// The USB product ID. public ushort UsbProductId => usbProduct; /// /// Gets the USB descriptors. /// /// The USB descriptors. public byte[] UsbDescriptors { get; } /// /// Gets the USB manufacturer string. /// /// The USB manufacturer string. public string UsbManufacturerString { get; } /// /// Gets the USB product string. /// /// The USB product string. public string UsbProductString { get; } /// /// Gets the USB serial string. /// /// The USB serial string. public string UsbSerialString { get; } /// /// Gets a value indicating whether this device is attached via FireWire. /// /// true if this device is attached via FireWire; otherwise, false. public bool IsFireWire { get; } /// /// Gets the FireWire GUID /// /// The FireWire GUID. public ulong FireWireGuid => firewireGuid; /// /// Gets the FireWire model number /// /// The FireWire model. public uint FireWireModel => firewireModel; /// /// Gets the FireWire model name. /// /// The FireWire model name. public string FireWireModelName { get; } /// /// Gets the FireWire vendor number. /// /// The FireWire vendor number. public uint FireWireVendor => firewireVendor; /// /// Gets the FireWire vendor name. /// /// The FireWire vendor name. public string FireWireVendorName { get; } /// /// Gets a value indicating whether this device is a CompactFlash device. /// /// true if this device is a CompactFlash device; otherwise, false. public bool IsCompactFlash { get; } /// /// Gets a value indicating whether this device is a PCMCIA device. /// /// true if this device is a PCMCIA device; otherwise, false. public bool IsPcmcia { get; } /// /// Contains the PCMCIA CIS if applicable /// public byte[] Cis { get; } } }