فهرست منبع

2020-01-10 / Alston Lin

Actions
1. Add FactoryConfig to DS60-120

Files
1. As follow commit history.
Alston 5 سال پیش
والد
کامیت
44c6e36173

+ 1 - 0
EVSE/Projects/DS60-120/Apps/Config.h

@@ -58,6 +58,7 @@ enum _SYSTEM_STATUS
 	S_TERMINATING,
 	S_COMPLETE,
 	S_ALARM,
+	S_FAULT,
 	S_RESERVATION,
 	S_BOOKING,
 	S_MAINTAIN,

+ 302 - 0
EVSE/Projects/DS60-120/Apps/FactoryConfig.c

@@ -0,0 +1,302 @@
+#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"
+
+#define Debug
+#define ARRAY_SIZE(A)		(sizeof(A) / sizeof(A[0]))
+#define PASS				1
+#define FAIL				-1
+#define OUTPUT_FLASH		0x01
+#define OUTPUT_FILE			0x02
+
+struct SysConfigData 			SysConfig;
+
+int StoreLogMsg(const char *fmt, ...);
+
+int StoreLogMsg(const char *fmt, ...)
+{
+	char Buf[4096+256];
+	char buffer[4096];
+	time_t CurrentTime;
+	struct tm *tm;
+	va_list args;
+
+	va_start(args, fmt);
+	int rc = vsnprintf(buffer, sizeof(buffer), fmt, args);
+	va_end(args);
+
+	memset(Buf,0,sizeof(Buf));
+	CurrentTime = time(NULL);
+	tm=localtime(&CurrentTime);
+	sprintf(Buf,"echo \"%04d-%02d-%02d %02d:%02d:%02d - %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,
+			buffer,
+			tm->tm_year+1900,tm->tm_mon+1);
+	system(Buf);
+
+	return rc;
+}
+
+void helpOutput(void)
+{
+	printf("Usage: Module_FactoryConfig [OPTION]...\r\n\r\n");
+	printf("Generate factory default configuration value\r\n\r\n");
+	printf("OPTION:\r\n");
+	printf("	-a Write to file(/mnt) & flash\r\n");
+	printf("	-f Write to file(/mnt)\r\n");
+	printf("	-m Write to flash\r\n");
+}
+
+/**************************************************************************************/
+/************This task will create Factory default confgiuration file *****************/
+ /***********and store it into mtdblock 10,11,12                               ****************/
+/**************************************************************************************/
+int main(int argc,char *argv[])
+{
+	unsigned char outType = 0;
+	unsigned int i,Chk, MtdBlockSize = 0x600000;
+	unsigned char *ptr;
+	int fd, wrd;
+
+	ptr = malloc(MtdBlockSize);
+	if(ptr == NULL)
+	{
+		#ifdef SystemLogMessage
+		StoreLogMsg("[FactoryConfig]main: malloc for SysConfigData NG");
+		#endif
+		return 0;
+	}
+	memset(ptr, 0, MtdBlockSize);
+	memset(&SysConfig, 0, sizeof(struct SysConfigData));
+
+	/*
+	 * TODO: Set factory default configuration
+	*/
+	//********** System **********//
+	strcpy((char *)SysConfig.ModelName, "DSYE122J0ET2PH");
+	strcpy((char *)SysConfig.SerialNumber, "");
+	strcpy((char *)SysConfig.SystemId, "");
+	strcpy((char *)SysConfig.SystemDateTime, "");
+	SysConfig.AuthorisationMode = 0;
+	SysConfig.DefaultLanguage = 0;
+	SysConfig.RfidCardNumEndian = 0;
+	SysConfig.AcPlugInTimes = 0;
+	SysConfig.GbPlugInTimes = 0;
+	SysConfig.Ccs1PlugInTime = 0;
+	SysConfig.Ccs2PlugInTimes = 0;
+	SysConfig.ChademoPlugInTimes = 0;
+	//********** Charging **********//
+	SysConfig.MaxChargingEnergy = 0;
+	SysConfig.MaxChargingPower = 0;
+	SysConfig.MaxChargingCurrent = 0;
+	SysConfig.MaxChargingDuration = 0;
+	SysConfig.PhaseLossPolicy = 0;
+	for(unsigned char i = 0; i < 10; i++)
+		strcpy((char *)SysConfig.LocalWhiteCard, "");
+
+	strcpy((char *)SysConfig.UserId, "");
+	//********** Network **********//
+	strcpy((char *)SysConfig.FtpServer, "");
+	SysConfig.Eth0Interface.EthDhcpClient = 0;
+	strcpy((char *) SysConfig.Eth0Interface.EthMacAddress, "");
+	strcpy((char *) SysConfig.Eth0Interface.EthIpAddress, "192.168.1.10");
+	strcpy((char *) SysConfig.Eth0Interface.EthSubmaskAddress, "255.255.255.0");
+	strcpy((char *) SysConfig.Eth0Interface.EthGatewayAddress, "192.168.1.254");
+	SysConfig.Eth1Interface.EthDhcpClient = 0;
+	strcpy((char *) SysConfig.Eth1Interface.EthMacAddress, "");
+	strcpy((char *) SysConfig.Eth1Interface.EthIpAddress, "192.168.0.10");
+	strcpy((char *) SysConfig.Eth1Interface.EthSubmaskAddress, "255.255.255.0");
+	strcpy((char *) SysConfig.Eth1Interface.EthGatewayAddress, "192.168.0.254");
+	SysConfig.AthInterface.WifiMode = 0;
+	strcpy((char *) SysConfig.AthInterface.WifiSsid, "");
+	strcpy((char *) SysConfig.AthInterface.WifiPassword, "");
+	SysConfig.AthInterface.WifiRssi = 0;
+	SysConfig.AthInterface.WifiDhcpServer = 0;
+	SysConfig.AthInterface.WifiDhcpClient = 0;
+	strcpy((char *) SysConfig.AthInterface.WifiMacAddress, "");
+	strcpy((char *) SysConfig.AthInterface.WifiIpAddress, "");
+	strcpy((char *) SysConfig.AthInterface.WifiSubmaskAddress, "");
+	strcpy((char *) SysConfig.AthInterface.WifiGatewayAddress, "");
+	SysConfig.AthInterface.WifiNetworkConn = 0;
+	strcpy((char *) SysConfig.TelecomInterface.TelcomModelName, "");
+	strcpy((char *) SysConfig.TelecomInterface.TelcomSoftwareVer, "");
+	strcpy((char *) SysConfig.TelecomInterface.TelcomApn, "Internet");
+	SysConfig.TelecomInterface.TelcomRssi = 0;
+	strcpy((char *) SysConfig.TelecomInterface.TelcomChapPapId, "");
+	strcpy((char *) SysConfig.TelecomInterface.TelcomChapPapPwd, "");
+	strcpy((char *) SysConfig.TelecomInterface.TelcomModemImei, "");
+	strcpy((char *) SysConfig.TelecomInterface.TelcomSimImsi, "");
+	strcpy((char *) SysConfig.TelecomInterface.TelcomSimIccid, "");
+	SysConfig.TelecomInterface.TelcomSimStatus = 0;
+	SysConfig.TelecomInterface.TelcomModemMode = 0;
+	strcpy((char *) SysConfig.TelecomInterface.TelcomIpAddress, "");
+	SysConfig.TelecomInterface.TelcomNetworkConn = 0;
+	//********** Backend **********//
+	SysConfig.BackendConnTimeout=300; //300 seconds
+	SysConfig.OfflinePolicy = 0;
+	SysConfig.OfflineMaxChargeEnergy = 0;
+	SysConfig.OfflineMaxChargeDuration = 0;
+	strcpy((char *) SysConfig.OcppServerURL, "ws://127.0.0.1");
+	strcpy((char *) SysConfig.ChargeBoxId, "");
+
+	//copy default configuration to pointer
+	memcpy(ptr, &SysConfig, sizeof(struct SysConfigData));
+
+	//calculate CRC
+	Chk=0;
+	for(i=0;i<(MtdBlockSize-4);i++)
+	{
+		Chk += *(ptr+i);
+	}
+	memcpy(	ptr + MtdBlockSize-4, &Chk, 4);
+
+	/*
+	* Parameter process
+	*/
+	if (argc > 1)
+	{
+		char *arg = argv[1];
+		switch (arg[0])
+		{
+		case '-':
+			switch (arg[1])
+			{
+				case 'a':
+					outType |= OUTPUT_FILE;
+					outType |= OUTPUT_FLASH;
+					break;
+				case 'f':
+					outType |= OUTPUT_FILE;
+					break;
+				case 'm':
+					outType |= OUTPUT_FLASH;
+					break;
+				default:
+					helpOutput();
+					break;
+			}
+				break;
+			default:
+				helpOutput();
+				break;
+		}
+	}
+	else
+	{
+		helpOutput();
+	}
+
+	/*
+	 * Configuration bin file generate
+	*/
+	if((outType&OUTPUT_FILE) > 0)
+	{
+		fd = open("/mnt/FactoryDefaultConfig.bin", O_RDWR | O_CREAT);
+		if (fd < 0)
+		{
+			StoreLogMsg("[FactoryConfig]main: open /mnt/FactoryDefaultConfig.bin NG");
+			free(ptr);
+			return 0;
+		}
+		wrd=write(fd, ptr, MtdBlockSize);
+		close(fd);
+		if(wrd < MtdBlockSize)
+		{
+			StoreLogMsg("write /mnt/FactoryDefaultConfig.bin NG\r\n");
+			free(ptr);
+			return 0;
+		}
+		StoreLogMsg("FactoryConfig write to file in /mnt OK.\r\n");
+	}
+
+	/*
+	* Flash memory write
+	*/
+	if((outType&OUTPUT_FLASH) > 0)
+	{
+		// Save factory default setting value to flash factory default setting block
+		fd = open("/dev/mtdblock12", O_RDWR);
+		if (fd < 0)
+		{
+			StoreLogMsg("open /dev/mtdblock12 NG\r\n");
+			free(ptr);
+			return 0;
+		}
+		wrd=write(fd, ptr, MtdBlockSize);
+		close(fd);
+		if(wrd < MtdBlockSize)
+		{
+			StoreLogMsg("write /dev/mtdblock12 NG\r\n");
+			free(ptr);
+			return 0;
+		}
+
+		// Save factory default setting value to flash backup setting block
+		fd = open("/dev/mtdblock11", O_RDWR);
+		if (fd < 0)
+		{
+			StoreLogMsg("open /dev/mtdblock11 NG\r\n");
+			free(ptr);
+			return 0;
+		}
+		wrd=write(fd, ptr, MtdBlockSize);
+		close(fd);
+		if(wrd < MtdBlockSize)
+		{
+			StoreLogMsg("write /dev/mtdblock11 NG\r\n");
+			free(ptr);
+			return 0;
+		}
+
+		// Save factory default setting value to flash setting block
+		fd = open("/dev/mtdblock10", O_RDWR);
+		if (fd < 0)
+		{
+			StoreLogMsg("open /dev/mtdblock10 NG\r\n");
+			free(ptr);
+			return 0;
+		}
+		wrd=write(fd, ptr, MtdBlockSize);
+		close(fd);
+		if(wrd < MtdBlockSize)
+		{
+			StoreLogMsg("write /dev/mtdblock10 NG\r\n");
+			free(ptr);
+			return 0;
+		}
+		StoreLogMsg("FactoryConfig write to flash OK\r\n");
+	}
+
+	free(ptr);
+
+	return FAIL;
+}
+

