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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • parseLEField

      public static long parseLEField​(byte[] pBuffer, int pStart, int pLength, boolean pSigned)
      Parse a littleEndian field.
      Parameters:
      pBuffer - the buffer to parse
      pStart - the start bit
      pLength - the bit length
      pSigned - 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 parse
      pStart - the start bit
      pLength - the bit length
      pSigned - 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 set
      pStart - the start bit
      pLength - the bit length
      pValue - 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 set
      pStart - the start bit
      pLength - the bit length
      pValue - 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 set
      pStart - the start bit
      pLength - 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 set
      pStart - the start bit
      pLength - the bit length