edu.wpi.first.wpilibj.hal

## Class HAL

- java.lang.Object
- - edu.wpi.first.wpilibj.hal.JNIWrapper
  - - edu.wpi.first.wpilibj.hal.HAL

-     public class HAL
      extends JNIWrapper

  JNI Wrapper for HAL
  .

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `kMaxJoystickAxes`
    `static int` | `kMaxJoystickPOVs`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HAL()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static AllianceStationID` | `getAllianceStation()`
    `static boolean` | `getBrownedOut()`
    `static void` | `getControlWord(ControlWord controlWord)`
    `static short` | `getJoystickAxes(byte joystickNum, float[] axesArray)`
    `static int` | `getJoystickAxisType(byte joystickNum, byte axis)`
    `static int` | `getJoystickButtons(byte joystickNum, java.nio.ByteBuffer count)`
    `static int` | `getJoystickIsXbox(byte joystickNum)`
    `static java.lang.String` | `getJoystickName(byte joystickNum)`
    `static short` | `getJoystickPOVs(byte joystickNum, short[] povsArray)`
    `static int` | `getJoystickType(byte joystickNum)`
    `static double` | `getMatchTime()`
    `static boolean` | `getSystemActive()`
    `static boolean` | `initialize(int timeout, int mode)`
    `static boolean` | `isNewControlData()`
    `static void` | `observeUserProgramAutonomous()`
    `static void` | `observeUserProgramDisabled()`
    `static void` | `observeUserProgramStarting()`
    `static void` | `observeUserProgramTeleop()`
    `static void` | `observeUserProgramTest()`
    `static void` | `releaseDSMutex()`
    `static void` | `report(int resource, int instanceNumber)`
    `static void` | `report(int resource, int instanceNumber, int context)`
    `static int` | `report(int resource, int instanceNumber, int context, java.lang.String feature)` Report the usage of a resource of interest.
    `static int` | `sendError(boolean isError, int errorCode, boolean isLVCode, java.lang.String details, java.lang.String location, java.lang.String callStack, boolean printMsg)`
    `static int` | `setErrorData(java.lang.String error)`
    `static int` | `setJoystickOutputs(byte joystickNum, int outputs, short leftRumble, short rightRumble)`
    `static void` | `waitForDSData()`
    `static boolean` | `waitForDSDataTimeout(double timeout)`

    - ### Methods inherited from class edu.wpi.first.wpilibj.hal.JNIWrapper

      `getPort, getPortWithModule`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### kMaxJoystickAxes

          public static int kMaxJoystickAxes

    - #### kMaxJoystickPOVs

          public static int kMaxJoystickPOVs

  - ### Constructor Detail

    - #### HAL

          public HAL()

  - ### Method Detail

    - #### waitForDSData

          public static void waitForDSData()

    - #### initialize

          public static boolean initialize(int timeout,
                                           int mode)

    - #### observeUserProgramStarting

          public static void observeUserProgramStarting()

    - #### observeUserProgramDisabled

          public static void observeUserProgramDisabled()

    - #### observeUserProgramAutonomous

          public static void observeUserProgramAutonomous()

    - #### observeUserProgramTeleop

          public static void observeUserProgramTeleop()

    - #### observeUserProgramTest

          public static void observeUserProgramTest()

    - #### report

          public static void report(int resource,
                                    int instanceNumber)

    - #### report

          public static void report(int resource,
                                    int instanceNumber,
                                    int context)

    - #### report

          public static int report(int resource,
                                   int instanceNumber,
                                   int context,
                                   java.lang.String feature)

      Report the usage of a resource of interest.

      Original signature: `uint32_t report(tResourceType, uint8_t, uint8_t, const char*)`

      Parameters:
        `resource` - one of the values in the tResourceType above (max value 51).
        `instanceNumber` - an index that identifies the resource instance.
        `context` - an optional additional context number for some cases (such as module number). Set to 0 to omit.
        `feature` - a string to be included describing features in use on a specific resource. Setting the same resource more than once allows you to change the feature string.

    - #### getControlWord

          public static void getControlWord(ControlWord controlWord)

    - #### getAllianceStation

          public static AllianceStationID getAllianceStation()

    - #### isNewControlData

          public static boolean isNewControlData()

    - #### releaseDSMutex

          public static void releaseDSMutex()

    - #### waitForDSDataTimeout

          public static boolean waitForDSDataTimeout(double timeout)

    - #### getJoystickAxes

          public static short getJoystickAxes(byte joystickNum,
                                              float[] axesArray)

    - #### getJoystickPOVs

          public static short getJoystickPOVs(byte joystickNum,
                                              short[] povsArray)

    - #### getJoystickButtons

          public static int getJoystickButtons(byte joystickNum,
                                               java.nio.ByteBuffer count)

    - #### setJoystickOutputs

          public static int setJoystickOutputs(byte joystickNum,
                                               int outputs,
                                               short leftRumble,
                                               short rightRumble)

    - #### getJoystickIsXbox

          public static int getJoystickIsXbox(byte joystickNum)

    - #### getJoystickType

          public static int getJoystickType(byte joystickNum)

    - #### getJoystickName

          public static java.lang.String getJoystickName(byte joystickNum)

    - #### getJoystickAxisType

          public static int getJoystickAxisType(byte joystickNum,
                                                byte axis)

    - #### getMatchTime

          public static double getMatchTime()

    - #### getSystemActive

          public static boolean getSystemActive()

    - #### getBrownedOut

          public static boolean getBrownedOut()

    - #### setErrorData

          public static int setErrorData(java.lang.String error)

    - #### sendError

          public static int sendError(boolean isError,
                                      int errorCode,
                                      boolean isLVCode,
                                      java.lang.String details,
                                      java.lang.String location,
                                      java.lang.String callStack,
                                      boolean printMsg)