We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
如题
The text was updated successfully, but these errors were encountered:
`void Ymodem::transmitStageFinishing() { switch (receivePacket()) { case CodeNak: { timeCount = 0; errorCount = 0; dataCount = 0; code = CodeNone; stage = StageFinishing; txBuffer[0] = CodeEot; txLength = 1; write(txBuffer, txLength);
break; } case CodeC: { memset(&(txBuffer[YMODEM_PACKET_HEADER]), NULL, YMODEM_PACKET_SIZE); uint16_t crc = crc16(&(txBuffer[YMODEM_PACKET_HEADER]), YMODEM_PACKET_SIZE); timeCount = 0; errorCount = 0; dataCount = 0; code = CodeNone; stage = StageFinished; txBuffer[0] = CodeSoh; txBuffer[1] = 0x00; txBuffer[2] = 0xFF; txBuffer[YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - 2] = static_cast<uint8_t>(crc >> 8); txBuffer[YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD - 1] = static_cast<uint8_t>(crc >> 0); txLength = YMODEM_PACKET_SIZE + YMODEM_PACKET_OVERHEAD; write(txBuffer, txLength); break; } case CodeAck: { timeCount = 0; errorCount = 0; dataCount = 0; code = CodeNone; stage = StageFinishing; //callback(StatusFinish, nullptr, nullptr); break; } case CodeA1: case CodeA2: case CodeCan: { timeCount = 0; errorCount = 0; dataCount = 0; code = CodeNone; stage = StageNone; callback(StatusAbort, nullptr, nullptr); break; } default: { timeCount++; if ((timeCount / (timeDivide + 1)) > timeMax) { timeCount = 0; errorCount = 0; dataCount = 0; code = CodeNone; stage = StageNone; for (txLength = 0; txLength < YMODEM_CODE_CAN_NUMBER; txLength++) { txBuffer[txLength] = CodeCan; } write(txBuffer, txLength); callback(StatusError, nullptr, nullptr); } else if ((timeCount % (timeDivide + 1)) == 0) { write(txBuffer, txLength); } }
} }`
Sorry, something went wrong.
No branches or pull requests
如题
The text was updated successfully, but these errors were encountered: