Package net.sourceforge.jarduino.util
Class ArduinoField
java.lang.Object
net.sourceforge.jarduino.util.ArduinoField
public final class ArduinoField extends Object
Field Parse/Set methods.
-
Method Summary
Modifier and Type Method Description static long
parseBEField(byte[] pBuffer, int pStart, int pLength, boolean pSigned)
Parse a bigEndian field.static long
parseLEField(byte[] pBuffer, int pStart, int pLength, boolean pSigned)
Parse a littleEndian field.static void
setBEField(byte[] pBuffer, int pStart, int pLength, long pValue)
Set a bigEndian field.static void
setBEFieldBits(byte[] pBuffer, int pStart, int pLength)
Set a bigEndian bitMap for field.static void
setLEField(byte[] pBuffer, int pStart, int pLength, long pValue)
Set a littleEndian field.static void
setLEFieldBits(byte[] pBuffer, int pStart, int pLength)
Set a littleEndian bitMap for field.
-
Method Details
-
parseLEField
public static long parseLEField(byte[] pBuffer, int pStart, int pLength, boolean pSigned)Parse a littleEndian field.- Parameters:
pBuffer
- the buffer to parsepStart
- the start bitpLength
- the bit lengthpSigned
- is the field signed?- Returns:
- the parsed value
-
parseBEField
public static long parseBEField(byte[] pBuffer, int pStart, int pLength, boolean pSigned)Parse a bigEndian field.- Parameters:
pBuffer
- the buffer to parsepStart
- the start bitpLength
- the bit lengthpSigned
- is the field signed?- Returns:
- the parsed value
-
setLEField
public static void setLEField(byte[] pBuffer, int pStart, int pLength, long pValue)Set a littleEndian field.- Parameters:
pBuffer
- the buffer to setpStart
- the start bitpLength
- the bit lengthpValue
- the value to set
-
setBEField
public static void setBEField(byte[] pBuffer, int pStart, int pLength, long pValue)Set a bigEndian field.- Parameters:
pBuffer
- the buffer to setpStart
- the start bitpLength
- the bit lengthpValue
- the value to set
-
setLEFieldBits
public static void setLEFieldBits(byte[] pBuffer, int pStart, int pLength)Set a littleEndian bitMap for field.- Parameters:
pBuffer
- the buffer to setpStart
- the start bitpLength
- the bit length
-
setBEFieldBits
public static void setBEFieldBits(byte[] pBuffer, int pStart, int pLength)Set a bigEndian bitMap for field.- Parameters:
pBuffer
- the buffer to setpStart
- the start bitpLength
- the bit length
-