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.simulation; 006 007import edu.wpi.first.hal.JNIWrapper; 008 009public class DriverStationDataJNI extends JNIWrapper { 010 public static native int registerEnabledCallback(NotifyCallback callback, boolean initialNotify); 011 012 public static native void cancelEnabledCallback(int uid); 013 014 public static native boolean getEnabled(); 015 016 public static native void setEnabled(boolean enabled); 017 018 public static native int registerAutonomousCallback( 019 NotifyCallback callback, boolean initialNotify); 020 021 public static native void cancelAutonomousCallback(int uid); 022 023 public static native boolean getAutonomous(); 024 025 public static native void setAutonomous(boolean autonomous); 026 027 public static native int registerTestCallback(NotifyCallback callback, boolean initialNotify); 028 029 public static native void cancelTestCallback(int uid); 030 031 public static native boolean getTest(); 032 033 public static native void setTest(boolean test); 034 035 public static native int registerEStopCallback(NotifyCallback callback, boolean initialNotify); 036 037 public static native void cancelEStopCallback(int uid); 038 039 public static native boolean getEStop(); 040 041 public static native void setEStop(boolean eStop); 042 043 public static native int registerFmsAttachedCallback( 044 NotifyCallback callback, boolean initialNotify); 045 046 public static native void cancelFmsAttachedCallback(int uid); 047 048 public static native boolean getFmsAttached(); 049 050 public static native void setFmsAttached(boolean fmsAttached); 051 052 public static native int registerDsAttachedCallback( 053 NotifyCallback callback, boolean initialNotify); 054 055 public static native void cancelDsAttachedCallback(int uid); 056 057 public static native boolean getDsAttached(); 058 059 public static native void setDsAttached(boolean dsAttached); 060 061 public static native int registerAllianceStationIdCallback( 062 NotifyCallback callback, boolean initialNotify); 063 064 public static native void cancelAllianceStationIdCallback(int uid); 065 066 public static native int getAllianceStationId(); 067 068 public static native void setAllianceStationId(int allianceStationId); 069 070 public static native int registerMatchTimeCallback( 071 NotifyCallback callback, boolean initialNotify); 072 073 public static native void cancelMatchTimeCallback(int uid); 074 075 public static native double getMatchTime(); 076 077 public static native void setMatchTime(double matchTime); 078 079 public static native void setJoystickAxes(byte joystickNum, float[] axesArray); 080 081 public static native void setJoystickPOVs(byte joystickNum, short[] povsArray); 082 083 public static native void setJoystickButtons(byte joystickNum, int buttons, int count); 084 085 public static native long getJoystickOutputs(int stick); 086 087 public static native int getJoystickRumble(int stick, int rumbleNum); 088 089 public static native void setMatchInfo( 090 String eventName, 091 String gameSpecificMessage, 092 int matchNumber, 093 int replayNumber, 094 int matchType); 095 096 public static native void registerAllCallbacks(NotifyCallback callback, boolean initialNotify); 097 098 public static native void notifyNewData(); 099 100 public static native void setSendError(boolean shouldSend); 101 102 public static native void setSendConsoleLine(boolean shouldSend); 103 104 public static native void setJoystickButton(int stick, int button, boolean state); 105 106 public static native void setJoystickAxis(int stick, int axis, double value); 107 108 public static native void setJoystickPOV(int stick, int pov, int value); 109 110 public static native void setJoystickButtonsValue(int stick, int buttons); 111 112 public static native void setJoystickAxisCount(int stick, int count); 113 114 public static native void setJoystickPOVCount(int stick, int count); 115 116 public static native void setJoystickButtonCount(int stick, int count); 117 118 public static native void setJoystickIsXbox(int stick, boolean isXbox); 119 120 public static native void setJoystickType(int stick, int type); 121 122 public static native void setJoystickName(int stick, String name); 123 124 public static native void setJoystickAxisType(int stick, int axis, int type); 125 126 public static native void setGameSpecificMessage(String message); 127 128 public static native void setEventName(String name); 129 130 public static native void setMatchType(int type); 131 132 public static native void setMatchNumber(int matchNumber); 133 134 public static native void setReplayNumber(int replayNumber); 135 136 public static native void resetData(); 137}