* DiscImageChef.Devices/Device/Constructor.cs:

Added support for USB on Linux.

	* DiscImageChef/Commands/DeviceInfo.cs:
	* DiscImageChef.Devices/Device/Variables.cs:
	  Added support for USB detection and metadata.

	* DiscImageChef.Devices/Linux/Extern.cs:
	* DiscImageChef.Devices/Linux/Command.cs:
	  Added readlink(3) support, for getting symlink destinations.
This commit is contained in:
2015-12-31 16:12:22 +00:00
parent da29ec63eb
commit eac5aae66c
7 changed files with 255 additions and 0 deletions

View File

@@ -53,6 +53,13 @@ namespace DiscImageChef.Devices
readonly string serial;
readonly Decoders.SCSI.PeripheralDeviceTypes scsiType;
readonly bool removable;
readonly bool usb;
readonly ushort usbVendor;
readonly ushort usbProduct;
readonly byte[] usbDescriptors;
readonly string usbManufacturerString;
readonly string usbProductString;
readonly string usbSerialString;
/// <summary>
/// Gets the Platform ID for this device
@@ -172,6 +179,10 @@ namespace DiscImageChef.Devices
}
}
/// <summary>
/// Gets the device's SCSI peripheral device type
/// </summary>
/// <value>The SCSI peripheral device type.</value>
public Decoders.SCSI.PeripheralDeviceTypes SCSIType
{
get
@@ -180,6 +191,10 @@ namespace DiscImageChef.Devices
}
}
/// <summary>
/// Gets a value indicating whether this device's media is removable.
/// </summary>
/// <value><c>true</c> if this device's media is removable; otherwise, <c>false</c>.</value>
public bool IsRemovable
{
get
@@ -187,6 +202,90 @@ namespace DiscImageChef.Devices
return removable;
}
}
/// <summary>
/// Gets a value indicating whether this device is attached via USB.
/// </summary>
/// <value><c>true</c> if this device is attached via USB; otherwise, <c>false</c>.</value>
public bool IsUSB
{
get
{
return usb;
}
}
/// <summary>
/// Gets the USB vendor ID.
/// </summary>
/// <value>The USB vendor ID.</value>
public ushort USBVendorID
{
get
{
return usbVendor;
}
}
/// <summary>
/// Gets the USB product ID.
/// </summary>
/// <value>The USB product ID.</value>
public ushort USBProductID
{
get
{
return usbProduct;
}
}
/// <summary>
/// Gets the USB descriptors.
/// </summary>
/// <value>The USB descriptors.</value>
public byte[] USBDescriptors
{
get
{
return usbDescriptors;
}
}
/// <summary>
/// Gets the USB manufacturer string.
/// </summary>
/// <value>The USB manufacturer string.</value>
public string USBManufacturerString
{
get
{
return usbManufacturerString;
}
}
/// <summary>
/// Gets the USB product string.
/// </summary>
/// <value>The USB product string.</value>
public string USBProductString
{
get
{
return usbProductString;
}
}
/// <summary>
/// Gets the USB serial string.
/// </summary>
/// <value>The USB serial string.</value>
public string USBSerialString
{
get
{
return usbSerialString;
}
}
}
}