mirror of
https://github.com/g4klx/MMDVMHost
synced 2025-12-22 16:25:45 +08:00
Remove duplication of frames.
This commit is contained in:
@@ -246,23 +246,17 @@ bool CDMRNetwork::write(const CDMRData& data)
|
|||||||
|
|
||||||
unsigned int slotIndex = slotNo - 1U;
|
unsigned int slotIndex = slotNo - 1U;
|
||||||
|
|
||||||
unsigned int count = 1U;
|
|
||||||
|
|
||||||
unsigned char dataType = data.getDataType();
|
unsigned char dataType = data.getDataType();
|
||||||
if (dataType == DT_VOICE_SYNC) {
|
if (dataType == DT_VOICE_SYNC) {
|
||||||
buffer[15U] |= 0x10U;
|
buffer[15U] |= 0x10U;
|
||||||
} else if (dataType == DT_VOICE) {
|
} else if (dataType == DT_VOICE) {
|
||||||
buffer[15U] |= data.getN();
|
buffer[15U] |= data.getN();
|
||||||
} else {
|
} else {
|
||||||
if (dataType == DT_VOICE_LC_HEADER) {
|
if (dataType == DT_VOICE_LC_HEADER)
|
||||||
m_streamId[slotIndex] = ::rand() + 1U;
|
m_streamId[slotIndex] = ::rand() + 1U;
|
||||||
count = 2U;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (dataType == DT_CSBK || dataType == DT_DATA_HEADER) {
|
if (dataType == DT_CSBK || dataType == DT_DATA_HEADER)
|
||||||
m_streamId[slotIndex] = ::rand() + 1U;
|
m_streamId[slotIndex] = ::rand() + 1U;
|
||||||
count = 1U;
|
|
||||||
}
|
|
||||||
|
|
||||||
buffer[15U] |= (0x20U | dataType);
|
buffer[15U] |= (0x20U | dataType);
|
||||||
}
|
}
|
||||||
@@ -280,7 +274,6 @@ bool CDMRNetwork::write(const CDMRData& data)
|
|||||||
if (m_debug)
|
if (m_debug)
|
||||||
CUtils::dump(1U, "Network Transmitted", buffer, HOMEBREW_DATA_PACKET_LENGTH);
|
CUtils::dump(1U, "Network Transmitted", buffer, HOMEBREW_DATA_PACKET_LENGTH);
|
||||||
|
|
||||||
for (unsigned int i = 0U; i < count; i++)
|
|
||||||
write(buffer, HOMEBREW_DATA_PACKET_LENGTH);
|
write(buffer, HOMEBREW_DATA_PACKET_LENGTH);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user