PrimoBurner for .NET  5.0
CD, DVD and Blu-ray Software Development Kit
Loading...
Searching...
No Matches
ScsiInterface Class Reference

Allows an application to send SCSI command to a device. More...

Inherits IDisposable.

Public Member Functions

void Dispose ()
 Disposes ScsiInterface and reclaims the resources used by the object.
 
string GetSenseMessage (ScsiCommandSense sense)
 Gets the error message for the specified SCSI command sense.
 
bool SendCommand (byte[] command)
 Sends a SCSI command to a device.
 
bool SendCommand (byte[] command, ScsiCommandDirection direction, byte[] dataBuffer)
 Sends a SCSI command to a device.
 
bool SendCommand (byte[] command, ScsiCommandDirection direction, byte[] dataBuffer, Int32 commandTimeout)
 Sends a SCSI command to a device.
 

Properties

Int32 Error [get]
 Gets the error code for the last operation that failed.
 
ScsiCommandSense Sense [get]
 Gets SCSI sense data that results from a command sent with the SendCommand method.
 
Int32 SystemError [get]
 Gets the OS specific error for the last operation that failed.
 
ErrorFacility SystemErrorFacility [get]
 Gets the system error facility for the last system error.
 

Detailed Description

Allows an application to send SCSI command to a device.

The calling application creates the SCSI command descriptor block, which contains the operation code and the parameters of the command that should be executed.

CAUTION:

Using this interface requires thorough understanding of SCSI-2 and Multi-Media Commands specifications. Improper use may lead to errors and data loss.

Member Function Documentation

◆ GetSenseMessage()

string GetSenseMessage ( ScsiCommandSense  sense)

Gets the error message for the specified SCSI command sense.

Parameters
senseSpecifies the SCSI command sense which description is to be returned
Returns
A string describing the specified Scsi sense .
Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.

◆ SendCommand() [1/3]

bool SendCommand ( byte[]  command)

Sends a SCSI command to a device.

The SCSI command is sent directly to the device without any changes.

Parameters
commandSpecifies the SCSI command descriptor block to be sent to the target device.
Returns
If successful returns true, otherwise returns false.
Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.

References ScsiInterface.SendCommand().

Referenced by ScsiInterface.SendCommand(), and ScsiInterface.SendCommand().

◆ SendCommand() [2/3]

bool SendCommand ( byte[]  command,
ScsiCommandDirection  direction,
byte[]  dataBuffer 
)

Sends a SCSI command to a device.

The SCSI command is sent directly to the device without any changes.

Parameters
commandSpecifies the SCSI command descriptor block to be sent to the target device.
directionIndicates whether the SCSI command will read or write data. The default command direction is ScsiCommandDirection.
dataBufferData Buffer. When the direction parameter is set to ScsiCommandDirection.Read this parameter will receive upon success the data reported by the device. When the direction parameter is set to ScsiCommandDirection.Write this parameter should contain will the data to write to the device.
Returns
If successful returns true, otherwise returns false.
Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.

References ScsiInterface.SendCommand().

◆ SendCommand() [3/3]

bool SendCommand ( byte[]  command,
ScsiCommandDirection  direction,
byte[]  dataBuffer,
Int32  commandTimeout 
)

Sends a SCSI command to a device.

The SCSI command is sent directly to the device without any changes.

Parameters
commandSpecifies the SCSI command descriptor block to be sent to the target device.
directionIndicates whether the SCSI command will read or write data. The default command direction is ScsiCommandDirection.
dataBufferData Buffer. When the direction parameter is set to ScsiCommandDirection.Read this parameter will receive upon success the data reported by the device. When the direction parameter is set to ScsiCommandDirection.Write this parameter should contain will the data to write to the device.
commandTimeoutIndicates the interval in milliseconds that the request can execute before the engine might consider it timed out. The default command timeout is 3 minutes.
Returns
If successful returns true, otherwise returns false.
Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.

Property Documentation

◆ Error

Int32 Error
get

Gets the error code for the last operation that failed.

See also
ScsiInterfaceError
Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.

◆ Sense

ScsiCommandSense Sense
get

Gets SCSI sense data that results from a command sent with the SendCommand method.

Use this property when the Error property returns ScsiInterfaceError.CheckSense

Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.
See also
ScsiInterfaceError

◆ SystemError

Int32 SystemError
get

Gets the OS specific error for the last operation that failed.

Use this method when the ScsiInterface.Error method returns ScsiInterfaceError.SystemError.

Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.
See also
ScsiInterfaceError, ErrorFacility

◆ SystemErrorFacility

ErrorFacility SystemErrorFacility
get

Gets the system error facility for the last system error.

The error code returned by SystemError must be interpreted in terms of the system error facility.

Returns
A constant from the ErrorFacility enumeration.
Exceptions
ObjectDisposedExceptionThe ScsiInterface object was already disposed.
See also
ErrorFacility