Class SMBus.Block

  • Enclosing class:
    SMBus

    public static class SMBus.Block
    extends Object
    Class representing a block of bytes for SMBus operations.

    Such a buffer is limited to 32 bytes.

    • Constructor Detail

      • Block

        public Block()
        Allocates a block.
    • Method Detail

      • clear

        public SMBus.Block clear()
        Fills the block with 0.
        Returns:
        This instance.
      • length

        public int length()
        Retrieves the current length of this block.

        Setting a byte to an index adjusts the length of the block to the highest index.

        Returns:
        The length.
        See Also:
        set( int, int )
      • get

        public int get​(int index)
        Retrieves the byte at the given position.
        Parameters:
        index - Where.
        Returns:
        An unsigned byte.
      • set

        public SMBus.Block set​(int index,
                               int b)
        Sets the byte at the given position.

        The length of this block will be adjusted to reflect the highest index of a byte set by the user or by an SMBus operation.

        Parameters:
        index - Which one.
        b - An unsigned byte.
        Returns:
        This instance.