001/*----------------------------------------------------------------------------*/
002/* Copyright (c) FIRST 2016-2017. All Rights Reserved.                        */
003/* Open Source Software - may be modified and shared by FRC teams. The code   */
004/* must be accompanied by the FIRST BSD license file in the root directory of */
005/* the project.                                                               */
006/*----------------------------------------------------------------------------*/
007
008package edu.wpi.first.wpilibj.hal;
009
010@SuppressWarnings("AbbreviationAsWordInName")
011public class HALUtil extends JNIWrapper {
012  public static final int NULL_PARAMETER = -1005;
013  public static final int SAMPLE_RATE_TOO_HIGH = 1001;
014  public static final int VOLTAGE_OUT_OF_RANGE = 1002;
015  public static final int LOOP_TIMING_ERROR = 1004;
016  public static final int INCOMPATIBLE_STATE = 1015;
017  public static final int ANALOG_TRIGGER_PULSE_OUTPUT_ERROR = -1011;
018  public static final int NO_AVAILABLE_RESOURCES = -104;
019  public static final int PARAMETER_OUT_OF_RANGE = -1028;
020
021  public static native short getFPGAVersion();
022
023  public static native int getFPGARevision();
024
025  public static native long getFPGATime();
026
027  public static native int getHALRuntimeType();
028
029  public static native boolean getFPGAButton();
030
031  public static native String getHALErrorMessage(int code);
032
033  public static native int getHALErrno();
034
035  public static native String getHALstrerror(int errno);
036
037  public static String getHALstrerror() {
038    return getHALstrerror(getHALErrno());
039  }
040}