Class CommandBlockWrapper

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  CommandBlockWrapper.Direction
      The direction of the data phase of the SCSI command.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • dCbwDataTransferLength

        protected int dCbwDataTransferLength
    • Constructor Detail

      • CommandBlockWrapper

        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).
        Parameters:
        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 NONE
        lun - The logical unit number the command is directed to.
        cbwcbLength - The length in bytes of the scsi command.
    • Method Detail

      • serialize

        public void serialize​(java.nio.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.
      • getdCbwTag

        public int getdCbwTag()
        Returns the tag which can be used to determine the corresponding CBW.
        Returns:
        The command block wrapper tag.
        See Also:
        #getdCswTag()
      • setdCbwTag

        public void setdCbwTag​(int dCbwTag)
        Sets the tag which can be used to determine the corresponding CBW.
        Parameters:
        dCbwTag - The command block wrapper tag
        See Also:
        #getdCswTag()
      • getdCbwDataTransferLength

        public int getdCbwDataTransferLength()
        Returns the amount of bytes which should be transmitted in the data phase.
        Returns:
        The length in bytes.