Эх сурвалжийг харах

2021.03.29 / Jerry Wang

Actions:
1. Modify ReadCmdline.c strchg commnad support Dispenser can be charge.
2. Add support 'K' type gun.

Files:
1. As follow as commit histroy.
Jerry_Wang 4 жил өмнө
parent
commit
2f1ebd5da3

+ 10 - 8
EVSE/Projects/DD360/Apps/Makefile

@@ -16,14 +16,16 @@ Internal485ProtocolLib = -L $(ModularizationPath)/Internal485Protocol -lInternal
 
 #define library variable
 Lib_Module_RFID = "-L$(ModularizationPath)" -lModule_RFID
+RFID_H = -include$(ModularizationPath)/Module_RFID.h
+
 Lib_Module_Upgrade = "-L$(ModularizationPath)" -lModule_Upgrade
-Lib_SQLite3 = "-L$(ModularizationPath)/ocppfiles" -lsqlite3
-#Lib_Module_RatingCurrent = "-L$(ModularizationPath)" -lModule_RatingCurrent
+ModuleUpgrade_H = -include$(ModularizationPath)/Module_Upgrade.h
 
+Lib_SQLite3 = "-L$(ModularizationPath)/ocppfiles" -lsqlite3
 SQLite3_H = -include$(ModularizationPath)/ocppfiles/sqlite3.h
-ModuleUpgrade_H = -include$(ModularizationPath)/Module_Upgrade.h
-RFID_H = -include$(ModularizationPath)/Module_RFID.h
-#RatingCurrent_H = -include$(ModularizationPath)/Module_RatingCurrent.h
+
+Lib_Module_RatedCurrent = "-L$(ModularizationPath)" -lModule_RatedCurrent
+RatedCurrent_H = -include$(ModularizationPath)/Module_RatedCurrent.h
 
 InfypwrPsuComm_H = -include$(ModularizationPath)/Infypwr_PsuCommObj.h
 InfypwrPsuComm_A = $(ModularizationPath)/libInfypwr_PsuCommObj.a
@@ -39,9 +41,9 @@ apps: MainTask DoCommTask EvCommTask \
 LOG_INC = Log
 
 MainTask:
-	$(CC) -D $(Project) -includeConfig.h $(SQLite3_H) $(ModuleUpgrade_H) $(RFID_H) $(CFLAGS) -o main.o ReMain.c
-	$(CC) -D $(Project) -includeConfig.h $(SQLite3_H) $(ModuleUpgrade_H) $(RFID_H) $(CFLAGS) -o timeout.o timeout.c
-	$(CC) $(TFLAGS) -o main main.o timeout.o ${Lib_Module_RFID} ${Lib_Module_Upgrade} ${Lib_SQLite3} $(Lib_Module_RatingCurrent)
+	$(CC) -D $(Project) -includeConfig.h $(SQLite3_H) $(ModuleUpgrade_H) $(RFID_H) $(RatedCurrent_H) $(CFLAGS) -o main.o ReMain.c
+	$(CC) -D $(Project) -includeConfig.h $(SQLite3_H) $(ModuleUpgrade_H) $(RFID_H) $(RatedCurrent_H) $(CFLAGS) -o timeout.o timeout.c
+	$(CC) $(TFLAGS) -o main main.o timeout.o ${Lib_Module_RFID} ${Lib_Module_Upgrade} ${Lib_SQLite3} $(Lib_Module_RatedCurrent)
 
 DoCommTask:
 	$(CC) -D $(Project) -includeConfig.h $(CFLAGS) -o DoComm.o ReDoComm.c

+ 3 - 3
EVSE/Projects/DD360/Apps/ReDoComm.c

@@ -1056,7 +1056,7 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
 
     case REG_DISPENSER_STATUS:
         memset(&gPreSysWarningInfo, 0, sizeof(struct WARNING_CODE_INFO));
