From fa67a9f2253026fb1b36ada7242e15d4f2463282 Mon Sep 17 00:00:00 2001 From: miketsai Date: Sun, 14 Jun 2026 14:42:58 +0800 Subject: [PATCH] fix(test): simplify TEST_CAN ALERT to single-level param like VIOLATION/COLLISION --- src/host_stream/event_recorder.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/host_stream/event_recorder.c b/src/host_stream/event_recorder.c index e8339f2..dfe8c00 100644 --- a/src/host_stream/event_recorder.c +++ b/src/host_stream/event_recorder.c @@ -676,10 +676,8 @@ static void handle_test_cmd(const char *raw) int lv = atoi(cmd + 18); test_can_event("COLLISION", lv, lv ? SPEED_LIMIT_STOP : SPEED_LIMIT_NORMAL); } else if (strncmp(cmd, "TEST_CAN ALERT", 14) == 0) { - int ll = 0, rl = 0; - sscanf(cmd + 14, " %d %d", &ll, &rl); - int active = ll || rl; - test_can_event("ALERT", active, active ? SPEED_LIMIT_ALERT : SPEED_LIMIT_NORMAL); + int lv = atoi(cmd + 14); + test_can_event("ALERT", lv, lv ? SPEED_LIMIT_ALERT : SPEED_LIMIT_NORMAL); } else if (strncmp(cmd, "TEST_BUZZER_ALL", 15) == 0) { if (s_test_all_running) { test_reply("TEST_ERR ALL_ALREADY_RUNNING"); return; } s_test_all_running = 1;