diff --git a/DStarControl.cpp b/DStarControl.cpp index 104c176..cb66c5b 100644 --- a/DStarControl.cpp +++ b/DStarControl.cpp @@ -473,12 +473,12 @@ void CDStarControl::writeNetwork() m_ackTimer.stop(); m_netFrames = 0U; - m_netLost = 0U; + m_netLost = 0U; - m_netN = 0U; + m_netN = 20U; - m_netBits = 1U; - m_netErrs = 0U; + m_netBits = 1U; + m_netErrs = 0U; writeQueueHeaderNet(data); @@ -536,12 +536,14 @@ void CDStarControl::writeNetwork() m_netErrs += errors; m_netBits += 48U; + m_netN = n; + + LogDebug("D-Star, audio sequence no. %u, errs: %u/48", m_netN, errors); + // Regenerate the sync if (n == 0U) CSync::addDStarSync(data + 2U); - m_netN = n; - m_packetTimer.start(); m_netFrames++; diff --git a/Modem.cpp b/Modem.cpp index e66aa9f..634deca 100644 --- a/Modem.cpp +++ b/Modem.cpp @@ -419,14 +419,17 @@ void CModem::clock(unsigned int ms) if (m_debug) { switch (buffer[3U]) { case MMDVM_DSTAR_HEADER: + LogDebug("D-Star header space reported = %u", m_dstarSpace); CUtils::dump(1U, "TX D-Star Header", m_buffer, len); m_dstarSpace -= 4U; break; case MMDVM_DSTAR_DATA: + LogDebug("D-Star data space reported = %u", m_dstarSpace); CUtils::dump(1U, "TX D-Star Data", m_buffer, len); m_dstarSpace -= 1U; break; default: + LogDebug("D-Star EOT space reported = %u", m_dstarSpace); CUtils::dump(1U, "TX D-Star EOT", m_buffer, len); m_dstarSpace -= 1U; break; @@ -574,10 +577,18 @@ bool CModem::writeDStarData(const unsigned char* data, unsigned int length) buffer[1U] = length + 2U; switch (data[0U]) { - case TAG_HEADER: buffer[2U] = MMDVM_DSTAR_HEADER; break; - case TAG_DATA: buffer[2U] = MMDVM_DSTAR_DATA; break; - case TAG_EOT: buffer[2U] = MMDVM_DSTAR_EOT; break; - default: return false; + case TAG_HEADER: + buffer[2U] = MMDVM_DSTAR_HEADER; + break; + case TAG_DATA: + buffer[2U] = MMDVM_DSTAR_DATA; + break; + case TAG_EOT: + buffer[2U] = MMDVM_DSTAR_EOT; + break; + default: + CUtils::dump(2U, "Unknown D-Star packet type", data, length); + return false; } ::memcpy(buffer + 3U, data + 1U, length - 1U);