yy1717
2020-11-24 6e0f29b08a040d14576d7053c1206a8439936570
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) {