Commit 0c8dc83
fix(inmotion-v1): send max-speed little-endian so the wheel stores the right value
Tester set 39 km/h and the V8S recorded 23, and legal mode drifted. Cause: a
byte-order bug. setMaxSpeed encoded (kmh*1000) BIG-endian (HIGH byte at slot 4),
but the wheel reads the field LITTLE-endian. 39 km/h = 39000 = 0x9858 sent as
`98 58` is read back as 0x5898 = 22680 ~= 23 km/h - exactly the reported value.
The slow-info confirms LE: the wheel reports 41 km/h as 0xa028 on the wire (`28 a0`).
So the parser was already correct; only the write was wrong-endian. Swap to LE
(LOW byte slot 4, HIGH byte slot 5). Legal mode compares the written value to the
wheel readback, so this fixes that too. The old code comment even flagged this
("spec says LE but worked example takes precedence... verify against a real
capture") - the capture proved the worked example wrong.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GADLyChheAoMX9dQbRgRnH1 parent 93a8594 commit 0c8dc83
1 file changed
Lines changed: 10 additions & 8 deletions
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
103 | 105 | | |
104 | 106 | | |
105 | 107 | | |
106 | | - | |
107 | 108 | | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | | - | |
| 112 | + | |
111 | 113 | | |
112 | 114 | | |
113 | 115 | | |
| |||
0 commit comments