[sim] Provide method to set the runtime type (#2539)

This is needed for extensions that effectively access real hardware and
want to disable the "simulation" parts of user code.
This commit is contained in:
Peter Johnson
2020-06-26 20:46:13 -07:00
committed by GitHub
parent 71c187a1ed
commit 629e8b41f2
6 changed files with 28 additions and 3 deletions

View File

@@ -108,6 +108,18 @@ jmethodID GetSpiReadAutoReceiveBufferCallback() {
} // namespace hal
extern "C" {
/*
* Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
* Method: setRuntimeType
* Signature: (I)V
*/
JNIEXPORT void JNICALL
Java_edu_wpi_first_hal_sim_mockdata_SimulatorJNI_setRuntimeType
(JNIEnv*, jclass, jint type)
{
HALSIM_SetRuntimeType(static_cast<HAL_RuntimeType>(type));
}
/*
* Class: edu_wpi_first_hal_sim_mockdata_SimulatorJNI
* Method: waitForProgramStart