[hal,wpilib] Add function to control "Radio" LED (#6073)

This commit is contained in:
Ryan Blue
2023-12-22 13:57:52 -05:00
committed by GitHub
parent 0b2cfb3abc
commit 4059e0cd9f
22 changed files with 531 additions and 3 deletions

View File

@@ -0,0 +1,28 @@
// Copyright (c) FIRST and other WPILib contributors.
// Open Source Software; you can modify and/or share it under the terms of
// the WPILib BSD license file in the root directory of this project.
package edu.wpi.first.hal;
public class LEDJNI extends JNIWrapper {
public static final int RADIO_LED_STATE_OFF = 0;
public static final int RADIO_LED_STATE_GREEN = 1;
public static final int RADIO_LED_STATE_RED = 2;
public static final int RADIO_LED_STATE_ORANGE = 3;
/**
* Set the state of the "Radio" LED.
*
* @param state The state to set the LED to.
* @see "HAL_SetRadioLEDState"
*/
public static native void setRadioLEDState(int state);
/**
* Get the state of the "Radio" LED.
*
* @return The state of the LED.
* @see "HAL_GetRadioLEDState"
*/
public static native int getRadioLEDState();
}

View File

@@ -176,5 +176,14 @@ public class RoboRioDataJNI extends JNIWrapper {
public static native void setComments(String comments);
public static native int registerRadioLEDStateCallback(
NotifyCallback callback, boolean initialNotify);
public static native void cancelRadioLEDStateCallback(int uid);
public static native int getRadioLEDState();
public static native void setRadioLEDState(int state);
public static native void resetData();
}