From 2cfc22e1ea5140861499ee5b7142766fb8f754f7 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期二, 29 九月 2020 15:53:20 +0800
Subject: [PATCH] 坐标

---
 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