Merge pull request #8297 from opentx/3djc/fix-7720

Send 0 with LUA getRSSI() when no telemetry is streaming
This commit is contained in:
Bertrand Songis
2021-03-10 16:07:25 +01:00
committed by GitHub
+4 -1
View File
@@ -1411,7 +1411,10 @@ Get RSSI value as well as low and critical RSSI alarm levels (in dB)
*/
static int luaGetRSSI(lua_State * L)
{
lua_pushunsigned(L, min((uint8_t)99, TELEMETRY_RSSI()));
if (TELEMETRY_STREAMING())
lua_pushunsigned(L, min((uint8_t)99, TELEMETRY_RSSI()));
else
lua_pushunsigned(L, 0);
lua_pushunsigned(L, g_model.rssiAlarms.getWarningRssi());
lua_pushunsigned(L, g_model.rssiAlarms.getCriticalRssi());
return 3;