From 6e0f29b08a040d14576d7053c1206a8439936570 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期二, 24 十一月 2020 14:18:03 +0800
Subject: [PATCH] 坐标

---
 lib/src/main/cpp/rtk_platform/platform.cpp |   33 ++++++++++++++++++++++++++++++++-
 1 files changed, 32 insertions(+), 1 deletions(-)

diff --git a/lib/src/main/cpp/rtk_platform/platform.cpp b/lib/src/main/cpp/rtk_platform/platform.cpp
index a2e10ba..e3e0bb7 100644
--- a/lib/src/main/cpp/rtk_platform/platform.cpp
+++ b/lib/src/main/cpp/rtk_platform/platform.cpp
@@ -110,7 +110,7 @@
 
 static void AddEvnet(uint32_t event, const uint8_t *data, int length)
 {
-    DEBUG("AddEvnet 0x%04X length %d", event, length);
+//    DEBUG("AddEvnet 0x%04X length %d", event, length);
 
     struct event_queue_t *nw = (struct event_queue_t *)malloc(sizeof(struct event_queue_t));
     nw->next = NULL;
@@ -378,6 +378,9 @@
     }
     if (events & RTK_UPDATE_EVT) {
         DEBUG("RTK_UPDATE_EVT length %d", length);
+
+//        uint32_t ost = AppTimer_GetTickCount();
+
         const rtk_info *rtk = (rtk_info *)data;
 
         rbf.qf = rtk->qf;
@@ -400,6 +403,8 @@
         }
 
         UpdateRTKInfo(rtk);
+
+//        DEBUG("driver_test 璇勫垽鑰楁椂 %ld", AppTimer_GetTickCount() - ost);
 
         DEBUG("RTK_UPDATE_EVT =================");
     }
@@ -569,6 +574,32 @@
             MA_MainProcMsgEntry(c.a, (char *) data + 4);
         }
     }
+    if (events & BLUETOOTH_STATUS_EVT) {
+        DEBUG("BLUETOOTH_STATUS_EVT %d", data[0]);
+
+        if (data[0] == 3) {
+            // Connected
+            ParseMcuInit();
+            ConfigRTKModuleLater();
+
+            PlayTTS("钃濈墮杩炴帴", NULL);
+        } else if (data[0] == 2) {
+            // Disconnect
+            PlayTTS("钃濈墮鏂紑", NULL);
+        } else if (data[0] == 1) {
+            // Open
+            ConnectToBluetooth("00:1B:35:16:20:4A", "3800");
+//            ConnectToBluetooth("00:1D:43:9A:E0:79", "1900");
+//            ConnectToBluetooth("DESKTOP-IE9V7U8", "0000");
+            PlayTTS("钃濈墮鍚姩", NULL);
+        } else {
+            // Close
+            PlayTTS("钃濈墮鍏抽棴", NULL);
+        }
+    }
+    if (events & BLUETOOTH_DATA_EVT) {
+        ParseMcu(data, length);
+    }
 }
 
 static void *PlatformDataListenThread(void *p) {

--
Gitblit v1.8.0