Package io.helins.linux.i2c
Class SMBus.Block
- java.lang.Object
-
- io.helins.linux.i2c.SMBus.Block
-
-
Field Summary
Fields Modifier and Type Field Description static intSIZEThe length of a buffer.
-
Constructor Summary
Constructors Constructor Description Block()Allocates a block.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SMBus.Blockclear()Fills the block with 0.intget(int index)Retrieves the byte at the given position.intlength()Retrieves the current length of this block.SMBus.Blockset(int index, int b)Sets the byte at the given position.
-
-
-
Field Detail
-
SIZE
public static final int SIZE
The length of a buffer.- See Also:
- Constant Field Values
-
-
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.
-
-