Skip to content

Commit 1b9f7f5

Browse files
eriedclaude
andcommitted
fix(ble): keep fast reconnects through the V8S cold-boot cycle
Tester V8S connect capture (build 260802.1515): the wheel connects, streams only a 0x0F060101 heartbeat for ~8 s, then resets its own BLE link (status=8 supervision timeout) and repeats - for ~30 s after power-on - before it finally starts streaming real fast/slow-info. So the connect DOES work, it just takes a few boot cycles. The manual-connect retry budget was 3, after which we fell to the slower 2 s auto-reconnect mid-boot, lengthening the tail the tester saw as "up to 2 min". Raise the budget to 10 so the quick 0.6 s retries persist through the whole boot window. Still bounded (a genuinely absent wheel falls through to auto-reconnect as before); no protocol / write change, so no wheel family's data path is touched. The ~30 s floor is the wheel's own boot and can't be shortened from our side without answering its boot handshake (separate investigation). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GADLyChheAoMX9dQbRgRnH
1 parent 484a497 commit 1b9f7f5

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,13 @@ class BleConnectionManager @Inject constructor(
5656
private const val TAG = "BleConnection"
5757
/** The first manual connect after a fresh install commonly returns GATT
5858
* status 133; retry the rider's connect up to this many times so a
59-
* single wheel tap connects instead of appearing to do nothing. */
60-
private const val MAX_MANUAL_CONNECT_RETRIES = 3
59+
* single wheel tap connects instead of appearing to do nothing.
60+
* Also covers the InMotion V8S cold-boot cycle: for ~30 s after power-on
61+
* the wheel only emits a heartbeat and resets its own BLE link every ~8 s
62+
* (status=8), so it takes several quick reconnects to land on the moment
63+
* it starts streaming. Keep the fast (0.6 s) retries going through that
64+
* window instead of dropping to the slower 2 s auto-reconnect mid-boot. */
65+
private const val MAX_MANUAL_CONNECT_RETRIES = 10
6166
/** Delay before a status-133 manual-connect retry: long enough for the
6267
* failed GATT client to close, short enough to still feel like one tap. */
6368
private const val MANUAL_RETRY_DELAY_MS = 600L

0 commit comments

Comments
 (0)