PrimoBurner(tm) for C++  4.7
CD, DVD and Blu-ray Software Development Kit
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
ScsiInterface Class Referenceabstract

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

#include <PrimoScsi2.h>

Inherits Reference.

Public Member Functions

virtual int32_t error ()=0
 Gets the error code for the last operation that failed. More...
 
virtual void getSense (ScsiCommandSense *sense)=0
 Gets SCSI sense data that results from a command sent with the ScsiInterface::sendCommand method. More...
 
virtual const char_t * getSenseMessage (const ScsiCommandSense *sense)=0
 Gets the description of a SCSI sense code. More...
 
virtual bool_t sendCommand (const void *cdb, int32_t cdbLength, ScsiCommandDirection::Enum direction=ScsiCommandDirection::Unspecified, void *dataBuffer=NULL, int32_t dataBufferLength=0, int32_t commandTimeoutMs=ScsiCommandTimeout::Long)=0
 Sends a SCSI command to a device. More...
 
virtual int32_t systemError ()=0
 Gets the OS specific error for the last operation that failed. More...
 
virtual int32_t systemErrorFacility ()=0
 Gets the system error domain for the last system error. More...
 
- Public Member Functions inherited from Reference
virtual int32_t release () const =0
 Releases the instance. More...
 
virtual int32_t retain () const =0
 Retains the instance. More...
 
virtual int32_t retainCount () const =0
 Returns the current reference count. More...
 

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.

WARNING. USE WITH 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

virtual int32_t error ( )
pure virtual

Gets the error code for the last operation that failed.

Use the ScsiInterface::sense method to obtain additional the SCSI sense data.

Returns
A constant from the ScsiInterfaceError enumeration.
See Also
ScsiInterfaceError::Enum
virtual void getSense ( ScsiCommandSense sense)
pure virtual

Gets SCSI sense data that results from a command sent with the ScsiInterface::sendCommand method.

Use this method when the ScsiInterface::error returns ScsiInterfaceError::CheckSense

Parameters
sense[out] A pointer to ScsiCommandSense structure that receives the SCSI sense data.
virtual const char_t* getSenseMessage ( const ScsiCommandSense sense)
pure virtual

Gets the description of a SCSI sense code.

Note: In case the error described by the input parameter is not recognized, the method returns NULL. The returned pointer is valid until a second call to ScsiInterface::senseMessage method or the ScsiInterface object is destroyed.

Parameters
sense[in] A pointer to ScsiCommandSense structure. It specifies the SCSI sense code whose description is to be returned.
Returns
A zero-terminated string containing the SCSI sense code description. Can be NULL if the specified sense is unknown. The returned pointer is valid until the next call to ScsiInterface::senseMessage method or the ScsiInterface object is released.
virtual bool_t sendCommand ( const void *  cdb,
int32_t  cdbLength,
ScsiCommandDirection::Enum  direction = ScsiCommandDirection::Unspecified,
void *  dataBuffer = NULL,
int32_t  dataBufferLength = 0,
int32_t  commandTimeoutMs = ScsiCommandTimeout::Long 
)
pure virtual

Sends a SCSI command to a device.

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

The following MMC commands are available only in the commercial edition of PrimoBurner(tm) Engine and are ignored (not sent) by the demo version: SET STREAMING Command - Operation Code (0xB6) SET CD SPEED Command - Operation Code (0xBB)

Parameters
cdbSpecifies the SCSI command descriptor block to be sent to the target device.
cdbLengthIndicates the size in bytes of the SCSI command descriptor block.
directionIndicates whether the SCSI command will read or write data. This field must have one of three values defined in EScsiCommandDirection.
dataBufferPointer to the data buffer.
dataBufferLengthIndicates the size in bytes of the data buffer.
commandTimeoutMsIndicates the interval in milliseconds that the request can execute before the engine might consider it timed out.
Returns
1 Success.
0 Error.
virtual int32_t systemError ( )
pure virtual

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

Use this method when the ScsiInterface::error method returns ScsiInterfaceError::SystemError.

Returns
OS error code.
See Also
primo::error::ErrorFacility
virtual int32_t systemErrorFacility ( )
pure virtual

Gets the system error domain for the last system error.

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

Returns
A constant from the primo::error::ErrorFacility namespace.
See Also
primo::error::ErrorFacility