mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Added XML documentation.
This commit is contained in:
@@ -41,6 +41,17 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
public partial class Device
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends a SCSI command to this device
|
||||
/// </summary>
|
||||
/// <returns>0 if no error occurred, otherwise, errno</returns>
|
||||
/// <param name="cdb">SCSI CDB</param>
|
||||
/// <param name="buffer">Buffer for SCSI command response</param>
|
||||
/// <param name="senseBuffer">Buffer with the SCSI sense</param>
|
||||
/// <param name="timeout">Timeout in seconds</param>
|
||||
/// <param name="direction">SCSI command transfer direction</param>
|
||||
/// <param name="duration">Time it took to execute the command in milliseconds</param>
|
||||
/// <param name="sense"><c>True</c> if SCSI error returned non-OK status and <paramref name="senseBuffer"/> contains SCSI sense</param>
|
||||
public int SendScsiCommand(byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, Enums.ScsiDirection direction, out double duration, out bool sense)
|
||||
{
|
||||
return Command.SendScsiCommand(platformID, fd, cdb, ref buffer, out senseBuffer, timeout, direction, out duration, out sense);
|
||||
|
||||
@@ -42,6 +42,10 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
public partial class Device
|
||||
{
|
||||
/// <summary>
|
||||
/// Opens the device for sending direct commands
|
||||
/// </summary>
|
||||
/// <param name="devicePath">Device path</param>
|
||||
public Device(string devicePath)
|
||||
{
|
||||
platformID = Interop.DetectOS.GetRealPlatformID();
|
||||
|
||||
@@ -42,6 +42,10 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
public partial class Device
|
||||
{
|
||||
/// <summary>
|
||||
/// Releases unmanaged resources and performs other cleanup operations before the
|
||||
/// <see cref="DiscImageChef.Devices.Device"/> is reclaimed by garbage collection.
|
||||
/// </summary>
|
||||
~Device()
|
||||
{
|
||||
if (fd != null)
|
||||
|
||||
@@ -41,22 +41,50 @@ namespace DiscImageChef.Devices
|
||||
{
|
||||
public partial class Device
|
||||
{
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer)
|
||||
{
|
||||
return ScsiInquiry(out buffer, out senseBuffer, Timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, out double duration)
|
||||
{
|
||||
return ScsiInquiry(out buffer, out senseBuffer, Timeout, out duration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, uint timeout)
|
||||
{
|
||||
double duration;
|
||||
return ScsiInquiry(out buffer, out senseBuffer, timeout, out duration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, uint timeout, out double duration)
|
||||
{
|
||||
buffer = new byte[5];
|
||||
@@ -80,22 +108,54 @@ namespace DiscImageChef.Devices
|
||||
return sense;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device with an Extended Vital Product Data page using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="page">The Extended Vital Product Data</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page)
|
||||
{
|
||||
return ScsiInquiry(out buffer, out senseBuffer, page, Timeout);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device with an Extended Vital Product Data page using default device timeout.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="page">The Extended Vital Product Data</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page, out double duration)
|
||||
{
|
||||
return ScsiInquiry(out buffer, out senseBuffer, page, Timeout, out duration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device with an Extended Vital Product Data page.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="page">The Extended Vital Product Data</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page, uint timeout)
|
||||
{
|
||||
double duration;
|
||||
return ScsiInquiry(out buffer, out senseBuffer, page, timeout, out duration);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sends the SCSI INQUIRY command to the device with an Extended Vital Product Data page.
|
||||
/// </summary>
|
||||
/// <returns><c>true</c> if the command failed and <paramref name="senseBuffer"/> contains the sense buffer.</returns>
|
||||
/// <param name="buffer">Buffer where the SCSI INQUIRY response will be stored</param>
|
||||
/// <param name="senseBuffer">Sense buffer.</param>
|
||||
/// <param name="timeout">Timeout in seconds.</param>
|
||||
/// <param name="duration">Duration in milliseconds it took for the device to execute the command.</param>
|
||||
/// <param name="page">The Extended Vital Product Data</param>
|
||||
public bool ScsiInquiry(out byte[] buffer, out byte[] senseBuffer, byte page, uint timeout, out double duration)
|
||||
{
|
||||
buffer = new byte[5];
|
||||
|
||||
@@ -45,6 +45,10 @@ namespace DiscImageChef.Devices
|
||||
Interop.PlatformID platformID;
|
||||
object fd;
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Platform ID for this device
|
||||
/// </summary>
|
||||
/// <value>The Platform ID</value>
|
||||
public Interop.PlatformID PlatformID
|
||||
{
|
||||
get
|
||||
@@ -53,6 +57,10 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the file handle representing this device
|
||||
/// </summary>
|
||||
/// <value>The file handle</value>
|
||||
public object FileHandle
|
||||
{
|
||||
get
|
||||
@@ -61,6 +69,10 @@ namespace DiscImageChef.Devices
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the standard timeout for commands sent to this device
|
||||
/// </summary>
|
||||
/// <value>The timeout in seconds</value>
|
||||
public uint Timeout
|
||||
{
|
||||
get;
|
||||
|
||||
Reference in New Issue
Block a user