+ 13 - 1
EVSE/Projects/DS60-120/Apps/Makefile

@@ -8,7 +8,7 @@ Internal485ProtocolLib = -L ../../../Modularization/Internal485Protocol -lIntern
 all: CopyFile apps
 #apps: Module_CSU Module_EvComm Module_EventLogging Module_InternalComm Module_LcmControl Module_PrimaryComm Module_PsuComm 
 # ReadCmdline kill.sh
-apps: MainTask EvCommTask EventLoggingTask InternalCommTask LcmControlTask PrimaryCommTask PsuCommTask ReadCmdlineTask WebService 4GTask OtherTools
+apps: MainTask EvCommTask EventLoggingTask InternalCommTask LcmControlTask PrimaryCommTask PsuCommTask ReadCmdlineTask WebService 4GTask FactoryConfigApp OtherTools
 
 MainTask:
 	rm -f *.o
@@ -69,6 +69,18 @@ WebService:
 4GTask:
 	cp -f ../../../Modularization/Module_4g ../Images/root
 
+FactoryConfigApp:
+	@echo "===== Module_FactoryConfig_Task =================================="
+	rm -f FactoryConfig
+	gcc "-I../../" -o FactoryConfig "./FactoryConfig.c"
+	mkdir -p /Storage/SystemLog	
+	./FactoryConfig -f;true
+	cp /mnt/FactoryDefaultConfig.bin ../Images
+	rm -f FactoryConfig; 
+	$(CC) -O0 -g3 -Wall -c -fmessage-length=0 -o FactoryConfig.o FactoryConfig.c 
+	$(CC) -o FactoryConfig FactoryConfig.o 
+	cp -f FactoryConfig ../Images/root
+
 OtherTools:
 	cp -f init.sh ../Images/root
 	cp -f kill.sh ../Images/root

