Skip to content

Commit

Permalink
Remove P25 LDU validation.
Browse files Browse the repository at this point in the history
  • Loading branch information
g4klx committed Jan 26, 2024
1 parent 0571d90 commit 9298235
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
25 changes: 13 additions & 12 deletions P25Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,16 @@ m_networkWatchdog(1000U, 0U, 1500U),
m_rfFrames(0U),
m_rfBits(0U),
m_rfErrs(0U),
m_rfUndecodableLC(0U),
// m_rfUndecodableLC(0U),
m_netFrames(0U),
m_netLost(0U),
m_rfDataFrames(0U),
m_nid(nac),
m_lastDUID(P25_DUID_TERM),
m_audio(),
m_rfData(),
m_rfLastLDU1(),
m_rfLastLDU2(),
// m_rfLastLDU1(),
// m_rfLastLDU2(),
m_netData(),
m_rfLSD(),
m_netLSD(),
Expand Down Expand Up @@ -134,7 +134,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len)
else
LogMessage("P25, transmission lost from %s to %s%u, %.1f seconds, BER: %.1f%%", source.c_str(), grp ? "TG " : "", dstId, float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits));

LogMessage("P25, total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_rfFrames, m_rfBits, m_rfUndecodableLC, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits));
// LogMessage("P25, total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_rfFrames, m_rfBits, m_rfUndecodableLC, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits));

if (m_netState == RS_NET_IDLE)
m_display->clearP25();
Expand Down Expand Up @@ -289,6 +289,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len)
}

if (m_rfState == RS_RF_AUDIO) {
/*
bool ret = m_rfData.decodeLDU1(data + 2U);
if (!ret) {
LogWarning("P25, LDU1 undecodable LC, using last LDU1 LC");
Expand All @@ -297,7 +298,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len)
} else {
m_rfLastLDU1 = m_rfData;
}

*/
// Regenerate Sync
CSync::addP25Sync(data + 2U);

Expand Down Expand Up @@ -342,16 +343,16 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len)
}
} else if (duid == P25_DUID_LDU2) {
if (m_rfState == RS_RF_AUDIO) {
/*
bool ret = m_rfData.decodeLDU2(data + 2U);
if (!ret) {
LogWarning("P25, LDU2 undecodable LC, using last LDU2 LC");
m_rfData = m_rfLastLDU2;
m_rfUndecodableLC++;
}
else {
} else {
m_rfLastLDU2 = m_rfData;
}

*/
writeNetwork(m_rfLDU, m_lastDUID, false);

// Regenerate Sync
Expand Down Expand Up @@ -505,7 +506,7 @@ bool CP25Control::writeModem(unsigned char* data, unsigned int len)
else
LogMessage("P25, received RF end of voice transmission from %s to %s%u, %.1f seconds, BER: %.1f%%", source.c_str(), grp ? "TG " : "", dstId, float(m_rfFrames) / 5.56F, float(m_rfErrs * 100U) / float(m_rfBits));

LogMessage("P25, total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_rfFrames, m_rfBits, m_rfUndecodableLC, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits));
// LogMessage("P25, total frames: %d, bits: %d, undecodable LC: %d, errors: %d, BER: %.4f%%", m_rfFrames, m_rfBits, m_rfUndecodableLC, m_rfErrs, float(m_rfErrs * 100U) / float(m_rfBits));

m_display->clearP25();

Expand Down Expand Up @@ -967,9 +968,9 @@ void CP25Control::createRFHeader()

m_rfFrames = 0U;
m_rfErrs = 0U;
m_rfUndecodableLC = 0U;
m_rfLastLDU1.reset();
m_rfLastLDU2.reset();
// m_rfUndecodableLC = 0U;
// m_rfLastLDU1.reset();
// m_rfLastLDU2.reset();
m_rfBits = 1U;
m_rfTimeout.start();
m_lastDUID = P25_DUID_HEADER;
Expand Down
6 changes: 3 additions & 3 deletions P25Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,16 @@ class CP25Control {
unsigned int m_rfFrames;
unsigned int m_rfBits;
unsigned int m_rfErrs;
unsigned int m_rfUndecodableLC;
// unsigned int m_rfUndecodableLC;
unsigned int m_netFrames;
unsigned int m_netLost;
unsigned int m_rfDataFrames;
CP25NID m_nid;
unsigned char m_lastDUID;
CP25Audio m_audio;
CP25Data m_rfData;
CP25Data m_rfLastLDU1;
CP25Data m_rfLastLDU2;
// CP25Data m_rfLastLDU1;
// CP25Data m_rfLastLDU2;
CP25Data m_netData;
CP25LowSpeedData m_rfLSD;
CP25LowSpeedData m_netLSD;
Expand Down

0 comments on commit 9298235

Please sign in to comment.