diff --git a/uart/uart.cpp b/uart/uart.cpp index 29607b5..f318e30 100644 --- a/uart/uart.cpp +++ b/uart/uart.cpp @@ -1023,6 +1023,7 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) { bool wave_error_y = false; bool wave_error_z = false; bytesRead = bytesRead + mlastSize; + for (int i = 0; i < bytesRead; i++) { if (UartRecvBuf[i] == head[0]) { char buf[12] = {0x00}; @@ -1039,7 +1040,7 @@ int Uart::FindRecvPackage(int bytesRead, char *mUartRecvBuf, char *head) { { continue; } - else if (wave_error_x && wave_error_y && !wave_error_z && command == WAVE_Y) + else if ((wave_error_x || wave_error_y) && !wave_error_z && command == WAVE_Y) { continue; } diff --git a/uart/uart_feature_parse.cpp b/uart/uart_feature_parse.cpp index c15e8b0..e41619e 100644 --- a/uart/uart_feature_parse.cpp +++ b/uart/uart_feature_parse.cpp @@ -804,6 +804,10 @@ void Uart::DealWave() { sqlite_db_ctrl::instance().InsertData(" receive_wave_status ", insertSql); } scheduler::instance().WaveSuccess(wave_shortAddr); + }else{ + if(scheduler::instance().WaveError(wave_shortAddr) < 0){ + zlog_error(zct, "wave size is 0,shortAddr %02x%02x", (wave_shortAddr >> 8) & 0xFF,wave_shortAddr & 0xFF); + } } std::string ran = "";