-        memcpy(&gPreSysWarningInfo,
+        memcpy((uint8_t *)&gPreSysWarningInfo,
                &(ShmSysConfigAndInfo->SysWarningInfo),
                sizeof(struct WARNING_CODE_INFO));
         break;
@@ -1995,7 +1995,7 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
         ftime(&AuthNowTime);
         if (DiffTimeb(gRegTimeUp[plugNum][REG_CHARGING_PERMISSION], AuthNowTime) > LOOP_RETRY_TIME) {
             if (readChargePermission(fd, gunID) == 0) {
-                DEBUG_INFO("Stop charging by power cabinet's permission = %d, %d\r\n",
+                DEBUG_INFO("S_PREPARING_FOR_EV Stop charging by power cabinet's permission = %d, %d\r\n",
                            plugNum,
                            REG_CHARGING_PERMISSION);
                 ChargingData[plugNum]->StopChargeFlag = POWER_CABINET_STOP_CHARGING;
@@ -2024,7 +2024,7 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
         ftime(&AuthNowTime);
         if (DiffTimeb(gRegTimeUp[plugNum][REG_CHARGING_PERMISSION], AuthNowTime) > LOOP_RETRY_TIME) {
             if (readChargePermission(fd, gunID) == 0) {
-                DEBUG_INFO("Stop charging by power cabinet's permission = %d, %d\r\n",
+                DEBUG_INFO("S_PREPARING_FOR_EVSE Stop charging by power cabinet's permission = %d, %d\r\n",
                            plugNum,
                            REG_CHARGING_PERMISSION);
                 ChargingData[plugNum]->StopChargeFlag = POWER_CABINET_STOP_CHARGING;

+ 6 - 2
EVSE/Projects/DD360/Apps/ReMain.c

@@ -1683,7 +1683,10 @@ void SelfTestRun()
                 if (!evInitFlag) {
                     evInitFlag = YES;
                     for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++) {
-                        //log_info("index = %d, charging index = %d, type = %d\r\n", index, chargingInfo[index]->type_index, chargingInfo[index]->Type);
+                        //log_info("index = %d, charging index = %d, type = %d\r\n",
+                        //         index,
+                        //         chargingInfo[index]->type_index,
+                        //         chargingInfo[index]->Type);
                         if (chargingInfo[index]->Type == _Type_Chademo) {
                             if ((strlen((char *)ShmCHAdeMOData->evse[chargingInfo[index]->type_index].version) != 0 ||
                                     ShmCHAdeMOData->evse[chargingInfo[index]->type_index].version[0] != '\0')
@@ -3303,7 +3306,8 @@ bool AddGunInfoByConnector(byte typeValue, byte slots)
         break;
     case '6': // GB/T AC Socket
         break;
-    case 'J': { // CHAdeMO
+    case 'J':
+    case 'K': { // CHAdeMO
         if (CHAdeMO_QUANTITY > _chademoIndex) {
             chargingInfo[_gunIndex] = &ShmSysConfigAndInfo->SysInfo.ChademoChargingData[_chademoIndex];
             chargingInfo[_gunIndex]->Index = _gunIndex;

+ 22 - 5
EVSE/Projects/DD360/Apps/ReModule_EvComm.c

@@ -2263,6 +2263,7 @@ void CANReceiver()
                         break;
                     }
                 }
+                //PRINTF_FUNC("target = %d, %d, %d\r\n", target, _chargingData[targetGun]->Evboard_id, targetGun);
 
                 if (targetGun < 0 || targetGun >= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY) {
                     PRINTF_FUNC("EvComm (CANReceiver) : Target index = %x is < 0 or > QUANTITY \n", targetGun);
@@ -2900,16 +2901,32 @@ void FormatVoltageAndCurrent()
             }
         } else {
             if (_chargingData[_index]->Type == _Type_Chademo) {
-                maxChargingCur[_index] = 1200;
+                if (_index == 0) {
+                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "K", 1) == 0) {
+                        maxChargingCur[_index] = 2000;
+                    } else {
+                        maxChargingCur[_index] = 1200;
+                    }
+                } else if (_index == 1) {
+                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "K", 1) == 0) {
+                        maxChargingCur[_index] = 2000;
+                    } else {
+                        maxChargingCur[_index] = 1200;
+                    }
+                }
             } else if (_chargingData[_index]->Type == _Type_CCS_2) {
                 if (_index == 0) {
-                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "V", 1) == 0) {
+                    if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "V", 1) == 0) ||
+                            (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "F", 1) == 0)
+                       ) {
                         maxChargingCur[_index] = 5000;
                     } else {
                         maxChargingCur[_index] = 2000;
                     }
                 } else if (_index == 1) {
-                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "V", 1) == 0) {
+                    if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "V", 1) == 0) ||
+                            (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "F", 1) == 0)
+                       ) {
                         maxChargingCur[_index] = 5000;
                     } else {
                         maxChargingCur[_index] = 2000;
@@ -3204,7 +3221,7 @@ int main(int argc, char *argv[])
 
                 if (priorityLow % 5 == 1) {
                     // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
-                    GetEvBatteryInfo(_index, targetID); //DS60-120 add
+                    GetEvBatteryInfo(_index, _chargingData[_index]->Evboard_id); //DS60-120 add
 
                     // 樁端輸出能力改變
                     if (gun_count == 1) {
@@ -3389,7 +3406,7 @@ int main(int argc, char *argv[])
                                               _chargingData[_index]->AvailableChargingPower,
                                               maxCur,
                                               maxVol,
-                                              targetID);
+                                              _chargingData[_index]->Evboard_id);
                     }
                 }
             }

