| | |
| | | } |
| | | |
| | | case ID_GNSS_DATA: { |
| | | // DEBUG("ID_GNSS_DATA %d", length); |
| | | DEBUG("ID_GNSS_DATA %d", length); |
| | | memcpy(RxBuf + RxBufLen, data, length); |
| | | RxBufLen += length; |
| | | |
| | |
| | | pCls = nullptr; |
| | | } |
| | | |
| | | static void AhpRun(void) |
| | | void InitAhp(void) |
| | | { |
| | | // TODO |
| | | static struct serial_config serialConfig; |
| | | |
| | | strcpy(serialConfig.name, "/dev/ttyCH341USB3"); |
| | |
| | | serialConfig.stop_bit = 1; |
| | | serialConfig.flow_ctrl = 0; |
| | | |
| | | while (true) { |
| | | std::thread t(UartThread, &serialConfig); |
| | | t.join(); |
| | | std::this_thread::sleep_for(std::chrono::seconds(3)); |
| | | } |
| | | } |
| | | |
| | | void InitAhp(void) |
| | | { |
| | | // TODO |
| | | std::thread(AhpRun).detach(); |
| | | std::thread([&] { |
| | | while (true) { |
| | | std::thread t(UartThread, &serialConfig); |
| | | t.join(); |
| | | std::this_thread::sleep_for(std::chrono::seconds(3)); |
| | | } |
| | | }).detach(); |
| | | } |
| | | |
| | | static void SendDfuFile(int fileLen, int sentLen, int blockLen, const uint8_t *data) { |