diff --git a/FM.cpp b/FM.cpp index 591aa38..664df88 100644 --- a/FM.cpp +++ b/FM.cpp @@ -328,7 +328,7 @@ void CFM::clock(uint8_t length) m_statusTimer.clock(length); if (m_statusTimer.isRunning() && m_statusTimer.hasExpired()) { - serial.writeFMStatus(); + serial.writeFMStatus(m_state); m_statusTimer.start(); } } @@ -356,7 +356,7 @@ void CFM::listeningState(bool validRFSignal, bool validExtSignal) m_callsignTimer.start(); m_statusTimer.start(); - serial.writeFMStatus(); + serial.writeFMStatus(m_state); } else if (validExtSignal) { if (m_kerchunkTimer.getTimeout() > 0U) { DEBUG1("State to KERCHUNK_EXT"); @@ -378,7 +378,7 @@ void CFM::listeningState(bool validRFSignal, bool validExtSignal) m_callsignTimer.start(); m_statusTimer.start(); - serial.writeFMStatus(); + serial.writeFMStatus(m_state); } } @@ -731,4 +731,3 @@ void CFM::insertSilence(uint16_t ms) for (uint32_t i = 0U; i < nSamples; i++) m_outputRFRB.put(0); } - diff --git a/SerialPort.cpp b/SerialPort.cpp index c7c6cc1..82913fa 100644 --- a/SerialPort.cpp +++ b/SerialPort.cpp @@ -1263,7 +1263,7 @@ void CSerialPort::writeFMData(const uint8_t* data, uint8_t length) writeInt(1U, reply, count); } -void CSerialPort::writeFMStatus() +void CSerialPort::writeFMStatus(uint8_t status) { if (m_modemState != STATE_FM && m_modemState != STATE_IDLE) return; @@ -1274,10 +1274,11 @@ void CSerialPort::writeFMStatus() uint8_t reply[10U]; reply[0U] = MMDVM_FRAME_START; - reply[1U] = 3U; + reply[1U] = 4U; reply[2U] = MMDVM_FM_STATUS; + reply[3U] = status; - writeInt(1U, reply, 3); + writeInt(1U, reply, 4); } void CSerialPort::writeCalData(const uint8_t* data, uint8_t length) diff --git a/SerialPort.h b/SerialPort.h index 9170368..2b5eb9a 100644 --- a/SerialPort.h +++ b/SerialPort.h @@ -51,7 +51,7 @@ public: void writeNXDNLost(); void writeFMData(const uint8_t* data, uint8_t length); - void writeFMStatus(); + void writeFMStatus(uint8_t status); void writeCalData(const uint8_t* data, uint8_t length); void writeRSSIData(const uint8_t* data, uint8_t length);