Skip to content

Commit 9998b9d

Browse files
committed
rename "No link" to "No telemetry"
1 parent 5569ebf commit 9998b9d

13 files changed

Lines changed: 43 additions & 43 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ The simulator supports multiple test scenarios, configurable via the `config.sce
102102
| Scenario | Description |
103103
|----------|-------------|
104104
| `normal` | TX + RX connected. Happy path with full telemetry and all parameters. |
105-
| `disconnected` | TX present but no RX. Shows "No link" state. |
105+
| `no_telemetry` | TX present but no RX telemetry. Shows "No telemetry" state. |
106106
| `reconnect` | Starts disconnected, transitions to connected after ~5 seconds. |
107107
| `model_mismatch` | TX + RX connected with Model ID mismatch flag. Triggers warning dialog. |
108108
| `armed` | TX + RX connected with "is Armed" warning flag. |

src/SCRIPTS/ELRS/crsf.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ CRSF._handlers = {}
7070
-- Device info cache (populated by built-in DEVICE_INFO handler)
7171
CRSF.deviceInfo = {}
7272

73-
-- RX connection state (populated by built-in ELRS_STATUS handler)
74-
CRSF.rxConnected = false
73+
-- Telemetry state (populated by built-in ELRS_STATUS handler)
74+
CRSF.hasTelemetry = false
7575
CRSF.modelMismatch = false
7676
CRSF.elrsFlags = 0
7777
CRSF.elrsFlagsInfo = ""
@@ -245,7 +245,7 @@ function CRSF:requestDeviceInfo()
245245
end
246246

247247
--- Request ELRS status from the TX module (PARAMETER_WRITE with fieldId=0).
248-
-- Updates rxConnected via the ELRS_STATUS handler on the next poll().
248+
-- Updates hasTelemetry via the ELRS_STATUS handler on the next poll().
249249
-- Rate-limited to at most once per second.
250250
function CRSF:requestElrsStatus()
251251
local now = getTime()
@@ -395,10 +395,10 @@ local function onDeviceInfo(data)
395395
end
396396
end
397397

398-
-- ELRS_STATUS handler: updates rxConnected, modelMismatch, elrsFlagsInfo
398+
-- ELRS_STATUS handler: updates hasTelemetry, modelMismatch, elrsFlagsInfo
399399
local function onElrsStatus(data)
400400
CRSF.elrsFlags = data[6] or 0
401-
CRSF.rxConnected = bit32.btest(CRSF.elrsFlags, 1)
401+
CRSF.hasTelemetry = bit32.btest(CRSF.elrsFlags, 1)
402402
CRSF.modelMismatch = bit32.btest(CRSF.elrsFlags, 4)
403403

404404
-- Parse null-terminated warning info string starting at data[7]

src/SCRIPTS/TOOLS/ExpressLRS/protocol.lua

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ local Protocol = {
100100
expectChunksRemain = -1,
101101
backgroundLoading = false,
102102

103-
-- Connection transition tracking (for auto-discovery on reconnect)
104-
wasConnected = false,
103+
-- Telemetry transition tracking (for auto-discovery on reconnect)
104+
hadTelemetry = false,
105105
}
106106

107107
-- ============================================================================
@@ -135,7 +135,7 @@ function Protocol.reset()
135135
Protocol.loadQueue = {}
136136
Protocol.expectChunksRemain = -1
137137
Protocol.backgroundLoading = false
138-
Protocol.wasConnected = false
138+
Protocol.hadTelemetry = false
139139
end
140140

141141
-- ============================================================================
@@ -157,8 +157,8 @@ function Protocol.pingDevices()
157157
)
158158
end
159159

160-
-- Check connection state from elrsFlags
161-
function Protocol.isConnected()
160+
-- Check if telemetry is being received from the RX (elrsFlags bit 1)
161+
function Protocol.hasTelemetry()
162162
return bit32.btest(Protocol.elrsFlags, 1)
163163
end
164164

@@ -742,12 +742,12 @@ function Protocol.poll()
742742
end
743743

744744
function Protocol.tick()
745-
-- Ping on connection transition (device may have changed)
746-
local connected = Protocol.isConnected()
747-
if connected and not Protocol.wasConnected then
745+
-- Ping on telemetry transition (device may have changed)
746+
local hasTelemetry = Protocol.hasTelemetry()
747+
if hasTelemetry and not Protocol.hadTelemetry then
748748
Protocol.pingDevices()
749749
end
750-
Protocol.wasConnected = connected
750+
Protocol.hadTelemetry = hasTelemetry
751751

752752
local time = getTime()
753753
-- Periodic ping for initial device discovery

src/SCRIPTS/TOOLS/ExpressLRS/ui/lcd.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ function UI.drawTitle()
419419
local barHeight = 9
420420
local goodBadPkt = ""
421421
if Protocol.receivedPackets then
422-
local state = Protocol.isConnected() and "C" or "-"
422+
local state = Protocol.hasTelemetry() and "C" or "-"
423423
goodBadPkt = string.format("%u/%u %s", Protocol.lostPackets, Protocol.receivedPackets, state)
424424
end
425425

src/SCRIPTS/TOOLS/ExpressLRS/ui/lvgl.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -664,7 +664,7 @@ function UI.getSubtitle()
664664

665665
local subtitle = ""
666666
if Protocol.receivedPackets then
667-
local state = Protocol.isConnected() and "Connected" or "No link"
667+
local state = Protocol.hasTelemetry() and "Telemetry OK" or "No telemetry"
668668
subtitle = string.format("%u/%u • %s", Protocol.lostPackets, Protocol.receivedPackets, state)
669669
end
670670

src/WIDGETS/ELRSTelemetry/loadable.lua

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ function Telemetry.statusText()
9494
if not crsf.hasCrsfModule() then
9595
return "No CRSF module"
9696
end
97-
if not crsf.rxConnected then
98-
return "No RX"
97+
if not crsf.hasTelemetry then
98+
return "No telemetry"
9999
end
100100
if crsf.modelMismatch then
101101
return "Model Mismatch"
@@ -127,7 +127,7 @@ end
127127

128128
--- Get RF mode string from device info.
129129
function Telemetry.getRfModeStr(rfmd)
130-
if not crsf.rxConnected or rfmd == nil then
130+
if not crsf.hasTelemetry or rfmd == nil then
131131
return ""
132132
end
133133
local mod = crsf.deviceInfo
@@ -170,7 +170,7 @@ end
170170

171171
--- Range percentage + RSSI text (e.g. "Range 69% -90dBm").
172172
function Telemetry.signalText()
173-
if not crsf.rxConnected then
173+
if not crsf.hasTelemetry then
174174
return ""
175175
end
176176
local tlm = Telemetry.readLink()
@@ -188,7 +188,7 @@ function Telemetry.rfDetailText()
188188
local tlm = Telemetry.readLink()
189189
local mode = Telemetry.getRfModeStr(tlm.rfmd)
190190
local parts = { mode }
191-
if crsf.rxConnected and tlm.tpwr then
191+
if crsf.hasTelemetry and tlm.tpwr then
192192
parts[#parts + 1] = table.concat({ tostring(tlm.tpwr), "mW" })
193193
end
194194
return table.concat(parts, " ")
@@ -351,8 +351,8 @@ local function buildFullScreen()
351351
if not Telemetry.hasModule() then
352352
return "No CRSF module"
353353
end
354-
if not crsf.rxConnected then
355-
return "No RX Connected"
354+
if not crsf.hasTelemetry then
355+
return "No telemetry"
356356
end
357357
if crsf.modelMismatch then
358358
return "Model Mismatch"
@@ -413,15 +413,15 @@ local function buildFullScreen()
413413
end)
414414

415415
createDisplayRow(fields, "Link Quality", function()
416-
if not crsf.rxConnected then
416+
if not crsf.hasTelemetry then
417417
return "--"
418418
end
419419
local tlm = Telemetry.readLink()
420420
return table.concat({ tostring(tlm.rqly or 0), "%" })
421421
end)
422422

423423
createDisplayRow(fields, "RSSI 1", function()
424-
if not crsf.rxConnected then
424+
if not crsf.hasTelemetry then
425425
return "--"
426426
end
427427
local tlm = Telemetry.readLink()
@@ -432,7 +432,7 @@ local function buildFullScreen()
432432
end)
433433

434434
createDisplayRow(fields, "RSSI 2", function()
435-
if not crsf.rxConnected then
435+
if not crsf.hasTelemetry then
436436
return "--"
437437
end
438438
local tlm = Telemetry.readLink()
@@ -448,7 +448,7 @@ local function buildFullScreen()
448448
end)
449449

450450
createDisplayRow(fields, "Active Antenna", function()
451-
if not crsf.rxConnected then
451+
if not crsf.hasTelemetry then
452452
return "--"
453453
end
454454
local tlm = Telemetry.readLink()
@@ -459,7 +459,7 @@ local function buildFullScreen()
459459
end)
460460

461461
createDisplayRow(fields, "Range", function()
462-
if not crsf.rxConnected then
462+
if not crsf.hasTelemetry then
463463
return "--"
464464
end
465465
local tlm = Telemetry.readLink()
@@ -471,7 +471,7 @@ local function buildFullScreen()
471471
createSectionHeader(fields, "Power")
472472

473473
createDisplayRow(fields, "TX Power", function()
474-
if not crsf.rxConnected then
474+
if not crsf.hasTelemetry then
475475
return "--"
476476
end
477477
local tlm = Telemetry.readLink()
@@ -482,7 +482,7 @@ local function buildFullScreen()
482482
end)
483483

484484
createDisplayRow(fields, "Power Index", function()
485-
if not crsf.rxConnected then
485+
if not crsf.hasTelemetry then
486486
return "--"
487487
end
488488
local tlm = Telemetry.readLink()
@@ -586,7 +586,7 @@ function wgt.refresh(_event, _touchState)
586586
wgt.background()
587587

588588
-- Update diversity detection each tick
589-
if crsf.rxConnected then
589+
if crsf.hasTelemetry then
590590
local tlm = Telemetry.readLink()
591591
Telemetry.updateDiversity(tlm.ant)
592592
end

src/WIDGETS/ELRSTelemetry/ui/hd.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ local function heroColorMismatch()
3838
end
3939

4040
local function detailColor()
41-
if not crsf.rxConnected then
41+
if not crsf.hasTelemetry then
4242
return COLOR_THEME_SECONDARY1
4343
end
4444
return Telemetry.rangeColor(Telemetry.smoothRng or 0)

src/WIDGETS/ELRSTelemetry/ui/portrait.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ local function heroColorMismatch()
3838
end
3939

4040
local function detailColor()
41-
if not crsf.rxConnected then
41+
if not crsf.hasTelemetry then
4242
return COLOR_THEME_SECONDARY1
4343
end
4444
return Telemetry.rangeColor(Telemetry.smoothRng or 0)

src/WIDGETS/ELRSTelemetry/ui/sd.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ local function heroColorMismatch()
3838
end
3939

4040
local function detailColor()
41-
if not crsf.rxConnected then
41+
if not crsf.hasTelemetry then
4242
return COLOR_THEME_SECONDARY1
4343
end
4444
return Telemetry.rangeColor(Telemetry.smoothRng or 0)

src/WIDGETS/ELRSTelemetry/ui/sd_tall.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ local function heroColorMismatch()
3939
end
4040

4141
local function detailColor()
42-
if not crsf.rxConnected then
42+
if not crsf.hasTelemetry then
4343
return COLOR_THEME_SECONDARY1
4444
end
4545
return Telemetry.rangeColor(Telemetry.smoothRng or 0)

0 commit comments

Comments
 (0)