Skip to content

Commit 7bc425b

Browse files
committed
Use getRSSI() for telemetry detection
1 parent bad5cb3 commit 7bc425b

File tree

4 files changed

+3
-15
lines changed

4 files changed

+3
-15
lines changed

src/SCRIPTS/BF/background.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,8 @@ local timeIsSet = false
33
local getApiVersion, setRtc, rssiTask
44
local rssiEnabled = true
55

6-
local function modelActive()
7-
return getValue(protocol.stateSensor) > 0
8-
end
9-
106
local function run_bg()
11-
if modelActive() then
7+
if getRSSI() > 0 then
128
-- Send data when the telemetry connection is available
139
-- assuming when sensor value higher than 0 there is an telemetry connection
1410
if not apiVersionReceived then

src/SCRIPTS/BF/protocols.lua

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ local supportedProtocols =
33
smartPort =
44
{
55
mspTransport = "MSP/sp.lua",
6-
rssi = function() return getValue("RSSI") end,
7-
stateSensor = "Tmp1",
86
push = sportTelemetryPush,
97
maxTxBufferSize = 6,
108
maxRxBufferSize = 6,
@@ -16,8 +14,6 @@ local supportedProtocols =
1614
{
1715
mspTransport = "MSP/crsf.lua",
1816
cmsTransport = "CMS/crsf.lua",
19-
rssi = function() return getValue("TQly") end,
20-
stateSensor = "1RSS",
2117
push = crossfireTelemetryPush,
2218
maxTxBufferSize = 8,
2319
maxRxBufferSize = 58,

src/SCRIPTS/BF/ui.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ local function run_ui(event)
408408
prevUiState = nil
409409
end
410410
end
411-
if protocol.rssi() == 0 then
411+
if getRSSI() == 0 then
412412
lcd.drawText(radio.NoTelem[1],radio.NoTelem[2],radio.NoTelem[3],radio.NoTelem[4])
413413
end
414414
mspProcessTxQ()

src/SCRIPTS/BF/ui_init.lua

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,8 @@ local boardInfoReceived = false
55
local getApiVersion, getVtxTables, getMCUId, getBoardInfo
66
local returnTable = { f = nil, t = "" }
77

8-
local function modelActive()
9-
return getValue(protocol.stateSensor) > 0
10-
end
11-
128
local function init()
13-
if not modelActive() then
9+
if getRSSI() == 0 then
1410
returnTable.t = "Waiting for connection"
1511
elseif not apiVersionReceived then
1612
getApiVersion = getApiVersion or assert(loadScript("api_version.lua"))()

0 commit comments

Comments
 (0)