App 2.32.0: an ACC recorder that records every value the head unit offers

The 2.31.1 log on the car showed the named assist properties constant
while ACC was engaged behind another car: they are not fed. The recorder
reads every property and vendor getter (read only, at most half the time
busy) for 3 minutes, plus steering-wheel key broadcasts, and lists what
changed, the rarest first. The recording is saved in the app and on a
USB stick if one is plugged in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LhzAVaUyqcw5PkGjz4mWW6
This commit is contained in:
2026-10-25 19:27:43 +01:00
co-authored by Claude Opus 5.5
parent 36cc417638
commit 2e6bb9cb83
9 changed files with 406 additions and 3 deletions
@@ -0,0 +1,66 @@
package com.evsuite.abrp;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import org.junit.Test;
/** The ACC change recorder's bookkeeping — pure JVM. */
public class AccRecordingTest {
private static Map<String, String> capture(String speed, String acc) {
Map<String, String> m = new TreeMap<>();
m.put("speed", speed);
m.put("acc", acc);
m.put("steady", "1");
return m;
}
@Test
public void rarestChangeFirst() {
AccRecording r = new AccRecording();
r.add(0, capture("10", "0"));
r.add(2000, capture("20", "0"));
r.add(4000, capture("30", "120"));
r.add(6000, capture("40", "120"));
r.add(8000, capture("50", "0"));
List<String> summary = r.summary();
assertEquals(2, summary.size());
assertEquals("acc 2× 0 → 120", summary.get(0));
assertTrue(summary.get(1).startsWith("speed 4× 10 → 20 → 30 → 40 → 50"));
assertEquals(5, r.captures());
}
@Test
public void appearingAndVanishingKeysAreChanges() {
AccRecording r = new AccRecording();
Map<String, String> a = capture("1", "0");
Map<String, String> b = capture("1", "0");
b.put("new", "5");
r.add(0, a);
r.add(1000, b);
r.add(2000, a);
assertEquals("new 2× 5 → null", r.summary().get(0));
}
@Test
public void longValuesAreShortened() {
String v = "[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]";
assertEquals(AccRecording.VALUE_CHARS, AccRecording.shorten(v).length());
assertEquals("short", AccRecording.shorten("short"));
}
@Test
public void firstCaptureIsKeptWhole() {
AccRecording r = new AccRecording();
r.add(0, capture("1", "0"));
r.note(500, "key 287 down");
assertEquals(5, r.lines().size());
assertTrue(r.lines().get(4).endsWith("key 287 down"));
assertEquals(1, r.notes().size());
}
}