Class CommandStatusWrapper
- java.lang.Object
-
- com.github.mjdev.libaums.driver.scsi.commands.CommandStatusWrapper
-
public class CommandStatusWrapper extends java.lang.ObjectThis class represents the command status wrapper (CSW) in the SCSI transparent command set standard, which is transmitted from the device to the host after the data phase (if any).
-
-
Field Summary
Fields Modifier and Type Field Description static intCOMMAND_FAILEDSCSI command could not be executed, host should issue an SCSI request sense.static intCOMMAND_PASSEDSCSI command has successfully been executed.static intPHASE_ERRORSCSI command could not be executed, host should issue a mass storage reset.static intSIZEEvery CSW has the same size.
-
Constructor Summary
Constructors Constructor Description CommandStatusWrapper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description bytegetbCswStatus()Returns the status of execution of the transmitted SCSI command.intgetdCswDataResidue()Returns the amount of bytes which has not been processed yet in the data phase.intgetdCswTag()Returns the tag which can be used to determine the correspondingCBW.voidread(java.nio.ByteBuffer buffer)Reads command block wrapper from the specified buffer and stores it into this object.
-
-
-
Field Detail
-
COMMAND_PASSED
public static final int COMMAND_PASSED
SCSI command has successfully been executed.- See Also:
- Constant Field Values
-
COMMAND_FAILED
public static final int COMMAND_FAILED
SCSI command could not be executed, host should issue an SCSI request sense.- See Also:
ScsiRequestSense, Constant Field Values
-
PHASE_ERROR
public static final int PHASE_ERROR
SCSI command could not be executed, host should issue a mass storage reset.- See Also:
- Constant Field Values
-
SIZE
public static final int SIZE
Every CSW has the same size.- See Also:
- Constant Field Values
-
-
Method Detail
-
read
public void read(java.nio.ByteBuffer buffer)
Reads command block wrapper from the specified buffer and stores it into this object.- Parameters:
buffer- The data where the command block wrapper is located.
-
getdCswTag
public int getdCswTag()
Returns the tag which can be used to determine the correspondingCBW.- Returns:
- The command status wrapper tag.
- See Also:
#getdCswTag()
-
getdCswDataResidue
public int getdCswDataResidue()
Returns the amount of bytes which has not been processed yet in the data phase.- Returns:
- The amount of bytes.
-
getbCswStatus
public byte getbCswStatus()
Returns the status of execution of the transmitted SCSI command.- Returns:
- The status.
- See Also:
#COMMAND_PASSED,#COMMAND_FAILED,#PHASE_ERROR
-
-