Skip to content

Commit 484a497

Browse files
eriedclaude
andcommitted
diag(inmotion-v1): log unhandled CAN ids so a non-streaming wheel is visible
Tester V8S connect capture: the wheel connects as V1 but streams only CAN 0x0F060101 (a short identity frame carrying the serial) at ~10 Hz, never fast/slow-info, then the BLE link drops with status=8 (supervision timeout) and the status-133 retry loops. Normal operation only exchanges 0x0F55xxxx telemetry / commands and 0x0F780101 alerts (docs 3.4), so 0x0F060101 means the wheel is not leaving its standby / locked / not-riding state (or another BLE client holds it). The same wheel streamed fine earlier, so this is wheel-state / RF, not our code. Log each distinct unhandled CAN id once per connection (deduped, cleared on disconnect) so the next diagnostics names the frame instead of dropping it silently. Diagnostic only, InMotion V1 only. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GADLyChheAoMX9dQbRgRnH
1 parent 2cae3b2 commit 484a497

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ class InMotionV1Adapter @Inject constructor() : WheelAdapter {
4242
*/
4343
private val reassemblyBuffer = ByteArrayOutputStream()
4444

45+
/** CAN IDs already logged as unhandled this connection, so an unexpected
46+
* frame the wheel repeats at ~10 Hz is noted once, not thousands of times.
47+
* Cleared on disconnect. */
48+
private val loggedUnknownCanIds = mutableSetOf<Int>()
49+
4550
override fun bleProfile(): BleProfile = BleProfile.INMOTION_V1
4651

4752
override fun notifyConnectingTo(deviceName: String?): DecodeResult.ModelName? {
@@ -144,6 +149,7 @@ class InMotionV1Adapter @Inject constructor() : WheelAdapter {
144149
override fun onDisconnect() {
145150
reassemblyBuffer.reset()
146151
detectedModel = null
152+
loggedUnknownCanIds.clear()
147153
}
148154

149155
override fun inspectMessageTypes(): List<String> =
@@ -253,7 +259,23 @@ class InMotionV1Adapter @Inject constructor() : WheelAdapter {
253259
out += DecodeResult.Settings(info.settings)
254260
out
255261
}
256-
else -> emptyList()
262+
else -> {
263+
// Frame the wheel sends that isn't fast/slow-info. Normal
264+
// operation only exchanges the 0x0F55xxxx telemetry/command IDs
265+
// and 0x0F780101 alerts (docs/protocols/inmotion_v1.md 3.4), so
266+
// an unexpected ID is worth surfacing - a V8S that streams ONLY
267+
// 0x0F060101 and never fast-info, then drops with a link
268+
// supervision timeout, points at a wheel that won't leave its
269+
// standby / locked / not-riding state (or another BLE client
270+
// holding it). Log each distinct ID once per connection so the
271+
// diagnostics name it without flooding at the ~10 Hz it arrives.
272+
if (loggedUnknownCanIds.add(canId)) {
273+
DiagnosticsLogger.note(
274+
"InMotion V1 unhandled can=0x%08X len=${unwrapped.size} - wheel not streaming telemetry".format(canId)
275+
)
276+
}
277+
emptyList()
278+
}
257279
}
258280
}
259281
}

0 commit comments

Comments
 (0)