From f5c123f6e78b25fb325c391a3c2ffeccf930f316 Mon Sep 17 00:00:00 2001 From: endian11 <Dana_Lee1016@126.com> Date: 星期二, 29 九月 2020 15:55:10 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/endian11/DriveJudge into lowprecision --- lib/src/main/cpp/native-lib.cpp | 17 +++++++++++++++++ 1 files changed, 17 insertions(+), 0 deletions(-) diff --git a/lib/src/main/cpp/native-lib.cpp b/lib/src/main/cpp/native-lib.cpp index 6eedb68..823ca99 100644 --- a/lib/src/main/cpp/native-lib.cpp +++ b/lib/src/main/cpp/native-lib.cpp @@ -383,3 +383,20 @@ TTSCallBack.erase(it); } } + +extern "C" +JNIEXPORT void JNICALL +Java_com_anyun_exam_lib_RemoteService_UpgradeMcu(JNIEnv *env, jobject thiz, jstring vercode, + jbyteArray rom) { + // TODO: implement UpgradeMcu() + if (vercode != NULL && rom != NULL) { + const char *str = env->GetStringUTFChars(vercode, 0); + jbyte *c_dat = env->GetByteArrayElements(rom, NULL); + int len = env->GetArrayLength(rom); + + LoadDefaultMcuRom(str, (uint8_t *)c_dat, len); + + env->ReleaseStringUTFChars(vercode, str); + env->ReleaseByteArrayElements(rom, c_dat, NULL); + } +} -- Gitblit v1.8.0