MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / handleBlock0AckByte

Method handleBlock0AckByte

app/src/IO/FileTransmission/YMODEM.cpp:83–99  ·  view source on GitHub ↗

* @brief Reacts to a byte received while waiting for ACK of block 0. */

Source from the content-addressed store, hash-verified

81 * @brief Reacts to a byte received while waiting for ACK of block 0.
82 */
83void IO::Protocols::YMODEM::handleBlock0AckByte(quint8 ch)
84{
85 if (ch == kACK) {
86 m_timeoutTimer.stop();
87 m_yState = YState::WaitingForDataC;
88 m_timeoutTimer.start(m_timeoutMs);
89 return;
90 }
91
92 if (ch == kCAN) {
93 m_timeoutTimer.stop();
94 resetState();
95 m_yState = YState::Idle;
96 Q_EMIT statusMessage(tr("Transfer cancelled by receiver"));
97 Q_EMIT finished(false, tr("Receiver cancelled the transfer"));
98 }
99}
100
101/**
102 * @brief Reacts to a byte received while waiting for ACK of the second EOT.

Callers

nothing calls this directly

Calls 3

resetStateFunction · 0.85
stopMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected