[hal] Allocate CANStreamMessage in JNI if null (#6107)

This commit is contained in:
Thad House
2023-12-28 22:50:57 -08:00
committed by GitHub
parent 6a2d3c30a6
commit 9333951736
3 changed files with 17 additions and 2 deletions

View File

@@ -365,6 +365,12 @@ jobject CreatePowerDistributionVersion(JNIEnv* env, uint32_t firmwareMajor,
static_cast<jint>(hardwareMajor), static_cast<jint>(uniqueId));
}
jobject CreateCANStreamMessage(JNIEnv* env) {
static jmethodID constructor =
env->GetMethodID(canStreamMessageCls, "<init>", "()V");
return env->NewObject(canStreamMessageCls, constructor);
}
JavaVM* GetJVM() {
return jvm;
}