// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // 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-2025 Natalia Portillo // ****************************************************************************/ using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Interop; using Aaru.CommonTypes.Structs.Devices.SCSI; namespace Aaru.Devices; public partial class Device { const string ATA_MODULE_NAME = "ATA Device"; const string SCSI_MODULE_NAME = "SCSI Device"; const string SD_MODULE_NAME = "SecureDigital Device"; const string MMC_MODULE_NAME = "MultiMediaCard Device"; /// Gets the Platform ID for this device /// The Platform ID public PlatformID PlatformId { get; private protected set; } /// Gets or sets the standard timeout for commands sent to this device /// The timeout in seconds public uint Timeout { get; set; } /// Gets a value indicating whether this is in error. /// true if error; otherwise, false. public bool Error { get; private protected set; } /// Gets the last error number. /// The last error. public int LastError { get; private protected set; } /// Gets the device type. /// The device type. public DeviceType Type { get; private protected set; } /// Gets the device's manufacturer /// The manufacturer. public string Manufacturer { get; private protected set; } /// Gets the device model /// The model. public string Model { get; private protected set; } /// Gets the device's firmware version. /// The firmware version. public string FirmwareRevision { get; private protected set; } /// Gets the device's serial number. /// The serial number. public string Serial { get; private protected set; } /// Gets the device's SCSI peripheral device type /// The SCSI peripheral device type. public PeripheralDeviceTypes ScsiType { get; private protected set; } /// 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; private protected set; } /// 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; private protected set; } /// 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; private protected set; } /// Gets the USB manufacturer string. /// The USB manufacturer string. public string UsbManufacturerString { get; private protected set; } /// Gets the USB product string. /// The USB product string. public string UsbProductString { get; private protected set; } /// Gets the USB serial string. /// The USB serial string. public string UsbSerialString { get; private protected set; } /// 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; private protected set; } /// 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; private protected set; } /// 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; private protected set; } /// 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; private set; } /// 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; private protected set; } /// Contains the PCMCIA CIS if applicable public byte[] Cis { get; private protected set; } // 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. #pragma warning disable PH2070 // Risks are known. TODO: Maybe protected property? private protected byte[] CachedCid; private protected byte[] CachedCsd; private protected byte[] CachedOcr; private protected byte[] CachedScr; private protected string DevicePath; private protected ulong FirewireGuid; private protected uint FirewireModel; private protected uint FirewireVendor; private protected ushort UsbProduct; private protected ushort UsbVendor; #pragma warning restore PH2070 }