Skip to content

Commit acfe093

Browse files
eriedclaude
andcommitted
fix(scan): match LeaperKim's LK serial-prefix BLE names
The scanner's Veteran filter only knew model tokens (Sherman / Patton / Abrams / Lynx). Real wheels often advertise as `LK<digits>` — LK20712 (Lynx S), LK19957 (Oryx), LK19486 — with NO model token in the name, so they were silently filtered out of the wheel-scan list. The user couldn't even see their LK20712 to tap on. CompositeWheelAdapter.pickAdapter already routed these to the Veteran adapter at connect time via the same `^lk\d` / "oryx" / "nosfet" / "leaperkim" patterns; the scan filter was just out of sync. Aligned them so anything the adapter picker would accept also shows up in scan. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 8c0d912 commit acfe093

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

app/src/main/java/com/eried/eucplanet/ble/BleScanner.kt

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,18 @@ class BleScanner @Inject constructor(
124124
name.startsWith("Mten", ignoreCase = true) || name.startsWith("MCM5", ignoreCase = true) ||
125125
name.startsWith("Hero", ignoreCase = true) ||
126126
name.startsWith("T3", ignoreCase = true) || name.startsWith("T4", ignoreCase = true)) return true
127-
// Veteran
127+
// Veteran (LeaperKim). Match the model tokens AND the brand's own
128+
// serial-style BLE prefixes — many wheels advertise as `LK<digits>`
129+
// (the rider's Lynx S showed up as `LK20712`, the Oryx as `LK19957`)
130+
// with no model token in the name, so the scan filter has to know
131+
// about the prefixes too. CompositeWheelAdapter.pickAdapter already
132+
// routes these to the Veteran adapter at connect time; the same
133+
// patterns belong here so they're not filtered out before scan.
128134
val nl = name.lowercase()
129135
if ("sherman" in nl || "patton" in nl || "abrams" in nl ||
130-
Regex("\\blynx\\b").containsMatchIn(nl)) return true
136+
"oryx" in nl || "nosfet" in nl || "leaperkim" in nl ||
137+
Regex("\\blynx\\b").containsMatchIn(nl) ||
138+
Regex("^lk\\d").containsMatchIn(nl)) return true
131139
// Ninebot / Segway-Ninebot. Both protocol families (Z and legacy)
132140
// start with the brand prefix; "ZN<serial>" is the bare-firmware
133141
// form on some Z6 wheels; "MiniPlus<serial>" advertises Z protocol

0 commit comments

Comments
 (0)