|
@@ -1,214 +1,96 @@
|
|
|
-#include <sys/time.h>
|
|
|
-#include <sys/timeb.h>
|
|
|
-#include <sys/types.h>
|
|
|
-#include <sys/stat.h>
|
|
|
-#include <sys/types.h>
|
|
|
-#include <sys/ioctl.h>
|
|
|
-#include <sys/socket.h>
|
|
|
-#include <sys/ipc.h>
|
|
|
-#include <sys/shm.h>
|
|
|
-#include <sys/shm.h>
|
|
|
-#include <sys/mman.h>
|
|
|
-#include <linux/can.h>
|
|
|
-#include <linux/can/raw.h>
|
|
|
-#include <linux/wireless.h>
|
|
|
-#include <arpa/inet.h>
|
|
|
-#include <netinet/in.h>
|
|
|
-
|
|
|
-#include <unistd.h>
|
|
|
-#include <stdarg.h>
|
|
|
-#include <stdio.h> /*標準輸入輸出定義*/
|
|
|
-#include <stdlib.h> /*標準函數庫定義*/
|
|
|
-#include <unistd.h> /*Unix 標準函數定義*/
|
|
|
-#include <fcntl.h> /*檔控制定義*/
|
|
|
-#include <termios.h> /*PPSIX 終端控制定義*/
|
|
|
-#include <errno.h> /*錯誤號定義*/
|
|
|
-#include <errno.h>
|
|
|
-#include <string.h>
|
|
|
-#include <time.h>
|
|
|
-#include <ctype.h>
|
|
|
-#include <ifaddrs.h>
|
|
|
-#include "../../define.h"
|
|
|
-#include "Module_EvComm.h"
|
|
|
-
|
|
|
-#define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
|
|
|
-#define PASS 1
|
|
|
-#define FAIL -1
|
|
|
-#define START 1
|
|
|
-#define STOP 0
|
|
|
-#define YES 1
|
|
|
-#define NO 0
|
|
|
-#define EQUAL 0
|
|
|
+#include <sys/time.h>
|
|
|
+#include <sys/timeb.h>
|
|
|
+#include <sys/types.h>
|
|
|
+#include <sys/stat.h>
|
|
|
+#include <sys/types.h>
|
|
|
+#include <sys/ioctl.h>
|
|
|
+#include <sys/socket.h>
|
|
|
+#include <sys/ipc.h>
|
|
|
+#include <sys/shm.h>
|
|
|
+#include <sys/shm.h>
|
|
|
+#include <sys/mman.h>
|
|
|
+#include <linux/can.h>
|
|
|
+#include <linux/can/raw.h>
|
|
|
+#include <linux/wireless.h>
|
|
|
+#include <arpa/inet.h>
|
|
|
+#include <netinet/in.h>
|
|
|
+
|
|
|
+#include <unistd.h>
|
|
|
+#include <stdarg.h>
|
|
|
+#include <stdio.h> /*標準輸入輸出定義*/
|
|
|
+#include <stdlib.h> /*標準函數庫定義*/
|
|
|
+#include <unistd.h> /*Unix 標準函數定義*/
|
|
|
+#include <fcntl.h> /*檔控制定義*/
|
|
|
+#include <termios.h> /*PPSIX 終端控制定義*/
|
|
|
+#include <errno.h> /*錯誤號定義*/
|
|
|
+#include <errno.h>
|
|
|
+#include <string.h>
|
|
|
+#include <time.h>
|
|
|
+#include <ctype.h>
|
|
|
+#include <ifaddrs.h>
|
|
|
+#include "../../define.h"
|
|
|
+#include "Config.h"
|
|
|
+#include "Module_EvComm.h"
|
|
|
+#include "VCCU.h"
|
|
|
+
|
|
|
+#define Debug
|
|
|
+#define ARRAY_SIZE(A) (sizeof(A) / sizeof(A[0]))
|
|
|
+#define PASS 1
|
|
|
+#define FAIL -1
|
|
|
+#define START 1
|
|
|
+#define STOP 0
|
|
|
+#define YES 1
|
|
|
+#define NO 0
|
|
|
+#define DEMO 0
|
|
|
|
|
|
struct SysConfigAndInfo *ShmSysConfigAndInfo;
|
|
|
struct StatusCodeData *ShmStatusCodeData;
|
|
|
struct FanModuleData *ShmFanModuleData;
|
|
|
-struct CHAdeMOData *ShmCHAdeMOData;
|
|
|
-struct GBTData *ShmGBTData;
|
|
|
-struct CcsData *ShmCcsData;
|
|
|
-
|
|
|
-byte gun_count;
|
|
|
+struct RelayModuleData *ShmRelayModuleData;
|
|
|
+struct LedModuleData *ShmLedModuleData;
|
|
|
+struct PsuData *ShmPsuData;
|
|
|
+struct OCPP16Data *ShmOCPP16Data;
|
|
|
+byte gunCount;
|
|
|
+byte gun_count = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
|
|
|
int chargingTime[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
|
|
|
|
|
|
-float _pow_1 = 0;
|
|
|
-float _cur_1 = 0;
|
|
|
-float _pow_2 = 0;
|
|
|
-float _cur_2 = 0;
|
|
|
-
|
|
|
-float _outVol_1 = 0;
|
|
|
-float _outCur_1 = 0;
|
|
|
-float _outVol_2 = 0;
|
|
|
-float _outCur_2 = 0;
|
|
|
-
|
|
|
-// 限制最大充電電壓,因應不同 type 槍線來限制
|
|
|
-// Chademo : 500V, 125A,
|
|
|
-// GB : 750, 120A
|
|
|
-// CCS : 950V, 120A
|
|
|
-float maxChargingVol[2] = { 9500, 9500 }; // 限制最大充電電壓,如依照模塊則填上 0
|
|
|
-// 限制最大充電電流與能量透過 Web
|
|
|
-float maxChargingCur[2] = { 600, 600 }; // 限制最大充電電流,如依照模塊則填上 0
|
|
|
-float maxChargingPow = 0; // 限制最大充電能量,如依照模塊則填上 0
|
|
|
+float maxChargingVol = 5000; // 限制最大充電電壓,如依照模塊則填上 0
|
|
|
+float maxChargingCur = 100; // 限制最大充電電流,如依照模塊則填上 0
|
|
|
+int maxValue = 950;
|
|
|
+
|
|
|
+int gbmaxValue = 7500;
|
|
|
+int whileLoopTime = 500000;//45000;//500ms//10000; // 10 ms
|
|
|
|
|
|
+int soc = 70;
|
|
|
// 槍資訊
|
|
|
struct ChargingInfoData *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
|
|
|
|
|
|
+byte normalStop = 0x01;
|
|
|
+byte stopReason[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
|
+byte evstaus[5] = { 0x01, 0x02, 0x03, 0x04, 0x05 };
|
|
|
+
|
|
|
struct Ev_Board_Cmd Ev_Cmd={
|
|
|
- 0,
|
|
|
- 0x00000200,
|
|
|
- 0x00000400,
|
|
|
- 0x00000500,
|
|
|
- 0x00000600,
|
|
|
- 0x00000700,
|
|
|
- 0x00000800,
|
|
|
- 0x00000900,
|
|
|
- 0x00000A00,
|
|
|
- 0x00000C00,
|
|
|
- 0x00000D00,
|
|
|
-
|
|
|
- 0x00000E00,
|
|
|
- 0x00000F00,
|
|
|
- 0x00001000,
|
|
|
- 0x00001100,
|
|
|
-
|
|
|
- 0x00001200,
|
|
|
- 0x00001400,
|
|
|
- 0x00001500,
|
|
|
+ 0,
|
|
|
+ 0x00000200,
|
|
|
+ 0x00000400,
|
|
|
+ 0x00000500,
|
|
|
+ 0x00000600,
|
|
|
+ 0x00000700,
|
|
|
+ 0x00000800,
|
|
|
+ 0x00000900,
|
|
|
+ 0x00000A00,
|
|
|
+ 0x00000C00,
|
|
|
+ 0x00000D00,
|
|
|
+
|
|
|
+ 0x00000E00,
|
|
|
+ 0x00000F00,
|
|
|
+ 0x00001000,
|
|
|
+ 0x00001100,
|
|
|
+
|
|
|
+ 0x00001200,
|
|
|
+ 0x00001500,
|
|
|
};
|
|
|
|
|
|
-unsigned char mask_table[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
|
|
|
-
|
|
|
-void PRINTF_FUNC(char *string, ...);
|
|
|
-
|
|
|
-void GetMaxVolAndCurMethod(byte index, float *vol, float *cur);
|
|
|
-void GetMaxPowerMethod(byte index, float *pow);
|
|
|
-unsigned long GetTimeoutValue(struct timeval _sour_time);
|
|
|
-
|
|
|
-#define DEBUG_INFO(format, args...) StoreLogMsg("[%s:%d][%s][Info] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
-#define DEBUG_WARN(format, args...) StoreLogMsg("[%s:%d][%s][Warn] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
-#define DEBUG_ERROR(format, args...) StoreLogMsg("[%s:%d][%s][Error] "format, __FILE__, __LINE__, __FUNCTION__, ##args)
|
|
|
-
|
|
|
-unsigned long GetTimeoutValue(struct timeval _sour_time)
|
|
|
-{
|
|
|
- struct timeval _end_time;
|
|
|
- gettimeofday(&_end_time, NULL);
|
|
|
-
|
|
|
- return 1000000 * (_end_time.tv_sec - _sour_time.tv_sec) + _end_time.tv_usec - _sour_time.tv_usec;
|
|
|
-}
|
|
|
-
|
|
|
-int StoreLogMsg(const char *fmt, ...)
|
|
|
-{
|
|
|
- char Buf[4096+256];
|
|
|
- char buffer[4096];
|
|
|
- va_list args;
|
|
|
- struct timeb SeqEndTime;
|
|
|
- struct tm *tm;
|
|
|
-
|
|
|
- va_start(args, fmt);
|
|
|
- int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
|
|
|
- va_end(args);
|
|
|
-
|
|
|
- memset(Buf,0,sizeof(Buf));
|
|
|
- ftime(&SeqEndTime);
|
|
|
- SeqEndTime.time = time(NULL);
|
|
|
- tm=localtime(&SeqEndTime.time);
|
|
|
-
|
|
|
- if (ShmSysConfigAndInfo->SysConfig.SwitchDebugFlag == YES)
|
|
|
- {
|
|
|
- sprintf(Buf,"%02d:%02d:%02d.%03d - %s",
|
|
|
- tm->tm_hour,tm->tm_min,tm->tm_sec,SeqEndTime.millitm, buffer);
|
|
|
- printf("%s \n", Buf);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- sprintf(Buf,"echo \"%04d-%02d-%02d %02d:%02d:%02d.%03d - %s\" >> /Storage/SystemLog/[%04d.%02d]SystemLog",
|
|
|
- tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec,SeqEndTime.millitm,
|
|
|
- buffer,
|
|
|
- tm->tm_year+1900,tm->tm_mon+1);
|
|
|
- system(Buf);
|
|
|
- }
|
|
|
-
|
|
|
- return rc;
|
|
|
-}
|
|
|
-
|
|
|
-int DiffTimeb(struct timeb ST, struct timeb ET)
|
|
|
-{
|
|
|
- //return milli-second
|
|
|
- unsigned int StartTime,StopTime;
|
|
|
-
|
|
|
- StartTime=(unsigned int)ST.time;
|
|
|
- StopTime=(unsigned int)ET.time;
|
|
|
- return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
|
|
|
-}
|
|
|
-
|
|
|
-void PRINTF_FUNC(char *string, ...)
|
|
|
-{
|
|
|
- va_list args;
|
|
|
- char buffer[4096];
|
|
|
- va_start(args, string);
|
|
|
- vsnprintf(buffer, sizeof(buffer), string, args);
|
|
|
- va_end(args);
|
|
|
-
|
|
|
- DEBUG_INFO("%s \n", buffer);
|
|
|
-}
|
|
|
-
|
|
|
-//=================================
|
|
|
-// Common routine
|
|
|
-//=================================
|
|
|
-void getTimeString(char *buff)
|
|
|
-{
|
|
|
- time_t timep;
|
|
|
- struct tm *p;
|
|
|
- time(&timep);
|
|
|
- p=gmtime(&timep);
|
|
|
-
|
|
|
- sprintf(buff, "[%04d-%02d-%02d %02d:%02d:%02d]", (1900+p->tm_year), (1+p->tm_mon), p->tm_mday, p->tm_hour, p->tm_hour, p->tm_sec);
|
|
|
-}
|
|
|
-
|
|
|
-bool CheckUniqNumber(byte value)
|
|
|
-{
|
|
|
- for (byte index = 0; index < gun_count; index++)
|
|
|
- {
|
|
|
- if (_chargingData[index]->Evboard_id == value)
|
|
|
- {
|
|
|
- struct timeval _end_time;
|
|
|
- gettimeofday(&_end_time, NULL);
|
|
|
- unsigned long diff = 1000000 * (_end_time.tv_sec - _id_assign_time.tv_sec) + _end_time.tv_usec - _id_assign_time.tv_usec;
|
|
|
- if (diff >= 3000000)
|
|
|
- {
|
|
|
- gettimeofday(&_id_assign_time, NULL);
|
|
|
- return true;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- return false;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- gettimeofday(&_id_assign_time, NULL);
|
|
|
- return true;
|
|
|
-}
|
|
|
-
|
|
|
//==========================================
|
|
|
// Init all share memory
|
|
|
//==========================================
|
|
@@ -217,143 +99,151 @@ int InitShareMemory()
|
|
|
int result = PASS;
|
|
|
int MeterSMId;
|
|
|
|
|
|
- //initial ShmSysConfigAndInfo
|
|
|
- if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo), 0777)) < 0)
|
|
|
+ if ((MeterSMId = shmget(ShmSysConfigAndInfoKey, sizeof(struct SysConfigAndInfo), IPC_CREAT | 0777)) < 0)
|
|
|
{
|
|
|
#ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmget ShmSysConfigAndInfo NG\n");
|
|
|
+ printf("EV shmget ShmSysConfigAndInfo NG\n");
|
|
|
#endif
|
|
|
result = FAIL;
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
{
|
|
|
#ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmat ShmSysConfigAndInfo NG\n");
|
|
|
+ printf("[shmat ShmSysConfigAndInfo NG\n");
|
|
|
#endif
|
|
|
result = FAIL;
|
|
|
- }
|
|
|
- else
|
|
|
- {}
|
|
|
+ }
|
|
|
|
|
|
- //initial ShmStatusCodeData
|
|
|
- if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData), 0777)) < 0)
|
|
|
+ if ((MeterSMId = shmget(ShmStatusCodeKey, sizeof(struct StatusCodeData), IPC_CREAT | 0777)) < 0)
|
|
|
{
|
|
|
#ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmget ShmStatusCodeData NG\n");
|
|
|
+ printf("shmget ShmStatusCodeData NG\n");
|
|
|
#endif
|
|
|
result = FAIL;
|
|
|
}
|
|
|
else if ((ShmStatusCodeData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
{
|
|
|
#ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmat ShmStatusCodeData NG\n");
|
|
|
+ printf("shmat ShmStatusCodeData NG\n");
|
|
|
#endif
|
|
|
result = FAIL;
|
|
|
}
|
|
|
- else
|
|
|
- {}
|
|
|
|
|
|
- if(CHAdeMO_QUANTITY > 0)
|
|
|
+ if ((MeterSMId = shmget(ShmFanBdKey, sizeof(struct FanModuleData), IPC_CREAT | 0777)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmget ShmFanModuleData NG\n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmFanModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmat ShmFanModuleData NG\n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ memset(ShmFanModuleData,0,sizeof(struct FanModuleData));
|
|
|
+
|
|
|
+ if ((MeterSMId = shmget(ShmRelayBdKey, sizeof(struct RelayModuleData), IPC_CREAT | 0777)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmget ShmRelayModuleData NG\n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmRelayModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
{
|
|
|
- if ((MeterSMId = shmget(ShmCHAdeMOCommKey, sizeof(struct CHAdeMOData), IPC_CREAT | 0777)) < 0)
|
|
|
- {
|
|
|
- #ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("[shmget ShmCHAdeMOData NG \n");
|
|
|
- #endif
|
|
|
- return FAIL;
|
|
|
- }
|
|
|
- else if ((ShmCHAdeMOData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
- {
|
|
|
- #ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmat ShmCHAdeMOData NG \n");
|
|
|
- #endif
|
|
|
- return FAIL;
|
|
|
- }
|
|
|
- else
|
|
|
- {}
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmat ShmRelayModuleData NG\n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
}
|
|
|
+ memset(ShmRelayModuleData,0,sizeof(struct RelayModuleData));
|
|
|
|
|
|
- if(GB_QUANTITY > 0)
|
|
|
+ if ((MeterSMId = shmget(ShmLedBdKey, sizeof(struct LedModuleData), IPC_CREAT | 0777)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmget ShmLedModuleData NG\n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmLedModuleData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
{
|
|
|
- if ((MeterSMId = shmget(ShmGBTCommKey, sizeof(struct GBTData), IPC_CREAT | 0777)) < 0)
|
|
|
- {
|
|
|
- #ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("[shmget ShmGBTData NG \n");
|
|
|
- #endif
|
|
|
- return FAIL;
|
|
|
- }
|
|
|
- else if ((ShmGBTData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
- {
|
|
|
- #ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmat ShmGBTData NG \n");
|
|
|
- #endif
|
|
|
- return FAIL;
|
|
|
- }
|
|
|
- else
|
|
|
- {}
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmat ShmLedModuleData NG\n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
}
|
|
|
+ memset(ShmLedModuleData,0,sizeof(struct LedModuleData));
|
|
|
|
|
|
- if(CCS_QUANTITY > 0)
|
|
|
+ if ((MeterSMId = shmget(ShmPsuKey, sizeof(struct PsuData), IPC_CREAT | 0777)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmget ShmPsuData NG \n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+ else if ((ShmPsuData = shmat(MeterSMId, NULL, 0)) == (void *) -1)
|
|
|
{
|
|
|
- if ((MeterSMId = shmget(ShmCcsCommKey, sizeof(struct CcsData), IPC_CREAT | 0777)) < 0)
|
|
|
- {
|
|
|
- #ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmget ShmCcsData NG \n");
|
|
|
- #endif
|
|
|
- return FAIL;
|
|
|
- }
|
|
|
- else if ((ShmCcsData = shmat(MeterSMId, NULL, 0)) == (void *) -1) {
|
|
|
- #ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("shmat ShmCcsData NG \n");
|
|
|
- #endif
|
|
|
- return FAIL;
|
|
|
- }
|
|
|
- else
|
|
|
- {}
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("shmat ShmPsuData NG \n");
|
|
|
+ #endif
|
|
|
+ result = FAIL;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-//================================================
|
|
|
-// initial can-bus
|
|
|
-//================================================
|
|
|
int InitCanBus()
|
|
|
{
|
|
|
- int s0,nbytes;
|
|
|
- struct timeval tv;
|
|
|
- struct ifreq ifr0;
|
|
|
- struct sockaddr_can addr0;
|
|
|
-
|
|
|
- system("/sbin/ip link set can0 down");
|
|
|
+ int s0, nbytes;
|
|
|
+ struct timeval tv;
|
|
|
+ struct ifreq ifr0;
|
|
|
+ struct sockaddr_can addr0;
|
|
|
+ /*
|
|
|
+ //can0
|
|
|
+ system("/sbin/ip link set can0 down");//先將interface disable
|
|
|
system("/sbin/ip link set can0 type can bitrate 500000 restart-ms 100");
|
|
|
system("/sbin/ip link set can0 up");
|
|
|
+ */
|
|
|
|
|
|
- s0 = socket(PF_CAN, SOCK_RAW, CAN_RAW);
|
|
|
+ //can1
|
|
|
+ system("/sbin/ip link set can0 down");//先將interface disable
|
|
|
+ system("/sbin/ip link set can0 type can bitrate 250000 restart-ms 100");
|
|
|
+ system("/sbin/ip link set can0 up");
|
|
|
|
|
|
+ s0 = socket(PF_CAN, SOCK_RAW, CAN_RAW);
|
|
|
tv.tv_sec = 0;
|
|
|
tv.tv_usec = 10000;
|
|
|
- if (setsockopt(s0, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)) < 0)
|
|
|
+
|
|
|
+ if(setsockopt(s0, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)) < 0)
|
|
|
{
|
|
|
#ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("Set SO_RCVTIMEO NG");
|
|
|
+ //StoreLogMsg("[CsuComm]InitCanBus:Set SO_RCVTIMEO NG");
|
|
|
#endif
|
|
|
}
|
|
|
- nbytes=40960;
|
|
|
- if (setsockopt(s0, SOL_SOCKET, SO_RCVBUF, &nbytes, sizeof(int)) < 0)
|
|
|
+
|
|
|
+ nbytes = 40960;
|
|
|
+
|
|
|
+ if(setsockopt(s0, SOL_SOCKET, SO_RCVBUF, &nbytes, sizeof(int)) < 0)
|
|
|
{
|
|
|
#ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("Set SO_RCVBUF NG");
|
|
|
+ //StoreLogMsg("[CsuComm]InitCanBus:Set SO_RCVBUF NG");
|
|
|
#endif
|
|
|
}
|
|
|
- nbytes=40960;
|
|
|
- if (setsockopt(s0, SOL_SOCKET, SO_SNDBUF, &nbytes, sizeof(int)) < 0)
|
|
|
+
|
|
|
+ nbytes = 40960;
|
|
|
+
|
|
|
+ if(setsockopt(s0, SOL_SOCKET, SO_SNDBUF, &nbytes, sizeof(int)) < 0)
|
|
|
{
|
|
|
#ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("Set SO_SNDBUF NG");
|
|
|
+ //StoreLogMsg("[CsuComm]InitCanBus:Set SO_SNDBUF NG");
|
|
|
#endif
|
|
|
}
|
|
|
|
|
|
+ //strcpy(ifr0.ifr_name, "can0" );
|
|
|
strcpy(ifr0.ifr_name, "can0" );
|
|
|
ioctl(s0, SIOCGIFINDEX, &ifr0); /* ifr.ifr_ifindex gets filled with that device's index */
|
|
|
addr0.can_family = AF_CAN;
|
|
@@ -362,3137 +252,1435 @@ int InitCanBus()
|
|
|
return s0;
|
|
|
}
|
|
|
|
|
|
-//================================================
|
|
|
-//================================================
|
|
|
-// CANBUS receive task
|
|
|
-//================================================
|
|
|
-//================================================
|
|
|
-bool FindChargingInfoData(byte target, struct ChargingInfoData **chargingData)
|
|
|
+int CHROMAInitCanBus()
|
|
|
{
|
|
|
- for (byte index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == target)
|
|
|
- {
|
|
|
- chargingData[target] = &ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index];
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for (byte index = 0; index < CCS_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == target)
|
|
|
- {
|
|
|
- chargingData[target] = &ShmSysConfigAndInfo->SysInfo.CcsChargingData[index];
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
+ int s0,nbytes;
|
|
|
+ struct timeval tv;
|
|
|
+ struct ifreq ifr0;
|
|
|
+ struct sockaddr_can addr0;
|
|
|
+
|
|
|
+ system("/sbin/ip link set can1 down");
|
|
|
+ system("/sbin/ip link set can1 type can bitrate 500000 restart-ms 100");
|
|
|
+ system("/sbin/ip link set can1 up");
|
|
|
+
|
|
|
+ s0 = socket(PF_CAN, SOCK_RAW, CAN_RAW);
|
|
|
+
|
|
|
+ tv.tv_sec = 0;
|
|
|
+ tv.tv_usec = 10000;
|
|
|
+ if (setsockopt(s0, SOL_SOCKET, SO_RCVTIMEO, (char *)&tv, sizeof(struct timeval)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ //DEBUG_ERROR("Set SO_RCVTIMEO NG");
|
|
|
+ #endif
|
|
|
+ }
|
|
|
+ nbytes=40960;
|
|
|
+ if (setsockopt(s0, SOL_SOCKET, SO_RCVBUF, &nbytes, sizeof(int)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ //DEBUG_ERROR("Set SO_RCVBUF NG");
|
|
|
+ #endif
|
|
|
+ }
|
|
|
+ nbytes=40960;
|
|
|
+ if (setsockopt(s0, SOL_SOCKET, SO_SNDBUF, &nbytes, sizeof(int)) < 0)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ //DEBUG_ERROR("Set SO_SNDBUF NG");
|
|
|
+ #endif
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy(ifr0.ifr_name, "can1" );
|
|
|
+ ioctl(s0, SIOCGIFINDEX, &ifr0); /* ifr.ifr_ifindex gets filled with that device's index */
|
|
|
+ addr0.can_family = AF_CAN;
|
|
|
+ addr0.can_ifindex = ifr0.ifr_ifindex;
|
|
|
+ bind(s0, (struct sockaddr *)&addr0, sizeof(addr0));
|
|
|
+ return s0;
|
|
|
+}
|
|
|
|
|
|
- for (byte index = 0; index < GB_QUANTITY; index++)
|
|
|
- {
|
|
|
- if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == target)
|
|
|
- {
|
|
|
- chargingData[target] = &ShmSysConfigAndInfo->SysInfo.GbChargingData[index];
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- return false;
|
|
|
+bool CheckUniqNumber(byte value)
|
|
|
+{
|
|
|
+ for (byte index = 0; index < gun_count; index++)
|
|
|
+ {
|
|
|
+ if (_chargingData[index]->Evboard_id == value)
|
|
|
+ {
|
|
|
+ struct timeval _end_time;
|
|
|
+ gettimeofday(&_end_time, NULL);
|
|
|
+ unsigned long diff = 1000000 * (_end_time.tv_sec - _id_assign_time.tv_sec) + _end_time.tv_usec - _id_assign_time.tv_usec;
|
|
|
+ if (diff >= 3000000)
|
|
|
+ {
|
|
|
+ gettimeofday(&_id_assign_time, NULL);
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ gettimeofday(&_id_assign_time, NULL);
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
void AddrAssignment(byte *data)
|
|
|
{
|
|
|
- byte target_number[8];
|
|
|
- byte index = 0x00;
|
|
|
+ byte target_number[8];
|
|
|
+ byte index = 0x00;
|
|
|
|
|
|
- memcpy(target_number, data, sizeof(target_number));
|
|
|
- index = *(data + 4);
|
|
|
+ memcpy(target_number, data, sizeof(target_number));
|
|
|
+ index = *(data + 4);
|
|
|
|
|
|
- if (gun_count == 1)
|
|
|
- index = 0x01;
|
|
|
-// if (CheckUniqNumber(index))
|
|
|
- {
|
|
|
- PRINTF_FUNC("EV board id = %x \n", index);
|
|
|
-// PRINTF_FUNC("target_number[0] = %x \n", target_number[0]);
|
|
|
-// PRINTF_FUNC("target_number[1] = %x \n", target_number[1]);
|
|
|
-// PRINTF_FUNC("target_number[2] = %x \n", target_number[2]);
|
|
|
-// PRINTF_FUNC("target_number[3] = %x \n", target_number[3]);
|
|
|
-// PRINTF_FUNC("target_number[4] = %x \n", target_number[4]);
|
|
|
-
|
|
|
- PRINTF_FUNC("SetTargetAddr = %d, type = %d \n", index, _chargingData[index - 1]->Type);
|
|
|
- SetTargetAddr(target_number, index);
|
|
|
- }
|
|
|
+ if (CheckUniqNumber(index))
|
|
|
+ {
|
|
|
+ //printf("EV board id = %x \n", index);
|
|
|
+ if (index < 1)
|
|
|
+ return;
|
|
|
+
|
|
|
+ printf("SetTargetAddr \n");
|
|
|
+ SetTargetAddr(target_number, index);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-void ClearAbnormalStatus_Chademo(byte gun_index)
|
|
|
+void setATEMode(byte gun_index, byte mode)
|
|
|
{
|
|
|
- bool isCleanCheck = false;
|
|
|
- char code[7];
|
|
|
+ _chargingData[gun_index]->ATEStatus = mode;
|
|
|
+}
|
|
|
|
|
|
- if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) == EQUAL)
|
|
|
- return;
|
|
|
+void setStatusMode(byte gun_index, byte mode)
|
|
|
+{
|
|
|
+ _chargingData[gun_index]->ATEStatus = mode;
|
|
|
+}
|
|
|
|
|
|
- if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023700", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023700", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023704", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023704", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023705", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023705", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023706", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023706", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023707", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023707", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023708", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023708", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023709", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023709", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023710", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023710", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023711", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023711", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023712", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023712", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023713", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023713", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023714", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023714", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023715", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023715", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023716", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023716", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023717", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023717", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023718", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023718", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023719", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023719", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023720", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023720", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023721", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023721", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023722", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023722", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023723", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023723", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023724", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023724", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023725", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023725", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023726", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023726", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023727", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023727", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023728", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023728", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023729", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023729", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023730", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023730", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023731", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023731", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023732", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023732", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023733", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023733", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023734", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023734", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023735", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023735", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023736", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023736", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
+unsigned char isStatusChange(unsigned char gun_index)
|
|
|
+{
|
|
|
+ unsigned char result = NO;
|
|
|
+ if(_chargingData[gun_index]->ATEStatus != _chargingData[gun_index]->PreviousATEStatus)
|
|
|
+ {
|
|
|
+ result = YES;
|
|
|
+ _chargingData[gun_index]->PreviousATEStatus = _chargingData[gun_index]->ATEStatus;
|
|
|
+
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+}
|
|
|
|
|
|
- if (isCleanCheck)
|
|
|
- {
|
|
|
- for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++)
|
|
|
- {
|
|
|
- if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
|
|
|
- {
|
|
|
- PRINTF_FUNC("CHA clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index, _chargingData[index]->EvConnAlarmCode, code);
|
|
|
- if (strncmp((char *)_chargingData[index]->EvConnAlarmCode, code, 6) != EQUAL)
|
|
|
- {
|
|
|
- if (strncmp(code, "023700", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = NO;
|
|
|
- if (strncmp(code, "023704", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = NO;
|
|
|
- if (strncmp(code, "023705", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = NO;
|
|
|
- if (strncmp(code, "023706", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = NO;
|
|
|
- if (strncmp(code, "023707", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP = NO;
|
|
|
- if (strncmp(code, "023708", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP = NO;
|
|
|
- if (strncmp(code, "023709", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP = NO;
|
|
|
- if (strncmp(code, "023710", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff = NO;
|
|
|
- if (strncmp(code, "023711", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff = NO;
|
|
|
- if (strncmp(code, "023712", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition = NO;
|
|
|
- if (strncmp(code, "023713", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault = NO;
|
|
|
- if (strncmp(code, "023714", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError = NO;
|
|
|
- if (strncmp(code, "023715", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop = NO;
|
|
|
- if (strncmp(code, "023716", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken = NO;
|
|
|
- if (strncmp(code, "023717", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail = NO;
|
|
|
- if (strncmp(code, "023718", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive = NO;
|
|
|
- if (strncmp(code, "023719", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout = NO;
|
|
|
- if (strncmp(code, "023720", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout = NO;
|
|
|
- if (strncmp(code, "023721", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout = NO;
|
|
|
- if (strncmp(code, "023722", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout = NO;
|
|
|
- if (strncmp(code, "023723", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout = NO;
|
|
|
- if (strncmp(code, "023724", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout = NO;
|
|
|
- if (strncmp(code, "023725", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout = NO;
|
|
|
- if (strncmp(code, "023726", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V = NO;
|
|
|
- if (strncmp(code, "023727", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V = NO;
|
|
|
- if (strncmp(code, "023728", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop = NO;
|
|
|
- if (strncmp(code, "023729", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop = NO;
|
|
|
- if (strncmp(code, "023730", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop = NO;
|
|
|
- if (strncmp(code, "023731", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail = NO;
|
|
|
- if (strncmp(code, "023732", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard = NO;
|
|
|
- if (strncmp(code, "023733", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit = NO;
|
|
|
- if (strncmp(code, "023734", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit = NO;
|
|
|
- if (strncmp(code, "023735", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = NO;
|
|
|
- if (strncmp(code, "023736", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = NO;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+int bitExtracted(byte number, int k, int p)
|
|
|
+{
|
|
|
+ return (((1 << k) - 1) & (number >> (p - 1)));
|
|
|
}
|
|
|
|
|
|
-void ClearAbnormalStatus_GB(byte gun_index)
|
|
|
+unsigned short bitextract(unsigned short value, int begin, int end)
|
|
|
{
|
|
|
- bool isCleanCheck = false;
|
|
|
- char code[7];
|
|
|
+ unsigned short mask = (1 << (end - begin)) - 1;
|
|
|
+ return (value >> begin) & mask;
|
|
|
+}
|
|
|
|
|
|
- if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) == EQUAL)
|
|
|
- return;
|
|
|
+//接收can
|
|
|
+void CANReceiver()
|
|
|
+{
|
|
|
+ pid_t canRecPid;
|
|
|
+ canRecPid = fork();
|
|
|
+ if(canRecPid > 0){
|
|
|
+ int nbytes;
|
|
|
+ struct can_frame frame;
|
|
|
+ int intCmd;
|
|
|
+ while (1){
|
|
|
+ if(ShmSysConfigAndInfo->ate.ATEState == 1){
|
|
|
+ //清空 canbus recever buf
|
|
|
+ memset(&frame, 0, sizeof(struct can_frame));
|
|
|
+ //讀取 canbus 是否有接收到封包
|
|
|
+ nbytes = read(CanFd, &frame, sizeof(struct can_frame));
|
|
|
+ //如果有收到 canbus 封包
|
|
|
+ if (nbytes > 0){
|
|
|
+ intCmd = (int) (frame.can_id & CAN_EFF_MASK);//extended frame format
|
|
|
+ #ifdef Debug
|
|
|
+ //printf("hsout0StatusChange Get-INFYPWR-Msg : %08x - %02x %02x %02x %02x %02x %02x %02x %02x\n ", intCmd, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ //printf(" Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ #endif
|
|
|
+ switch (intCmd){
|
|
|
+ case VCCU_ChargeFromVehicleId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle, &frame.data, frame.can_dlc);
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle.VCCU_Vehicle_ContactorVoltage = ((short) frame.data[1] << 8) + (short) frame.data[0];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle.VCCU_Vehicle_LinkVoltage = ((short) frame.data[3] << 8) + (short) frame.data[2];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle.DATA.bits.VCCU_Vehicle_IsolationMeasurem = bitextract(frame.data[4],0, 2);//((short) frame.data[4] >> 0)+((short) frame.data[4] >> 1);//((short) frame.data[4] << 2);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle.DATA.bits.VCCU_Vehicle_PlugLockPermissio = bitextract(frame.data[4],2, 4);//((short) frame.data[4] >> 2)+((short) frame.data[4] >> 3);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle.DATA.bits.VCCU_Vehicle_PlugUnlockPermiss = bitextract(frame.data[4],4, 6);//((short) frame.data[4] >> 4)+((short) frame.data[4] >> 5);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle.DATA.bits.VCCU_Vehicle_ChargePermission = bitextract(frame.data[4],6, 8);//((short) frame.data[4] >> 6)+((short) frame.data[4] >> 7);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle.bits.VCCU_Vehicle_ContactorStatus = bitextract(frame.data[5],0, 2);
|
|
|
+
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.chargeFromVehicle,*frame.data, frame.can_dlc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_ControlPilotStatusId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.controlPilotStatus, &frame.data, frame.can_dlc);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Frequency.bits.VCCU_ControlPilot_Frequency = ((short) frame.data[1] << 8) + (short) frame.data[0];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_DutyCycle.bits.value = ((short) frame.data[2] ) ;
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Voltage.bits.value = ((short) frame.data[3] << 8) + (short) frame.data[4];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.DATA.bits.VCCU_ControlPilot_Wakeup = bitextract(((short) (frame.data[5])), 0, 2);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.DATA.bits.VCCU_ChargeUnit_Mode = bitextract(frame.data[5],2, 5);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.DATA.bits.VCCU_ChargeUnit_State = bitextract(((short) (frame.data[5])), 5, 8);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ChargeUnit_MaxCurrent = ((short) frame.data[6] );
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.controlPilotStatus.ControlPilot_Voltage,frame.data[5], frame.can_dlc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_V2G_StateMId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.v2g_StateM, &frame.data, frame.can_dlc);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_StateM.VCCU_V2G_StateM_EnergyTransfer = (short) frame.data[0];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_StateM.VCCU_V2G_StateM_StateMachineEr = (short) frame.data[1];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_StateM.VCCU_V2G_StateM_StateMachineMe = (short) frame.data[2];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_StateM.VCCU_V2G_StateM_StateMachineSt = (short) frame.data[3];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_StateM.DATA.bits.VCCU_V2G_StateM_InternetAvaila = bitextract(frame.data[4],0, 1);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_StateM.DATA.bits.VCCU_V2G_Appl_SccChargeModeReq = bitextract(frame.data[4],1, 4);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_StateM.DATA.bits.VCCU_V2G_Appl_SccFuncModeReq = bitextract(frame.data[4],4, 6);
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.v2g_StateM.VCCU_V2G_StateM_StateMachineSt,*frame.data, frame.can_dlc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_InletStatusId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.inletStatus, &frame.data, frame.can_dlc);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.VCCU_POSFeedback_Voltage = ((short) frame.data[1] << 8) + (short) frame.data[0];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA2.VCCU_PlugPresent_SelfDiagnosti = bitextract(frame.data[2],0, 3);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA2.VCCU_PlugPresent_Resistance = bitextract(frame.data[2],3, 6);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA2.VCCU_PlugPresent_Status = bitextract(frame.data[2],6, 8);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA3.VCCU_PlugPresent_Wakeup = bitextract(frame.data[3],0, 2);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA3.VCCU_POSFeedback_SelfDiagnosti = bitextract(frame.data[3],2, 5);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA3.VCCU_PlugLock_MotorStatus = bitextract(frame.data[3],5, 8);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA4.VCCU_PlugLock_Output0_SelfDiag = bitextract(frame.data[4],0, 3);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA4.VCCU_PlugLock_Output1_SelfDiag = bitextract(frame.data[4],3, 6);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA4.VCCU_Inlet_HWVariant = bitextract(frame.data[4],6, 8);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA5.bits.VCCU_DigitalInput_Status = bitextract(frame.data[5],0, 2);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA5.bits.VCCU_DigitalInput_Wakeup = bitextract(frame.data[5],2, 4);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA5.bits.VCCU_Inlet_MotorStatus = bitextract(frame.data[5],4, 7);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.VCCU_Inlet_MaxCurrent = (short) frame.data[6];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA7.bits.VCCU_DigitalInput_DebouncedSta = bitextract(frame.data[7],0, 2);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA7.bits.VCCU_Inlet_ConnectionStatus = bitextract(frame.data[7],2, 4);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA7.bits.VCCU_S3Switch_Status = bitextract(frame.data[7],4, 6);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA7.bits.VCCU_S3Switch_DebouncedStatus = bitextract(frame.data[7],6, 8);
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.inletStatus,*frame.data, frame.can_dlc);
|
|
|
+ //printf("VCCU_ControlPilotStatus Get-INFYPWR-Msg : %08x - %02x %02x %02x %02x %02x %02x %02x %02x\n ", intCmd, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_ChargeToVehicleId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.chargeToVehicle, &frame.data, frame.can_dlc);
|
|
|
+ //ShmSysConfigAndInfo->ate.vccu.chargeToVehicle.Data.bits.VCCU_Vehicle_IsolationMea_0000 = bitextract(frame.data[0],0, 2);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeToVehicle.bits.VCCU_Vehicle_IsolationMea_0000 = bitextract(frame.data[0],0, 2);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.chargeToVehicle.bits.VCCU_Vehicle_ContactorRequest = bitextract(frame.data[0],2, 4);
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.chargeToVehicle,*frame.data, frame.can_dlc);
|
|
|
+ //printf("VCCU_ControlPilotStatus Get-INFYPWR-Msg : %08x - %02x %02x %02x %02x %02x %02x %02x %02x\n ", intCmd, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_V2G_EVMaximumVoltageLimitId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.v2g_EVMaximumVoltageLimit, &frame.data, frame.can_dlc);
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.v2g_EVMaximumVoltageLimit,*frame.data, frame.can_dlc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_V2G_EVSEMaximumCurrentLimId:{
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_EVSEMaximumCurrentLim.DATA.VCCU_V2G_EVSEMaximumCurre_0002 = bitextract(frame.data[0],0, 4);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_EVSEMaximumCurrentLim.DATA.VCCU_V2G_EVSEMaximumCurrentLim = bitextract(frame.data[0],4, 6);
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_EVSEMaximumCurrentLim.VCCU_V2G_EVSEMaximumCurre_0003 = (short) frame.data[1];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_EVSEMaximumCurrentLim.VCCU_V2G_EVSEMaximumCurre_0000 = ((short) frame.data[3] << 8) + (short) frame.data[2];
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_EVSEMaximumCurrentLim.VCCU_V2G_EVSEMaximumCurre_0001 = (short) frame.data[4];//樁的電流
|
|
|
+
|
|
|
+ //printf("VCCU_V2G_EVSEMaximumCurrentLimId Get-INFYPWR-Msg : VCCU_V2G_EVSEMaximumCurre_0000 = %d \n ", ShmSysConfigAndInfo->ate.vccu.v2g_EVSEMaximumCurrentLim.VCCU_V2G_EVSEMaximumCurre_0000);
|
|
|
+
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.v2g_EVMaximumCurrentLimit, &frame.data, frame.can_dlc);
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.v2g_EVMaximumCurrentLimit,*frame.data, frame.can_dlc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_V2G_EVTargetCurrentId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.v2g_EVTargetCurrent, &frame.data, frame.can_dlc);
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.v2g_EVTargetCurrent,*frame.data, frame.can_dlc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_V2G_EVTargetVoltageId:{
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.vccu.v2g_EVTargetVoltage, &frame.data, frame.can_dlc);
|
|
|
+ //memset(&ShmSysConfigAndInfo->ate.vccu.v2g_EVTargetVoltage,*frame.data, frame.can_dlc);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case VCCU_V2G_EVSEPresentVoltageId:{
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va = ((short) frame.data[3] << 8) + (short) frame.data[2];
|
|
|
+ //printf("EVSEPresentVoltage = %d\n ", ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va );
|
|
|
+ ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va = ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va / 10;
|
|
|
+ //printf("EVSEPresentVoltage = %d\n ", ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va );
|
|
|
+ /*
|
|
|
+ if(ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va != 0){
|
|
|
+ ShmSysConfigAndInfo->ate.targetVoltage_Value = ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va;
|
|
|
+
|
|
|
+ }
|
|
|
+ */
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ usleep(2000);
|
|
|
+
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.ATEState == 2){
|
|
|
+ memset(&frame, 0, sizeof(struct can_frame));
|
|
|
+ nbytes = read(CanFd, &frame, sizeof(struct can_frame));
|
|
|
+ if (nbytes > 0)
|
|
|
+ {
|
|
|
+ intCmd = (int) (frame.can_id & CAN_EFF_MASK);
|
|
|
+ #ifdef Debug
|
|
|
+ //printf("hsout0StatusChange Get-INFYPWR-Msg : %08x - %02x %02x %02x %02x %02x %02x %02x %02x\n ", intCmd, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ //printf(" Get-Msg2 : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ #endif
|
|
|
+ if (intCmd == ADDRESS_REQ)
|
|
|
+ {
|
|
|
+ AddrAssignment(frame.data);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ intCmd = (int) (frame.can_id & CAN_EFF_MASK & 0xFFFFFF00);
|
|
|
+
|
|
|
+
|
|
|
+ if(intCmd == 256)
|
|
|
+ {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //gettimeofday(&_cmd_ack_timeout[targetGun], NULL);
|
|
|
+ //printf ("intCmd = %x \n", intCmd);
|
|
|
+ switch (intCmd)
|
|
|
+ {
|
|
|
+ case EV_BOARD_STATUS_NOTIFICATION:
|
|
|
+ {
|
|
|
+ //printf(" EV_BOARD_STATUS_NOTIFICATION\n ");
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id03.ProximitySignal = frame.data[2];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id03.state = frame.data[3];
|
|
|
+ //printf(" EV_BOARD_STATUS_NOTIFICATION %d \n ", ShmSysConfigAndInfo->ate.chademo.id03.state);
|
|
|
+ //printf(" EV_BOARD_STATUS_NOTIFICATION Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+
|
|
|
+ //printf("EVBoardStatusNotification Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+
|
|
|
+ //printf("ConnectorPlugIn = %x, data[0] = %x \n", _chargingData[target]->ConnectorPlugIn, frame.data[0]);
|
|
|
+ //printf("ConnectorPlugIn = %x \n", (-120 + frame.data[1]) / 10);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ACK_EV_FW_VERSION:
|
|
|
+ {
|
|
|
+ printf(" ACK_EV_FW_VERSION\n ");
|
|
|
+ /*
|
|
|
+ if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
+ {
|
|
|
+ memcpy(ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version, frame.data, ARRAY_SIZE(frame.data));
|
|
|
+ ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
|
|
|
+ }
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_CCS)
|
|
|
+ {
|
|
|
+ if (ShmCcsData->CommProtocol == 0x01)
|
|
|
+ {
|
|
|
+ memcpy(&ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].version, frame.data, ARRAY_SIZE(frame.data));
|
|
|
+ ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ACK_EV_HW_VERSION:
|
|
|
+ {
|
|
|
+ printf("Get EV HW = %s \n", frame.data);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+
|
|
|
+ case ACK__GET_EVSE_OUTPUT_STATUS:
|
|
|
+ {
|
|
|
+ //printf(" ACK__GET_EVSE_OUTPUT_STATUS\n ");
|
|
|
+ //printf(" ACK__GET_EVSE_OUTPUT_STATUS\n ");
|
|
|
+
|
|
|
+ //printf(" Get EVSE output status Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id09_ack.DcEvState = frame.data[0];//EV模擬器
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id09_ack.ChargingMode = frame.data[1];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id09_ack.EvsePresentOutputVoltage = ((short) frame.data[3] << 8) + (short) frame.data[2];//充電樁輸出電壓
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id09_ack.EvsePresentOutputCurrent = ((short) frame.data[5] << 8) + (short) frame.data[4];//充電樁輸出電流
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id09_ack.RemainingTimeSec = ((short) frame.data[7] << 8) + (short) frame.data[6];//剩餘時間
|
|
|
+
|
|
|
+ /*
|
|
|
+ _chargingData[targetGun]->EvBatterySoc = frame.data[1];
|
|
|
+ _chargingData[targetGun]->EvBatterytargetVoltage = ((short) frame.data[3] << 8) + (short) frame.data[2];
|
|
|
+ _chargingData[targetGun]->EvBatterytargetCurrent = ((short) frame.data[5] << 8) + (short) frame.data[4];
|
|
|
+ _chargingData[targetGun]->PresentChargedDuration = ((short) frame.data[7] << 8) + (short) frame.data[6];
|
|
|
+
|
|
|
+ if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
+ {
|
|
|
+ if (ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].EvDetection != frame.data[0])
|
|
|
+ {
|
|
|
+ // log
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].EvDetection = frame.data[0];
|
|
|
+ ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].SOC = _chargingData[targetGun]->EvBatterySoc;
|
|
|
+ ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].TargetBatteryVoltage = _chargingData[targetGun]->EvBatterytargetVoltage;
|
|
|
+ ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].ChargingCurrentRequest = _chargingData[targetGun]->EvBatterytargetCurrent;
|
|
|
+ }
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_CCS)
|
|
|
+ {
|
|
|
+ if(ShmCcsData->CommProtocol == 0x01)
|
|
|
+ {
|
|
|
+ ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+ //printf("frame.data_2 = %x, frame.data_3 = %x \n", frame.data[2], frame.data[3]);
|
|
|
+ //printf("EvBatterytargetVoltage = %f \n", _chargingData[targetGun]->EvBatterytargetVoltage);
|
|
|
+ //printf("EvBatterytargetCurrent = %f \n", _chargingData[targetGun]->EvBatterytargetCurrent);
|
|
|
+ //printf("BatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TargetBatteryVoltage);
|
|
|
+ //printf("CurrentRequest = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].ChargingCurrentRequest);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ACK_GET_EVSE_Capacity_INFO:
|
|
|
+ {
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0A_ack.EvseMaxChargeVoltage = ((short) frame.data[1] << 8) + (short) frame.data[0];//樁的最大電壓
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0A_ack.EvseMaxChargeCurrent = ((short) frame.data[3] << 8) + (short) frame.data[2];//樁的最大電流
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0A_ack.EvseMinChargeVoltage = ((short) frame.data[5] << 8) + (short) frame.data[4];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0A_ack.EvseMinChargeCurrent = ((short) frame.data[7] << 8) + (short) frame.data[6];
|
|
|
+
|
|
|
+ /*
|
|
|
+ //_chargingData[target].EvACorDCcharging = frame.data[0];
|
|
|
+ //_chargingData[target]->TotalBatteryCap = ((float) frame.data[4] << 8) + (short) frame.data[3];
|
|
|
+ _chargingData[targetGun]->EvBatteryMaxVoltage = ((short) frame.data[4] << 8) + (short) frame.data[3];
|
|
|
+ //_chargingData[target]->EvBatteryMaxCurrent = ((float) frame.data[4] << 8) + (short) frame.data[3];
|
|
|
+ //_chargingData[target].MaxiBatteryCurrent = ((short) frame.data[6] << 8) + (short) frame.data[5];
|
|
|
+ if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
+ {
|
|
|
+ ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data[2] << 8) + (short) frame.data[1];
|
|
|
+ ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].MaxiBatteryVoltage = _chargingData[targetGun]->EvBatteryMaxVoltage;
|
|
|
+
|
|
|
+ //printf("EvBatteryMaxVoltage = %f \n", _chargingData[target]->EvBatteryMaxVoltage);
|
|
|
+ //printf("TotalBatteryCapacity = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TotalBatteryCapacity);
|
|
|
+ //printf("MaxiBatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].MaxiBatteryVoltage);
|
|
|
+ }
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_CCS)
|
|
|
+ {
|
|
|
+ if(ShmCcsData->CommProtocol == 0x01)
|
|
|
+ {
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ACK_GET_MISCELLANEOUS_INFO:
|
|
|
+ {
|
|
|
+ //printf(" ACK_GET_MISCELLANEOUS_INFO\n ");
|
|
|
+ //printf(" ACK_GET_MISCELLANEOUS_INFO\n ");
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0D_ack.K1K2OnOff = frame.data[5];
|
|
|
+ if(ShmSysConfigAndInfo->ate.chademo.relaystatus == 0){
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0D_req.K1K2Status = ShmSysConfigAndInfo->ate.chademo.id0D_ack.K1K2OnOff;
|
|
|
+ setStatusMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.chademo.id0D_req.K1K2Status);
|
|
|
+
|
|
|
+ int status = isStatusChange(CCS_QUANTITY);
|
|
|
+ if(status){
|
|
|
+ /*
|
|
|
+ if(ShmSysConfigAndInfo->ate.chademo.id0D_req.K1K2Status == 1){
|
|
|
+ if(ShmSysConfigAndInfo->ate.ATEState == 1){
|
|
|
+
|
|
|
+
|
|
|
+ //usleep(whileLoopTime);
|
|
|
+
|
|
|
+ //outputRelay.relay_event.bits.Gun1_Parallel_N = 0x00;
|
|
|
+ //outputRelay.relay_event.bits.Gun1_Parallel_P = 0x00;
|
|
|
+ //Config_Relay_Output(Uart5Fd, Addr.Relay, &outputRelay);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.ATEState == 2){
|
|
|
+ //outputRelay.relay_event.bits.Gun1_Parallel_N = 0x01;
|
|
|
+ //outputRelay.relay_event.bits.Gun1_Parallel_P = 0x01;
|
|
|
+ //Config_Relay_Output(Uart5Fd, Addr.Relay, &outputRelay);
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ */
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //memcpy(&ShmSysConfigAndInfo->ate.chademo.id0D_ack, &frame.data, frame.can_dlc);
|
|
|
+ //printf("%d %d\n", ShmSysConfigAndInfo->ate.chademo.id0D_ack.K1K2OnOff, ShmSysConfigAndInfo->ate.chademo.id0D_ack.EvBoardState);
|
|
|
+ //printf(" Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ /*
|
|
|
+ float pilotVol = (float)(-120 + frame.data[3]) / 10;
|
|
|
+
|
|
|
+ // if (pilotVol != _chargingData[targetGun]->PilotVoltage)
|
|
|
+ // DEBUG_INFO("PilotVoltage = %f \n", _chargingData[targetGun]->PilotVoltage);
|
|
|
+
|
|
|
+ if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
+ {
|
|
|
+ _chargingData[targetGun]->GunLocked = frame.data[0];
|
|
|
+ ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureP = frame.data[1];
|
|
|
+ ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureN = frame.data[2];
|
|
|
+ _chargingData[targetGun]->PilotVoltage = pilotVol;
|
|
|
+ ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].EvboardStatus = frame.data[7];
|
|
|
+ }
|
|
|
+ else if (_chargingData[targetGun]->Type == _Type_CCS)
|
|
|
+ {
|
|
|
+ if (ShmCcsData->CommProtocol == 0x01)
|
|
|
+ {
|
|
|
+ _chargingData[targetGun]->GunLocked = frame.data[0];
|
|
|
+ //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureP = frame.data[1];
|
|
|
+ //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureN = frame.data[2];
|
|
|
+ _chargingData[targetGun]->PilotVoltage = pilotVol;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ */
|
|
|
+
|
|
|
+ //printf("ConnectorPlug locked = %x \n", frame.data[0]);
|
|
|
+ //printf("ConnectorTemp 0= %d \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].ConnectorTemperatureP);
|
|
|
+ //printf("ConnectorTemp 1= %d \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].ConnectorTemperatureN);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case ACK_EVSE_ISOLATION_STATUS: { } break;
|
|
|
+ case ACK_EVSE_PRECHAGE_INFO:
|
|
|
+ {
|
|
|
+ //_chargingData[targetGun]->PrechargeStatus = frame.data[0];
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case NOTIFICATION_EV_STOP:
|
|
|
+ {
|
|
|
+ printf(" ACK_GET_MISCELLANEOUS_INFO\n ");
|
|
|
+
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0B.EvStopReason = frame.data[0];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode1 = frame.data[1];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode2 = frame.data[2];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode3 = frame.data[3];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode4 = frame.data[4];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode5 = frame.data[5];
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode6 = frame.data[6];
|
|
|
+ printf("EvStopReason = %d %d %d %d %d %d %d \n", ShmSysConfigAndInfo->ate.chademo.id0B.EvStopReason, ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode1, ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode2, ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode3, ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode4, ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode5, ShmSysConfigAndInfo->ate.chademo.id0B.AlarmCode6);
|
|
|
+ //byte normalStop = 0x01;
|
|
|
+ //byte stopReason[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
|
+ //byte evstaus[5] = { 0x01, 0x02, 0x03, 0x04, 0x05 };
|
|
|
+
|
|
|
+ //ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ //setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ //ShmSysConfigAndInfo->ate.ATEStatus = 0x00;
|
|
|
+ //SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ //EvseStopChargingEvent(normalStop, stopReason, 1);
|
|
|
+ setEVStatus1(evstaus[4]);
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setStatusMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ ShmSysConfigAndInfo->ate.ATEStatus = 0x00;
|
|
|
+ SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ EvseStopChargingEvent(normalStop, stopReason, 1);
|
|
|
+ /*
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ ShmSysConfigAndInfo->ate.ATEStatus = 0x00;
|
|
|
+ SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+*/
|
|
|
+ /*
|
|
|
+ time_t CurrentTime;
|
|
|
+ struct tm *tm;
|
|
|
+ CurrentTime = time(NULL);
|
|
|
+ tm = localtime(& CurrentTime);
|
|
|
+ printf(" Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+
|
|
|
+ printf("NOTIFICATION_EV_STOP : %04d-%02d-%02d %02d:%02d:%02d \n",
|
|
|
+ tm->tm_year+1900,tm->tm_mon+1,tm->tm_mday,tm->tm_hour,tm->tm_min,tm->tm_sec);
|
|
|
+ // 車端要求停止
|
|
|
+ // frame.data[0] : 0x01 => normal stop, 0x02 => ev emergency stop
|
|
|
+ if (frame.data[0] == 0x02)
|
|
|
+ {
|
|
|
+ //printf("NOTIFICATION_EV_STOP -----------------------------\n");
|
|
|
+ AbnormalStopAnalysis(targetGun, frame.data + 1);
|
|
|
+ }
|
|
|
+ _chargingData[targetGun]->StopChargeFlag = YES;
|
|
|
+ */
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ //printf("Ack none defined. intCmd = %d \n", intCmd);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ usleep(10000);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023702", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023702", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023900", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023900", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023901", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023901", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023902", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023902", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023903", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023903", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023904", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023904", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023905", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023905", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023906", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023906", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023907", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023907", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023908", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023908", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023909", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023909", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023910", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023910", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023911", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023911", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023912", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023912", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023913", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023913", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023914", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023914", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023915", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023915", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023916", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023916", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023917", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023917", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023918", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023918", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023919", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023919", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023930", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023930", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023931", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023931", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023932", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023932", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023933", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023933", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023934", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023934", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023935", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023935", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023936", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023936", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023937", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023937", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023938", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023938", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023939", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023939", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023940", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023940", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023941", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023941", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023942", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023942", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023943", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023943", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023944", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023944", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023945", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023945", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023946", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023946", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023947", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023947", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023950", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023950", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023951", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023951", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023952", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023952", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023953", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023953", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023954", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023954", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023955", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023955", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023956", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023956", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023957", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023957", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023958", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023958", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023959", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023959", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023960", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023960", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023961", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023961", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023962", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023962", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023963", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023963", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023964", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023964", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023970", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023970", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023971", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023971", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023972", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023972", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023973", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023973", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023974", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023974", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023975", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023975", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023976", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023976", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023977", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023977", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
-
|
|
|
- if (isCleanCheck)
|
|
|
- {
|
|
|
- for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++)
|
|
|
- {
|
|
|
- if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
|
|
|
- {
|
|
|
- PRINTF_FUNC("GBT clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index, _chargingData[index]->EvConnAlarmCode, code);
|
|
|
- if (strncmp((char *)_chargingData[index]->EvConnAlarmCode, code, 6) != EQUAL)
|
|
|
- {
|
|
|
- if (strncmp(code, "023702", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = NO;
|
|
|
- if (strncmp(code, "023900", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = NO;
|
|
|
- if (strncmp(code, "023901", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = NO;
|
|
|
- if (strncmp(code, "023902", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = NO;
|
|
|
- if (strncmp(code, "023903", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023904", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023905", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = NO;
|
|
|
- if (strncmp(code, "023906", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = NO;
|
|
|
- if (strncmp(code, "023907", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = NO;
|
|
|
- if (strncmp(code, "023908", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023909", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = NO;
|
|
|
- if (strncmp(code, "023910", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = NO;
|
|
|
- if (strncmp(code, "023911", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = NO;
|
|
|
- if (strncmp(code, "023912", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = NO;
|
|
|
- if (strncmp(code, "023913", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = NO;
|
|
|
- if (strncmp(code, "023914", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = NO;
|
|
|
- if (strncmp(code, "023915", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = NO;
|
|
|
- if (strncmp(code, "023916", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = NO;
|
|
|
- if (strncmp(code, "023917", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = NO;
|
|
|
- if (strncmp(code, "023918", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = NO;
|
|
|
- if (strncmp(code, "023919", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = NO;
|
|
|
- if (strncmp(code, "023930", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023931", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023932", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023933", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023934", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023935", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023936", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023937", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023938", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023939", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023940", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023941", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023942", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023943", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023944", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023945", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023946", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023947", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = NO;
|
|
|
- if (strncmp(code, "023950", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = NO;
|
|
|
- if (strncmp(code, "023951", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = NO;
|
|
|
- if (strncmp(code, "023952", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = NO;
|
|
|
- if (strncmp(code, "023953", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = NO;
|
|
|
- if (strncmp(code, "023954", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = NO;
|
|
|
- if (strncmp(code, "023955", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = NO;
|
|
|
- if (strncmp(code, "023956", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = NO;
|
|
|
- if (strncmp(code, "023957", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = NO;
|
|
|
- if (strncmp(code, "023958", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = NO;
|
|
|
- if (strncmp(code, "023959", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = NO;
|
|
|
- if (strncmp(code, "023960", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = NO;
|
|
|
- if (strncmp(code, "023961", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = NO;
|
|
|
- if (strncmp(code, "023962", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = NO;
|
|
|
- if (strncmp(code, "023963", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = NO;
|
|
|
- if (strncmp(code, "023964", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = NO;
|
|
|
- if (strncmp(code, "023970", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = NO;
|
|
|
- if (strncmp(code, "023971", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = NO;
|
|
|
- if (strncmp(code, "023972", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = NO;
|
|
|
- if (strncmp(code, "023973", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = NO;
|
|
|
- if (strncmp(code, "023974", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = NO;
|
|
|
- if (strncmp(code, "023975", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = NO;
|
|
|
- if (strncmp(code, "023976", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = NO;
|
|
|
- if (strncmp(code, "023977", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = NO;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void ClearAbnormalStatus_CCS(byte gun_index)
|
|
|
-{
|
|
|
- bool isCleanCheck = false;
|
|
|
- char code[7];
|
|
|
-
|
|
|
- if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) == EQUAL)
|
|
|
- return;
|
|
|
-
|
|
|
- if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023701", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023701", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023737", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023737", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023738", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023738", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023739", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023739", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023740", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023740", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023741", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023741", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023742", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023742", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023743", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023743", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023744", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023744", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023745", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023745", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023746", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023746", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023747", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023747", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023748", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023748", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023749", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023749", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023750", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023750", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023751", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023751", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023752", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023752", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023753", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023753", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023754", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023754", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023755", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023755", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023756", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023756", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023757", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023757", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023758", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023758", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023759", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023759", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023760", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023760", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023761", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023761", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023762", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023762", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023763", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023763", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023764", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023764", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023765", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023765", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023766", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023766", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023767", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023767", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023768", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023768", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023769", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023769", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023770", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023770", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023771", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023771", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023772", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023772", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023773", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023773", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023774", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023774", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023775", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023775", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023776", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023776", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023777", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023777", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023778", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023778", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023779", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023779", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023780", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023780", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023781", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023781", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023782", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023782", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023783", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023783", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023784", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023784", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023785", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023785", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023786", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023786", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023787", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023787", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023788", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023788", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023789", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023789", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023790", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023790", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023791", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023791", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023792", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023792", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023793", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023793", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023794", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023794", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023795", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023795", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023796", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023796", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023797", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023797", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023798", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023798", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023799", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023799", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023800", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023800", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023801", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023801", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023802", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023802", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023803", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023803", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023809", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023809", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023810", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023810", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023811", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023811", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023812", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023812", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023813", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023813", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023814", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023814", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023815", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023815", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023816", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023816", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023817", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023817", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023823", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023823", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023824", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023824", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023825", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023825", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023826", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023826", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023832", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023832", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023833", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023833", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023834", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023834", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023835", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023835", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023836", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023836", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023837", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023837", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023838", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023838", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023839", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023839", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023840", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023840", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023841", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023841", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023842", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023842", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023843", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023843", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023844", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023844", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023845", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023845", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023846", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023846", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023847", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023847", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023848", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023848", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023849", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023849", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023850", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023850", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023855", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023855", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023856", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023856", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023857", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023857", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023858", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023858", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023859", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023859", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023860", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023860", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023861", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023861", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023862", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023862", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023863", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023863", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023864", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023864", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023865", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023865", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023866", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023866", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023867", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023867", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023868", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023868", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023869", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023869", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023870", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023870", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023871", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023871", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023872", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023872", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023873", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023873", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023874", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023874", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023875", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023875", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023876", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023876", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023877", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023877", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023878", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023878", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023879", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023879", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023880", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023880", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023881", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023881", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023882", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023882", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023883", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023883", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023884", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023884", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023885", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023885", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023886", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023886", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023887", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023887", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023888", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023888", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023889", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023889", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023890", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023890", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023891", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023891", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
- else if (strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "023892", 6) == EQUAL &&
|
|
|
- ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm == YES)
|
|
|
- {
|
|
|
- memcpy(code, "023892", 6);
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, "", 6);
|
|
|
- isCleanCheck = true;
|
|
|
- }
|
|
|
-
|
|
|
- if (isCleanCheck)
|
|
|
- {
|
|
|
- for (byte index = 0; index < ShmSysConfigAndInfo->SysConfig.TotalConnectorCount; index++)
|
|
|
- {
|
|
|
- if (index != gun_index || ShmSysConfigAndInfo->SysConfig.TotalConnectorCount == 1)
|
|
|
- {
|
|
|
- PRINTF_FUNC("CCS clean error : index = %d, EvConnAlarmCode = %s, code = %s \n", index, _chargingData[index]->EvConnAlarmCode, code);
|
|
|
- if (strncmp((char *)_chargingData[index]->EvConnAlarmCode, code, 6) != EQUAL)
|
|
|
- {
|
|
|
- if (strncmp(code, "023701", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = NO;
|
|
|
- if (strncmp(code, "023737", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = NO;
|
|
|
- if (strncmp(code, "023738", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = NO;
|
|
|
- if (strncmp(code, "023739", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = NO;
|
|
|
- if (strncmp(code, "023740", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = NO;
|
|
|
- if (strncmp(code, "023741", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = NO;
|
|
|
- if (strncmp(code, "023742", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = NO;
|
|
|
- if (strncmp(code, "023743", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = NO;
|
|
|
- if (strncmp(code, "023744", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = NO;
|
|
|
- if (strncmp(code, "023745", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = NO;
|
|
|
- if (strncmp(code, "023746", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = NO;
|
|
|
- if (strncmp(code, "023747", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = NO;
|
|
|
- if (strncmp(code, "023748", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = NO;
|
|
|
- if (strncmp(code, "023749", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = NO;
|
|
|
- if (strncmp(code, "023750", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = NO;
|
|
|
- if (strncmp(code, "023751", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = NO;
|
|
|
- if (strncmp(code, "023752", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = NO;
|
|
|
- if (strncmp(code, "023753", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = NO;
|
|
|
- if (strncmp(code, "023754", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = NO;
|
|
|
- if (strncmp(code, "023755", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = NO;
|
|
|
- if (strncmp(code, "023756", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = NO;
|
|
|
- if (strncmp(code, "023757", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = NO;
|
|
|
- if (strncmp(code, "023758", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = NO;
|
|
|
- if (strncmp(code, "023759", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = NO;
|
|
|
- if (strncmp(code, "023760", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = NO;
|
|
|
- if (strncmp(code, "023761", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = NO;
|
|
|
- if (strncmp(code, "023762", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = NO;
|
|
|
- if (strncmp(code, "023763", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = NO;
|
|
|
- if (strncmp(code, "023764", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = NO;
|
|
|
- if (strncmp(code, "023765", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = NO;
|
|
|
- if (strncmp(code, "023766", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = NO;
|
|
|
- if (strncmp(code, "023767", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023768", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = NO;
|
|
|
- if (strncmp(code, "023769", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = NO;
|
|
|
- if (strncmp(code, "023770", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = NO;
|
|
|
- if (strncmp(code, "023771", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = NO;
|
|
|
- if (strncmp(code, "023772", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = NO;
|
|
|
- if (strncmp(code, "023773", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = NO;
|
|
|
- if (strncmp(code, "023774", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = NO;
|
|
|
- if (strncmp(code, "023775", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = NO;
|
|
|
- if (strncmp(code, "023776", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = NO;
|
|
|
- if (strncmp(code, "023777", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = NO;
|
|
|
- if (strncmp(code, "023778", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = NO;
|
|
|
- if (strncmp(code, "023779", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = NO;
|
|
|
- if (strncmp(code, "023780", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = NO;
|
|
|
- if (strncmp(code, "023781", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = NO;
|
|
|
- if (strncmp(code, "023782", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = NO;
|
|
|
- if (strncmp(code, "023783", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = NO;
|
|
|
- if (strncmp(code, "023784", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = NO;
|
|
|
- if (strncmp(code, "023785", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = NO;
|
|
|
- if (strncmp(code, "023786", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = NO;
|
|
|
- if (strncmp(code, "023787", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = NO;
|
|
|
- if (strncmp(code, "023788", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = NO;
|
|
|
- if (strncmp(code, "023789", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = NO;
|
|
|
- if (strncmp(code, "023790", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = NO;
|
|
|
- if (strncmp(code, "023791", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = NO;
|
|
|
- if (strncmp(code, "023792", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = NO;
|
|
|
- if (strncmp(code, "023793", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023794", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023795", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023796", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023797", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023798", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023799", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023800", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023801", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023802", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023803", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = NO;
|
|
|
- if (strncmp(code, "023809", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = NO;
|
|
|
- if (strncmp(code, "023810", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = NO;
|
|
|
- if (strncmp(code, "023811", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = NO;
|
|
|
- if (strncmp(code, "023812", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = NO;
|
|
|
- if (strncmp(code, "023813", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = NO;
|
|
|
- if (strncmp(code, "023814", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = NO;
|
|
|
- if (strncmp(code, "023815", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = NO;
|
|
|
- if (strncmp(code, "023816", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = NO;
|
|
|
- if (strncmp(code, "023817", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = NO;
|
|
|
- if (strncmp(code, "023823", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = NO;
|
|
|
- if (strncmp(code, "023824", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = NO;
|
|
|
- if (strncmp(code, "023825", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = NO;
|
|
|
- if (strncmp(code, "023826", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = NO;
|
|
|
- if (strncmp(code, "023832", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = NO;
|
|
|
- if (strncmp(code, "023833", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = NO;
|
|
|
- if (strncmp(code, "023834", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = NO;
|
|
|
- if (strncmp(code, "023835", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = NO;
|
|
|
- if (strncmp(code, "023836", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = NO;
|
|
|
- if (strncmp(code, "023837", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = NO;
|
|
|
- if (strncmp(code, "023838", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = NO;
|
|
|
- if (strncmp(code, "023839", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = NO;
|
|
|
- if (strncmp(code, "023840", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = NO;
|
|
|
- if (strncmp(code, "023841", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = NO;
|
|
|
- if (strncmp(code, "023842", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = NO;
|
|
|
- if (strncmp(code, "023843", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = NO;
|
|
|
- if (strncmp(code, "023844", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = NO;
|
|
|
- if (strncmp(code, "023845", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = NO;
|
|
|
- if (strncmp(code, "023846", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = NO;
|
|
|
- if (strncmp(code, "023847", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = NO;
|
|
|
- if (strncmp(code, "023848", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = NO;
|
|
|
- if (strncmp(code, "023849", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = NO;
|
|
|
- if (strncmp(code, "023850", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime = NO;
|
|
|
- if (strncmp(code, "023855", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = NO;
|
|
|
- if (strncmp(code, "023856", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = NO;
|
|
|
- if (strncmp(code, "023857", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = NO;
|
|
|
- if (strncmp(code, "023858", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = NO;
|
|
|
- if (strncmp(code, "023859", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = NO;
|
|
|
- if (strncmp(code, "023860", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = NO;
|
|
|
- if (strncmp(code, "023861", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = NO;
|
|
|
- if (strncmp(code, "023862", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = NO;
|
|
|
- if (strncmp(code, "023863", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = NO;
|
|
|
- if (strncmp(code, "023864", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = NO;
|
|
|
- if (strncmp(code, "023865", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = NO;
|
|
|
- if (strncmp(code, "023866", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = NO;
|
|
|
- if (strncmp(code, "023867", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = NO;
|
|
|
- if (strncmp(code, "023868", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = NO;
|
|
|
- if (strncmp(code, "023869", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = NO;
|
|
|
- if (strncmp(code, "023870", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = NO;
|
|
|
- if (strncmp(code, "023871", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = NO;
|
|
|
- if (strncmp(code, "023872", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = NO;
|
|
|
- if (strncmp(code, "023873", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = NO;
|
|
|
- if (strncmp(code, "023874", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = NO;
|
|
|
- if (strncmp(code, "023875", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = NO;
|
|
|
- if (strncmp(code, "023876", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = NO;
|
|
|
- if (strncmp(code, "023877", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = NO;
|
|
|
- if (strncmp(code, "023878", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = NO;
|
|
|
- if (strncmp(code, "023879", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = NO;
|
|
|
- if (strncmp(code, "023880", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = NO;
|
|
|
- if (strncmp(code, "023881", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = NO;
|
|
|
- if (strncmp(code, "023882", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = NO;
|
|
|
- if (strncmp(code, "023883", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = NO;
|
|
|
- if (strncmp(code, "023884", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = NO;
|
|
|
- if (strncmp(code, "023885", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = NO;
|
|
|
- if (strncmp(code, "023886", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = NO;
|
|
|
- if (strncmp(code, "023887", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = NO;
|
|
|
- if (strncmp(code, "023888", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = NO;
|
|
|
- if (strncmp(code, "023889", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = NO;
|
|
|
- if (strncmp(code, "023890", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = NO;
|
|
|
- if (strncmp(code, "023891", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging = NO;
|
|
|
- if (strncmp(code, "023892", 6) == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm = NO;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-void AbnormalStopAnalysis(byte gun_index, byte *errCode)
|
|
|
+//接收can
|
|
|
+void CHROMACANReceiver()
|
|
|
{
|
|
|
- char string[7];
|
|
|
- sprintf(string, "%d%d%d%d%d%d", *(errCode + 0), *(errCode + 1), *(errCode + 2), *(errCode + 3), *(errCode + 4), *(errCode + 5));
|
|
|
-
|
|
|
- PRINTF_FUNC("NOTIFICATION_EV_STOP : Err Code = %s \n", string);
|
|
|
- if (strncmp(string, "000000", 6) == EQUAL ||
|
|
|
- strncmp((char *)_chargingData[gun_index]->EvConnAlarmCode, "", 6) != EQUAL)
|
|
|
- return;
|
|
|
-
|
|
|
- memcpy(_chargingData[gun_index]->EvConnAlarmCode, string, 6);
|
|
|
- printf("NOTIFICATION_EV_STOP : EvConnAlarmCode = %s \n", _chargingData[gun_index]->EvConnAlarmCode);
|
|
|
-
|
|
|
- if (strcmp(string, "023700") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvCommFail = YES;
|
|
|
- if (strcmp(string, "023704") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryMalfun = YES;
|
|
|
- if (strcmp(string, "023705") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoNoPermission = YES;
|
|
|
- if (strcmp(string, "023706") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryIncompatibility = YES;
|
|
|
- if (strcmp(string, "023707") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOVP = YES;
|
|
|
- if (strcmp(string, "023708") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryUVP = YES;
|
|
|
- if (strcmp(string, "023709") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOTP = YES;
|
|
|
- if (strcmp(string, "023710") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryCurrentDiff = YES;
|
|
|
- if (strcmp(string, "023711") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryVoltageDiff = YES;
|
|
|
- if (strcmp(string, "023712") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoShiftPosition = YES;
|
|
|
- if (strcmp(string, "023713") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBatteryOtherFault = YES;
|
|
|
- if (strcmp(string, "023714") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargingSystemError = YES;
|
|
|
- if (strcmp(string, "023715") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoEvNormalStop = YES;
|
|
|
- if (strcmp(string, "023716") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoTempSensorBroken = YES;
|
|
|
- if (strcmp(string, "023717") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoConnectorLockFail = YES;
|
|
|
- if (strcmp(string, "023718") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoD1OnNoReceive = YES;
|
|
|
- if (strcmp(string, "023719") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJTimeout = YES;
|
|
|
- if (strcmp(string, "023720") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeAllowTimeout = YES;
|
|
|
- if (strcmp(string, "023721") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoWaitGfdTimeout = YES;
|
|
|
- if (strcmp(string, "023722") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayTimeout = YES;
|
|
|
- if (strcmp(string, "023723") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsReqCurrentTimeout = YES;
|
|
|
- if (strcmp(string, "023724") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsKtoJOffTimeout = YES;
|
|
|
- if (strcmp(string, "023725") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsEvRelayOffTimeout = YES;
|
|
|
- if (strcmp(string, "023726") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan10V = YES;
|
|
|
- if (strcmp(string, "023727") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoAdcMoreThan20V = YES;
|
|
|
- if (strcmp(string, "023728") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoBmsChargeBeforeStop = YES;
|
|
|
- if (strcmp(string, "023729") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetNormalStop = YES;
|
|
|
- if (strcmp(string, "023730") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargerGetEmergencyStop = YES;
|
|
|
- if (strcmp(string, "023731") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoIsolationResultFail = YES;
|
|
|
- if (strcmp(string, "023732") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoMissLinkWithMotherBoard = YES;
|
|
|
- if (strcmp(string, "023733") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoOutputVolMoreThanLimit = YES;
|
|
|
- if (strcmp(string, "023734") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit = YES;
|
|
|
- if (strcmp(string, "023735") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = YES;
|
|
|
- if (strcmp(string, "023736") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = YES;
|
|
|
-
|
|
|
- if (strcmp(string, "023701") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEvCommFail = YES;
|
|
|
- if (strcmp(string, "023737") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = YES;
|
|
|
- if (strcmp(string, "023738") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = YES;
|
|
|
- if (strcmp(string, "023739") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = YES;
|
|
|
- if (strcmp(string, "023740") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = YES;
|
|
|
- if (strcmp(string, "023741") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = YES;
|
|
|
- if (strcmp(string, "023742") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = YES;
|
|
|
- if (strcmp(string, "023743") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = YES;
|
|
|
- if (strcmp(string, "023744") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = YES;
|
|
|
- if (strcmp(string, "023745") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = YES;
|
|
|
- if (strcmp(string, "023746") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = YES;
|
|
|
- if (strcmp(string, "023747") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = YES;
|
|
|
- if (strcmp(string, "023748") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = YES;
|
|
|
- if (strcmp(string, "023749") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = YES;
|
|
|
- if (strcmp(string, "023750") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = YES;
|
|
|
- if (strcmp(string, "023751") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = YES;
|
|
|
- if (strcmp(string, "023752") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = YES;
|
|
|
- if (strcmp(string, "023753") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = YES;
|
|
|
- if (strcmp(string, "023754") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = YES;
|
|
|
- if (strcmp(string, "023755") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = YES;
|
|
|
- if (strcmp(string, "023756") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = YES;
|
|
|
- if (strcmp(string, "023757") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = YES;
|
|
|
- if (strcmp(string, "023758") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = YES;
|
|
|
- if (strcmp(string, "023759") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = YES;
|
|
|
- if (strcmp(string, "023760") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = YES;
|
|
|
- if (strcmp(string, "023761") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = YES;
|
|
|
- if (strcmp(string, "023762") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = YES;
|
|
|
- if (strcmp(string, "023763") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = YES;
|
|
|
- if (strcmp(string, "023764") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = YES;
|
|
|
- if (strcmp(string, "023765") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = YES;
|
|
|
- if (strcmp(string, "023766") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = YES;
|
|
|
- if (strcmp(string, "023767") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023768") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = YES;
|
|
|
- if (strcmp(string, "023769") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = YES;
|
|
|
- if (strcmp(string, "023770") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = YES;
|
|
|
- if (strcmp(string, "023771") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = YES;
|
|
|
- if (strcmp(string, "023772") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = YES;
|
|
|
- if (strcmp(string, "023773") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = YES;
|
|
|
- if (strcmp(string, "023774") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = YES;
|
|
|
- if (strcmp(string, "023775") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = YES;
|
|
|
- if (strcmp(string, "023776") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = YES;
|
|
|
- if (strcmp(string, "023777") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = YES;
|
|
|
- if (strcmp(string, "023778") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = YES;
|
|
|
- if (strcmp(string, "023779") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = YES;
|
|
|
- if (strcmp(string, "023780") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = YES;
|
|
|
- if (strcmp(string, "023781") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = YES;
|
|
|
- if (strcmp(string, "023782") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = YES;
|
|
|
- if (strcmp(string, "023783") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = YES;
|
|
|
- if (strcmp(string, "023784") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = YES;
|
|
|
- if (strcmp(string, "023785") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = YES;
|
|
|
- if (strcmp(string, "023786") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = YES;
|
|
|
- if (strcmp(string, "023787") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = YES;
|
|
|
- if (strcmp(string, "023788") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = YES;
|
|
|
- if (strcmp(string, "023789") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = YES;
|
|
|
- if (strcmp(string, "023790") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = YES;
|
|
|
- if (strcmp(string, "023791") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = YES;
|
|
|
- if (strcmp(string, "023792") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = YES;
|
|
|
- if (strcmp(string, "023793") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023794") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023795") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023796") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023797") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023798") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023799") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023800") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023801") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023802") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023803") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = YES;
|
|
|
- if (strcmp(string, "023809") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = YES;
|
|
|
- if (strcmp(string, "023810") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = YES;
|
|
|
- if (strcmp(string, "023811") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = YES;
|
|
|
- if (strcmp(string, "023812") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = YES;
|
|
|
- if (strcmp(string, "023813") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = YES;
|
|
|
- if (strcmp(string, "023814") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = YES;
|
|
|
- if (strcmp(string, "023815") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = YES;
|
|
|
- if (strcmp(string, "023816") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = YES;
|
|
|
- if (strcmp(string, "023817") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = YES;
|
|
|
- if (strcmp(string, "023823") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = YES;
|
|
|
- if (strcmp(string, "023824") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = YES;
|
|
|
- if (strcmp(string, "023825") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = YES;
|
|
|
- if (strcmp(string, "023826") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = YES;
|
|
|
- if (strcmp(string, "023832") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = YES;
|
|
|
- if (strcmp(string, "023833") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = YES;
|
|
|
- if (strcmp(string, "023834") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = YES;
|
|
|
- if (strcmp(string, "023835") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = YES;
|
|
|
- if (strcmp(string, "023836") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = YES;
|
|
|
- if (strcmp(string, "023837") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = YES;
|
|
|
- if (strcmp(string, "023838") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = YES;
|
|
|
- if (strcmp(string, "023839") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = YES;
|
|
|
- if (strcmp(string, "023840") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = YES;
|
|
|
- if (strcmp(string, "023841") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = YES;
|
|
|
- if (strcmp(string, "023842") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = YES;
|
|
|
- if (strcmp(string, "023843") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = YES;
|
|
|
- if (strcmp(string, "023844") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = YES;
|
|
|
- if (strcmp(string, "023845") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = YES;
|
|
|
- if (strcmp(string, "023846") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = YES;
|
|
|
- if (strcmp(string, "023847") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = YES;
|
|
|
- if (strcmp(string, "023848") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = YES;
|
|
|
- if (strcmp(string, "023849") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = YES;
|
|
|
- if (strcmp(string, "023850") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutV2GPreChargePerformaceTime = YES;
|
|
|
- if (strcmp(string, "023855") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = YES;
|
|
|
- if (strcmp(string, "023856") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = YES;
|
|
|
- if (strcmp(string, "023857") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = YES;
|
|
|
- if (strcmp(string, "023858") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = YES;
|
|
|
- if (strcmp(string, "023859") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = YES;
|
|
|
- if (strcmp(string, "023860") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = YES;
|
|
|
- if (strcmp(string, "023861") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = YES;
|
|
|
- if (strcmp(string, "023862") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = YES;
|
|
|
- if (strcmp(string, "023863") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = YES;
|
|
|
- if (strcmp(string, "023864") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = YES;
|
|
|
- if (strcmp(string, "023865") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = YES;
|
|
|
- if (strcmp(string, "023866") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = YES;
|
|
|
- if (strcmp(string, "023867") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = YES;
|
|
|
- if (strcmp(string, "023868") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = YES;
|
|
|
- if (strcmp(string, "023869") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = YES;
|
|
|
- if (strcmp(string, "023870") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = YES;
|
|
|
- if (strcmp(string, "023871") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = YES;
|
|
|
- if (strcmp(string, "023872") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = YES;
|
|
|
- if (strcmp(string, "023873") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = YES;
|
|
|
- if (strcmp(string, "023874") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = YES;
|
|
|
- if (strcmp(string, "023875") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = YES;
|
|
|
- if (strcmp(string, "023876") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = YES;
|
|
|
- if (strcmp(string, "023877") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = YES;
|
|
|
- if (strcmp(string, "023878") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = YES;
|
|
|
- if (strcmp(string, "023879") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = YES;
|
|
|
- if (strcmp(string, "023880") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = YES;
|
|
|
- if (strcmp(string, "023881") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = YES;
|
|
|
- if (strcmp(string, "023882") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = YES;
|
|
|
- if (strcmp(string, "023883") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = YES;
|
|
|
- if (strcmp(string, "023884") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = YES;
|
|
|
- if (strcmp(string, "023885") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = YES;
|
|
|
- if (strcmp(string, "023886") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = YES;
|
|
|
- if (strcmp(string, "023887") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = YES;
|
|
|
- if (strcmp(string, "023888") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = YES;
|
|
|
- if (strcmp(string, "023889") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCpStatus_Error = YES;
|
|
|
- if (strcmp(string, "023890") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnexpectVolBeforeCharing_Error = YES;
|
|
|
- if (strcmp(string, "023891") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccNotReadyForCharging = YES;
|
|
|
- if (strcmp(string, "023892") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSeccTimeoutQCA7000Comm = YES;
|
|
|
-
|
|
|
- if (strcmp(string, "023702") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.GbEvCommFail = YES;
|
|
|
- if (strcmp(string, "023900") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_LOS_CC1 = YES;
|
|
|
- if (strcmp(string, "023901") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CONNECTOR_LOCK_FAIL = YES;
|
|
|
- if (strcmp(string, "023902") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BATTERY_INCOMPATIBLE = YES;
|
|
|
- if (strcmp(string, "023903") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_BROAA_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023904") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CSU_PRECHARGE_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023905") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_PRESENT_VOLTAGE_FAULT = YES;
|
|
|
- if (strcmp(string, "023906") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BMS_VOLTAGE_OVER_RANGE = YES;
|
|
|
- if (strcmp(string, "023907") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_BSM_CHARGE_ALLOW_00_10MIN_COUUNTDONE = YES;
|
|
|
- if (strcmp(string, "023908") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_WAIT_GROUNDFAULT_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023909") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_10V = YES;
|
|
|
- if (strcmp(string, "023910") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ADC_MORE_THAN_60V = YES;
|
|
|
- if (strcmp(string, "023911") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_NORMAL_STOP_CMD = YES;
|
|
|
- if (strcmp(string, "023912") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_CHARGER_GET_EMERGENCY_STOP_CMD = YES;
|
|
|
- if (strcmp(string, "023913") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_ISOLATION_RESULT_FAIL = YES;
|
|
|
- if (strcmp(string, "023914") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_MOTHER_BOARD_MISS_LINK = YES;
|
|
|
- if (strcmp(string, "023915") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_LIMIT = YES;
|
|
|
- if (strcmp(string, "023916") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_REQ_CURRENT_MORE_THAN_LIMIT = YES;
|
|
|
- if (strcmp(string, "023917") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_MORE_THAN_10_PERCENT = YES;
|
|
|
- if (strcmp(string, "023918") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_OUTPUT_VOLTAGE_DIFF_BCS_5_PERCENT = YES;
|
|
|
- if (strcmp(string, "023919") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GBT_STOP_ADC_MORE_THAN_10V = YES;
|
|
|
- if (strcmp(string, "023930") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BHM_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023931") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRM_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023932") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCP_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023933") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BRO_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023934") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCL_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023935") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BCS_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023936") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSM_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023937") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BST_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023938") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BSD_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023939") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_CEM_BEM_OTHER_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023940") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRM_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023941") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRMAA_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023942") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CTS_CML_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023943") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CRO_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023944") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CCS_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023945") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CST_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023946") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_CSD_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023947") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BEM_BEM_OTHER_TIMEOUT = YES;
|
|
|
- if (strcmp(string, "023950") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_SOC_GOAL = YES;
|
|
|
- if (strcmp(string, "023951") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_TOTAL_VOLTAGE_GOAL = YES;
|
|
|
- if (strcmp(string, "023952") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CELL_VOLTAGE_GOAL = YES;
|
|
|
- if (strcmp(string, "023953") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_GET_CST = YES;
|
|
|
- if (strcmp(string, "023954") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_ISOLATION = YES;
|
|
|
- if (strcmp(string, "023955") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OUTPUT_CONNECTOR_OTP = YES;
|
|
|
- if (strcmp(string, "023956") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_COMPONENT = YES;
|
|
|
- if (strcmp(string, "023957") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CHARGE_CONNECTOR = YES;
|
|
|
- if (strcmp(string, "023958") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTP = YES;
|
|
|
- if (strcmp(string, "023959") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_OTHER = YES;
|
|
|
- if (strcmp(string, "023960") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_HIGH_V = YES;
|
|
|
- if (strcmp(string, "023961") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CC2 = YES;
|
|
|
- if (strcmp(string, "023962") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_CURRENT = YES;
|
|
|
- if (strcmp(string, "023963") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BST_VOLTAGE = YES;
|
|
|
- if (strcmp(string, "023964") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_GET_BST_NO_REASON = YES;
|
|
|
- if (strcmp(string, "023970") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_OVER_VOLTAGE = YES;
|
|
|
- if (strcmp(string, "023971") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CELL_UNDER_VOLTAGE = YES;
|
|
|
- if (strcmp(string, "023972") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OVER_SOC = YES;
|
|
|
- if (strcmp(string, "023973") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_UNDER_SOC = YES;
|
|
|
- if (strcmp(string, "023974") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_CURRENT = YES;
|
|
|
- if (strcmp(string, "023975") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_TEMPERATURE = YES;
|
|
|
- if (strcmp(string, "023976") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_ISOLATE = YES;
|
|
|
- if (strcmp(string, "023977") == EQUAL) ShmStatusCodeData->InfoCode.InfoEvents.bits.ERROR_CODE_BSM_OUTPUT_CONNECTOR = YES;
|
|
|
+ pid_t canRecPid;
|
|
|
+ canRecPid = fork();
|
|
|
+ if(canRecPid > 0){
|
|
|
+ int nbytes;
|
|
|
+ struct can_frame frame;
|
|
|
+ int intCmd;
|
|
|
+ while (1){
|
|
|
+ //清空 canbus recever buf
|
|
|
+ memset(&frame, 0, sizeof(struct can_frame));
|
|
|
+ //讀取 canbus 是否有接收到封包
|
|
|
+ nbytes = read(CanFd2, &frame, sizeof(struct can_frame));
|
|
|
+ //如果有收到 canbus 封包
|
|
|
+ if (nbytes > 0){
|
|
|
+ intCmd = (int) (frame.can_id & CAN_EFF_MASK);//extended frame format
|
|
|
+ #ifdef Debug
|
|
|
+ //printf("hsout0StatusChange Get-INFYPWR-Msg : %08x - %02x %02x %02x %02x %02x %02x %02x %02x\n ", intCmd, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ //printf(" Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ #endif
|
|
|
+ //printf("hsout0StatusChange Get-INFYPWR-Msg : %08x - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ //printf("Ack none defined. intCmd = %08x \n", intCmd);
|
|
|
+ switch (intCmd){
|
|
|
+ case bn_res1:{
|
|
|
+ /*
|
|
|
+ ShmSysConfigAndInfo->ate.ATEState = (short) frame.data[0];
|
|
|
+ setATEMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.ATEState);
|
|
|
+ printf("00010102 Get-Msg : %d %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", ShmSysConfigAndInfo->ate.ATEState, frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ */
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case bn_res2:{
|
|
|
+ //printf(" Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x\n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7] );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case ATE_Connector2:{
|
|
|
+
|
|
|
+ /*
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetVoltage = ((short) frame.data[1] << 8) + (short) frame.data[0];//
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetCurrent = ((short) frame.data[3] << 8) + (short) frame.data[2];//
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.PresentVoltage = ((short) frame.data[5] << 8) + (short) frame.data[4];
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.PresentCurrent = ((short) frame.data[7] << 8) + (short) frame.data[6];
|
|
|
+ //ShmSysConfigAndInfo->ate.linkVoltage = ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.PresentVoltage;
|
|
|
+ ShmSysConfigAndInfo->ate.targetVoltage_Value = ((short) frame.data[1] << 8) + (short) frame.data[0];
|
|
|
+ ShmSysConfigAndInfo->ate.targetCurrent_Value = ((short) frame.data[3] << 8) + (short) frame.data[2];
|
|
|
+ //ShmSysConfigAndInfo->ate.maximumVoltage_value = ShmSysConfigAndInfo->ate.targetVoltage_Value+(ShmSysConfigAndInfo->ate.targetVoltage_Value*0.1);
|
|
|
+ ShmSysConfigAndInfo->ate.maximumVoltage_value = ShmSysConfigAndInfo->ate.targetVoltage_Value+10;
|
|
|
+ ShmSysConfigAndInfo->ate.linkVoltage = ShmSysConfigAndInfo->ate.targetVoltage_Value;
|
|
|
+ */
|
|
|
+ //printf("targetVoltage_Value= %d targetCurrent_Value =%d maximumVoltage_value = %d linkVoltage = %d \n",ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.targetCurrent_Value, ShmSysConfigAndInfo->ate.maximumVoltage_value, ShmSysConfigAndInfo->ate.linkVoltage);
|
|
|
+ //printf("ATE_Connector2 Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x %d %d %d %d %d %d \n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7], ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetVoltage, ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetCurrent, ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.PresentVoltage, ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.PresentCurrent, ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.targetCurrent_Value);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case ATE_Connector1:{
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->ate.ATEState == 1){//ccs
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.TargetVoltage = ((short) frame.data[1] << 8) + (short) frame.data[0];//
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.TargetCurrent = ((short) frame.data[3] << 8) + (short) frame.data[2];//
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.PresentVoltage = ((short) frame.data[5] << 8) + (short) frame.data[4];
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.PresentCurrent = ((short) frame.data[7] << 8) + (short) frame.data[6];
|
|
|
+ //ShmSysConfigAndInfo->ate.linkVoltage = ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.PresentVoltage;
|
|
|
+ //ShmSysConfigAndInfo->ate.targetVoltage_Value = ((short) frame.data[1] << 8) + (short) frame.data[0];
|
|
|
+ int voltage = ((short) frame.data[1] << 8) + (short) frame.data[0];
|
|
|
+ int evseMaxCurrent = ShmSysConfigAndInfo->ate.vccu.v2g_EVSEMaximumCurrentLim.VCCU_V2G_EVSEMaximumCurre_0000 / 10;
|
|
|
+ //int evseMaxvoltage = ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va / 10;
|
|
|
+ ShmSysConfigAndInfo->ate.targetCurrent_Value = ((short) frame.data[3] << 8) + (short) frame.data[2];
|
|
|
+ //ShmSysConfigAndInfo->ate.maximumVoltage_value = ShmSysConfigAndInfo->ate.targetVoltage_Value+(ShmSysConfigAndInfo->ate.targetVoltage_Value*0.1);
|
|
|
+ //ShmSysConfigAndInfo->ate.maximumVoltage_value = ShmSysConfigAndInfo->ate.targetVoltage_Value+10;
|
|
|
+ //ShmSysConfigAndInfo->ate.maximumVoltage_value = 0;
|
|
|
+ //ShmSysConfigAndInfo->ate.targetVoltage_Value = 0;
|
|
|
+
|
|
|
+
|
|
|
+ if(voltage > (maxValue - 10)){
|
|
|
+ ShmSysConfigAndInfo->ate.maximumVoltage_value = maxValue;
|
|
|
+ ShmSysConfigAndInfo->ate.targetVoltage_Value = maxValue - 20;
|
|
|
+ ShmSysConfigAndInfo->ate.linkVoltage = maxValue - 20;
|
|
|
+ }else{
|
|
|
+ ShmSysConfigAndInfo->ate.maximumVoltage_value = voltage + 10;
|
|
|
+ ShmSysConfigAndInfo->ate.targetVoltage_Value = voltage - 10;
|
|
|
+ ShmSysConfigAndInfo->ate.linkVoltage = voltage - 10;
|
|
|
+ }
|
|
|
+
|
|
|
+ if((ShmSysConfigAndInfo->ate.targetCurrent_Value > evseMaxCurrent) && (evseMaxCurrent > 0)){
|
|
|
+ ShmSysConfigAndInfo->ate.targetCurrent_Value = evseMaxCurrent;
|
|
|
+ }
|
|
|
+ }else if (ShmSysConfigAndInfo->ate.ATEState == 2){//gb
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetVoltage = ((short) frame.data[1] << 8) + (short) frame.data[0];//
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetCurrent = ((short) frame.data[3] << 8) + (short) frame.data[2];//
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.PresentVoltage = ((short) frame.data[5] << 8) + (short) frame.data[4];
|
|
|
+ ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.PresentCurrent = ((short) frame.data[7] << 8) + (short) frame.data[6];
|
|
|
+ int voltage = ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetVoltage * 10;
|
|
|
+ int current = ShmSysConfigAndInfo->ate.chroma.ate_Connector_2.TargetCurrent * 10;
|
|
|
+
|
|
|
+ if(voltage > (gbmaxValue - 100)){
|
|
|
+ //ShmSysConfigAndInfo->ate.targetVoltage_Value = maxValue - 100;
|
|
|
+ ShmSysConfigAndInfo->ate.chademoTargetVoltage_Value = gbmaxValue - 100;
|
|
|
+ ShmSysConfigAndInfo->ate.RequireVoltage = gbmaxValue -100;
|
|
|
+ ShmSysConfigAndInfo->ate.MaxBatteryVoltage = gbmaxValue;
|
|
|
+
|
|
|
+ }else{
|
|
|
+ ShmSysConfigAndInfo->ate.chademoTargetVoltage_Value = voltage;
|
|
|
+ ShmSysConfigAndInfo->ate.RequireVoltage = voltage;
|
|
|
+ ShmSysConfigAndInfo->ate.MaxBatteryVoltage = gbmaxValue;
|
|
|
+ }
|
|
|
+ //ShmSysConfigAndInfo->ate.targetVoltage_Value = voltage;
|
|
|
+ ShmSysConfigAndInfo->ate.chademoTargetCurrent_Value = current;
|
|
|
+ ShmSysConfigAndInfo->ate.RequireCurrent = current;
|
|
|
+ //printf("voltage= %d cstatus = %d current= %d voltage =%d %02x %02x \n", ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.chademo.id03.state , current, voltage, frame.data[1], frame.data[0]);
|
|
|
+
|
|
|
+
|
|
|
+ }else if (ShmSysConfigAndInfo->ate.ATEState == 3){//chademo
|
|
|
+
|
|
|
+ }
|
|
|
+ //printf("targetVoltage_Value= %d targetCurrent_Value =%d maximumVoltage_value = %d linkVoltage = %d \n",ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.targetCurrent_Value, ShmSysConfigAndInfo->ate.maximumVoltage_value, ShmSysConfigAndInfo->ate.linkVoltage);
|
|
|
+ //printf("ATE_Connector1 Get-Msg : %08X - %02x %02x %02x %02x %02x %02x %02x %02x %d %d %d %d %d %d \n ", frame.can_id, frame.data[0], frame.data[1], frame.data[2], frame.data[3],frame.data[4], frame.data[5], frame.data[6], frame.data[7], ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.TargetVoltage, ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.TargetCurrent, ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.PresentVoltage, ShmSysConfigAndInfo->ate.chroma.ate_Connector_1.PresentCurrent, ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.targetCurrent_Value );
|
|
|
+ break;
|
|
|
+ }
|
|
|
+
|
|
|
+ default:
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ usleep(2000);
|
|
|
+ //usleep(100000);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-void CANReceiver()
|
|
|
+int DiffTimeb(struct timeb ST, struct timeb ET)
|
|
|
{
|
|
|
- pid_t canRecPid;
|
|
|
+ //return milli-second
|
|
|
+ unsigned int StartTime,StopTime;
|
|
|
|
|
|
- canRecPid = fork();
|
|
|
-
|
|
|
- if(canRecPid > 0)
|
|
|
- {
|
|
|
- int nbytes;
|
|
|
- struct can_frame frame;
|
|
|
- int intCmd;
|
|
|
-
|
|
|
- // 槍資訊
|
|
|
- struct ChargingInfoData *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
|
|
|
- struct timeval _cmd_ack_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
|
|
|
-
|
|
|
- bool isPass = false;
|
|
|
- gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
|
|
|
-
|
|
|
- while(!isPass)
|
|
|
- {
|
|
|
- isPass = true;
|
|
|
- for (byte _index = 0; _index < gun_count; _index++)
|
|
|
- {
|
|
|
- if (!FindChargingInfoData(_index, &_chargingData[0]))
|
|
|
- {
|
|
|
- DEBUG_ERROR("EvComm (main) : FindChargingInfoData false \n");
|
|
|
- isPass = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- for (byte _index = 0; _index < gun_count; _index++)
|
|
|
- gettimeofday(&_cmd_ack_timeout[_index], NULL);
|
|
|
-
|
|
|
- while (1)
|
|
|
- {
|
|
|
- memset(&frame, 0, sizeof(struct can_frame));
|
|
|
- nbytes = read(CanFd, &frame, sizeof(struct can_frame));
|
|
|
-
|
|
|
- for (byte _index = 0; _index < gun_count; _index++)
|
|
|
- {
|
|
|
- if (GetTimeoutValue(_cmd_ack_timeout[_index]) >= 5000000)
|
|
|
- {
|
|
|
- // ACK timeout
|
|
|
- //PRINTF_FUNC("gun = %x, ack timeout \n", _index);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (nbytes > 0)
|
|
|
- {
|
|
|
- byte target;
|
|
|
- byte targetGun = 0x00;
|
|
|
- intCmd = (int) (frame.can_id & CAN_EFF_MASK);
|
|
|
-
|
|
|
- if (intCmd == ADDRESS_REQ)
|
|
|
- {
|
|
|
- AddrAssignment(frame.data);
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- intCmd = (int) (frame.can_id & CAN_EFF_MASK & 0xFFFFFF00);
|
|
|
- target = ((byte) (frame.can_id & 0x000000FF)); // 0x01 or 0x02
|
|
|
-
|
|
|
- for (byte _index = 0; _index < gun_count; _index++)
|
|
|
- {
|
|
|
- if (_chargingData[_index]->Evboard_id == target)
|
|
|
- {
|
|
|
- targetGun = _index;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(targetGun < 0 || targetGun >= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY)
|
|
|
- {
|
|
|
- PRINTF_FUNC("EvComm (CANReceiver) : Target index = %x is < 0 or > QUANTITY \n", targetGun);
|
|
|
- continue;
|
|
|
- }
|
|
|
- if(intCmd == 256)
|
|
|
- {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- gettimeofday(&_cmd_ack_timeout[targetGun], NULL);
|
|
|
- switch (intCmd)
|
|
|
- {
|
|
|
- case NOTIFICATION_EV_STATUS:
|
|
|
- {
|
|
|
- if (_chargingData[targetGun]->ConnectorPlugIn != frame.data[0])
|
|
|
- PRINTF_FUNC("index = %d, ConnectorPlugIn = %x, data[0] = %x \n", targetGun, _chargingData[targetGun]->ConnectorPlugIn, frame.data[0]);
|
|
|
-
|
|
|
- _chargingData[targetGun]->ConnectorPlugIn = frame.data[0];
|
|
|
- _chargingData[targetGun]->PilotVoltage = frame.data[1];
|
|
|
-
|
|
|
- //PRINTF_FUNC("index = %d, ConnectorPlugIn = %x, data[0] = %x \n", targetGun, _chargingData[targetGun]->ConnectorPlugIn, frame.data[0]);
|
|
|
- //PRINTF_FUNC("ConnectorPlugIn = %x \n", (-120 + frame.data[1]) / 10);
|
|
|
- }
|
|
|
- break;
|
|
|
- case ACK_EV_FW_VERSION:
|
|
|
- {
|
|
|
- byte ver[16];
|
|
|
-
|
|
|
- memset(ver, 0, sizeof(ver));
|
|
|
- if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
- {
|
|
|
- memcpy(ver, frame.data, frame.can_dlc);
|
|
|
- memcpy(ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version, ver, ARRAY_SIZE(ver));
|
|
|
- ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
|
|
|
- PRINTF_FUNC("chademo ver. : %s\n", ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version);
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
- {
|
|
|
- memcpy(ver, frame.data, frame.can_dlc);
|
|
|
- memcpy(ShmGBTData->evse[_chargingData[targetGun]->type_index].version, ver, ARRAY_SIZE(ver));
|
|
|
- ShmGBTData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
|
|
|
- PRINTF_FUNC("gbt ver. : %s\n", ShmGBTData->evse[_chargingData[targetGun]->type_index].version);
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- if (ShmCcsData->CommProtocol == 0x01)
|
|
|
- {
|
|
|
- for (byte _vCount = 0, _vPoint = 0; _vCount < frame.can_dlc; _vCount++)
|
|
|
- {
|
|
|
- if (_vCount % 2 == 0 && _vCount != 0)
|
|
|
- {
|
|
|
- ver[_vCount + _vPoint] = 0x2E;
|
|
|
- _vPoint++;
|
|
|
- }
|
|
|
-
|
|
|
- ver[_vCount + _vPoint] = frame.data[_vCount];
|
|
|
- }
|
|
|
-
|
|
|
- memcpy(&ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].version, ver, ARRAY_SIZE(ver));
|
|
|
- ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
|
|
|
- PRINTF_FUNC("CCS FW = %s \n", ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].version);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (targetGun == 0)
|
|
|
- {
|
|
|
- memset(ShmSysConfigAndInfo->SysInfo.Connector1FwRev, 0, sizeof(ShmSysConfigAndInfo->SysInfo.Connector1FwRev));
|
|
|
- memcpy(ShmSysConfigAndInfo->SysInfo.Connector1FwRev, ver, ARRAY_SIZE(ver));
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- memset(ShmSysConfigAndInfo->SysInfo.Connector2FwRev, 0, sizeof(ShmSysConfigAndInfo->SysInfo.Connector2FwRev));
|
|
|
- memcpy(ShmSysConfigAndInfo->SysInfo.Connector2FwRev, ver, ARRAY_SIZE(ver));
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case ACK_EV_HW_VERSION:
|
|
|
- {
|
|
|
- //PRINTF_FUNC("Get EV HW = %s \n", frame.data);
|
|
|
- }
|
|
|
- break;
|
|
|
- case ACK_GET_OUTPUT_REQ:
|
|
|
- {
|
|
|
- _chargingData[targetGun]->EvBatterySoc = frame.data[1];
|
|
|
- _chargingData[targetGun]->EvBatterytargetVoltage = (((short) frame.data[3] << 8) + (short) frame.data[2]) / 10;
|
|
|
- _chargingData[targetGun]->EvBatterytargetCurrent = (((short) frame.data[5] << 8) + (short) frame.data[4]) / 10;
|
|
|
- _chargingData[targetGun]->RemainChargingDuration = ((short) frame.data[7] << 8) + (short) frame.data[6];
|
|
|
-
|
|
|
- if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
- {
|
|
|
- ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
|
|
|
- ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].EvDetection = frame.data[0];
|
|
|
- ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].SOC = _chargingData[targetGun]->EvBatterySoc;
|
|
|
- ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].TargetBatteryVoltage = (_chargingData[targetGun]->EvBatterytargetVoltage * 10);
|
|
|
- ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].ChargingCurrentRequest = (_chargingData[targetGun]->EvBatterytargetCurrent * 10);
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
- {
|
|
|
- ShmGBTData->ev[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
|
|
|
- ShmGBTData->ev[_chargingData[targetGun]->type_index].EvDetection = frame.data[0];
|
|
|
- ShmGBTData->ev[_chargingData[targetGun]->type_index].SOC = _chargingData[targetGun]->EvBatterySoc;
|
|
|
- ShmGBTData->ev[_chargingData[targetGun]->type_index].TargetBatteryVoltage = (_chargingData[targetGun]->EvBatterytargetVoltage * 10);
|
|
|
- ShmGBTData->ev[_chargingData[targetGun]->type_index].ChargingCurrentRequest = (_chargingData[targetGun]->EvBatterytargetCurrent * 10);
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- if(ShmCcsData->CommProtocol == 0x01)
|
|
|
- {
|
|
|
- ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index].PresentMsgFlowStatus = frame.data[0];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //PRINTF_FUNC("EvBatterytargetVoltage = %f \n", _chargingData[targetGun]->EvBatterytargetVoltage);
|
|
|
- //PRINTF_FUNC("EvBatterytargetCurrent = %f \n", _chargingData[targetGun]->EvBatterytargetCurrent);
|
|
|
- //PRINTF_FUNC("BatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TargetBatteryVoltage);
|
|
|
- //PRINTF_FUNC("CurrentRequest = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].ChargingCurrentRequest);
|
|
|
- }
|
|
|
- break;
|
|
|
- case ACK_GET_EV_BATTERY_INFO:
|
|
|
- {
|
|
|
- //_chargingData[target].EvACorDCcharging = frame.data[0];
|
|
|
- //_chargingData[target]->TotalBatteryCap = ((float) frame.data[4] << 8) + (short) frame.data[3];
|
|
|
- _chargingData[targetGun]->EvBatteryMaxVoltage = (((short) frame.data[4] << 8) + (short) frame.data[3]) / 10;
|
|
|
- //_chargingData[target]->EvBatteryMaxCurrent = ((float) frame.data[4] << 8) + (short) frame.data[3];
|
|
|
- //_chargingData[target].MaxiBatteryCurrent = ((short) frame.data[6] << 8) + (short) frame.data[5];
|
|
|
- if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
- {
|
|
|
- ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data[2] << 8) + (short) frame.data[1];
|
|
|
- ShmCHAdeMOData->ev[_chargingData[targetGun]->type_index].MaxiBatteryVoltage = _chargingData[targetGun]->EvBatteryMaxVoltage;
|
|
|
-
|
|
|
- //PRINTF_FUNC("EvBatteryMaxVoltage = %f \n", _chargingData[target]->EvBatteryMaxVoltage);
|
|
|
- //PRINTF_FUNC("TotalBatteryCapacity = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].TotalBatteryCapacity);
|
|
|
- //PRINTF_FUNC("MaxiBatteryVoltage = %d \n", ShmCHAdeMOData->ev[_chargingData[target]->type_index].MaxiBatteryVoltage);
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
- {
|
|
|
- ShmGBTData->ev[_chargingData[targetGun]->type_index].TotalBatteryCapacity = ((short) frame.data[2] << 8) + (short) frame.data[1];
|
|
|
- ShmGBTData->ev[_chargingData[targetGun]->type_index].MaxiBatteryVoltage = _chargingData[targetGun]->EvBatteryMaxVoltage;
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case ACK_GET_MISCELLANEOUS_INFO:
|
|
|
- {
|
|
|
- _chargingData[targetGun]->GunLocked = frame.data[0];
|
|
|
- _chargingData[targetGun]->PilotVoltage = (float)(-120 + frame.data[3]) / 10;
|
|
|
-
|
|
|
- if (_chargingData[targetGun]->Type == _Type_Chademo)
|
|
|
- {
|
|
|
- ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureP = frame.data[1];
|
|
|
- ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureN = frame.data[2];
|
|
|
- ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].EvboardStatus = frame.data[7];
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_GB)
|
|
|
- {
|
|
|
- ShmGBTData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureP = frame.data[1];
|
|
|
- ShmGBTData->evse[_chargingData[targetGun]->type_index].ConnectorTemperatureN = frame.data[2];
|
|
|
- ShmGBTData->evse[_chargingData[targetGun]->type_index].EvboardStatus = frame.data[7];
|
|
|
- }
|
|
|
- else if (_chargingData[targetGun]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- if (ShmCcsData->CommProtocol == 0x01)
|
|
|
- {
|
|
|
- //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureP = frame.data[1];
|
|
|
- //ShmCcsData->V2GMessage_DIN70121[_chargingData[targetGun]->type_index]. .ConnectorTemperatureN = frame.data[2];
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //PRINTF_FUNC("EvboardStatus = %x \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].EvboardStatus);
|
|
|
- //PRINTF_FUNC("ConnectorPlug locked = %x \n", frame.data[0]);
|
|
|
- //PRINTF_FUNC("ConnectorTemp 0= %d \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].ConnectorTemperatureP);
|
|
|
- //PRINTF_FUNC("ConnectorTemp 1= %d \n", ShmCHAdeMOData->evse[_chargingData[target]->type_index].ConnectorTemperatureN);
|
|
|
- //PRINTF_FUNC("PilotVoltage = %x \n", (-120 + frame.data[3]) / 10);
|
|
|
- }
|
|
|
- break;
|
|
|
- case ACK_EVSE_ISOLATION_STATUS: {}
|
|
|
- break;
|
|
|
- case ACK_EVSE_PRECHAGE_INFO:
|
|
|
- {
|
|
|
- _chargingData[targetGun]->PrechargeStatus = frame.data[0];
|
|
|
- }
|
|
|
- break;
|
|
|
- case NOTIFICATION_EV_STOP:
|
|
|
- {
|
|
|
- // 車端要求停止
|
|
|
- // frame.data[0] : 0x01 => normal stop, 0x02 => ev emergency stop
|
|
|
- PRINTF_FUNC("(%d) NOTIFICATION_EV_STOP err level = %d-----------------------------\n", targetGun, frame.data[0]);
|
|
|
-
|
|
|
- AbnormalStopAnalysis(targetGun, frame.data + 1);
|
|
|
- _chargingData[targetGun]->StopChargeFlag = YES;
|
|
|
- }
|
|
|
- break;
|
|
|
- default:
|
|
|
- PRINTF_FUNC("EV board = %d, Ack none defined. intCmd = %d \n", targetGun, intCmd);
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- usleep(10000);
|
|
|
- }
|
|
|
- }
|
|
|
+ StartTime=(unsigned int)ST.time;
|
|
|
+ StopTime=(unsigned int)ET.time;
|
|
|
+ //return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
|
|
|
+ return (StopTime-StartTime);
|
|
|
}
|
|
|
|
|
|
-//================================================
|
|
|
-// Main process
|
|
|
-//================================================
|
|
|
-// 檢查 Byte 中某個 Bit 的值
|
|
|
-// _byte : 欲改變的 byte
|
|
|
-// _bit : 該 byte 的第幾個 bit
|
|
|
-unsigned char EvDetectionStatus(unsigned char _byte, unsigned char _bit)
|
|
|
+unsigned short MaxValue(unsigned short value1, unsigned short value2)
|
|
|
{
|
|
|
- return ( _byte & mask_table[_bit] ) != 0x00;
|
|
|
+ return value1 >= value2 ? value1 : value2;
|
|
|
}
|
|
|
|
|
|
-bool IsConnectorPlugIn(struct ChargingInfoData *chargingData)
|
|
|
+void Initialization()
|
|
|
{
|
|
|
- return (chargingData->ConnectorPlugIn == 0x01) ? true : false;
|
|
|
+ _chargingData[CCS_QUANTITY] = &ShmSysConfigAndInfo->SysInfo.CcsChargingData[CCS_QUANTITY];
|
|
|
}
|
|
|
|
|
|
-void SetPresentChargingOutputPower(struct ChargingInfoData *chargingData_1, struct ChargingInfoData *chargingData_2)
|
|
|
-{
|
|
|
- float vol1 = 0, cur1 = 0;
|
|
|
- float vol2 = 0, cur2 = 0;
|
|
|
-
|
|
|
- vol1 = chargingData_1->FireChargingVoltage;
|
|
|
- cur1 = (chargingData_1->PresentChargingCurrent * 10);
|
|
|
-
|
|
|
- vol2 = chargingData_2->FireChargingVoltage;
|
|
|
- cur2 = (chargingData_2->PresentChargingCurrent * 10);
|
|
|
-
|
|
|
- if (_outVol_1 != vol1 ||
|
|
|
- _outCur_1 != cur1 ||
|
|
|
- _outVol_2 != vol2 ||
|
|
|
- _outCur_2 != cur2)
|
|
|
- {
|
|
|
- PRINTF_FUNC("G1 -> Output Vol = %f, Output Cur = %f -- G2 -> Output Vol = %f, Output Cur = %f \n",
|
|
|
- vol1, cur1, vol2, cur2);
|
|
|
-
|
|
|
- _outVol_1 = vol1; _outCur_1 = cur1; _outVol_2 = vol2; _outCur_2 = cur2;
|
|
|
- }
|
|
|
-
|
|
|
- SetPresentOutputPower(vol1, cur1, vol2, cur2);
|
|
|
+void VCCU_Requests(int LED0, int LED1, int LED2,
|
|
|
+ int HighSideOut0, int HighSideOut1, int HighSideOut2, int HighSideOut3,
|
|
|
+ int HighSideOut4, int RTC_TimerRequest, int PlugLock,
|
|
|
+ int RTC_TimerValue,
|
|
|
+ int ControlPilot, int ChargeUnit, int Inlet){
|
|
|
+ struct VCCU_Requests obj;
|
|
|
+ obj.VCCU_LED0_Request = LED0;//0.0
|
|
|
+ obj.VCCU_LED1_Request = LED1;//0.0
|
|
|
+ obj.VCCU_LED2_Request = LED2;//0.0
|
|
|
+ obj.byte3.VCCU_HighSideOut0_Request = HighSideOut0;//3
|
|
|
+ obj.byte3.VCCU_HighSideOut1_Request = HighSideOut1;//3
|
|
|
+ obj.byte3.VCCU_HighSideOut2_Request = HighSideOut2;//3
|
|
|
+ obj.byte3.VCCU_HighSideOut3_Request = HighSideOut3;//3
|
|
|
+ obj.byte4.VCCU_HighSideOut4_Request = HighSideOut4;//3
|
|
|
+ obj.byte4.VCCU_RTC_TimerRequest = RTC_TimerRequest;//3
|
|
|
+ obj.byte4.VCCU_PlugLock_MotorRequest = PlugLock;//7
|
|
|
+ obj.VCCU_RTC_TimerValue= RTC_TimerValue;//0
|
|
|
+ obj.byte6.VCCU_ControlPilot_ChargeModeRe = ControlPilot;//7
|
|
|
+ obj.byte6.VCCU_ChargeUnit_Request = ChargeUnit;//3
|
|
|
+ obj.byte6.VCCU_Inlet_MotorRequest = Inlet;//3
|
|
|
+
|
|
|
+
|
|
|
+ byte data[7];
|
|
|
+ data[0] = *((UBYTE *) &obj.VCCU_LED0_Request);
|
|
|
+ data[1] = *((UBYTE *) &obj.VCCU_LED1_Request);
|
|
|
+ data[2] = *((UBYTE *) &obj.VCCU_LED2_Request);
|
|
|
+ data[3] = *((UBYTE *) &obj.byte3);
|
|
|
+ data[4] = *((UBYTE *) &obj.byte4);
|
|
|
+ data[5] = *((UBYTE *) &obj.VCCU_RTC_TimerValue);
|
|
|
+ data[6] = *((UBYTE *) &obj.byte6);
|
|
|
+ //printf("%02x %02x %02x %02x %02x %02x %02x \n", data[0], data[1], data[2], data[3], data[4], data[5] , data[6]);
|
|
|
+ setVCCU_Requests(data, sizeof(data));
|
|
|
}
|
|
|
|
|
|
-void SetPresentChargingOutputCap(struct ChargingInfoData *chargingData_1, struct ChargingInfoData *chargingData_2)
|
|
|
-{
|
|
|
- float pow1 = 0, cur1 = 0;
|
|
|
- float pow2 = 0, cur2 = 0;
|
|
|
- float vol = 0;
|
|
|
-
|
|
|
- pow1 = chargingData_1->AvailableChargingPower;
|
|
|
- cur1 = chargingData_1->AvailableChargingCurrent;
|
|
|
-
|
|
|
- vol = chargingData_1->MaximumChargingVoltage;
|
|
|
- GetMaxVolAndCurMethod(chargingData_1->Index, &vol, &cur1);
|
|
|
- GetMaxPowerMethod(chargingData_1->Index, &pow1);
|
|
|
-
|
|
|
- pow2 = chargingData_2->AvailableChargingPower;
|
|
|
- cur2 = chargingData_2->AvailableChargingCurrent;
|
|
|
- vol = chargingData_2->MaximumChargingVoltage;
|
|
|
-
|
|
|
- GetMaxVolAndCurMethod(chargingData_2->Index, &vol, &cur2);
|
|
|
- GetMaxPowerMethod(chargingData_2->Index, &pow2);
|
|
|
-
|
|
|
- if (_pow_1 != pow1 ||
|
|
|
- _cur_1 != cur1 ||
|
|
|
- _pow_2 != pow2 ||
|
|
|
- _cur_2 != cur2)
|
|
|
- {
|
|
|
- PRINTF_FUNC("To EV (Real) Power_1 = %f, Cur_1 = %f, Power_2 = %f, Cur_2 = %f \n",
|
|
|
- pow1, cur1, pow2, cur2);
|
|
|
- _pow_1 = pow1; _cur_1 = cur1; _pow_2 = pow2; _cur_2 = cur2;
|
|
|
- chargingData_1->RealMaxCurrent = _cur_1;
|
|
|
- chargingData_1->RealMaxPower = pow1;
|
|
|
-
|
|
|
- if (gun_count == 2)
|
|
|
- {
|
|
|
- chargingData_2->RealMaxCurrent = cur2;
|
|
|
- chargingData_2->RealMaxPower = pow2;
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
- SetPresentOutputCapacity(pow1, cur1, pow2, cur2);
|
|
|
+void VCCU_ChargeFromVehicle(int canfd, int linkVoltage, int contactorVoltage,
|
|
|
+ int chargePermission, int isolationMeasurem,
|
|
|
+ int plugLockPermissio, int plugUnlockPermiss, int contactorStatus){
|
|
|
+
|
|
|
+ struct VCCU_ChargeFromVehicle obj;
|
|
|
+ obj.VCCU_Vehicle_LinkVoltage= linkVoltage;//500
|
|
|
+ obj.VCCU_Vehicle_ContactorVoltage = contactorVoltage;//0
|
|
|
+ obj.DATA.bits.VCCU_Vehicle_ChargePermission = chargePermission;//Not_allowed
|
|
|
+ obj.DATA.bits.VCCU_Vehicle_IsolationMeasurem = isolationMeasurem;//Active
|
|
|
+ obj.DATA.bits.VCCU_Vehicle_PlugLockPermissio = plugLockPermissio;//Allowed//Not_allowed;
|
|
|
+ obj.DATA.bits.VCCU_Vehicle_PlugUnlockPermiss = plugUnlockPermiss;//Not_allowed
|
|
|
+ obj.bits.VCCU_Vehicle_ContactorStatus = contactorStatus;//Open
|
|
|
+ obj.bits.VCCU_Vehicle_StopCharge = 3;//Open
|
|
|
+ obj.bits.VCCU_Vehicle_ChargeSelection = 3;//Open
|
|
|
+ byte* data1;
|
|
|
+ data1 = (byte*) &(*((UWORD *) &obj.VCCU_Vehicle_ContactorVoltage));
|
|
|
+ byte* data2;
|
|
|
+ data2 = (byte*) &(*((UWORD *) &obj.VCCU_Vehicle_LinkVoltage));
|
|
|
+ byte data[6];
|
|
|
+ data[0] = data1[0];
|
|
|
+ data[1] = data1[1];
|
|
|
+ data[2] = data2[0];
|
|
|
+ data[3] = data2[1];
|
|
|
+ data[4] = *((UBYTE *) &obj.DATA);
|
|
|
+ data[5] = *((UBYTE *) &obj.bits);
|
|
|
+ setVCCU_ChargeFromVehicle(data, sizeof(data));
|
|
|
}
|
|
|
|
|
|
-void Initialization()
|
|
|
-{
|
|
|
- bool isPass = false;
|
|
|
- while(!isPass)
|
|
|
- {
|
|
|
- isPass = true;
|
|
|
- for (byte _index = 0; _index < gun_count; _index++)
|
|
|
- {
|
|
|
- if (!FindChargingInfoData(_index, &_chargingData[0]))
|
|
|
- {
|
|
|
- DEBUG_ERROR("EvComm (main) : FindChargingInfoData false \n");
|
|
|
- isPass = false;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+void VCVCCU_V2G_RemainingTimeToFullSO(int remainingTime){
|
|
|
+ struct VCCU_V2G_RemainingTimeToFullSO obj;
|
|
|
+ obj.VCCU_V2G_RemainingTimeToB_0000.value = remainingTime;
|
|
|
+ obj.DATA.VCCU_V2G_RemainingTimeToFullSO = 1;
|
|
|
+ obj.DATA.VCCU_V2G_RemainingTimeToF_0002 = 0;//520
|
|
|
+ obj.VCCU_V2G_RemainingTimeToB_0001.value = 0;//1
|
|
|
+ obj.VCCU_V2G_RemainingTimeToB_0003.value = 0;//0
|
|
|
+ byte* data1;
|
|
|
+ data1 = (byte*) &(*((UWORD *) &obj.VCCU_V2G_RemainingTimeToB_0000));
|
|
|
+ byte data[5];
|
|
|
+ data[0] = data1[0];
|
|
|
+ data[1] = data1[1];
|
|
|
+ data[2] = *((UBYTE *) &obj.VCCU_V2G_RemainingTimeToB_0003);
|
|
|
+ data[3] = *((UBYTE *) &obj.VCCU_V2G_RemainingTimeToB_0001);
|
|
|
+ data[4] = *((UBYTE *) &obj.DATA);
|
|
|
+ setVCCU_V2G_RemainingTimeToFullSO(data, sizeof(data));
|
|
|
}
|
|
|
|
|
|
-void GetMaxVolAndCurMethod(byte index, float *vol, float *cur)
|
|
|
-{
|
|
|
- if (maxChargingVol[index] != 0 && maxChargingVol[index] <= *vol)
|
|
|
- *vol = maxChargingVol[index];
|
|
|
+void VCCU_V2G_EVMaximumVoltageLimit(int VMaximumVoltageLimit,
|
|
|
+ int EVMaximumVoltage_0002,
|
|
|
+ int EVMaximumVoltage_0000,
|
|
|
+ int EVMaximumVoltage_0001,
|
|
|
+ int EVMaximumVoltage_0003){
|
|
|
+
|
|
|
+ struct VCCU_V2G_EVMaximumVoltageLimit obj;
|
|
|
+ obj.DATA1.VCCU_V2G_EVMaximumVoltageLimit = VMaximumVoltageLimit;//1
|
|
|
+ obj.DATA1.VCCU_V2G_EVMaximumVoltage_0002 = EVMaximumVoltage_0002;//5
|
|
|
+ obj.VCCU_V2G_EVMaximumVoltage_0000.value = EVMaximumVoltage_0000;//520
|
|
|
+ obj.VCCU_V2G_EVMaximumVoltage_0001.value = EVMaximumVoltage_0001;//1
|
|
|
+ obj.VCCU_V2G_EVMaximumVoltage_0003.value = EVMaximumVoltage_0003;//0
|
|
|
+ byte* data1;
|
|
|
+ data1 = (byte*) &(*((UWORD *) &obj.VCCU_V2G_EVMaximumVoltage_0000));
|
|
|
+ byte data[5];
|
|
|
+ data[0] = *((UBYTE *) &obj.DATA1);
|
|
|
+ data[1] = *((UBYTE *) &obj.VCCU_V2G_EVMaximumVoltage_0003);
|
|
|
+ data[2] = data1[0];
|
|
|
+ data[3] = data1[1];
|
|
|
+ data[4] = *((UBYTE *) &obj.VCCU_V2G_EVMaximumVoltage_0001);
|
|
|
+ //printf("%02x %02x %02x %02x %02x \n", data[0], data[1], data[2], data[3], data[4]);
|
|
|
+ setVCCU_V2G_EVMaximumVoltageLimit(data, sizeof(data));
|
|
|
+}
|
|
|
|
|
|
- if (maxChargingCur[index] != 0 && maxChargingCur[index] <= *cur)
|
|
|
- *cur = maxChargingCur[index];
|
|
|
+void VCCU_V2G_EVMaximumCurrentLimit(int EVMaximumCurrentLimit,
|
|
|
+ int EVMaximumCurrent_0000,
|
|
|
+ int EVMaximumCurrent_0001,
|
|
|
+ int EVMaximumCurrent_0002,
|
|
|
+ int EVMaximumCurrent_0003){
|
|
|
+
|
|
|
+ struct VCCU_V2G_EVMaximumCurrentLimit obj;
|
|
|
+ obj.DATA1.VCCU_V2G_EVMaximumCurrentLimit = EVMaximumCurrentLimit;//1
|
|
|
+ obj.DATA1.VCCU_V2G_EVMaximumCurrent_0000 = EVMaximumCurrent_0000;//3
|
|
|
+ obj.VCCU_V2G_EVMaximumCurrent_0001.value = EVMaximumCurrent_0001;//1
|
|
|
+ obj.VCCU_V2G_EVMaximumCurrent_0002.value = EVMaximumCurrent_0002;//0
|
|
|
+ obj.VCCU_V2G_EVMaximumCurrent_0003.value = EVMaximumCurrent_0003;//10
|
|
|
+ byte* data1;
|
|
|
+ data1 = (byte*) &(*((UWORD *) &obj.VCCU_V2G_EVMaximumCurrent_0003));
|
|
|
+ byte data[5];
|
|
|
+ data[0] = *((UBYTE *) &obj.DATA1);
|
|
|
+ data[1] = *((UBYTE *) &obj.VCCU_V2G_EVMaximumCurrent_0002);
|
|
|
+ data[2] = data1[0];
|
|
|
+ data[3] = data1[1];
|
|
|
+ data[4] = *((UBYTE *) &obj.VCCU_V2G_EVMaximumCurrent_0001);
|
|
|
+ //printf("%02x %02x %02x %02x %02x \n", data[0], data[1], data[2], data[3], data[4]);
|
|
|
+ setVCCU_V2G_EVMaximumCurrentLimit(data, sizeof(data));
|
|
|
+}
|
|
|
|
|
|
- if (_chargingData[index]->SystemStatus == S_CHARGING &&
|
|
|
- _chargingData[index]->ChargingProfileCurrent > 0 &&
|
|
|
- _chargingData[index]->ChargingProfileCurrent <= *cur)
|
|
|
- {
|
|
|
- *cur = _chargingData[index]->ChargingProfileCurrent;
|
|
|
- }
|
|
|
+void VCCU_V2G_EVTargetVoltage(int EVTargetVoltage_Value,
|
|
|
+ int EVTargetVoltage_Unit,
|
|
|
+ int EVTargetVoltage_UnitF,
|
|
|
+ int EVTargetVoltage_Multi){//C2 01 00 01 05
|
|
|
+
|
|
|
+ struct VCCU_V2G_EVTargetVoltage obj;
|
|
|
+ obj.VCCU_V2G_EVTargetVoltage_Value.value = EVTargetVoltage_Value;//450
|
|
|
+ obj.VCCU_V2G_EVTargetVoltage_Unit.value = EVTargetVoltage_Unit;//5
|
|
|
+ obj.VCCU_V2G_EVTargetVoltage_UnitF.value = EVTargetVoltage_UnitF;//1
|
|
|
+ obj.VCCU_V2G_EVTargetVoltage_Multi.value = EVTargetVoltage_Multi;//0
|
|
|
+
|
|
|
+ byte* data1;
|
|
|
+ data1 = (byte*) &(*((UWORD *) &obj.VCCU_V2G_EVTargetVoltage_Value));
|
|
|
+ byte data[5];
|
|
|
+ data[0] = data1[0];
|
|
|
+ data[1] = data1[1];
|
|
|
+ data[2] = *((UBYTE *) &obj.VCCU_V2G_EVTargetVoltage_Multi);
|
|
|
+ data[3] = *((UBYTE *) &obj.VCCU_V2G_EVTargetVoltage_UnitF);
|
|
|
+ data[4] = *((UBYTE *) &obj.VCCU_V2G_EVTargetVoltage_Unit);
|
|
|
+ //printf("%d %02x %02x \n",obj.VCCU_V2G_EVTargetVoltage_Value.value, data[0], data[1]);
|
|
|
+ //printf("%02x %02x %02x %02x %02x \n", data[0], data[1], data[2], data[3], data[4]);
|
|
|
+ setVCCU_V2G_EVTargetVoltage(data, sizeof(data));
|
|
|
}
|
|
|
|
|
|
-void GetMaxPowerMethod(byte index, float *pow)
|
|
|
-{
|
|
|
- if (maxChargingPow != 0 && maxChargingPow <= *pow)
|
|
|
- *pow = maxChargingPow;
|
|
|
+void VCCU_V2G_EVTargetCurrent(int EVTargetCurrent_Unit,
|
|
|
+ int EVTargetCurrent_Value,
|
|
|
+ int EVTargetCurrent_UnitF,
|
|
|
+ int EVTargetCurrent_Multi){//05 00 00 01 03
|
|
|
+
|
|
|
+ struct VCCU_V2G_EVTargetCurrent obj;
|
|
|
+ obj.VCCU_V2G_EVTargetCurrent_Unit.value = EVTargetCurrent_Unit;//3
|
|
|
+ obj.VCCU_V2G_EVTargetCurrent_Value.value = EVTargetCurrent_Value;//5
|
|
|
+ obj.VCCU_V2G_EVTargetCurrent_UnitF.value = EVTargetCurrent_UnitF;//1
|
|
|
+ obj.VCCU_V2G_EVTargetCurrent_Multi.value = EVTargetCurrent_Multi;//0
|
|
|
+ byte* data1;
|
|
|
+ data1 = (byte*) &(*((UWORD *) &obj.VCCU_V2G_EVTargetCurrent_Value));
|
|
|
+ byte data[5];
|
|
|
+ data[0] = data1[0];
|
|
|
+ data[1] = data1[1];
|
|
|
+ data[2] = *((UBYTE *) &obj.VCCU_V2G_EVTargetCurrent_Multi);
|
|
|
+ data[3] = *((UBYTE *) &obj.VCCU_V2G_EVTargetCurrent_UnitF);
|
|
|
+ data[4] = *((UBYTE *) &obj.VCCU_V2G_EVTargetCurrent_Unit);
|
|
|
+ //printf("%02x %02x %02x %02x %02x \n", data[0], data[1], data[2], data[3], data[4]);
|
|
|
+ setVCCU_V2G_EVTargetCurrent(data, sizeof(data));
|
|
|
+}
|
|
|
|
|
|
- if (_chargingData[index]->SystemStatus == S_CHARGING &&
|
|
|
- _chargingData[index]->ChargingProfilePower > 0 &&
|
|
|
- _chargingData[index]->ChargingProfilePower <= *pow)
|
|
|
- {
|
|
|
- *pow = _chargingData[index]->ChargingProfilePower;
|
|
|
- }
|
|
|
+void VCCU_V2G_VehicleStatus(int canfd, int EnergyTra, int EVErrorCode,
|
|
|
+ int EVPowerDeliveryParame, int EVRESSSOC,
|
|
|
+ int EVRESSConditioningFla, int EVRESSConditionin, int EVReady,
|
|
|
+ int BulkChargingCompleteF, int EVCabinConditioningFl, int EVCabinConditioning,
|
|
|
+ int ChargingComplete, int FullSOCFlag, int FullSOC,
|
|
|
+ int BulkSOCFlag, int BulkSOC, int BulkChargingComplete,
|
|
|
+ int BulkChargingCompleteFValue){
|
|
|
+ struct VCCU_V2G_VehicleStatus obj;
|
|
|
+ obj.DATA4.VCCU_V2G_StateM_EnergyTra_0000 = EnergyTra;//VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended;
|
|
|
+ obj.DATA1.VCCU_V2G_EVErrorCode = EVErrorCode;//0;
|
|
|
+ obj.DATA4.VCCU_V2G_EVPowerDeliveryParame = EVPowerDeliveryParame;//3;
|
|
|
+ obj.VCCU_V2G_EVRESSSOC.value = EVRESSSOC;//0;
|
|
|
+ obj.DATA3.VCCU_V2G_EVRESSConditioningFla = EVRESSConditioningFla;//3;
|
|
|
+ obj.DATA3.VCCU_V2G_EVRESSConditioning = EVRESSConditionin;//3;
|
|
|
+ obj.DATA3.VCCU_V2G_EVReady = EVReady;//3;
|
|
|
+ obj.DATA1.VCCU_V2G_BulkChargingCompleteF = BulkChargingCompleteF;//3;
|
|
|
+ obj.DATA3.VCCU_V2G_EVCabinConditioningFl = EVCabinConditioningFl;//3;
|
|
|
+ obj.DATA2.VCCU_V2G_EVCabinConditioning = EVCabinConditioning;//3;
|
|
|
+ obj.DATA2.VCCU_V2G_ChargingComplete = ChargingComplete;//3;
|
|
|
+ obj.DATA2.VCCU_V2G_FullSOCFlag = FullSOCFlag;//0;
|
|
|
+ obj.VCCU_V2G_FullSOC.value = FullSOC;//3;
|
|
|
+ obj.DATA2.VCCU_V2G_BulkSOCFlag = BulkSOCFlag;//3;
|
|
|
+ obj.VCCU_V2G_BulkSOC.value = BulkSOC;//0;
|
|
|
+ obj.DATA1.VCCU_V2G_BulkChargingComplete = BulkChargingComplete;//3;
|
|
|
+ obj.DATA1.VCCU_V2G_BulkChargingCompleteF = BulkChargingCompleteFValue;//3;
|
|
|
+ byte data[7];
|
|
|
+ data[0] = *((UBYTE *) &obj.DATA1);
|
|
|
+ data[1] = *((UBYTE *) &obj.DATA2);
|
|
|
+ data[2] = *((UBYTE *) &obj.DATA3);
|
|
|
+ data[3] = *((UBYTE *) &obj.DATA4);
|
|
|
+ data[4] = *((UBYTE *) &obj.VCCU_V2G_BulkSOC);
|
|
|
+ data[5] = *((UBYTE *) &obj.VCCU_V2G_FullSOC);
|
|
|
+ data[6] = *((UBYTE *) &obj.VCCU_V2G_EVRESSSOC);
|
|
|
+ setVCCU_V2G_VehicleStatus(data, sizeof(data));
|
|
|
}
|
|
|
|
|
|
-time_t GetRtcInfoForEpoch()
|
|
|
+unsigned char isModeChange(unsigned char gun_index)
|
|
|
{
|
|
|
- struct timeb csuTime;
|
|
|
- struct tm *tmCSU;
|
|
|
- struct tm t;
|
|
|
- time_t result;
|
|
|
-
|
|
|
- ftime(&csuTime);
|
|
|
- tmCSU = localtime(&csuTime.time);
|
|
|
-
|
|
|
- t.tm_year = tmCSU->tm_year;
|
|
|
- t.tm_mon = tmCSU->tm_mon;
|
|
|
- t.tm_mday = tmCSU->tm_mday;
|
|
|
- t.tm_hour = tmCSU->tm_hour;
|
|
|
- t.tm_min = tmCSU->tm_min;
|
|
|
- t.tm_sec = tmCSU->tm_sec;
|
|
|
- t.tm_isdst = -1;
|
|
|
- result = mktime(&t);
|
|
|
-
|
|
|
- return result;
|
|
|
+ unsigned char result = NO;
|
|
|
+ if(_chargingData[gun_index]->SystemStatus != _chargingData[gun_index]->PreviousSystemStatus)
|
|
|
+ {
|
|
|
+ result = YES;
|
|
|
+ _chargingData[gun_index]->PreviousSystemStatus = _chargingData[gun_index]->SystemStatus;
|
|
|
+
|
|
|
+ }
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
-byte GetStopChargingReasonByEvse(byte gunIndex, byte *reason)
|
|
|
+void setChargerMode(byte gun_index, byte mode)
|
|
|
{
|
|
|
- byte result = NO;
|
|
|
-
|
|
|
- if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.EmergencyStopTrip == 0x01)
|
|
|
- {
|
|
|
- // 012251
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 2;
|
|
|
- *(reason + 2) = 2;
|
|
|
- *(reason + 1) = 5;
|
|
|
- *(reason + 0) = 1;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
+ _chargingData[gun_index]->SystemStatus = mode;
|
|
|
+}
|
|
|
|
|
|
- if (_chargingData[gunIndex]->Type == _Type_Chademo)
|
|
|
- {
|
|
|
- if (ShmStatusCodeData->FaultCode.FaultEvents.bits.ChademoOutputRelayDrivingFault == YES)
|
|
|
- {
|
|
|
- // 011012
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 1;
|
|
|
- *(reason + 2) = 0;
|
|
|
- *(reason + 1) = 1;
|
|
|
- *(reason + 0) = 2;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoOutputUVPFail == YES)
|
|
|
- {
|
|
|
- // 012289
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 2;
|
|
|
- *(reason + 2) = 2;
|
|
|
- *(reason + 1) = 8;
|
|
|
- *(reason + 0) = 9;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.ChademoGfdTrip == YES)
|
|
|
- {
|
|
|
- // 012234
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 2;
|
|
|
- *(reason + 2) = 2;
|
|
|
- *(reason + 1) = 3;
|
|
|
- *(reason + 0) = 4;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- }
|
|
|
- else if (_chargingData[gunIndex]->Type == _Type_GB)
|
|
|
- {
|
|
|
- if (ShmStatusCodeData->FaultCode.FaultEvents.bits.ChademoOutputRelayDrivingFault == YES)
|
|
|
- {
|
|
|
- // 012290
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 2;
|
|
|
- *(reason + 2) = 2;
|
|
|
- *(reason + 1) = 9;
|
|
|
- *(reason + 0) = 0;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.GbGfdTrip == YES)
|
|
|
- {
|
|
|
- // 012236
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 2;
|
|
|
- *(reason + 2) = 2;
|
|
|
- *(reason + 1) = 3;
|
|
|
- *(reason + 0) = 6;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- }
|
|
|
- else if (_chargingData[gunIndex]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- if (ShmStatusCodeData->FaultCode.FaultEvents.bits.CcsOutputRelayDrivingFault == YES)
|
|
|
- {
|
|
|
- // 011014
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 1;
|
|
|
- *(reason + 2) = 0;
|
|
|
- *(reason + 1) = 1;
|
|
|
- *(reason + 0) = 4;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsOutputUVPFail == YES)
|
|
|
- {
|
|
|
- // 012288
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 2;
|
|
|
- *(reason + 2) = 2;
|
|
|
- *(reason + 1) = 8;
|
|
|
- *(reason + 0) = 8;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.CcsGfdTrip == YES)
|
|
|
- {
|
|
|
- // 012236
|
|
|
- *(reason + 5) = 0;
|
|
|
- *(reason + 4) = 1;
|
|
|
- *(reason + 3) = 2;
|
|
|
- *(reason + 2) = 2;
|
|
|
- *(reason + 1) = 3;
|
|
|
- *(reason + 0) = 5;
|
|
|
- result = YES;
|
|
|
- }
|
|
|
- }
|
|
|
+void handleEmulatorFaultStatus(){
|
|
|
+ setEVStatus1(evstaus[4]);
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setStatusMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ ShmSysConfigAndInfo->ate.ATEStatus = 0x00;
|
|
|
+ SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap,
|
|
|
+ ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ EvseStopChargingEvent(normalStop, stopReason, 1);
|
|
|
|
|
|
- return result;
|
|
|
}
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
{
|
|
|
- if(InitShareMemory() == FAIL)
|
|
|
- {
|
|
|
- #ifdef SystemLogMessage
|
|
|
- DEBUG_ERROR("InitShareMemory NG\n");
|
|
|
- #endif
|
|
|
- if(ShmStatusCodeData != NULL)
|
|
|
- {
|
|
|
- ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
|
|
|
- }
|
|
|
- sleep(5);
|
|
|
- return 0;
|
|
|
- }
|
|
|
-
|
|
|
- gun_count = ShmSysConfigAndInfo->SysConfig.TotalConnectorCount;
|
|
|
- Initialization();
|
|
|
- CanFd = InitCanBus();
|
|
|
- CANReceiver();
|
|
|
-
|
|
|
- byte priorityLow = 1;
|
|
|
- time_t rtc = GetRtcInfoForEpoch();
|
|
|
- while(CanFd)
|
|
|
- {
|
|
|
- for(byte _index = 0; _index < gun_count; _index++)
|
|
|
- {
|
|
|
- if (priorityLow == 1)
|
|
|
- {
|
|
|
- // 優先權較低 - 只要有回應即不會再詢問
|
|
|
- if (_chargingData[_index]->Type == _Type_Chademo &&
|
|
|
- ShmCHAdeMOData->evse[_chargingData[_index]->type_index].SelfTest_Comp != PASS)
|
|
|
- {
|
|
|
- SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
|
|
|
- GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- else if (_chargingData[_index]->Type == _Type_GB &&
|
|
|
- ShmGBTData->evse[_chargingData[_index]->type_index].SelfTest_Comp != PASS)
|
|
|
- {
|
|
|
- SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
|
|
|
- GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- else if (_chargingData[_index]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- if (ShmCcsData->CommProtocol == 0x01 &&
|
|
|
- ShmCcsData->V2GMessage_DIN70121[_chargingData[_index]->type_index].SelfTest_Comp != PASS)
|
|
|
- {
|
|
|
- SyncRtcInfo(_index, _chargingData[_index]->Evboard_id, (int)rtc);
|
|
|
- GetFirmwareVersion(_index, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 固定要取得的資訊 : 1.槍鎖狀態, 2."Connector 1" 溫度, 3."Connector 2" 溫度, 4.Pilot Voltage
|
|
|
- //PRINTF_FUNC("GetMiscellaneousInfo. index = %d, Eid = %d \n", _index, _chargingData[_index]->Evboard_id);
|
|
|
- GetMiscellaneousInfo(_index,
|
|
|
- _chargingData[_index]->RelayK1K2Status,
|
|
|
- _chargingData[_index]->PresentChargedEnergy,
|
|
|
- (_chargingData[_index]->PresentChargingVoltage * 10),
|
|
|
- _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
-
|
|
|
- switch (_chargingData[_index]->SystemStatus)
|
|
|
- {
|
|
|
- case S_IDLE:
|
|
|
- case S_RESERVATION:
|
|
|
- if (_chargingData[_index]->Type == _Type_Chademo)
|
|
|
- {
|
|
|
- ClearAbnormalStatus_Chademo(_index);
|
|
|
- }
|
|
|
- else if (_chargingData[_index]->Type == _Type_GB)
|
|
|
- {
|
|
|
- ClearAbnormalStatus_GB(_index);
|
|
|
- }
|
|
|
- else if (_chargingData[_index]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- ClearAbnormalStatus_CCS(_index);
|
|
|
- }
|
|
|
-
|
|
|
- if (priorityLow == 1)
|
|
|
- {
|
|
|
- _chargingData[_index]->PresentChargedEnergy = 0;
|
|
|
- _chargingData[_index]->PresentChargingPower = 0;
|
|
|
- _chargingData[_index]->GroundFaultStatus = GFD_WAIT;
|
|
|
- _chargingData[_index]->RealRatingPower = 0;
|
|
|
- _chargingData[_index]->StopChargeFlag = NO;
|
|
|
- _chargingData[_index]->ChargingFee = 0.0;
|
|
|
- _chargingData[_index]->EvBatterySoc = 0;
|
|
|
- _chargingData[_index]->PresentChargingVoltage = 0;
|
|
|
- _chargingData[_index]->PresentChargingCurrent = 0;
|
|
|
- _chargingData[_index]->EvBatteryMaxVoltage = 0;
|
|
|
-
|
|
|
- chargingTime[_index] = 0;
|
|
|
-
|
|
|
- maxChargingPow = (ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10);
|
|
|
- }
|
|
|
- break;
|
|
|
- case S_PREPARNING:
|
|
|
- {
|
|
|
- // 設定當前輸出
|
|
|
- if (gun_count == 1)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
|
|
|
- else if (gun_count == 2)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
|
|
|
- }
|
|
|
- break;
|
|
|
- case S_PREPARING_FOR_EV:
|
|
|
- {
|
|
|
- // 開始確認車端是否同意開始充電 : 1.SOC, 2.Target Vol, 3.Target Cur, 4.Charging remaining time
|
|
|
- GetOutputReq(_index, _chargingData[_index]->Evboard_id);
|
|
|
-
|
|
|
-// PRINTF_FUNC("PresentChargingVoltage = %f \n", _chargingData[_index]->PresentChargingVoltage);
|
|
|
-// PRINTF_FUNC("PresentChargingCurrent = %f \n", _chargingData[_index]->PresentChargingCurrent);
|
|
|
-// PRINTF_FUNC("AvailableChargingPower = %f \n", _chargingData[_index]->AvailableChargingPower);
|
|
|
-// PRINTF_FUNC("AvailableChargingCurrent = %f \n", _chargingData[_index]->AvailableChargingCurrent);
|
|
|
-// PRINTF_FUNC("MaximumChargingVoltage = %f \n", _chargingData[_index]->MaximumChargingVoltage);
|
|
|
-
|
|
|
- // 設定當前輸出
|
|
|
- if (gun_count == 1)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
|
|
|
- else if (gun_count == 2)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
|
|
|
-
|
|
|
- if (priorityLow == 1)
|
|
|
- {
|
|
|
- float maxVol, maxCur;
|
|
|
- // 樁端輸出能力
|
|
|
- maxVol = _chargingData[_index]->MaximumChargingVoltage;
|
|
|
- maxCur = _chargingData[_index]->AvailableChargingCurrent;
|
|
|
-
|
|
|
- GetMaxVolAndCurMethod(_index, &maxVol, &maxCur);
|
|
|
-
|
|
|
- PRINTF_FUNC("To EV_%d Max_Vol = %f, Cap_Cur = %f, Cap_Pow = %f \n",
|
|
|
- _index, maxVol, maxCur, _chargingData[_index]->AvailableChargingPower);
|
|
|
- _chargingData[_index]->RealMaxVoltage = maxVol;
|
|
|
-
|
|
|
- SetChargingPermission(_index, START,
|
|
|
- _chargingData[_index]->AvailableChargingPower,
|
|
|
- maxCur,
|
|
|
- maxVol,
|
|
|
- _chargingData[_index]->Evboard_id);
|
|
|
-
|
|
|
- // 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
|
|
|
- GetEvBatteryInfo(_index, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case S_PREPARING_FOR_EVSE:
|
|
|
- case S_CCS_PRECHARGE_ST0:
|
|
|
- case S_CCS_PRECHARGE_ST1:
|
|
|
- {
|
|
|
- // 開始確認車端是否同意開始充電
|
|
|
- GetOutputReq(_index, _chargingData[_index]->Evboard_id);
|
|
|
-
|
|
|
- // 設定當前輸出
|
|
|
- if (gun_count == 1)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
|
|
|
- else if (gun_count == 2)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
|
|
|
-
|
|
|
- if (priorityLow % 5 == 1)
|
|
|
- {
|
|
|
- // 樁端輸出能力改變
|
|
|
- if (gun_count == 1)
|
|
|
- SetPresentChargingOutputCap(_chargingData[0], _chargingData[0]);
|
|
|
- else if (gun_count == 2)
|
|
|
- SetPresentChargingOutputCap(_chargingData[0], _chargingData[1]);
|
|
|
- }
|
|
|
-
|
|
|
- // 持續通知 Isolation 測試狀態
|
|
|
- if (priorityLow == 1)
|
|
|
- {
|
|
|
- // 拉 500 V 如果在一秒鐘內 GFD 都符合則 PASS
|
|
|
-// if (_chargingData[_index]->FireChargingVoltage >= 3500)
|
|
|
-// _chargingData[_index]->GroundFaultStatus = GFD_PASS;
|
|
|
-
|
|
|
- //PRINTF_FUNC("To EV_%d GFD = %d \n", _index, _chargingData[_index]->GroundFaultStatus);
|
|
|
-
|
|
|
- unsigned char _result = GFD_WAIT;
|
|
|
- _result = _chargingData[_index]->GroundFaultStatus;
|
|
|
-
|
|
|
- if(_chargingData[_index]->Type == _Type_Chademo ||
|
|
|
- _chargingData[_index]->Type == _Type_GB)
|
|
|
- {
|
|
|
- if (_result == GFD_WARNING)
|
|
|
- {
|
|
|
- _result = GFD_PASS;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(_result < GFD_WAIT &&
|
|
|
- _result > GFD_WARNING)
|
|
|
- {
|
|
|
- PRINTF_FUNC("Unexpected GFD status : %d \n", _result);
|
|
|
- _result = GFD_WAIT;
|
|
|
- }
|
|
|
-
|
|
|
- SetIsolationStatus(_index, _result, _chargingData[_index]->Evboard_id);
|
|
|
-
|
|
|
- if(_chargingData[_index]->SystemStatus == S_CCS_PRECHARGE_ST0 &&
|
|
|
- _chargingData[_index]->PrechargeStatus == PRECHARGE_READY)
|
|
|
- {
|
|
|
- SetEvsePrechargeInfo(_index, PRECHARGE_PRERELAY_PASS, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case S_CHARGING:
|
|
|
- {
|
|
|
- // 計算 Power
|
|
|
- _chargingData[_index]->PresentChargingPower = ((float)((_chargingData[_index]->PresentChargingVoltage) * (_chargingData[_index]->PresentChargingCurrent)) / 1000);
|
|
|
-
|
|
|
- if (chargingTime[_index] == 0)
|
|
|
- {
|
|
|
- chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- int passTime = _chargingData[_index]->PresentChargedDuration - chargingTime[_index];
|
|
|
-
|
|
|
- if (passTime > 0)
|
|
|
- {
|
|
|
- float changingPow = (_chargingData[_index]->PresentChargingPower) * passTime / 3600;
|
|
|
- if (ShmSysConfigAndInfo->SysConfig.BillingData.isBilling)
|
|
|
- {
|
|
|
- _chargingData[_index]->ChargingFee += changingPow * ShmSysConfigAndInfo->SysConfig.BillingData.Cur_fee;
|
|
|
- }
|
|
|
-
|
|
|
- _chargingData[_index]->PresentChargedEnergy += changingPow;
|
|
|
- chargingTime[_index] = _chargingData[_index]->PresentChargedDuration;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // 開始確認車端是否同意開始充電
|
|
|
- GetOutputReq(_index, _chargingData[_index]->Evboard_id);
|
|
|
-
|
|
|
- // 設定當前輸出
|
|
|
- if (gun_count == 1)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
|
|
|
- else if (gun_count == 2)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
|
|
|
-
|
|
|
- // for test end
|
|
|
- if (priorityLow % 5 == 0)
|
|
|
- {
|
|
|
- // 樁端輸出能力改變
|
|
|
- if (gun_count == 1)
|
|
|
- SetPresentChargingOutputCap(_chargingData[0], _chargingData[0]);
|
|
|
- else if (gun_count == 2)
|
|
|
- SetPresentChargingOutputCap(_chargingData[0], _chargingData[1]);
|
|
|
- }
|
|
|
-
|
|
|
- if (priorityLow == 1)
|
|
|
- {
|
|
|
- // Chademo & GB/T GFD 失敗再通知
|
|
|
- if(_chargingData[_index]->Type == _Type_Chademo || _chargingData[_index]->Type == _Type_GB)
|
|
|
- {
|
|
|
- if(_chargingData[_index]->GroundFaultStatus == GFD_FAIL)
|
|
|
- {
|
|
|
- SetIsolationStatus(_index, _chargingData[_index]->GroundFaultStatus, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- }
|
|
|
- // CCS will be continuous notify GFD state
|
|
|
- else if(_chargingData[_index]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- SetIsolationStatus(_index, _chargingData[_index]->GroundFaultStatus, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //NULL
|
|
|
- }
|
|
|
-
|
|
|
- if(_chargingData[_index]->Type == _Type_CCS_2 &&
|
|
|
- _chargingData[_index]->PrechargeStatus == PRECHARGE_READY)
|
|
|
- {
|
|
|
- SetEvsePrechargeInfo(_index, PRECHARGE_CHARELAY_PASS, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- case S_TERMINATING:
|
|
|
- {
|
|
|
- // 設定當前輸出
|
|
|
- if (gun_count == 1)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
|
|
|
- else if (gun_count == 2)
|
|
|
- SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
|
|
|
-
|
|
|
- // 槍鎖還在,則代表是樁端要求的停止
|
|
|
- if (_chargingData[_index]->GunLocked == START ||
|
|
|
- _chargingData[_index]->Type == _Type_CCS_2)
|
|
|
- {
|
|
|
- byte normalStop = 0x01;
|
|
|
- byte stopReason[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
|
|
|
-
|
|
|
- if (GetStopChargingReasonByEvse(_index, stopReason))
|
|
|
- {
|
|
|
- normalStop = 0x02;
|
|
|
- }
|
|
|
-
|
|
|
- EvseStopChargingEvent(normalStop, stopReason, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- GetOutputReq(_index, _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- break;
|
|
|
- case S_COMPLETE:
|
|
|
- {
|
|
|
- if (priorityLow == 1)
|
|
|
- {
|
|
|
- float maxVol, maxCur;
|
|
|
-
|
|
|
- // 樁端輸出能力
|
|
|
- maxVol = _chargingData[_index]->MaximumChargingVoltage;
|
|
|
- maxCur = _chargingData[_index]->AvailableChargingCurrent;
|
|
|
-
|
|
|
- GetMaxVolAndCurMethod(_index, &maxVol, &maxCur);
|
|
|
- SetChargingPermission(_index, STOP,
|
|
|
- _chargingData[_index]->AvailableChargingPower,
|
|
|
- maxCur,
|
|
|
- maxVol,
|
|
|
- _chargingData[_index]->Evboard_id);
|
|
|
- }
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- priorityLow >= 20 ? priorityLow = 1 : priorityLow++;
|
|
|
- usleep(45000); //EV 小板通訊 (50 ms)
|
|
|
- }
|
|
|
- DEBUG_INFO("Module_EvComm : Can-bus port = %d \n", CanFd);
|
|
|
- return FAIL;
|
|
|
+ if(InitShareMemory() == FAIL)
|
|
|
+ {
|
|
|
+ #ifdef SystemLogMessage
|
|
|
+ printf("InitShareMemory NG\n");
|
|
|
+ #endif
|
|
|
+ if(ShmStatusCodeData != NULL)
|
|
|
+ {
|
|
|
+ ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
|
|
|
+ }
|
|
|
+ sleep(5);
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ Initialization();
|
|
|
+ CanFd = InitCanBus();
|
|
|
+ CanFd2 = CHROMAInitCanBus();
|
|
|
+ CANReceiver();
|
|
|
+ CHROMACANReceiver();
|
|
|
+
|
|
|
+ //printf("%08X %08X %d %d %d ....................\n" , bn1, (bn1 | 0x80000000), CanFd, CanFd2, ShmSysConfigAndInfo->ate.ATEState);
|
|
|
+
|
|
|
+/*
|
|
|
+ sleep(2);
|
|
|
+ system("killall Module_InternalComm");
|
|
|
+ system("killall Module_EvComm");
|
|
|
+ return 0;
|
|
|
+ */
|
|
|
+
|
|
|
+ printf("EvComm %d....................\n" , ShmSysConfigAndInfo->ate.ATEState);
|
|
|
+ while(true){
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->ate.ATEState == 1){//VCCU
|
|
|
+
|
|
|
+ setBootNotification1();
|
|
|
+ VCCU_TD();
|
|
|
+ VCCU_Requests(0, 0, 0,
|
|
|
+ 3, 3, 3, 3,
|
|
|
+ 3, 3, 7,
|
|
|
+ 0,
|
|
|
+ 7, 3, 3);
|
|
|
+
|
|
|
+ int status = isModeChange(CCS_QUANTITY);
|
|
|
+ VCVCCU_V2G_RemainingTimeToFullSO(8000);
|
|
|
+ switch(_chargingData[CCS_QUANTITY]->SystemStatus){
|
|
|
+ case V_IDLE:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS IDLE Processing 1....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[0]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_UNMATEDPLUG:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS UNMATEDPLUG Processing 2....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[0]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Not_allowed, Not_allowed, Opened);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_MATED_PLUG_INLET_UNLOCKED:{
|
|
|
+ if (status){
|
|
|
+ if(ShmSysConfigAndInfo->ate.vccu.inletStatus.DATA2.VCCU_PlugPresent_Status == VCCU_InletStatus_Connected){
|
|
|
+
|
|
|
+ }
|
|
|
+ printf("CCS MATED_PLUG_INLET_UNLOCKED Processing 3....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[0]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ //VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_INLETLOCKING:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS INLETLOCKING Processing 4....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[0]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_INLETLOCKED:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS INLETLOCKED Processing 5....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+ /*
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ */
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_SLAC:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS SLAC Processing 6....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ /*
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ */
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_DEFINITION:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS DEFINITION Processing 7....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ /*
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0, 3, 0,
|
|
|
+ 3, 3, TRUE, 3, 3, 3, 3, 3, 0, 3, 0, 3, 3);
|
|
|
+ */
|
|
|
+ /*
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, 500, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, 10);
|
|
|
+
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ */
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_CABLECHECK:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS CABLECHECK Processing 8....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_ISOLATION:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS ISOLATION Processing 9....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Allowed, Not_Active, Allowed, Not_allowed, Opened);
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_VOLTAGEDIFFERENCE:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS VOLTAGEDIFFERENCE Processing 10....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ /*
|
|
|
+ int val = (ShmSysConfigAndInfo->ate.linkVoltage - ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va);
|
|
|
+
|
|
|
+ printf("linkVoltage = %d v2g_EVSEPresentVoltage = %d val = %d RemainChargingDuration = %d....................\n", ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, val, _chargingData[CCS_QUANTITY]->RemainChargingDuration);
|
|
|
+*/
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Opened);
|
|
|
+ //VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_CONTACTORSCLOSED:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS CONTACTORSCLOSED Processing 11....................\n");
|
|
|
+ //printf("EVSEPresentVoltage = %d\n ", ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va );
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_POWERDELIVERY:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS POWERDELIVERY Processing 12....................\n");
|
|
|
+ }
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.linkVoltage, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ /*
|
|
|
+ if(ShmSysConfigAndInfo->ate.ATEStatus == 0){
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ }else{
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Not_allowed, Not_Active, Allowed, Not_allowed, Opened);
|
|
|
+ }
|
|
|
+ */
|
|
|
+ //VCCU_V2G_EVTargetVoltage(400, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_CURRENTDEMAND:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS CURRENTDEMAND Processing 13 %d....................\n", ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va);
|
|
|
+ //ShmSysConfigAndInfo->ate.linkVoltage = ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va;
|
|
|
+ //printf("maximumVoltage_value = %d Voltage = %d maximumCurrent_value = %d Current = %d....................\n", ShmSysConfigAndInfo->ate.maximumVoltage_value, ShmSysConfigAndInfo->ate.targetVoltage_Value, ShmSysConfigAndInfo->ate.maximumCurrent_value, ShmSysConfigAndInfo->ate.targetCurrent_Value);
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[2]);
|
|
|
+ if(ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va <= 1){
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Not_allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ }else{
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ }
|
|
|
+ /*
|
|
|
+ if(ShmSysConfigAndInfo->ate.ATEStatus == 0){
|
|
|
+ //VCCU_ChargeFromVehicle(CanFd, 500, 500, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ }else{
|
|
|
+ //VCCU_ChargeFromVehicle(CanFd, 500, 500, Not_allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.vccu.v2g_EVSEPresentVoltage.VCCU_V2G_EVSEPresentVoltage_Va, Not_allowed, Not_Active, Allowed, Not_allowed, Closed);
|
|
|
+ }
|
|
|
+ */
|
|
|
+ VCCU_V2G_VehicleStatus(CanFd, VCCU_V2G_StateM_EnergyTra_0000_DC_DC_extended, 0,
|
|
|
+ 3, soc,
|
|
|
+ 3, 3, TRUE,
|
|
|
+ 3, 3, 3,
|
|
|
+ 3, 3, 0,
|
|
|
+ 3, 0, 3,
|
|
|
+ 3);
|
|
|
+ VCCU_V2G_EVMaximumVoltageLimit(TRUE, U_V, ShmSysConfigAndInfo->ate.maximumVoltage_value, TRUE, 0);
|
|
|
+ VCCU_V2G_EVMaximumCurrentLimit(TRUE, U_A, TRUE, 0, ShmSysConfigAndInfo->ate.maximumCurrent_value);
|
|
|
+ VCCU_V2G_EVTargetVoltage(ShmSysConfigAndInfo->ate.targetVoltage_Value, U_V, TRUE, 0);
|
|
|
+ VCCU_V2G_EVTargetCurrent(U_A, ShmSysConfigAndInfo->ate.targetCurrent_Value, TRUE, 0);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_POWERDELIVERYFALSE:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS POWERDELIVERYFALSE Processing 14....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[3]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, ShmSysConfigAndInfo->ate.linkVoltage, Not_allowed, Not_Active, Allowed, Not_allowed, Opened);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_DETECTION:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS DETECTION Processing 15....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[3]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_SESSION_STOP:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS SESSION_STOP Processing 16....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[3]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_STOP_COMMUNICATION_SESSION:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS STOP_COMMUNICATION_SESSION Processing 17....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[3]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ case V_FINISHED:{
|
|
|
+ if (status){
|
|
|
+ printf("CCS FINISHED Processing 18....................\n");
|
|
|
+ }
|
|
|
+ setEVStatus1(evstaus[3]);
|
|
|
+ VCCU_ChargeFromVehicle(CanFd, ShmSysConfigAndInfo->ate.linkVoltage, 0, Not_allowed, Active, Allowed, Not_allowed, Opened);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ default:{
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //usleep(25000);
|
|
|
+ usleep(40000);
|
|
|
+
|
|
|
+ //setBootNotification1();
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.ATEState == 2){//GB
|
|
|
+ if(ShmSysConfigAndInfo->ate.status == 0){
|
|
|
+ int status = isModeChange(CCS_QUANTITY);
|
|
|
+ setBootNotification1();
|
|
|
+ usleep(1000);
|
|
|
+
|
|
|
+ setMisc(1, ShmSysConfigAndInfo->ate.chademo.id0D_req.K1K2Status, ShmSysConfigAndInfo->ate.chademo.id0D_req.Soc);
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->ate.ATEStatus == 1){
|
|
|
+ //ShmSysConfigAndInfo->ate.Permission = START;
|
|
|
+ //setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ //printf("ATEStatus == 1 %d \n",ShmSysConfigAndInfo->ate.ATEStatus);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.ATEStatus == 2){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ //printf("ATEStatus == 2 %d \n",ShmSysConfigAndInfo->ate.ATEStatus);
|
|
|
+ ShmSysConfigAndInfo->ate.ATEStatus = 0;
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.ATEStatus == 3){
|
|
|
+ //setEVStatus1(evstaus[4]);
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ ShmSysConfigAndInfo->ate.ATEStatus = 0x00;
|
|
|
+ SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ EvseStopChargingEvent(normalStop, stopReason, 1);
|
|
|
+ }else{
|
|
|
+
|
|
|
+ }
|
|
|
+ //printf("state == %d permission = %d \n",ShmSysConfigAndInfo->ate.chademo.id03.state, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ if(ShmSysConfigAndInfo->ate.chademo.id03.state == 0 && ShmSysConfigAndInfo->ate.Permission == 0){
|
|
|
+ //SetChargingPermission(CCS_QUANTITY, START, 1000, 1200, 6000, 1);
|
|
|
+ //setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = START;
|
|
|
+ setChargerMode(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission);
|
|
|
+ SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+
|
|
|
+ setEVStatus1(evstaus[0]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state ==1){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setEVStatus1(evstaus[0]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state ==2){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state ==3){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ //setEVStatus1(evstaus[1]);
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state ==4){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ //setEVStatus1(evstaus[1]);
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state == 5){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state == 6){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state == 7){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setEVStatus1(evstaus[2]);
|
|
|
+ //setEVStatus2(evstaus[2]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state == 8){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ //outputRelay.relay_event.bits.Gun1_Parallel_N = 0x00;
|
|
|
+ //outputRelay.relay_event.bits.Gun1_Parallel_P = 0x00;
|
|
|
+ setEVStatus1(evstaus[2]);
|
|
|
+ //setEVStatus2(evstaus[2]);
|
|
|
+ }//else if(ShmSysConfigAndInfo->ate.chademo.id03.state == 16 ){
|
|
|
+ else if(ShmSysConfigAndInfo->ate.chademo.id03.state >= 13 ){
|
|
|
+ handleEmulatorFaultStatus();
|
|
|
+ //setEVStatus1(evstaus[3]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state == 14 ){
|
|
|
+ handleEmulatorFaultStatus();
|
|
|
+ //setEVStatus1(evstaus[3]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.state == 9 || ShmSysConfigAndInfo->ate.chademo.id03.state == 10
|
|
|
+ || ShmSysConfigAndInfo->ate.chademo.id03.state == 11 || ShmSysConfigAndInfo->ate.chademo.id03.state == 12
|
|
|
+ //|| ShmSysConfigAndInfo->ate.chademo.id03.state == 13
|
|
|
+ //|| ShmSysConfigAndInfo->ate.chademo.id03.state == 15
|
|
|
+ ){
|
|
|
+ ShmSysConfigAndInfo->ate.Permission = STOP;
|
|
|
+ setEVStatus1(evstaus[3]);
|
|
|
+ //setEVStatus1(evstaus[3]);
|
|
|
+ handleEmulatorFaultStatus();
|
|
|
+ }else{
|
|
|
+ setEVStatus1(evstaus[0]);
|
|
|
+ //printf("4 %d %d\n",ShmSysConfigAndInfo->ate.chademo.id03.state,ShmSysConfigAndInfo->ate.chademo.id0D_req.K1K2Status);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(ShmSysConfigAndInfo->ate.chademo.id03.ProximitySignal == 0){
|
|
|
+ //printf("1 %d ===== \n", ShmSysConfigAndInfo->ate.chademo.id03.ProximitySignal);
|
|
|
+
|
|
|
+ //printf("ProximitySignal=====%d \n", ShmSysConfigAndInfo->ate.chademo.id03.ProximitySignal);
|
|
|
+ setEVStatus1(evstaus[3]);
|
|
|
+ }else if(ShmSysConfigAndInfo->ate.chademo.id03.ProximitySignal == 1 && ShmSysConfigAndInfo->ate.chademo.id03.state != 7 &&
|
|
|
+ ShmSysConfigAndInfo->ate.chademo.id03.state != 9 && ShmSysConfigAndInfo->ate.chademo.id03.state != 10
|
|
|
+ && ShmSysConfigAndInfo->ate.chademo.id03.state != 11 && ShmSysConfigAndInfo->ate.chademo.id03.state != 12
|
|
|
+ && ShmSysConfigAndInfo->ate.chademo.id03.state != 13
|
|
|
+ && ShmSysConfigAndInfo->ate.chademo.id03.state != 15){
|
|
|
+ //printf("2 %d ===== \n", ShmSysConfigAndInfo->ate.chademo.id03.ProximitySignal);
|
|
|
+ setEVStatus1(evstaus[1]);
|
|
|
+ }
|
|
|
+ if(status){
|
|
|
+ //printf("status change1 %d ===== \n", status);
|
|
|
+ SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ }else{
|
|
|
+ if(ShmSysConfigAndInfo->ate.Permission == STOP ){
|
|
|
+ if(ShmSysConfigAndInfo->ate.chademo.id03.state == 0){
|
|
|
+ //printf("status change0 %d ===== \n", status);
|
|
|
+ //SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //SetChargingPermission(CCS_QUANTITY, ShmSysConfigAndInfo->ate.Permission, ShmSysConfigAndInfo->ate.TotalBatteryCap, ShmSysConfigAndInfo->ate.MaxBatteryCurrent, ShmSysConfigAndInfo->ate.MaxBatteryVoltage, 1);
|
|
|
+ //SetChargingPermission(CCS_QUANTITY, START, 1000, 1200, 6000, 1);
|
|
|
+ //usleep(1000);
|
|
|
+ //給火線電壓
|
|
|
+ SetPresentInputPower(ShmSysConfigAndInfo->ate.RequireVoltage, ShmSysConfigAndInfo->ate.RequireCurrent, 1);
|
|
|
+ //usleep(1000);
|
|
|
+ //SetPresentInputRequirement(4800, 6000, 1920, 20);
|
|
|
+ SetPresentInputRequirement(ShmSysConfigAndInfo->ate.RequireVoltage, ShmSysConfigAndInfo->ate.RequireCurrent, ShmSysConfigAndInfo->ate.PresentBattVoltage, ShmSysConfigAndInfo->ate.MinimumChargeCurrent, 1);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ #if (!DEMO)
|
|
|
+
|
|
|
+ #else
|
|
|
+
|
|
|
+ #endif
|
|
|
+ return FAIL;
|
|
|
}
|