+ 3 - 4
EVSE/Projects/DD360/Apps/ReModule_InternalComm.c

@@ -33,7 +33,6 @@
 #include "internalComm.h"
 #include "Config.h"
 
-#define AudiCustomized              1
 #define ARRAY_SIZE(A)       (sizeof(A) / sizeof(A[0]))
 #define PASS                1
 #define FAIL                -1
@@ -1348,7 +1347,7 @@ void SetLedColor(struct ChargingInfoData *chargingData_1, struct ChargingInfoDat
                     (chargingData_2->SystemStatus == S_BOOTING ||
                      chargingData_2->SystemStatus == S_IDLE ||
                      chargingData_2->SystemStatus == S_RESERVATION)) {
-#ifdef AudiCustomized
+#if defined DD360Audi
                 led_color.Connect_1_Green = _colorBuf;
                 led_color.Connect_1_Blue = _colorBuf;
                 led_color.Connect_1_Red = _colorBuf;
@@ -1391,7 +1390,7 @@ void SetLedColor(struct ChargingInfoData *chargingData_1, struct ChargingInfoDat
                     led_color.Connect_1_Blue = COLOR_MIN_LV;
                     led_color.Connect_1_Red = _colorBuf;
                 } else {
-#ifdef AudiCustomized
+#if defined DD360Audi
                     led_color.Connect_1_Green = _colorBuf;
                     led_color.Connect_1_Blue = _colorBuf;
                     led_color.Connect_1_Red = _colorBuf;
@@ -1420,7 +1419,7 @@ void SetLedColor(struct ChargingInfoData *chargingData_1, struct ChargingInfoDat
                     led_color.Connect_2_Blue = COLOR_MIN_LV;
                     led_color.Connect_2_Red = _colorBuf;
                 } else {
-#ifdef AudiCustomized
+#if defined DD360Audi
                     led_color.Connect_2_Green = _colorBuf;
                     led_color.Connect_2_Blue = _colorBuf;
                     led_color.Connect_2_Red = _colorBuf;

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 480 - 587
EVSE/Projects/DD360/Apps/ReadCmdline.c


BIN
EVSE/Projects/DD360/Apps/UnsafetyOutputTask


BIN
EVSE/Projects/DD360/Images/ramdisk.gz


BIN
EVSE/Projects/DD360/output/DoComm


BIN
EVSE/Projects/DD360/output/FactoryConfig


BIN
EVSE/Projects/DD360/output/Module_EvComm


BIN
EVSE/Projects/DD360/output/Module_EventLogging


BIN
EVSE/Projects/DD360/output/Module_InternalComm


BIN
EVSE/Projects/DD360/output/Module_LcmControl


BIN
EVSE/Projects/DD360/output/Module_PrimaryComm


BIN
EVSE/Projects/DD360/output/ReadCmdline


BIN
EVSE/Projects/DD360/output/UnsafetyOutputTask


BIN
EVSE/Projects/DD360/output/main


+ 3 - 3
EVSE/Projects/DD360Audi/Apps/ReDoComm.c

@@ -1056,7 +1056,7 @@ static int responsePackeHandle(int fd, uint8_t *pResult, uint8_t plugNum, uint8_
 
     case REG_DISPENSER_STATUS:
         memset(&gPreSysWarningInfo, 0, sizeof(struct WARNING_CODE_INFO));
-        memcpy(&gPreSysWarningInfo,
+        memcpy((uint8_t *)&gPreSysWarningInfo,
                &(ShmSysConfigAndInfo->SysWarningInfo),
                sizeof(struct WARNING_CODE_INFO));
         break;
@@ -1995,7 +1995,7 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
         ftime(&AuthNowTime);
         if (DiffTimeb(gRegTimeUp[plugNum][REG_CHARGING_PERMISSION], AuthNowTime) > LOOP_RETRY_TIME) {
             if (readChargePermission(fd, gunID) == 0) {
-                DEBUG_INFO("Stop charging by power cabinet's permission = %d, %d\r\n",
+                DEBUG_INFO("S_PREPARING_FOR_EV Stop charging by power cabinet's permission = %d, %d\r\n",
                            plugNum,
                            REG_CHARGING_PERMISSION);
                 ChargingData[plugNum]->StopChargeFlag = POWER_CABINET_STOP_CHARGING;
@@ -2024,7 +2024,7 @@ static void systemStatusProcess(int fd, uint8_t totalGun, uint8_t plugNum, uint8
         ftime(&AuthNowTime);
         if (DiffTimeb(gRegTimeUp[plugNum][REG_CHARGING_PERMISSION], AuthNowTime) > LOOP_RETRY_TIME) {
             if (readChargePermission(fd, gunID) == 0) {
-                DEBUG_INFO("Stop charging by power cabinet's permission = %d, %d\r\n",
+                DEBUG_INFO("S_PREPARING_FOR_EVSE Stop charging by power cabinet's permission = %d, %d\r\n",
                            plugNum,
                            REG_CHARGING_PERMISSION);
                 ChargingData[plugNum]->StopChargeFlag = POWER_CABINET_STOP_CHARGING;

+ 6 - 2
EVSE/Projects/DD360Audi/Apps/ReMain.c

@@ -1683,7 +1683,10 @@ void SelfTestRun()
                 if (!evInitFlag) {
                     evInitFlag = YES;
                     for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++) {
-                        //log_info("index = %d, charging index = %d, type = %d\r\n", index, chargingInfo[index]->type_index, chargingInfo[index]->Type);
+                        //log_info("index = %d, charging index = %d, type = %d\r\n",
+                        //         index,
+                        //         chargingInfo[index]->type_index,
+                        //         chargingInfo[index]->Type);
                         if (chargingInfo[index]->Type == _Type_Chademo) {
                             if ((strlen((char *)ShmCHAdeMOData->evse[chargingInfo[index]->type_index].version) != 0 ||
                                     ShmCHAdeMOData->evse[chargingInfo[index]->type_index].version[0] != '\0')
@@ -3303,7 +3306,8 @@ bool AddGunInfoByConnector(byte typeValue, byte slots)
         break;
     case '6': // GB/T AC Socket
         break;
-    case 'J': { // CHAdeMO
+    case 'J':
+    case 'K': { // CHAdeMO
         if (CHAdeMO_QUANTITY > _chademoIndex) {
             chargingInfo[_gunIndex] = &ShmSysConfigAndInfo->SysInfo.ChademoChargingData[_chademoIndex];
             chargingInfo[_gunIndex]->Index = _gunIndex;

+ 22 - 5
EVSE/Projects/DD360Audi/Apps/ReModule_EvComm.c

@@ -2263,6 +2263,7 @@ void CANReceiver()
                         break;
                     }
                 }
+                //PRINTF_FUNC("target = %d, %d, %d\r\n", target, _chargingData[targetGun]->Evboard_id, targetGun);
 
                 if (targetGun < 0 || targetGun >= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY) {
                     PRINTF_FUNC("EvComm (CANReceiver) : Target index = %x is < 0 or > QUANTITY \n", targetGun);
@@ -2900,16 +2901,32 @@ void FormatVoltageAndCurrent()
             }
         } else {
             if (_chargingData[_index]->Type == _Type_Chademo) {
-                maxChargingCur[_index] = 1200;
+                if (_index == 0) {
+                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "K", 1) == 0) {
+                        maxChargingCur[_index] = 2000;
+                    } else {
+                        maxChargingCur[_index] = 1200;
+                    }
+                } else if (_index == 1) {
+                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "K", 1) == 0) {
+                        maxChargingCur[_index] = 2000;
+                    } else {
+                        maxChargingCur[_index] = 1200;
+                    }
+                }
             } else if (_chargingData[_index]->Type == _Type_CCS_2) {
                 if (_index == 0) {
-                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "V", 1) == 0) {
+                    if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "V", 1) == 0) ||
+                            (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[7], "F", 1) == 0)
+                       ) {
                         maxChargingCur[_index] = 5000;
                     } else {
                         maxChargingCur[_index] = 2000;
                     }
                 } else if (_index == 1) {
-                    if (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "V", 1) == 0) {
+                    if ((strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "V", 1) == 0) ||
+                            (strncmp((char *)&ShmSysConfigAndInfo->SysConfig.ModelName[9], "F", 1) == 0)
+                       ) {
                         maxChargingCur[_index] = 5000;
                     } else {
                         maxChargingCur[_index] = 2000;
@@ -3204,7 +3221,7 @@ int main(int argc, char *argv[])
 
                 if (priorityLow % 5 == 1) {
                     // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
-                    GetEvBatteryInfo(_index, targetID); //DS60-120 add
+                    GetEvBatteryInfo(_index, _chargingData[_index]->Evboard_id); //DS60-120 add
 
                     // 樁端輸出能力改變
                     if (gun_count == 1) {
@@ -3389,7 +3406,7 @@ int main(int argc, char *argv[])
                                               _chargingData[_index]->AvailableChargingPower,
                                               maxCur,
                                               maxVol,
-                                              targetID);
+                                              _chargingData[_index]->Evboard_id);
                     }
                 }
             }

+ 3 - 4
EVSE/Projects/DD360Audi/Apps/ReModule_InternalComm.c

@@ -33,7 +33,6 @@
 #include "internalComm.h"
 #include "Config.h"
 
-#define AudiCustomized              1
 #define ARRAY_SIZE(A)       (sizeof(A) / sizeof(A[0]))
 #define PASS                1
 #define FAIL                -1
@@ -1348,7 +1347,7 @@ void SetLedColor(struct ChargingInfoData *chargingData_1, struct ChargingInfoDat
                     (chargingData_2->SystemStatus == S_BOOTING ||
                      chargingData_2->SystemStatus == S_IDLE ||
                      chargingData_2->SystemStatus == S_RESERVATION)) {
-#ifdef AudiCustomized
+#if defined DD360Audi
                 led_color.Connect_1_Green = _colorBuf;
                 led_color.Connect_1_Blue = _colorBuf;
                 led_color.Connect_1_Red = _colorBuf;
@@ -1391,7 +1390,7 @@ void SetLedColor(struct ChargingInfoData *chargingData_1, struct ChargingInfoDat
                     led_color.Connect_1_Blue = COLOR_MIN_LV;
                     led_color.Connect_1_Red = _colorBuf;
                 } else {
-#ifdef AudiCustomized
+#if defined DD360Audi
                     led_color.Connect_1_Green = _colorBuf;
                     led_color.Connect_1_Blue = _colorBuf;
                     led_color.Connect_1_Red = _colorBuf;
@@ -1420,7 +1419,7 @@ void SetLedColor(struct ChargingInfoData *chargingData_1, struct ChargingInfoDat
                     led_color.Connect_2_Blue = COLOR_MIN_LV;
                     led_color.Connect_2_Red = _colorBuf;
                 } else {
-#ifdef AudiCustomized
+#if defined DD360Audi
                     led_color.Connect_2_Green = _colorBuf;
                     led_color.Connect_2_Blue = _colorBuf;
                     led_color.Connect_2_Red = _colorBuf;

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 480 - 587
EVSE/Projects/DD360Audi/Apps/ReadCmdline.c


BIN
EVSE/Projects/DD360Audi/Apps/UnsafetyOutputTask


Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно