public abstract class CommandBlockWrapper
extends java.lang.Object
Every SCSI command shall extend this class, call the constructor
CommandBlockWrapper(int, Direction, byte, byte) with the desired
information. When transmitting the command, the
serialize(ByteBuffer) method has to be called!
| Modifier and Type | Class and Description |
|---|---|
static class |
CommandBlockWrapper.Direction
The direction of the data phase of the SCSI command.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
dCbwDataTransferLength |
| Modifier | Constructor and Description |
|---|---|
protected |
CommandBlockWrapper(int transferLength,
CommandBlockWrapper.Direction direction,
byte lun,
byte cbwcbLength)
Constructs a new command block wrapper with the given information which
can than easily be serialized with
serialize(ByteBuffer). |
| Modifier and Type | Method and Description |
|---|---|
int |
getdCbwDataTransferLength()
Returns the amount of bytes which should be transmitted in the data
phase.
|
int |
getdCbwTag()
Returns the tag which can be used to determine the corresponding
CBW. |
CommandBlockWrapper.Direction |
getDirection()
Returns the direction in the data phase.
|
void |
serialize(java.nio.ByteBuffer buffer)
Serializes the command block wrapper for transmission.
|
void |
setdCbwTag(int dCbwTag)
Sets the tag which can be used to determine the corresponding
CBW. |
protected CommandBlockWrapper(int transferLength,
CommandBlockWrapper.Direction direction,
byte lun,
byte cbwcbLength)
serialize(ByteBuffer).transferLength - The bytes which should be transferred in the following data
phase (Zero if no data phase).direction - The direction the data shall be transferred in the data phase.
If there is no data phase it should be
#NONE
NONElun - The logical unit number the command is directed to.cbwcbLength - The length in bytes of the scsi command.public void serialize(java.nio.ByteBuffer buffer)
This method should be called in every subclass right before the specific SCSI command serializes itself to the buffer!
buffer - The buffer were the serialized data should be copied to.public int getdCbwTag()
CBW.#getdCswTag()public void setdCbwTag(int dCbwTag)
CBW.dCbwTag - The command block wrapper tag#getdCswTag()public int getdCbwDataTransferLength()
public CommandBlockWrapper.Direction getDirection()
Direction