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 009/** JNI for addressable LED data. */ 010public class AddressableLEDDataJNI extends JNIWrapper { 011 public static native int registerInitializedCallback( 012 int index, NotifyCallback callback, boolean initialNotify); 013 014 public static native void cancelInitializedCallback(int index, int uid); 015 016 public static native boolean getInitialized(int index); 017 018 public static native void setInitialized(int index, boolean initialized); 019 020 public static native int registerOutputPortCallback( 021 int index, NotifyCallback callback, boolean initialNotify); 022 023 public static native void cancelOutputPortCallback(int index, int uid); 024 025 public static native int getOutputPort(int index); 026 027 public static native void setOutputPort(int index, int outputPort); 028 029 public static native int registerLengthCallback( 030 int index, NotifyCallback callback, boolean initialNotify); 031 032 public static native void cancelLengthCallback(int index, int uid); 033 034 public static native int getLength(int index); 035 036 public static native void setLength(int index, int length); 037 038 public static native int registerRunningCallback( 039 int index, NotifyCallback callback, boolean initialNotify); 040 041 public static native void cancelRunningCallback(int index, int uid); 042 043 public static native boolean getRunning(int index); 044 045 public static native void setRunning(int index, boolean running); 046 047 public static native int registerDataCallback(int index, ConstBufferCallback callback); 048 049 public static native void cancelDataCallback(int index, int uid); 050 051 public static native byte[] getData(int index); 052 053 public static native void setData(int index, byte[] data); 054 055 public static native void resetData(int index); 056 057 public static native int findForChannel(int channel); 058 059 /** Utility class. */ 060 private AddressableLEDDataJNI() {} 061}