yy1717
2024-02-28 27fc91fbe8f88b6885356e68828cfe1ce1db7601
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)