001// Copyright (c) FIRST and other WPILib contributors.
002// Open Source Software; you can modify and/or share it under the terms of
003// the WPILib BSD license file in the root directory of this project.
004
005package edu.wpi.first.hal;
006
007@SuppressWarnings("AbbreviationAsWordInName")
008public final class HALUtil extends JNIWrapper {
009  public static final int NULL_PARAMETER = -1005;
010  public static final int SAMPLE_RATE_TOO_HIGH = 1001;
011  public static final int VOLTAGE_OUT_OF_RANGE = 1002;
012  public static final int LOOP_TIMING_ERROR = 1004;
013  public static final int INCOMPATIBLE_STATE = 1015;
014  public static final int ANALOG_TRIGGER_PULSE_OUTPUT_ERROR = -1011;
015  public static final int NO_AVAILABLE_RESOURCES = -104;
016  public static final int PARAMETER_OUT_OF_RANGE = -1028;
017
018  public static final int RUNTIME_ROBORIO = 0;
019  public static final int RUNTIME_ROBORIO2 = 1;
020  public static final int RUNTIME_SIMULATION = 2;
021
022  public static native short getFPGAVersion();
023
024  public static native int getFPGARevision();
025
026  public static native long getFPGATime();
027
028  public static native int getHALRuntimeType();
029
030  public static native boolean getFPGAButton();
031
032  public static native String getHALErrorMessage(int code);
033
034  public static native int getHALErrno();
035
036  public static native String getHALstrerror(int errno);
037
038  public static String getHALstrerror() {
039    return getHALstrerror(getHALErrno());
040  }
041
042  private HALUtil() {}
043}