Added API function allowing to query the current status of the RX audio squelch

This commit is contained in:
Silvano Seva 2021-12-07 10:02:19 +01:00 committed by Niccolò Izzo
parent 7c978470c2
commit 3c6ad9802c
6 changed files with 44 additions and 0 deletions

View File

@ -88,6 +88,16 @@ public:
{ {
return NONE; return NONE;
} }
/**
* Check if RX squelch is open.
*
* @return true if RX squelch is open.
*/
virtual bool rxSquelchOpen()
{
return false;
}
}; };
#endif /* OPMODE_H */ #endif /* OPMODE_H */

View File

@ -81,6 +81,13 @@ public:
return FM; return FM;
} }
/**
* Check if RX squelch is open.
*
* @return true if RX squelch is open.
*/
virtual bool rxSquelchOpen() override;
private: private:
bool rfSqlOpen; ///< Flag for RF squelch status (analog squelch). bool rfSqlOpen; ///< Flag for RF squelch status (analog squelch).

View File

@ -83,6 +83,16 @@ public:
return M17; return M17;
} }
/**
* Check if RX squelch is open.
*
* @return true if RX squelch is open.
*/
virtual bool rxSquelchOpen() override
{
return false;
}
private: private:
/** /**

View File

@ -131,6 +131,13 @@ void rtx_taskFunc();
*/ */
float rtx_getRssi(); float rtx_getRssi();
/**
* Get current status of the RX squelch. This function is thread-safe and can
* be called also from threads other than the one running the RTX task.
* @return true if RX squelch is open.
*/
bool rtx_rxSquelchOpen();
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif

View File

@ -194,3 +194,8 @@ void OpMode_FM::update(rtxStatus_t *const status, const bool newCfg)
// Sleep thread for 30ms for 33Hz update rate // Sleep thread for 30ms for 33Hz update rate
sleepFor(0u, 30u); sleepFor(0u, 30u);
} }
bool OpMode_FM::rxSquelchOpen()
{
return sqlOpen;
}

View File

@ -207,3 +207,8 @@ float rtx_getRssi()
{ {
return rssi; return rssi;
} }
bool rtx_rxSquelchOpen()
{
return currMode->rxSquelchOpen();
}