MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / finishTransmit

Method finishTransmit

src/gui/Ax25HfPacketDecodeDialog.cpp:1802–1860  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1800}
1801
1802void Ax25HfPacketDecodeDialog::finishTransmit(bool aborted, const QString& reason)
1803{
1804 if (m_txPaceTimer)
1805 m_txPaceTimer->stop();
1806
1807 const bool hadTx = m_txActive || m_txPendingStream || !m_txPcm.isEmpty();
1808 m_txActive = false;
1809 m_txPendingStream = false;
1810
1811 if (m_radio) {
1812 auto& txModel = m_radio->transmitModel();
1813 if (txModel.isTransmitting())
1814 txModel.requestPttOff(TransmitModel::PttSource::Dax);
1815 if (m_txRestoreTransmitDax)
1816 txModel.setDax(m_txPreviousTransmitDax);
1817 }
1818 if (m_audio) {
1819 if (m_txRestoreAudioDaxMode)
1820 m_audio->setDaxTxMode(m_txPreviousAudioDaxMode);
1821 m_audio->clearTxAccumulators();
1822 }
1823
1824 if (hadTx) {
1825 appendSystemLine(aborted
1826 ? QStringLiteral("AX.25 TX aborted: %1.").arg(reason)
1827 : QStringLiteral("%1.").arg(reason));
1828 qCInfo(lcAx25).noquote()
1829 << QStringLiteral("AX.25 TX %1 reason=%2 chunks=%3/%4 bytes=%5/%6")
1830 .arg(aborted ? QStringLiteral("aborted") : QStringLiteral("finished"),
1831 reason)
1832 .arg(m_txChunkIndex)
1833 .arg(m_txChunkCount)
1834 .arg(m_txOffsetBytes)
1835 .arg(m_txPcm.size());
1836 }
1837
1838 m_txPcm.clear();
1839 m_pendingTx = {};
1840 m_txOffsetBytes = 0;
1841 m_txChunkIndex = 0;
1842 m_txChunkCount = 0;
1843 m_txRestoreAudioDaxMode = false;
1844 m_txRestoreTransmitDax = false;
1845 m_txFromKiss = false;
1846 refreshTransmitControls();
1847
1848 // Drain any queued KISS transmits. On a clean finish, kick the next one on a
1849 // deferred (queued) call so we never re-enter the TX path within finish; on
1850 // an abort, drop the backlog so a broken radio can't spin the queue.
1851 if (aborted) {
1852 if (!m_kissTxQueue.isEmpty()) {
1853 appendSystemLine(QStringLiteral("Dropping %1 queued KISS TX frame(s) after abort.")
1854 .arg(m_kissTxQueue.size()));
1855 m_kissTxQueue.clear();
1856 }
1857 } else if (!m_kissTxQueue.isEmpty()) {
1858 QTimer::singleShot(0, this, [this] { maybeStartNextKissTx(); });
1859 }

Callers

nothing calls this directly

Calls 9

isTransmittingMethod · 0.80
requestPttOffMethod · 0.80
setDaxMethod · 0.80
setDaxTxModeMethod · 0.80
clearTxAccumulatorsMethod · 0.80
stopMethod · 0.45
isEmptyMethod · 0.45
sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected