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

Method sendZFILE

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

* @brief Sends the ZFILE header followed by file metadata subpacket. */

Source from the content-addressed store, hash-verified

425 * @brief Sends the ZFILE header followed by file metadata subpacket.
426 */
427void IO::Protocols::ZMODEM::sendZFILE()
428{
429 m_state = State::SentZFILE;
430 Q_EMIT writeRequested(buildBin32Header(kZFILE, 0));
431
432 QFileInfo info(m_filePath);
433 QByteArray fileInfo;
434 fileInfo.append(info.fileName().toUtf8());
435 fileInfo.append('\0');
436 fileInfo.append(QByteArray::number(m_fileSize));
437 fileInfo.append(' ');
438 fileInfo.append(QByteArray::number(info.lastModified().toSecsSinceEpoch()));
439 fileInfo.append(" 0 0 0 0");
440 fileInfo.append('\0');
441
442 Q_EMIT writeRequested(buildSubpacket(fileInfo, kZCRCW));
443
444 Q_EMIT statusMessage(tr("Sending file info: %1 (%2 bytes)").arg(info.fileName()).arg(m_fileSize));
445 m_timeoutTimer.start(m_timeoutMs);
446}
447
448/**
449 * @brief Initiates async file data streaming as ZDATA subpackets.

Callers

nothing calls this directly

Calls 3

appendMethod · 0.45
fileNameMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected