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

pull/63/head
Silvano Seva 2021-12-07 10:02:19 +01:00 zatwierdzone przez Niccolò Izzo
rodzic 7c978470c2
commit 3c6ad9802c
6 zmienionych plików z 44 dodań i 0 usunięć

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

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

Wyświetl plik

@ -131,6 +131,13 @@ void rtx_taskFunc();
*/
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
}
#endif

Wyświetl plik

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

Wyświetl plik

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