mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[hal, wpilib] Add RobotController.getComments() (#4463)
This commit is contained in:
@@ -470,6 +470,20 @@ Java_edu_wpi_first_hal_HALUtil_getSerialNumber
|
||||
return MakeJString(env, std::string_view(serialNum, len));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HALUtil
|
||||
* Method: getComments
|
||||
* Signature: ()Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_first_hal_HALUtil_getComments
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
char comments[65];
|
||||
size_t len = HAL_GetComments(comments, sizeof(comments));
|
||||
return MakeJString(env, std::string_view(comments, len));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_HALUtil
|
||||
* Method: getFPGATime
|
||||
|
||||
@@ -856,6 +856,33 @@ Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setSerialNumber
|
||||
serialNumberJString.size());
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
|
||||
* Method: getComments
|
||||
* Signature: ()Ljava/lang/String;
|
||||
*/
|
||||
JNIEXPORT jstring JNICALL
|
||||
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_getComments
|
||||
(JNIEnv* env, jclass)
|
||||
{
|
||||
char comments[65];
|
||||
size_t len = HALSIM_GetRoboRioComments(comments, sizeof(comments));
|
||||
return MakeJString(env, std::string_view(comments, len));
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
|
||||
* Method: setComments
|
||||
* Signature: (Ljava/lang/String;)V
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
Java_edu_wpi_first_hal_simulation_RoboRioDataJNI_setComments
|
||||
(JNIEnv* env, jclass, jstring comments)
|
||||
{
|
||||
JStringRef commentsJString{env, comments};
|
||||
HALSIM_SetRoboRioComments(commentsJString.c_str(), commentsJString.size());
|
||||
}
|
||||
|
||||
/*
|
||||
* Class: edu_wpi_first_hal_simulation_RoboRioDataJNI
|
||||
* Method: resetData
|
||||
|
||||
Reference in New Issue
Block a user