From 9c13ff18dab0c35ada32a318ab6e380c9b184ffe Mon Sep 17 00:00:00 2001 From: yy1717 <fctom1215@outlook.com> Date: 星期一, 06 一月 2020 11:23:32 +0800 Subject: [PATCH] 修改ndk,20200106 --- lib/src/main/cpp/rtk_platform/platform.cpp | 24 ++++++++++++++++++++++-- 1 files changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/src/main/cpp/rtk_platform/platform.cpp b/lib/src/main/cpp/rtk_platform/platform.cpp index 99751dd..f1f0358 100644 --- a/lib/src/main/cpp/rtk_platform/platform.cpp +++ b/lib/src/main/cpp/rtk_platform/platform.cpp @@ -15,6 +15,7 @@ #include "parse_net.h" #include "../defs.h" #include "../rtk_module/rtk.h" +#include "../mcu/mcu_if.h" #define PARSE_BUFF_SIZE 4096 @@ -69,6 +70,7 @@ static void LoginPlatform(void); static void LoginPlatformTimeout(union sigval sig); static void TriggerHeartbeat(union sigval sig); +static void RequestRtkNoResp(union sigval sig); void InitPlatform(const uint8_t *phone, const char *domain_name, int port) { @@ -96,8 +98,6 @@ pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);//detached pthread_create(&pid, &attr, StatusListenThread, NULL); - - strcpy(deviceInfo.imei, GetImei()); ConnectPlatform(domain_name, port); } @@ -346,11 +346,31 @@ } } +void ReceivedRtk(const uint8_t *data, int length) +{ + AppTimer_delete(RequestRtkNoResp); + // 姹囨姤缁欏崟鐗囨満 + if (length > 0) { + SendRtkToMcu(data, length); + } +} + +static void RequestRtkNoResp(union sigval sig) +{ + AppTimer_delete(RequestRtkNoResp); + requestPlatformSendRtk = true; +} + void RequestRtkDownload(uint32_t latitude, uint32_t longitude, uint16_t altitude, const uint8_t *bcd_time, uint16_t rtk_pkt_interval) { if (requestPlatformSendRtk) { + DisplayText("璇锋眰涓嬭浇RTK鏁版嵁"); requestPlatformSendRtk = false; + + AppTimer_delete(RequestRtkNoResp); + AppTimer_add(RequestRtkNoResp, D_SEC(5)); + SendRTKStart(latitude, longitude, altitude, bcd_time, rtk_pkt_interval); } } -- Gitblit v1.8.0