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
007public final class HALUtil extends JNIWrapper {
008  public static final int NULL_PARAMETER = -1005;
009  public static final int SAMPLE_RATE_TOO_HIGH = 1001;
010  public static final int VOLTAGE_OUT_OF_RANGE = 1002;
011  public static final int LOOP_TIMING_ERROR = 1004;
012  public static final int INCOMPATIBLE_STATE = 1015;
013  public static final int ANALOG_TRIGGER_PULSE_OUTPUT_ERROR = -1011;
014  public static final int NO_AVAILABLE_RESOURCES = -104;
015  public static final int PARAMETER_OUT_OF_RANGE = -1028;
016
017  public static final int RUNTIME_ROBORIO = 0;
018  public static final int RUNTIME_ROBORIO2 = 1;
019  public static final int RUNTIME_SIMULATION = 2;
020
021  public static native short getFPGAVersion();
022
023  public static native int getFPGARevision();
024
025  public static native String getSerialNumber();
026
027  public static native String getComments();
028
029  public static native long getFPGATime();
030
031  public static native int getHALRuntimeType();
032
033  public static native boolean getFPGAButton();
034
035  public static native String getHALErrorMessage(int code);
036
037  public static native int getHALErrno();
038
039  public static native String getHALstrerror(int errno);
040
041  public static String getHALstrerror() {
042    return getHALstrerror(getHALErrno());
043  }
044
045  private HALUtil() {}
046}