Add diag console probe (OBD-II mode 01/09 on 0x7DF); wiki: diagnostic polling, two sources

Firmware:
- CANDriver::transmit(): the single sanctioned transmit path (single-shot,
  echoed as CANTX lines, TX_FAILED alert counted); CAN-task warnings now take
  the serial lock
- DiagProbe module: `diag pids` supported-PID bitmap scan, `diag pid <hex>`,
  `diag vin`, `diag ecu`, `diag status`; ISO-TP reassembly with flow control;
  one request in flight, refused for 3 s after any foreign tester frame
- Console dispatch chained via Tunables::setExtraCommandHandler()
- CLAUDE.md and docs/UART_PROTOCOL.md updated

Wiki:
- New page obd-diagnostic-polling (broadcast vs polled, 0x6F1->0x612 addressing,
  Route A generic OBD PID table, Route B, test-day procedure, firmware probe)
- New sources: google-ai-dde7m57-pids (clipping, unverified, 0x612 direction
  contradicted), dwr-335d-torque-pids (thread + raw/BMW 335d.csv decoded)
- Clippings/ folder added to the schema (Obsidian Web Clipper, treated as raw/)
- bmw-m57n-engine, can-bus-integration, open-questions, index, log updated
This commit is contained in:
2026-09-21 19:51:49 +02:00
parent f60bdac268
commit 974082cb3e
21 changed files with 1357 additions and 24 deletions
+8 -2
View File
@@ -22,6 +22,7 @@ static SemaphoreHandle_t g_mutex = NULL;
static char g_line[96];
static size_t g_line_len = 0;
static bool (*g_extra_handler)(const char*) = NULL;
// ============================================================================
// PRIVATE HELPERS
@@ -88,6 +89,7 @@ static void help() {
print(" tach_en temp_en coolant_hot gearbox_hot batt_low(x100)");
print("cfg override off | rpm <n> | duty <n> | both <rpm> <duty>");
print("cfg reset back to defaults");
print("diag help OBD-II diagnostic probe (transmits on the bus)");
}
static bool setField(const char* name, long v) {
@@ -241,14 +243,18 @@ bool handleCommand(const char* line) {
return true;
}
void setExtraCommandHandler(bool (*handler)(const char* line)) {
g_extra_handler = handler;
}
void pollSerial() {
while (Serial.available()) {
char c = (char)Serial.read();
if (c == '\r' || c == '\n') {
if (g_line_len > 0) {
g_line[g_line_len] = 0;
if (!handleCommand(g_line)) {
print("[console] unknown command '%s' (try 'cfg help')", g_line);
if (!handleCommand(g_line) && !(g_extra_handler && g_extra_handler(g_line))) {
print("[console] unknown command '%s' (try 'cfg help' or 'diag help')", g_line);
}
g_line_len = 0;
}