| | |
| | | #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) |
| | | |
| | |
| | | { |
| | | static int seq = 0; |
| | | |
| | | lock_guard<std::mutex> lock(tts_mutex); |
| | | std::lock_guard<std::mutex> lock(tts_mutex); |
| | | seq++; |
| | | return seq; |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | TTSCallBack.insert(pair<int, void (*)(int)>(id, callback)); |
| | | TTSCallBack.insert(std::pair<int, void (*)(int)>(id, callback)); |
| | | |
| | | return id; |
| | | } |
| | |
| | | |
| | | AppTimer_init(); |
| | | ///////////////ConfigMCU(ayDevice); |
| | | InitAda(); |
| | | InitAhp(); |
| | | // InitAda(); |
| | | // InitAhp(); |
| | | InitCarBox(); |
| | | DriverTestInit(); |
| | | |
| | | MA_Init(); |
| | |
| | | } |
| | | } |
| | | |
| | | 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)}, |
| | |
| | | {"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) |