+ 289 - 5
EVSE/Projects/DS60-120/Apps/Module_EvComm.c

@@ -50,8 +50,8 @@ struct CcsData					*ShmCcsData;
 byte gun_count = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
 int chargingTime[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 
-float maxChargingVol = 5000;			// 限制最大充電電壓,如依照模塊則填上 0
-float maxChargingCur = 100;				// 限制最大充電電流,如依照模塊則填上 0
+float maxChargingVol = 6000;			// 限制最大充電電壓,如依照模塊則填上 0
+float maxChargingCur = 1200;				// 限制最大充電電流,如依照模塊則填上 0
 
 // 槍資訊
 struct ChargingInfoData *_chargingData[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
@@ -359,7 +359,7 @@ void AddrAssignment(byte *data)
 	}
 }
 
-void ClearAbnormalStatus_Chadmoe(byte gun_index)
+void ClearAbnormalStatus_Chademo(byte gun_index)
 {
 	int codeValue = 0;
 
@@ -411,6 +411,156 @@ void ClearAbnormalStatus_Chadmoe(byte gun_index)
 	ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = 0x00;
 }
 
+void ClearAbnormalStatus_CCS(byte gun_index)
+{
+	int codeValue = 0;
+
+	if (strlen((char *)ShmSysConfigAndInfo->SysStopChargingAlarmCode.StopCode[gun_index]) == 6)
+	{
+		codeValue = atoi((char *)ShmSysConfigAndInfo->SysStopChargingAlarmCode.StopCode[gun_index]);
+
+		if (codeValue >= 23737 && codeValue <= 23888)
+		{
+			memcpy(&ShmSysConfigAndInfo->SysStopChargingAlarmCode.StopCode[gun_index][0], "", 7);
+			ShmSysConfigAndInfo->SysStopChargingAlarmCode.Level = 0;
+		}
+	}
+
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = 0x00;
+	ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = 0x00;
+
+}
+
 void AbnormalStopAnalysis(byte gun_index, byte *errCode)
 {
 	char string[7];
@@ -463,6 +613,139 @@ void AbnormalStopAnalysis(byte gun_index, byte *errCode)
 	if (strcmp(string, "023734") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReqCurrentMoreThanLimit = 0x01;
 	if (strcmp(string, "023735") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoReCapBmsEqrCurrentExceed = 0x01;
 	if (strcmp(string, "023736") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.ChademoChargeRemainCountDown = 0x01;
+
+	if (strcmp(string, "23737") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsRESTemperatureInhibit = 0x01;
+	if (strcmp(string, "23738") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVShiftPosition = 0x01;
+	if (strcmp(string, "23739") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargerConnectorLockFault = 0x01;
+	if (strcmp(string, "23740") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVRESSMalfunction = 0x01;
+	if (strcmp(string, "23741") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingCurrentdifferential = 0x01;
+	if (strcmp(string, "23742") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingVoltageOutOfRange = 0x01;
+	if (strcmp(string, "23743") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingSystemIncompatibility = 0x01;
+	if (strcmp(string, "23744") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEmergencyEvent = 0x01;
+	if (strcmp(string, "23745") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsBreaker = 0x01;
+	if (strcmp(string, "23746") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoData = 0x01;
+	if (strcmp(string, "23747") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_A = 0x01;
+	if (strcmp(string, "23748") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_B = 0x01;
+	if (strcmp(string, "23749") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_DIN_C = 0x01;
+	if (strcmp(string, "23750") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_1 = 0x01;
+	if (strcmp(string, "23751") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_2 = 0x01;
+	if (strcmp(string, "23752") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_ISO_3 = 0x01;
+	if (strcmp(string, "23753") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_1 = 0x01;
+	if (strcmp(string, "23754") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_2 = 0x01;
+	if (strcmp(string, "23755") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_3 = 0x01;
+	if (strcmp(string, "23756") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_4 = 0x01;
+	if (strcmp(string, "23757") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.Ccsreserved_by_OEM_5 = 0x01;
+	if (strcmp(string, "23758") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequenceError = 0x01;
+	if (strcmp(string, "23759") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSignatureError = 0x01;
+	if (strcmp(string, "23760") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUnknownSession = 0x01;
+	if (strcmp(string, "23761") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceIDInvalid = 0x01;
+	if (strcmp(string, "23762") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPaymentSelectionInvalid = 0x01;
+	if (strcmp(string, "23763") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsIdentificationSelectionInvalid = 0x01;
+	if (strcmp(string, "23764") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceSelectionInvalid = 0x01;
+	if (strcmp(string, "23765") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateExpired = 0x01;
+	if (strcmp(string, "23766") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotYetValid = 0x01;
+	if (strcmp(string, "23767") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateRevoked = 0x01;
+	if (strcmp(string, "23768") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoCertificateAvailable = 0x01;
+	if (strcmp(string, "23769") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertChainError = 0x01;
+	if (strcmp(string, "23770") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertValidationError = 0x01;
+	if (strcmp(string, "23771") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertVerificationError = 0x01;
+	if (strcmp(string, "23772") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractCanceled = 0x01;
+	if (strcmp(string, "23773") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChallengeInvalid = 0x01;
+	if (strcmp(string, "23774") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongEnergyTransferMode = 0x01;
+	if (strcmp(string, "23775") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWrongChargeParameter = 0x01;
+	if (strcmp(string, "23776") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargingProfileInvalid = 0x01;
+	if (strcmp(string, "23777") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTariffSelectionInvalid = 0x01;
+	if (strcmp(string, "23778") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEPresentVoltageToLow = 0x01;
+	if (strcmp(string, "23779") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryNotApplied = 0x01;
+	if (strcmp(string, "23780") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMeteringSignatureNotValid = 0x01;
+	if (strcmp(string, "23781") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoChargeServiceSelected = 0x01;
+	if (strcmp(string, "23782") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContactorError = 0x01;
+	if (strcmp(string, "23783") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCertificateNotAllowedAtThisEVSE = 0x01;
+	if (strcmp(string, "23784") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsGAChargeStop = 0x01;
+	if (strcmp(string, "23785") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAlignmentError = 0x01;
+	if (strcmp(string, "23786") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsACDError = 0x01;
+	if (strcmp(string, "23787") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsAssociationError = 0x01;
+	if (strcmp(string, "23788") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsEVSEChargeAbort = 0x01;
+	if (strcmp(string, "23789") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsNoSupportedAppProtocol = 0x01;
+	if (strcmp(string, "23790") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractNotAccepted = 0x01;
+	if (strcmp(string, "23791") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMOUnknown = 0x01;
+	if (strcmp(string, "23792") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_Prov_CertificateRevoke = 0x01;
+	if (strcmp(string, "23793") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA1_CertificateRevoked = 0x01;
+	if (strcmp(string, "23794") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_SubCA2_CertificateRevoked = 0x01;
+	if (strcmp(string, "23795") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsOEM_RootCA_CertificateRevoked = 0x01;
+	if (strcmp(string, "23796") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_Prov_CertificateRevoked = 0x01;
+	if (strcmp(string, "23797") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA1_CertificateRevoked = 0x01;
+	if (strcmp(string, "23798") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_SubCA2_CertificateRevoked = 0x01;
+	if (strcmp(string, "23799") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMO_RootCA_CertificateRevoked = 0x01;
+	if (strcmp(string, "23800") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_Prov_CertificateRevoked = 0x01;
+	if (strcmp(string, "23801") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA1_CertificateRevoked = 0x01;
+	if (strcmp(string, "23802") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_SubCA2_CertificateRevoked = 0x01;
+	if (strcmp(string, "23803") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPS_RootCA_CertificateRevoked = 0x01;
+	if (strcmp(string, "23809") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_SLAC_init = 0x01;
+	if (strcmp(string, "23810") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_match_response = 0x01;
+	if (strcmp(string, "23811") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_sequence = 0x01;
+	if (strcmp(string, "23812") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_match_MNBC = 0x01;
+	if (strcmp(string, "23813") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_avg_atten_calc = 0x01;
+	if (strcmp(string, "23814") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_match_response = 0x01;
+	if (strcmp(string, "23815") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_match_session = 0x01;
+	if (strcmp(string, "23816") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_assoc_session = 0x01;
+	if (strcmp(string, "23817") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_vald_toggle = 0x01;
+	if (strcmp(string, "23823") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsUDP_TT_match_join = 0x01;
+	if (strcmp(string, "23824") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTCP_TT_match_join = 0x01;
+	if (strcmp(string, "23825") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_amp_map_exchange = 0x01;
+	if (strcmp(string, "23826") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_link_ready_notification = 0x01;
+	if (strcmp(string, "23832") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSupportedAppProtocolRes = 0x01;
+	if (strcmp(string, "23833") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionSetupRes = 0x01;
+	if (strcmp(string, "23834") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServiceDiscoveryRes = 0x01;
+	if (strcmp(string, "23835") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsServicePaymentSelectionRes = 0x01;
+	if (strcmp(string, "23836") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsContractAuthenticationRes = 0x01;
+	if (strcmp(string, "23837") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsChargeParameterDiscoveryRes = 0x01;
+	if (strcmp(string, "23838") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPowerDeliveryRes = 0x01;
+	if (strcmp(string, "23839") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheckRes = 0x01;
+	if (strcmp(string, "23840") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsPreChargeRes = 0x01;
+	if (strcmp(string, "23841") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCurrentDemandRes = 0x01;
+	if (strcmp(string, "23842") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsWeldingDetectionRes = 0x01;
+	if (strcmp(string, "23843") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSessionStopRes = 0x01;
+	if (strcmp(string, "23844") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsSequence_Time = 0x01;
+	if (strcmp(string, "23845") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsReadyToCharge_Performance_Time = 0x01;
+	if (strcmp(string, "23846") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCommunicationSetup_Performance_Time = 0x01;
+	if (strcmp(string, "23847") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCableCheck_Performance_Time = 0x01;
+	if (strcmp(string, "23848") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPState_Detection_Time = 0x01;
+	if (strcmp(string, "23849") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCPOscillator_Retain_Time = 0x01;
+	if (strcmp(string, "23855") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_TARGET_INFO = 0x01;
+	if (strcmp(string, "23856") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_TARGET_INFO = 0x01;
+	if (strcmp(string, "23857") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_EV_BATTERY_INFO = 0x01;
+	if (strcmp(string, "23858") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_EV_BATTERY_INFO = 0x01;
+	if (strcmp(string, "23859") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EV_STOP_EVENT = 0x01;
+	if (strcmp(string, "23860") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EV_STOP_EVENT = 0x01;
+	if (strcmp(string, "23861") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_STOP_EVENT = 0x01;
+	if (strcmp(string, "23862") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_STOP_EVENT = 0x01;
+	if (strcmp(string, "23863") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_GET_MISC_INFO = 0x01;
+	if (strcmp(string, "23864") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_GET_MISC_INFO = 0x01;
+	if (strcmp(string, "23865") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_REQUEST = 0x01;
+	if (strcmp(string, "23866") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_REQUEST = 0x01;
+	if (strcmp(string, "23867") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_START_BLOCK_TRANSFER = 0x01;
+	if (strcmp(string, "23868") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_START_BLOCK_TRANSFER = 0x01;
+	if (strcmp(string, "23869") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DATA_TRANSFER = 0x01;
+	if (strcmp(string, "23870") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DATA_TRANSFER = 0x01;
+	if (strcmp(string, "23871") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_DOWNLOAD_FINISH = 0x01;
+	if (strcmp(string, "23872") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_DOWNLOAD_FINISH = 0x01;
+	if (strcmp(string, "23873") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_ISOLATION_STATUS = 0x01;
+	if (strcmp(string, "23874") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_ISOLATION_STATUS = 0x01;
+	if (strcmp(string, "23875") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_CONNECTOR_INFO = 0x01;
+	if (strcmp(string, "23876") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_CONNECTOR_INFO = 0x01;
+	if (strcmp(string, "23877") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_RTC_INFO = 0x01;
+	if (strcmp(string, "23878") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_RTC_INFO = 0x01;
+	if (strcmp(string, "23879") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTP_EVSE_PRECHARGE_INFO = 0x01;
+	if (strcmp(string, "23880") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsTT_EVSE_PRECHARGE_INFO = 0x01;
+	if (strcmp(string, "23881") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsMSG_Sequence = 0x01;
+	if (strcmp(string, "23882") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsCAN_MSG_Unrecognized_CMD_ID = 0x01;
+	if (strcmp(string, "23883") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Decode_Error = 0x01;
+	if (strcmp(string, "23884") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsDIN_Msg_Encode_Error = 0x01;
+	if (strcmp(string, "23885") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Decode_Error = 0x01;
+	if (strcmp(string, "23886") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO1_Msg_Encode_Error = 0x01;
+	if (strcmp(string, "23887") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Decode_Error = 0x01;
+	if (strcmp(string, "23888") == 0) ShmStatusCodeData->InfoCode.InfoEvents.bits.CcsISO2_Msg_Encode_Error = 0x01;
 }
 
 void CANReceiver()
@@ -564,6 +847,7 @@ void CANReceiver()
 						{
 							memcpy(ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version, frame.data, ARRAY_SIZE(frame.data));
 							ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].SelfTest_Comp = PASS;
+							//printf("chademo ver. : %s\n", ShmCHAdeMOData->evse[_chargingData[targetGun]->type_index].version);
 						}
 						else if (_chargingData[targetGun]->Type == _Type_CCS)
 						{
@@ -886,11 +1170,11 @@ int main(int argc, char *argv[])
 
 					if (_chargingData[_index]->Type == _Type_Chademo)
 					{
-						ClearAbnormalStatus_Chadmoe(_index);
+						ClearAbnormalStatus_Chademo(_index);
 					}
 					else if (_chargingData[_index]->Type == _Type_CCS)
 					{
-
+						ClearAbnormalStatus_CCS(_index);
 					}
 					break;
 				case S_PREPARING_FOR_EV:

+ 19 - 55
EVSE/Projects/DS60-120/Apps/Module_InternalComm.c

@@ -155,23 +155,6 @@ unsigned short MaxValue(unsigned short value1, unsigned short value2)
 //==========================================
 // Communication Function
 //==========================================
-void GetFwAndHwVersion_Aux()
-{
-	if (Query_FW_Ver(Uart5Fd, Addr.Aux, &ver) == PASS)
-	{
-		// SystemInfo
-		strcpy((char *) ShmSysConfigAndInfo->SysInfo.AuxPwrFwRev, ver.Version_FW);
-		printf("s1 = %s \n", ver.Version_FW);
-	}
-
-	if (Query_HW_Ver(Uart5Fd, Addr.Aux, &ver) == PASS)
-	{
-		// SystemInfo
-		strcpy((char *) ShmSysConfigAndInfo->SysInfo.AuxPwrHwRev, ver.Version_HW);
-		printf("s2 = %s \n", ver.Version_HW);
-	}
-}
-
 void GetFwAndHwVersion_Fan()
 {
 	if(Query_FW_Ver(Uart5Fd, Addr.Fan, &ver) == PASS)
@@ -210,44 +193,11 @@ void GetFwAndHwVersion_Relay()
 	}
 }
 
-void GetTemperature_Aux()
+void SetModelName_Fan()
 {
-	memset(temperature.temperature, 0, ARRAY_SIZE(temperature.temperature));
-	if (Query_Temperature(Uart5Fd, Addr.Aux, &temperature) == PASS)
+	if (Config_Model_Name(Uart5Fd, Addr.Fan, ShmSysConfigAndInfo->SysConfig.ModelName) == PASS)
 	{
-		// aux temp
-		// UI ¹ê»ÚÅã¥Ü·Å«×Âà´«
-		//char s[4];
-		//sprintf(s,"%d",(-60 + temperature[2].temperature[4])),
-		//printf("s = %s \n",s);
-
-		printf("Aux temp = %d,%d,%d,%d,%d,%d,%d,%d \n",
-				(-60 + temperature.temperature[0]),
-				(-60 + temperature.temperature[1]),
-				(-60 + temperature.temperature[2]),
-				(-60 + temperature.temperature[3]),
-				(-60 + temperature.temperature[4]),
-				(-60 + temperature.temperature[5]),
-				(-60 + temperature.temperature[6]),
-				(-60 + temperature.temperature[7]));
-	}
-}
-
-void GetTemperature_Relay()
-{
-	memset(temperature.temperature, 0, ARRAY_SIZE(temperature.temperature));
-	if (Query_Temperature(Uart5Fd, Addr.Relay, &temperature) == PASS)
-	{
-		// relay temp
-		printf("Relay temp = %d,%d,%d,%d,%d,%d,%d,%d \n",
-				(-60 + temperature.temperature[0]),
-				(-60 + temperature.temperature[1]),
-				(-60 + temperature.temperature[2]),
-				(-60 + temperature.temperature[3]),
-				(-60 + temperature.temperature[4]),
-				(-60 + temperature.temperature[5]),
-				(-60 + temperature.temperature[6]),
-				(-60 + temperature.temperature[7]));
+		printf("Set Model name PASS \n");
 	}
 }
 
@@ -528,8 +478,6 @@ void GetGpioInput()
 	if (Query_Gpio_Input(Uart5Fd, Addr.Aux, &gpio_in) == PASS)
 	{
 		// AC Contactor Status
-		//ShmSysConfigAndInfo->SysInfo.AcContactorStatus = gpio_in.AC_Connector;
-
 		if (gpio_in.AC_MainBreaker == 1)
 		{
 			// AC Main Breaker ON
@@ -1178,6 +1126,18 @@ void CableCheckDetected(byte index)
 	}
 }
 
+void CheckOutputPowerOverCarReq(byte index)
+{
+	float fireV = _chargingData[index]->FireChargingVoltage;
+	float carV = _chargingData[index]->EvBatterytargetVoltage;
+
+	if (fireV >= (carV + (carV * 0.1)))
+	{
+		printf("[Module_InternalComm]CheckOutputPowerOverCarReq NG \n");
+		_chargingData[index]->StopChargeFlag = YES;
+	}
+}
+
 int main(void)
 {
 	if(InitShareMemory() == FAIL)
@@ -1227,6 +1187,7 @@ int main(void)
 		if (ShmFanModuleData->SelfTest_Comp == NO)
 		{
 			//GetFwAndHwVersion_Fan();
+			SetModelName_Fan();
 			sleep(1);
 		}
 
@@ -1262,6 +1223,9 @@ int main(void)
 				{
 					_chargingData[i]->IsReadyToCharging = YES;
 					isCharging = true;
+
+					if (_chargingData[i]->SystemStatus == S_CHARGING)
+						CheckOutputPowerOverCarReq(i);
 				}
 				else
 					_chargingData[i]->IsReadyToCharging = NO;

+ 5 - 1
EVSE/Projects/DS60-120/Apps/Module_PrimaryComm.c

@@ -35,6 +35,8 @@
 #define ARRAY_SIZE(A)		(sizeof(A) / sizeof(A[0]))
 #define PASS				1
 #define FAIL				-1
+#define YES					1
+#define NO					0
 
 typedef unsigned char 		byte;
 
@@ -249,6 +251,8 @@ void GetInputGpioStatus()
 		//printf("left = %d \n", ShmPrimaryMcuData->InputDet.bits.Button1);
 		//printf("right = %d \n", ShmPrimaryMcuData->InputDet.bits.Button2);
 		//printf("ShmSysConfigAndInfo->SysInfo.AcContactorStatus = %d \n", ShmSysConfigAndInfo->SysInfo.AcContactorStatus);
+		if (ShmPrimaryMcuData->InputDet.bits.AcMainBreakerDetec == YES)
+			DEBUG_ERROR("AC Mainbreaker occur. \n");
 	}
 }
 
@@ -311,7 +315,7 @@ int main(void)
 		#endif
 		if(ShmStatusCodeData!=NULL)
 		{
-			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
+			ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory = 1;
 		}
 		sleep(5);
 		return 0;

+ 13 - 9
EVSE/Projects/DS60-120/Apps/Module_PsuComm.c

@@ -812,24 +812,28 @@ int main(void)
 			{
 				if (priorityLow == 1)
 				{
-					for (byte psuIndex = 0;	psuIndex < ShmPsuData->PsuGroup[0].GroupPresentPsuQuantity;	psuIndex++)
+					byte targetGp = 0;
+					if (ShmSysConfigAndInfo->SysInfo.BootingStatus != BOOTTING)
+						targetGp = ShmSysConfigAndInfo->SysInfo.CurGunSelected;
+
+					for (byte psuIndex = 0;	psuIndex < ShmPsuData->PsuGroup[targetGp].GroupPresentPsuQuantity;	psuIndex++)
 					{
-						if (ShmPsuData->PsuGroup[0].PsuModule[psuIndex].Address == NONE_CARE_ADDRESS)
+						if (ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].Address == NONE_CARE_ADDRESS)
 							continue;
 
-						GetStatus(0, ShmPsuData->PsuGroup[0].PsuModule[psuIndex].Address);
+						GetStatus(targetGp, ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].Address);
 						usleep(cmdDelayTime);
-						if (strlen((char *)ShmPsuData->PsuGroup[0].PsuModule[psuIndex].FwVersion) == 0 &&
-								ShmPsuData->PsuGroup[0].PsuModule[psuIndex].FwVersion[0] == '\0')
+						if (strlen((char *)ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].FwVersion) == 0 &&
+							ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].FwVersion[0] == '\0')
 						{
-							GetFwVersion(0, ShmPsuData->PsuGroup[0].PsuModule[psuIndex].Address, 0x02);
+							GetFwVersion(targetGp, ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].Address, 0x02);
 							usleep(cmdDelayTime);
 						}
 
-						if (strlen((char *)ShmPsuData->PsuGroup[0].PsuModule[psuIndex].SerialNumber) == 0 &&
-								ShmSysConfigAndInfo->SysInfo.RelayModuleFwRev[0] == '\0')
+						if (strlen((char *)ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].SerialNumber) == 0 &&
+								ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].SerialNumber[0] == '\0')
 						{
-							GetSerialNumber(0, ShmPsuData->PsuGroup[0].PsuModule[psuIndex].Address);
+							GetSerialNumber(targetGp, ShmPsuData->PsuGroup[targetGp].PsuModule[psuIndex].Address);
 							usleep(cmdDelayTime);
 						}
 					}

+ 41 - 1
EVSE/Projects/DS60-120/Apps/internalComm.c

@@ -39,7 +39,7 @@
 #define FAIL				-1
 
 struct Address Addr={0x01,0x02,0x03,0xFF};
-struct Command Cmd={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x81,0x85,0x86,0x87,0xe0,0xe1,0xe2,0xe3};
+struct Command Cmd={0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0a,0x81,0x83,0x85,0x86,0x87,0xe0,0xe1,0xe2,0xe3};
 
 int tranceive(int fd, unsigned char* cmd, unsigned char cmd_len, unsigned char* rx)
 {
@@ -606,6 +606,46 @@ unsigned char Config_Gfd_Value(unsigned char fd, unsigned char targetAddr, Gfd_c
 	return result;
 }
 
+unsigned char Config_Model_Name(unsigned char fd, unsigned char targetAddr, unsigned char *modelname)
+{
+	unsigned char result = FAIL;
+	unsigned char tx[21] = {0xaa, 0x00, targetAddr, Cmd.config_Model_Name, 0x0E, 0x00,
+			0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
+	unsigned char rx[512];
+	unsigned char chksum = 0x00;
+
+	memcpy(tx + 6, modelname, 14);
+
+	for(int idx = 0; idx<(tx[4] | tx[5]<<8);idx++)
+		chksum ^= tx[6+idx];
+	tx[20] = chksum;
+
+	unsigned char len = tranceive(fd, tx, sizeof(tx), rx);
+
+	if(len > 6)
+	{
+		if (len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
+		chksum = 0x00;
+		for(int idx = 0;idx<(rx[4] | rx[5]<<8);idx++)
+		{
+			chksum ^= rx[6+idx];
+		}
+
+		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
+			  (rx[2] == tx[1]) &&
+			  (rx[1] == tx[2]) &&
+			  (rx[3] == tx[3]) &&
+			  (rx[6] == tx[6]))
+		{
+			result = PASS;
+		}
+	}
+
+	return result;
+}
+
 unsigned char Update_Start(unsigned char fd, unsigned char targetAddr, unsigned int crc32)
 {
 	unsigned char result = FAIL;

+ 2 - 0
EVSE/Projects/DS60-120/Apps/internalComm.h

@@ -30,6 +30,7 @@ extern struct Command
 	unsigned char query_Gpio_In;				//0x0a
 
 	unsigned char config_Fan_Speed;			//0x81
+	unsigned char config_Model_Name;			//0x83
 	unsigned char config_Relay_Output;			//0x85
 	unsigned char config_Gpio_Output;			//0x86
 	unsigned char config_Gfd_Value;			//0x87
@@ -176,6 +177,7 @@ extern unsigned char Config_Fan_Speed(unsigned char fd, unsigned char targetAddr
 extern unsigned char Config_Relay_Output(unsigned char fd, unsigned char targetAddr, Relay *Set_Buf);
 extern unsigned char Config_Gpio_Output(unsigned char fd, unsigned char targetAddr, Gpio_out *Set_Buf);
 extern unsigned char Config_Gfd_Value(unsigned char fd, unsigned char targetAddr, Gfd_config *Set_Buf);
+extern unsigned char Config_Model_Name(unsigned char fd, unsigned char targetAddr, unsigned char *modelname);
 
 extern unsigned char Update_Start(unsigned char fd, unsigned char targetAddr, unsigned int crc32);
 extern unsigned char Update_Abord(unsigned char fd, unsigned char targetAddr);

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 329 - 208
EVSE/Projects/DS60-120/Apps/main.c


برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است