Add name to HAL Notifier

This commit is contained in:
Peter Johnson
2019-11-09 11:41:58 -08:00
parent 2da64d15f6
commit 3e049e02f0
10 changed files with 74 additions and 2 deletions

View File

@@ -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