Skip to content

Commit

Permalink
Drop duplicate packets
Browse files Browse the repository at this point in the history
  • Loading branch information
juribeparada committed Feb 9, 2018
1 parent 349cc43 commit 04934c5
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions DMRSlot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1353,10 +1353,10 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
m_netLost = 0U;
}

insertSilence(data, dmrData.getN());

if (!m_netTimeout)
writeQueueNet(data);
if (insertSilence(data, dmrData.getN())) {
if (!m_netTimeout)
writeQueueNet(data);
}

m_netEmbeddedReadN = (m_netEmbeddedReadN + 1U) % 2U;
m_netEmbeddedWriteN = (m_netEmbeddedWriteN + 1U) % 2U;
Expand Down Expand Up @@ -1505,10 +1505,10 @@ void CDMRSlot::writeNetwork(const CDMRData& dmrData)
m_netLost = 0U;
}

insertSilence(data, dmrData.getN());

if (!m_netTimeout)
writeQueueNet(data);
if (insertSilence(data, dmrData.getN())) {
if (!m_netTimeout)
writeQueueNet(data);
}

m_packetTimer.start();
m_elapsed.start();
Expand Down Expand Up @@ -1989,6 +1989,10 @@ bool CDMRSlot::insertSilence(const unsigned char* data, unsigned char seqNo)
{
assert(data != NULL);

// Do not send duplicate
if (seqNo == m_netN)
return false;

// Check to see if we have any spaces to fill?
unsigned char seq = (m_netN + 1U) % 6U;

Expand Down

0 comments on commit 04934c5

Please sign in to comment.