2017-05-28 21:01:17 +01:00
|
|
|
|
// /***************************************************************************
|
|
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : USB.cs
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2017-05-28 21:01:17 +01:00
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Component : Core algorithms.
|
2017-05-28 21:01:17 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Creates reports from USB devices.
|
2017-05-28 21:01:17 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
|
// it under the terms of the GNU General Public License as
|
|
|
|
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program 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 General Public License for more details.
|
|
|
|
|
|
//
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2018-12-29 17:34:38 +00:00
|
|
|
|
// Copyright © 2011-2019 Natalia Portillo
|
2017-05-28 21:01:17 +01:00
|
|
|
|
// ****************************************************************************/
|
2017-12-19 03:50:57 +00:00
|
|
|
|
|
2018-06-25 19:08:16 +01:00
|
|
|
|
using DiscImageChef.CommonTypes.Metadata;
|
2017-05-28 21:01:17 +01:00
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Core.Devices.Report
|
|
|
|
|
|
{
|
2017-12-23 01:46:08 +00:00
|
|
|
|
/// <summary>
|
2017-12-23 17:41:23 +00:00
|
|
|
|
/// Implements creating a report for a USB device
|
2017-12-23 01:46:08 +00:00
|
|
|
|
/// </summary>
|
2018-11-25 18:28:57 +00:00
|
|
|
|
public partial class DeviceReport
|
2017-05-28 21:01:17 +01:00
|
|
|
|
{
|
2017-12-23 01:46:08 +00:00
|
|
|
|
/// <summary>
|
2017-12-23 17:41:23 +00:00
|
|
|
|
/// Fills a device report with parameters specific to a USB device
|
2017-12-23 01:46:08 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="dev">Device</param>
|
|
|
|
|
|
/// <param name="report">Device report</param>
|
|
|
|
|
|
/// <param name="removable">If device is removable</param>
|
|
|
|
|
|
/// <param name="debug">If debug is enabled</param>
|
2018-11-25 18:28:57 +00:00
|
|
|
|
public Usb UsbReport()
|
2017-05-28 21:01:17 +01:00
|
|
|
|
{
|
2018-11-25 18:28:57 +00:00
|
|
|
|
Usb usbReport = new Usb
|
2017-12-21 23:00:30 +00:00
|
|
|
|
{
|
|
|
|
|
|
Manufacturer = dev.UsbManufacturerString,
|
2018-06-22 08:08:38 +01:00
|
|
|
|
Product = dev.UsbProductString,
|
|
|
|
|
|
ProductID = dev.UsbProductId,
|
|
|
|
|
|
VendorID = dev.UsbVendorId
|
2017-12-21 23:00:30 +00:00
|
|
|
|
};
|
2017-05-28 21:01:17 +01:00
|
|
|
|
|
2018-11-25 18:28:57 +00:00
|
|
|
|
if(debug) usbReport.Descriptors = dev.UsbDescriptors;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2018-11-25 18:28:57 +00:00
|
|
|
|
return usbReport;
|
2017-05-28 21:01:17 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|