From 25777013517d1bd398a98504826a417236706af2 Mon Sep 17 00:00:00 2001
From: yy1717 <fctom1215@outlook.com>
Date: 星期二, 24 三月 2020 19:01:29 +0800
Subject: [PATCH] 车辆信号完善,路边停车完善。

---
 lib/src/main/cpp/driver_test.cpp |   76 ++++++++++++++++++++++++++++++++++++--
 1 files changed, 72 insertions(+), 4 deletions(-)

diff --git a/lib/src/main/cpp/driver_test.cpp b/lib/src/main/cpp/driver_test.cpp
index 46e0c3d..57a835f 100644
--- a/lib/src/main/cpp/driver_test.cpp
+++ b/lib/src/main/cpp/driver_test.cpp
@@ -551,10 +551,9 @@
 
     if (start == 0) {
         DEBUG("缁撴潫鑰冭瘯");
-//        CurrExamMapIndex = -1;
-//        ExamStart = false;
-//        CommTestStart(false);
-//        MA_SendExamStatus(0, 0);
+        CurrExamMapIndex = -1;
+        ExamStart = false;
+        MA_SendExamStatus(0, 0);
         return;
     }
 
@@ -728,6 +727,75 @@
 
 static void ExecuteExam(const struct RtkTime* rtkTime)
 {
+    {
+        static const char *NAME[] = {"OBD_SPEED",
+                                     "ENGINE_RPM",
+                                     "GEAR",
+                                     "TURN_SIGNAL_LAMP",
+                                     "DIPPED_BEAM_LAMP",
+                                     "FOG_LAMP",
+                                     "CLEARANCE_LAMP",
+                                     "FLASH_BEAM_LAMP",
+                                     "MAIN_BEAM_LAMP",
+                                     "SEATBELT",
+                                     "ENGINE_START",
+                                     "BREAK",
+                                     "HAND_BREAK",
+                                     "SECOND_BREAK",
+                                     "DOOR",
+                                     "SURROUND_CAR_1",
+                                     "SURROUND_CAR_2",
+                                     "SURROUND_CAR_3",
+                                     "SURROUND_CAR_4",
+                                     "CAR_STATUS_END"};
+
+        static const char *VALUE[] = {
+                "0",
+                "HAZARD_LIGHTS",
+                "LEFT_TURN_LIGHT",
+                "RIGHT_TURN_LIGHT",
+                "CLEARANCE_LIGHT",
+                "DIPPED_BEAM_LIGHT",
+                "MAIN_BEAM_LIGHT",
+                "FLASH_BEAM_LIGHT",
+                "FOG_LIGHT",
+                "INSERT_SEATBELT",
+                "ENGINE_START_ACTIVE",
+                "GEAR_N",
+                "GEAR_1",
+                "GEAR_2",
+                "GEAR_3",
+                "GEAR_4",
+                "GEAR_5",
+                "GEAR_R",
+                "BREAK_ACTIVE",
+                "DOOR_CLOSE",
+                "SURROUND_CAR_ACTIVE"
+        };
+
+
+
+        static int cs[CAR_STATUS_END] = {0};
+
+        int cs_temp[CAR_STATUS_END];
+
+        for (int i = 0; i < CAR_STATUS_END; ++i) {
+            cs_temp[i] = ReadCarStatus(i);
+
+//            DEBUG("璇诲彇 %d  <----  %d", i, cs_temp[i]);
+        }
+
+        for (int i = 0; i < CAR_STATUS_END; ++i) {
+            if (cs_temp[i] != cs[i]) {
+                DEBUG("杞﹁締鐘舵�� %s = %s", NAME[i], VALUE[ cs_temp[i] ]);
+
+                cs[i] = cs_temp[i];
+            }
+        }
+
+    }
+
+
     if (ReadCarStatus(ENGINE_RPM) < ENGINE_MIN_ROTATE) {
         if (engineRuning) {
             engineRuning = false;

--
Gitblit v1.8.0