Implemented rxSquelchOpen() function for M17 opmode handler, returning true in case of valid stream data.
This commit is contained in:
parent
0adab74255
commit
8fe9837035
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
||||
}
|
||||
|
|
@ -54,9 +55,10 @@ void OpMode_M17::enable()
|
|||
codec_init();
|
||||
modulator.init();
|
||||
demodulator.init();
|
||||
locked = false;
|
||||
startRx = true;
|
||||
startTx = false;
|
||||
locked = false;
|
||||
dataValid = false;
|
||||
startRx = true;
|
||||
startTx = false;
|
||||
}
|
||||
|
||||
void OpMode_M17::disable()
|
||||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue