JNI for test coverage #3965

This commit is contained in:
rusefillc 2022-03-13 21:35:59 -04:00
parent d306638220
commit 8733841c79
1 changed files with 11 additions and 0 deletions

View File

@ -56,4 +56,15 @@ JNIEXPORT void JNICALL Java_com_rusefi_native_1_EngineLogic_invokePeriodicCallba
(JNIEnv *, jobject) {
EngineTestHelper* eth = getEth();
eth->engine.periodicSlowCallback();
eth->engine.periodicFastCallback();
}
JNIEXPORT jbyteArray JNICALL Java_com_rusefi_native_1_EngineLogic_getOutputs(JNIEnv * env, jobject instance) {
jbyteArray retVal = env->NewByteArray(sizeof(TunerStudioOutputChannels));
jbyte *buf = env->GetByteArrayElements(retVal, NULL);
memcpy(buf, (const void*)&eth->engine.outputChannels, sizeof(TunerStudioOutputChannels));
env->ReleaseByteArrayElements(retVal, buf, 0);
return retVal;
}