浏览代码

2022-08-01 / Simon Xue

Action:
1. [Add] Send Present Charging info in Complete and Alarm status by
DoComm.

Files
As the following commit history files

Image Version: V2.09.XX.XXXX.XX
Simon Xue 2 年之前
父节点
当前提交
3441130e90

+ 1 - 1
EVSE/Projects/DD360UCar/Apps/CSU/main.c

@@ -83,7 +83,7 @@ uint8_t bd1_1_status = 0;
 uint8_t bd1_2_status = 0;
 
 char *fwVersion = "V2.09.00.0000.00"; // Phihong version
-char* DebugVersion = "V2.09.01";      // Software debug version
+char* DebugVersion = "V2.09.02";      // Software debug version
 //sqlite3 *localDb;
 bool isDb_ready;
 

+ 26 - 6
EVSE/Projects/DD360UCar/Apps/ModuleDoComm/DoComm.c

@@ -2780,15 +2780,26 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
     case S_ALARM:
     case S_AUTHORIZING:
         
-        if(pDcChargingInfo->SystemStatus == S_ALARM &&
-            strlen((char*)ShmDcCommonData->pGunInfo[plugNum].ChargeStopTime) <= 1) {
+        if(pDcChargingInfo->SystemStatus == S_ALARM) {
+            if (strlen((char*)ShmDcCommonData->pGunInfo[plugNum].ChargeStopTime) <= 1) {
+                ftime(&AuthNowTime);
+                if (DiffTimeb(gRegTimeUp[plugNum][REG_READ_CHARGING_TIMESTAMP], AuthNowTime) > LOOP_RETRY_TIME ||
+                    DiffTimeb(gRegTimeUp[plugNum][REG_READ_CHARGING_TIMESTAMP], AuthNowTime) < 0
+                    ) {
+                    readChargingTimeStamp(fd, gunID);
+                    ftime(&gRegTimeUp[plugNum][REG_READ_CHARGING_TIMESTAMP]);
+                }
+            }
             ftime(&AuthNowTime);
-            if (DiffTimeb(gRegTimeUp[plugNum][REG_READ_CHARGING_TIMESTAMP], AuthNowTime) > LOOP_RETRY_TIME ||
-                DiffTimeb(gRegTimeUp[plugNum][REG_READ_CHARGING_TIMESTAMP], AuthNowTime) < 0
+            if (DiffTimeb(gRegTimeUp[plugNum][REG_PRESENT_CHARGING_INFO], AuthNowTime) > LOOP_RETRY_TIME ||
+                DiffTimeb(gRegTimeUp[plugNum][REG_PRESENT_CHARGING_INFO], AuthNowTime) < 0
                 ) {
-                readChargingTimeStamp(fd, gunID);
-                ftime(&gRegTimeUp[plugNum][REG_READ_CHARGING_TIMESTAMP]);
+                writePresentChargingInfo(fd, plugNum, gunID);
+                if (pDcChargingInfo->PantographFlag)
+                    writeGroundFaultDetection(fd, 0, gunID);
+                ftime(&gRegTimeUp[plugNum][REG_PRESENT_CHARGING_INFO]);
             }
+
         }
 
         checkAuthorProcess(fd, plugNum);
@@ -2997,6 +3008,15 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
 				writeGroundFaultDetection(fd, 0, gunID);
             ftime(&gRegTimeUp[plugNum][REG_CHARGING_CAP]);
         }
+
+        ftime(&AuthNowTime);
+        if (DiffTimeb(gRegTimeUp[plugNum][REG_PRESENT_CHARGING_INFO], AuthNowTime) > LOOP_RETRY_TIME ||
+            DiffTimeb(gRegTimeUp[plugNum][REG_PRESENT_CHARGING_INFO], AuthNowTime) < 0
+            ) {
+            writePresentChargingInfo(fd, plugNum, gunID);
+            ftime(&gRegTimeUp[plugNum][REG_PRESENT_CHARGING_INFO]);
+        }
+
         // 獲得Charging時間
         if (strlen((char*)ShmDcCommonData->pGunInfo[plugNum].ChargeStopTime) <= 1) {
             ftime(&AuthNowTime);

二进制
EVSE/Projects/DD360UCar/Images/ramdisk.gz


二进制
EVSE/Projects/DD360UCar/output/Module_DoComm


二进制
EVSE/Projects/DD360UCar/output/main