Implemented rxSquelchOpen() function for M17 opmode handler, returning true in case of valid stream data.

This commit is contained in:
Silvano Seva 2023-09-12 17:42:02 +02:00
parent 0adab74255
commit 8fe9837035
2 changed files with 14 additions and 6 deletions

View File

@ -92,7 +92,7 @@ public:
*/
virtual bool rxSquelchOpen() override
{
return false;
return dataValid;
}
private:
@ -125,6 +125,7 @@ private:
bool startRx; ///< Flag for RX management.
bool startTx; ///< Flag for TX management.
bool locked; ///< Demodulator locked on data stream.
bool dataValid; ///< Demodulated data is valid
bool invertTxPhase; ///< TX signal phase inversion setting.
bool invertRxPhase; ///< RX signal phase inversion setting.
pathId rxAudioPath; ///< Audio path ID for RX

View File

@ -39,7 +39,8 @@ using namespace std;
using namespace M17;
OpMode_M17::OpMode_M17() : startRx(false), startTx(false), locked(false),
invertTxPhase(false), invertRxPhase(false)
dataValid(false), invertTxPhase(false),
invertRxPhase(false)
{
}
@ -55,6 +56,7 @@ void OpMode_M17::enable()
modulator.init();
demodulator.init();
locked = false;
dataValid = false;
startRx = true;
startTx = false;
}
@ -129,7 +131,7 @@ void OpMode_M17::update(rtxStatus_t *const status, const bool newCfg)
{
case RX:
if(locked)
if(dataValid)
platform_ledOn(GREEN);
else
platform_ledOff(GREEN);
@ -214,6 +216,8 @@ void OpMode_M17::rxState(rtxStatus_t *const status)
if(status->lsfOk)
{
dataValid = true;
// Retrieve stream source and destination data
std::string dst = lsf.getDestination();
std::string src = lsf.getSource();
@ -261,7 +265,10 @@ void OpMode_M17::rxState(rtxStatus_t *const status)
// Force invalidation of LSF data as soon as lock is lost (for whatever cause)
if(locked == false)
{
status->lsfOk = false;
dataValid = false;
}
}
void OpMode_M17::txState(rtxStatus_t *const status)