Fix the logging messages for late entry.

This commit is contained in:
Jonathan Naylor
2020-11-26 14:25:45 +00:00
parent ec80e9553a
commit ef9fedcc01

View File

@@ -203,12 +203,15 @@ bool CM17Control::writeModem(unsigned char* data, unsigned int len)
if (colorCode != m_colorCode) if (colorCode != m_colorCode)
return false; return false;
bool lateEntry = false;
if (!m_rfLICH.isValid()) { if (!m_rfLICH.isValid()) {
unsigned char lich[M17_LICH_FRAGMENT_LENGTH_BYTES]; unsigned char lich[M17_LICH_FRAGMENT_LENGTH_BYTES];
CM17Utils::combineFragmentLICH(lich1, lich2, lich3, lich4, lich); CM17Utils::combineFragmentLICH(lich1, lich2, lich3, lich4, lich);
unsigned int n = (lich4 >> 4) & 0x07U; unsigned int n = (lich4 >> 4) & 0x07U;
m_rfLICH.setFragment(lich, n); m_rfLICH.setFragment(lich, n);
lateEntry = true;
} }
bool valid = m_rfLICH.isValid(); bool valid = m_rfLICH.isValid();
@@ -241,19 +244,19 @@ bool CM17Control::writeModem(unsigned char* data, unsigned int len)
unsigned char dataType = m_rfLICH.getDataType(); unsigned char dataType = m_rfLICH.getDataType();
switch (dataType) { switch (dataType) {
case 1U: case 1U:
LogMessage("M17, received RF data transmission from %s to %s", source.c_str(), dest.c_str()); LogMessage("M17, received RF %s data transmission from %s to %s", lateEntry ? "late entry" : "", source.c_str(), dest.c_str());
m_rfState = RS_RF_DATA; m_rfState = RS_RF_DATA;
break; break;
case 2U: case 2U:
LogMessage("M17, received RF voice transmission from %s to %s", source.c_str(), dest.c_str()); LogMessage("M17, received RF %s voice transmission from %s to %s", lateEntry ? "late entry" : "", source.c_str(), dest.c_str());
m_rfState = RS_RF_AUDIO; m_rfState = RS_RF_AUDIO;
break; break;
case 3U: case 3U:
LogMessage("M17, received RF voice + data transmission from %s to %s", source.c_str(), dest.c_str()); LogMessage("M17, received RF %s voice + data transmission from %s to %s", lateEntry ? "late entry" : "", source.c_str(), dest.c_str());
m_rfState = RS_RF_AUDIO; m_rfState = RS_RF_AUDIO;
break; break;
default: default:
LogMessage("M17, received RF unknown transmission from %s to %s", source.c_str(), dest.c_str()); LogMessage("M17, received RF %s unknown transmission from %s to %s", lateEntry ? "late entry" : "", source.c_str(), dest.c_str());
m_rfState = RS_RF_DATA; m_rfState = RS_RF_DATA;
break; break;
} }