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

Method sendDataSubpackets

app/src/IO/FileTransmission/ZMODEM.cpp:451–467  ·  view source on GitHub ↗

* @brief Initiates async file data streaming as ZDATA subpackets. */

Source from the content-addressed store, hash-verified

449 * @brief Initiates async file data streaming as ZDATA subpackets.
450 */
451void IO::Protocols::ZMODEM::sendDataSubpackets()
452{
453 Q_ASSERT(m_file.isOpen());
454 Q_ASSERT(m_fileSize > 0);
455
456 m_state = State::SendingData;
457
458 if (!m_file.seek(m_fileOffset)) [[unlikely]] {
459 Q_EMIT finished(false, tr("Failed to seek to offset %1").arg(m_fileOffset));
460 return;
461 }
462
463 m_bytesSent = m_fileOffset;
464
465 Q_EMIT writeRequested(buildBin32Header(kZDATA, static_cast<quint32>(m_fileOffset)));
466 sendNextDataChunk();
467}
468
469/**
470 * @brief Sends a batch of data chunks, then yields to the event loop.

Callers

nothing calls this directly

Calls 1

isOpenMethod · 0.45

Tested by

no test coverage detected