| | |
| | | |
| | | 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; |
| | |
| | | } |
| | | 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; |
| | |
| | | } |
| | | |
| | | UpdateRTKInfo(rtk); |
| | | |
| | | // DEBUG("driver_test 评判耗时 %ld", AppTimer_GetTickCount() - ost); |
| | | |
| | | DEBUG("RTK_UPDATE_EVT ================="); |
| | | } |
| | |
| | | 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) { |