From 8ebe83a59e982317a746e8dd61d87c4a2359b40d Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期三, 08 一月 2020 14:42:36 +0800
Subject: [PATCH] 实现rtk平台基础配置

---
 lib/src/main/cpp/rtk_platform/platform.cpp |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/src/main/cpp/rtk_platform/platform.cpp b/lib/src/main/cpp/rtk_platform/platform.cpp
index e0072ab..5811569 100644
--- a/lib/src/main/cpp/rtk_platform/platform.cpp
+++ b/lib/src/main/cpp/rtk_platform/platform.cpp
@@ -22,7 +22,7 @@
 
 #define PARSE_BUFF_SIZE         4096
 
-const char *VK_REG = "platform_register";
+#define DEBUG(fmt, args...)     LOGD("<platform> <%s>: " fmt, __func__, ##args)
 
 struct platformSocket {
     char domain_name[32];
@@ -84,6 +84,8 @@
 
 void InitPlatform(const uint8_t *phone, const char *domain_name, int port)
 {
+    DEBUG("InitPlatform");
+
     pthread_mutex_init(&platform_tx_mutex, NULL);
     pthread_mutex_init(&events_mutex, NULL);
 
@@ -105,15 +107,16 @@
     pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);//detached
     pthread_create(&pid, &attr, StatusListenThread, NULL);
 
-    MA_ReqRtkPlatformConfig();
     AppTimer_add(ReqRtkPlatformConfigTimeout, D_SEC(2));
+    MA_ReqRtkPlatformConfig();
 }
 
 static void ReqRtkPlatformConfigTimeout(union sigval sig)
 {
     AppTimer_delete(ReqRtkPlatformConfigTimeout);
-    MA_ReqRtkPlatformConfig();
+
     AppTimer_add(ReqRtkPlatformConfigTimeout, D_SEC(2));
+    MA_ReqRtkPlatformConfig();
 }
 
 void ConfigPlatform(const rtk_platform_cfg_t *p)

--
Gitblit v1.8.0