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

Method sendRawBlock

app/src/IO/FileTransmission.cpp:621–640  ·  view source on GitHub ↗

* @brief Sends the next binary block from the file. */

Source from the content-addressed store, hash-verified

619 * @brief Sends the next binary block from the file.
620 */
621void IO::FileTransmission::sendRawBlock()
622{
623 if (!IO::ConnectionManager::instance().isConnected())
624 return;
625
626 if (m_file.atEnd()) {
627 stopTransmission();
628 m_statusText = tr("Transmission complete");
629 Q_EMIT statusTextChanged();
630 appendLog(tr("Raw binary transmission complete (%1 bytes)").arg(m_bytesSent));
631 return;
632 }
633
634 QByteArray block = m_file.read(m_blockSize);
635 if (!block.isEmpty()) {
636 (void)IO::ConnectionManager::instance().writeData(block);
637 m_bytesSent += block.size();
638 Q_EMIT progressChanged();
639 }
640}
641
642//--------------------------------------------------------------------------------------------------
643// Protocol callbacks

Callers

nothing calls this directly

Calls 6

isEmptyMethod · 0.80
isConnectedMethod · 0.45
atEndMethod · 0.45
readMethod · 0.45
writeDataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected