Class HALUtil

java.lang.Object
org.wpilib.hardware.hal.JNIWrapper
org.wpilib.hardware.hal.HALUtil

public final class HALUtil extends JNIWrapper
Hardware Abstraction Layer (HAL) Utilities JNI Functions.
See Also:
  • "wpi/hal/HAL.h"
  • Field Details

  • Method Details

    • getSerialNumber

      public static String getSerialNumber()
      Returns the roboRIO serial number.
      Returns:
      The roboRIO serial number.
      See Also:
      • "HAL_GetSerialNumber"
    • getComments

      public static String getComments()
      Returns the comments from the roboRIO web interface.
      Returns:
      The comments string.
      See Also:
      • "HAL_GetComments"
    • getTeamNumber

      public static int getTeamNumber()
      Returns the team number configured for the robot controller.
      Returns:
      team number, or 0 if not found.
      See Also:
      • "HAL_GetTeamNumber"
    • getMonotonicTime

      public static long getMonotonicTime()
      Reads the microsecond-resolution monotonic timer.
      Returns:
      The current monotonic time in microseconds.
    • getHALRuntimeType

      public static int getHALRuntimeType()
      Returns the runtime type of the HAL.
      Returns:
      HAL Runtime Type
      See Also:
    • getHALErrorMessage

      public static String getHALErrorMessage(int code)
      Gets the error message for a specific status code.
      Parameters:
      code - the status code
      Returns:
      the error message for the code. This does not need to be freed.
      See Also:
      • "HAL_GetErrorMessage"
    • getHALErrno

      public static int getHALErrno()
      Get the last HAL error code.
      Returns:
      error code
    • getHALstrerror

      public static String getHALstrerror(int errno)
      Returns the textual description of the system error code.
      Parameters:
      errno - errno to get description of
      Returns:
      description of errno
      See Also:
      • "std::strerror"
    • getHALstrerror

      public static String getHALstrerror()
      Gets the error message for the last HAL error.
      Returns:
      the error message for the code.