mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Add name to HAL Notifier
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include <cassert>
|
||||
#include <cstdio>
|
||||
|
||||
#include <wpi/jni_util.h>
|
||||
|
||||
#include "HALUtil.h"
|
||||
#include "edu_wpi_first_hal_NotifierJNI.h"
|
||||
#include "hal/Notifier.h"
|
||||
@@ -37,6 +39,21 @@ Java_edu_wpi_first_hal_NotifierJNI_initializeNotifier
|
||||
return (jint)notifierHandle;
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_NotifierJNI
|
||||
* Method: setNotifierName
|
||||
* Signature: (ILjava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_NotifierJNI_setNotifierName
|
||||
(JNIEnv* env, jclass cls, jint notifierHandle, jstring name)
|
||||
{
|
||||
int32_t status = 0;
|
||||
HAL_SetNotifierName((HAL_NotifierHandle)notifierHandle,
|
||||
wpi::java::JStringRef{env, name}.c_str(), &status);
|
||||
CheckStatus(env, status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_NotifierJNI
|
||||
* Method: stopNotifier
|
||||
|
||||
Reference in New Issue
Block a user