-
- All Implemented Interfaces:
public abstract class CommandBlockWrapperThis class represents the command block wrapper (CBW) which is always wrapped around a specific SCSI command in the SCSI transparent command set standard.
Every SCSI command shall extend this class, call the constructor .CommandBlockWrapper with the desired information. When transmitting the command, the .serialize method has to be called!
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumCommandBlockWrapper.DirectionThe direction of the data phase of the SCSI command.
public classCommandBlockWrapper.Companion
-
Field Summary
Fields Modifier and Type Field Description private IntegerdCbwTagprivate BytebmCbwFlagsprivate IntegerdCbwDataTransferLengthprivate final CommandBlockWrapper.Directiondirectionprivate final BytebCbwcbLengthprivate final BooleanbCbwDynamicSize
-
Method Summary
Modifier and Type Method Description final IntegergetDCbwTag()The tag which can be used to determine the corresponding CBW. final UnitsetDCbwTag(Integer dCbwTag)The tag which can be used to determine the corresponding CBW. final BytegetBmCbwFlags()final UnitsetBmCbwFlags(Byte bmCbwFlags)final IntegergetDCbwDataTransferLength()final UnitsetDCbwDataTransferLength(Integer dCbwDataTransferLength)final CommandBlockWrapper.DirectiongetDirection()Returns the direction in the data phase. final BytegetBCbwcbLength()The amount of bytes which should be transmitted in the data phase. final BooleangetBCbwDynamicSize()Unitserialize(ByteBuffer buffer)Serializes the command block wrapper for transmission. IntegerdynamicSizeFromPartialResponse(ByteBuffer buffer)Returns the data transfer length for (dynamic) messagesThis method should be overridden in subclasses whose data length changes as data is received (dynamic length messages). -
-
Method Detail
-
getDCbwTag
final Integer getDCbwTag()
The tag which can be used to determine the corresponding CBW.
-
setDCbwTag
final Unit setDCbwTag(Integer dCbwTag)
The tag which can be used to determine the corresponding CBW.
-
getBmCbwFlags
final Byte getBmCbwFlags()
-
setBmCbwFlags
final Unit setBmCbwFlags(Byte bmCbwFlags)
-
getDCbwDataTransferLength
final Integer getDCbwDataTransferLength()
-
setDCbwDataTransferLength
final Unit setDCbwDataTransferLength(Integer dCbwDataTransferLength)
-
getDirection
final CommandBlockWrapper.Direction getDirection()
Returns the direction in the data phase.
-
getBCbwcbLength
final Byte getBCbwcbLength()
The amount of bytes which should be transmitted in the data phase.
-
getBCbwDynamicSize
final Boolean getBCbwDynamicSize()
-
serialize
Unit serialize(ByteBuffer buffer)
Serializes the command block wrapper for transmission.
This method should be called in every subclass right before the specific SCSI command serializes itself to the buffer!
- Parameters:
buffer- The buffer were the serialized data should be copied to.
-
dynamicSizeFromPartialResponse
Integer dynamicSizeFromPartialResponse(ByteBuffer buffer)
Returns the data transfer length for (dynamic) messages
This method should be overridden in subclasses whose data length changes as data is received (dynamic length messages). The function returns the new total data transfer length.
- Parameters:
buffer- The buffer containing the received data so far.
-
-
-
-