From 27fc91fbe8f88b6885356e68828cfe1ce1db7601 Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期三, 28 二月 2024 09:53:13 +0800 Subject: [PATCH] 坐标 --- lib/src/main/cpp/native-lib.cpp | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/lib/src/main/cpp/native-lib.cpp b/lib/src/main/cpp/native-lib.cpp index 90f370d..179b288 100644 --- a/lib/src/main/cpp/native-lib.cpp +++ b/lib/src/main/cpp/native-lib.cpp @@ -20,6 +20,8 @@ #include "defs.h" #include "mcu/ada.h" #include "mcu/ahp.h" +#include "rtcm.h" +#include "mcu/car_box.h" #define DEBUG(fmt, args...) LOGD("<native-lib> <%s>: " fmt, __func__, ##args) @@ -212,7 +214,7 @@ { static int seq = 0; - lock_guard<std::mutex> lock(tts_mutex); + std::lock_guard<std::mutex> lock(tts_mutex); seq++; return seq; } @@ -250,7 +252,7 @@ } } - TTSCallBack.insert(pair<int, void (*)(int)>(id, callback)); + TTSCallBack.insert(std::pair<int, void (*)(int)>(id, callback)); return id; } @@ -427,8 +429,9 @@ AppTimer_init(); ///////////////ConfigMCU(ayDevice); - InitAda(); - InitAhp(); +// InitAda(); +// InitAhp(); + InitCarBox(); DriverTestInit(); MA_Init(); @@ -562,6 +565,17 @@ } } +void UploadRtcm(JNIEnv *env, jobject thiz, + jbyteArray data, jint length) { + // TODO: implement BluetoothDataComeIn() + jbyte *c_dat = env->GetByteArrayElements(data, NULL); + + SendRtcmToUart((uint8_t *)c_dat, length); +// ParseRtcm((uint8_t *)c_dat, length); + + env->ReleaseByteArrayElements(data, c_dat, NULL); +} + static JNINativeMethod methods[] = { {"startNative", "(Z)V", reinterpret_cast<void *>(startNative)}, {"MainProcMsgEntry", "(ILjava/lang/String;)V", reinterpret_cast<void *>(MainProcMsgEntry)}, @@ -570,7 +584,8 @@ {"TextSpeakEnd", "(I)V", reinterpret_cast<void *>(TextSpeakEnd)}, {"BluetoothConnected", "(Ljava/lang/String;Ljava/lang/String;)V", reinterpret_cast<void *>(BluetoothConnected)}, {"BluetoothStatusChange", "(I)V", reinterpret_cast<void *>(BluetoothStatusChange)}, - {"BluetoothDataComeIn", "([BI)V", reinterpret_cast<void *>(BluetoothDataComeIn)} + {"BluetoothDataComeIn", "([BI)V", reinterpret_cast<void *>(BluetoothDataComeIn)}, + {"uploadRtcm", "([BI)V", reinterpret_cast<void *>(UploadRtcm)} }; jint JNI_OnLoad(JavaVM *vm, void *reserved) -- Gitblit v1.8.0