Small System Fusion cleanups.

This commit is contained in:
Jonathan Naylor 2016-02-16 07:57:46 +00:00
parent 833822d388
commit 151b95e5d3

View file

@ -54,7 +54,7 @@ bool CYSFControl::writeModem(unsigned char *data)
unsigned char fi = data[1U] & YSF_FI_MASK; unsigned char fi = data[1U] & YSF_FI_MASK;
unsigned char dt = data[1U] & YSF_DT_MASK; unsigned char dt = data[1U] & YSF_DT_MASK;
if (valid && m_state == RS_LISTENING) { if (type == TAG_DATA && valid && m_state == RS_LISTENING) {
m_frames = 0U; m_frames = 0U;
m_timeoutTimer.start(); m_timeoutTimer.start();
m_display->writeFusion("XXXXXX"); m_display->writeFusion("XXXXXX");
@ -62,14 +62,16 @@ bool CYSFControl::writeModem(unsigned char *data)
LogMessage("YSF, received RF header"); LogMessage("YSF, received RF header");
} }
if (fi == YSF_DT_TERMINATOR_CHANNEL) { if (m_state != RS_RELAYING_RF_AUDIO)
if (m_state == RS_RELAYING_RF_AUDIO) { return false;
if (type == TAG_EOT) {
CSync::addYSFSync(data + 2U); CSync::addYSFSync(data + 2U);
m_frames++; m_frames++;
if (m_duplex) { if (m_duplex) {
data[0U] = TAG_DATA; data[0U] = TAG_EOT;
data[1U] = 0x00U; data[1U] = 0x00U;
writeQueue(data); writeQueue(data);
} }
@ -77,7 +79,6 @@ bool CYSFControl::writeModem(unsigned char *data)
LogMessage("YSF, received RF end of transmission, %.1f seconds", float(m_frames) / 10.0F); LogMessage("YSF, received RF end of transmission, %.1f seconds", float(m_frames) / 10.0F);
writeEndOfTransmission(); writeEndOfTransmission();
}
return false; return false;
} else { } else {