From 8e7d369e87f4203912d116215ee94e68afa67b62 Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期三, 08 一月 2020 15:28:09 +0800 Subject: [PATCH] 实现rtk平台基础配置 --- lib/src/main/cpp/master/comm_if.h | 2 ++ lib/src/main/cpp/master/comm_if.cpp | 16 +++++++++++++++- lib/src/main/cpp/rtk_platform/platform.cpp | 3 +++ lib/src/main/java/com/anyun/exam/lib/RemoteService.java | 3 ++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/src/main/cpp/master/comm_if.cpp b/lib/src/main/cpp/master/comm_if.cpp index 6b481b0..836fc49 100644 --- a/lib/src/main/cpp/master/comm_if.cpp +++ b/lib/src/main/cpp/master/comm_if.cpp @@ -22,6 +22,10 @@ #define ID_SM_RTK_PLAT_CONN 0x0003 #define ID_SM_RTK_PLAT_REG 0x0004 #define ID_SM_RTK_PLAT_LOGIN 0x0005 +#define ID_SM_READ_MAP 0x0006 +#define ID_MS_MAP 0x8006 +#define ID_SM_READ_CAR 0x0007 +#define ID_MS_CAR 0x8007 void MA_NdkStart(void) { @@ -80,7 +84,7 @@ writer.StartObject(); - writer.Key("password"); + writer.Key("login_code"); writer.Int(login); writer.EndObject(); @@ -88,6 +92,16 @@ SendMsgToMainProc(ID_SM_RTK_PLAT_LOGIN, sb.GetString()); } +void MA_ReadMap(void) +{ + SendMsgToMainProc(ID_SM_READ_MAP, NULL); +} + +void MA_ReadCar(void) +{ + SendMsgToMainProc(ID_SM_READ_CAR, NULL); +} + void MA_MainProcMsgEntry(int cmd, const char *value) { switch (cmd) { diff --git a/lib/src/main/cpp/master/comm_if.h b/lib/src/main/cpp/master/comm_if.h index 3755666..8286f14 100644 --- a/lib/src/main/cpp/master/comm_if.h +++ b/lib/src/main/cpp/master/comm_if.h @@ -14,5 +14,7 @@ void MA_RtkPlatformConnect(int conn, const char *ip, int port); void MA_RtkPlatformRegister(int reg, const uint8_t *pwd, int length); void MA_RtkPlatformLogin(int login); +void MA_ReadMap(void); +void MA_ReadCar(void); #endif //MYAPPLICATION2_COMM_IF_H diff --git a/lib/src/main/cpp/rtk_platform/platform.cpp b/lib/src/main/cpp/rtk_platform/platform.cpp index 5811569..cd9540d 100644 --- a/lib/src/main/cpp/rtk_platform/platform.cpp +++ b/lib/src/main/cpp/rtk_platform/platform.cpp @@ -109,6 +109,9 @@ AppTimer_add(ReqRtkPlatformConfigTimeout, D_SEC(2)); MA_ReqRtkPlatformConfig(); + + MA_ReadMap(); + MA_ReadCar(); } static void ReqRtkPlatformConfigTimeout(union sigval sig) diff --git a/lib/src/main/java/com/anyun/exam/lib/RemoteService.java b/lib/src/main/java/com/anyun/exam/lib/RemoteService.java index 8e5a18d..f8b7133 100644 --- a/lib/src/main/java/com/anyun/exam/lib/RemoteService.java +++ b/lib/src/main/java/com/anyun/exam/lib/RemoteService.java @@ -4,6 +4,7 @@ import android.content.Intent; import android.content.SharedPreferences; import android.os.IBinder; +import android.os.Process; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.util.Base64; @@ -51,7 +52,7 @@ @Override public void SendCmd(int cmd, String value) throws RemoteException { - Log.d(TAG, "RecvMsgFromMainProc cmd = " + String.format(" %04X ", cmd) + " value " + value); + Log.d(TAG, "Process " + Process.myPid() + " Thread " + Thread.currentThread().getId() + " RecvMsgFromMainProc cmd = " + String.format(" %04X ", cmd) + " value " + value); MainProcMsgEntry(cmd, value); } }; -- Gitblit v1.8.0