浏览代码

2020-01-20 / Kathy Yeh
1.mofiy Clear ChargingProfile error
2. mofigy update Firmwave thread & local location
3. modfiy define.h a. struct OCPP16Data size b. struct StructChargingSchedulePeriod type

Kathy_Yeh 5 年之前
父节点
当前提交
b1e1a2ea96
共有 2 个文件被更改,包括 149 次插入111 次删除
  1. 129 91
      EVSE/Modularization/ocppfiles/MessageHandler.c
  2. 20 20
      EVSE/Projects/define.h

+ 129 - 91
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -126,7 +126,7 @@ int OcppPort=0;
 //===============================
 int server_sign = FALSE;
 int server_pending = FALSE;
-int PRE_SYS_MODE[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+int PRE_SYS_MODE[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 int BootNotificationInterval = 0;
 static int SystemInitial = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;	// System Boot UP
 
@@ -149,7 +149,7 @@ static int DiagnosticsStatusNotificationStatus = 0; // Idle
 // OCPP status/previous related variables
 //========================================
 static int GunStatusInterval = 10;
-int statusModeChage[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY] = {FALSE};
+int statusModeChage[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY] = {FALSE};
 static int ChademoPreviousSystemStatus[CHAdeMO_QUANTITY];
 static int CcsPreviousSystemStatus[CCS_QUANTITY];
 static int GbPreviousSystemStatus[GB_QUANTITY];
@@ -204,24 +204,24 @@ struct StructOCPPMeterValue
 struct ClientTime
 {
 	unsigned int Heartbeat;
-	unsigned int StatusNotification[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+	unsigned int StatusNotification[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 	unsigned int StartTransaction;
 	unsigned int StopTransaction;
-	unsigned int MeterValues[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+	unsigned int MeterValues[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 
 }clientTime;
 
 typedef union
 {
 	//Operations Initiated by Central System
-	unsigned char CsMsgValue[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+	unsigned char CsMsgValue[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 	struct
 	{
 	//CsMsgValue[0]
 	unsigned char StatusNotificationReq :1;	//bit 0,
 	unsigned char StatusNotificationConf :1;	//bit 0,
 	unsigned char :6;	//bit 2~7
-	}bits[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+	}bits[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 }CpinitiateMsg;
 
 CpinitiateMsg cpinitateMsg;
@@ -936,6 +936,7 @@ struct StructConfigurationKey staticResponseConfigurationKeyArray[GetConfigurati
 struct StructConfigurationKeyItems staticResponseUnknownKey[10]={0};
 struct StructLocalAuthorizationList staticLocalAuthorizationList[500]={0};
 
+#if 0
 struct StructChargingSchedulePeriod staticCHAdeMOChargingSchedulePeriod[10]={0};
 struct StructChargingSchedulePeriod staticCCSChargingSchedulePeriod[10]={0};
 struct StructChargingSchedulePeriod staticGBChargingSchedulePeriod[10]={0};
@@ -950,18 +951,9 @@ struct StructChargingSchedulePeriod staticCHAdeMORemoteStartTransactionChargingS
 struct StructChargingSchedulePeriod staticCCSRemoteStartTransactionChargingSchedulePeriod[10]={0};
 struct StructChargingSchedulePeriod staticGBRemoteStartTransactionChargingSchedulePeriod[10]={0};
 struct StructChargingSchedulePeriod staticACRemoteStartTransactionChargingSchedulePeriod[10]={0};
+#endif
 
 
-struct StructOCPPMeterValue staticCHAdeMOTransactionDataForMeterValueRequest={0};
-struct StructOCPPMeterValue staticCCSTransactionDataForMeterValueRequest={0};
-struct StructOCPPMeterValue staticGBTransactionDataForMeterValueRequest={0};
-struct StructOCPPMeterValue staticACTransactionDataForMeterValueRequest={0};
-
-struct StructOCPPMeterValue staticCHAdeMOTransactionDataForStopTransactionRequest[0];
-struct StructOCPPMeterValue staticCCSTransactionDataForStopTransactionRequest[0];
-struct StructOCPPMeterValue staticGBTransactionDataForStopTransactionRequest[0];
-struct StructOCPPMeterValue staticACTransactionDataForStopTransactionRequest[0];
-
 //==========================================
 // Init all share memory
 //==========================================
@@ -1053,7 +1045,7 @@ int InitShareMemory()
 
    	gunTotalNumber = (strstr((const char *)ShmSysConfigAndInfo->SysConfig.ModelName ,"DC") != NULL) ? (CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY): AC_QUANTITY;
 
-	memset(ShmOCPP16Data->StatusNotification,0,sizeof(struct StructStatusNotification)*gunTotalNumber/*(CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY)*/);
+	memset(ShmOCPP16Data->StatusNotification,0,sizeof(struct StructStatusNotification)*(CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY));
 
 	for(int gun_index=0; gun_index < gunTotalNumber/*(CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY)*/; gun_index++ )
 	{
@@ -1092,6 +1084,7 @@ int InitShareMemory()
 
 	if(strstr((const char *)ShmSysConfigAndInfo->SysConfig.ModelName ,"DC") != NULL)
 	{
+#if 0
 		if(CHAdeMO_QUANTITY != 0)
 		{
 			int index = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[0].Index;
@@ -1121,13 +1114,14 @@ int InitShareMemory()
 			//ShmOCPP16Data->StopTransaction[index].TransactionData = (struct StructMeterValue *)&staticGBTransactionDataForStopTransactionRequest;
 			//ShmOCPP16Data->StopTransaction[index].TransactionData[0].SampledValue = staticGBTransactionDataForStopTransactionRequest[0].SampledValue;
 		}
-
+#endif
 		SystemInitial = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;
 		DEBUG_INFO("DC ...\n");
 	}
 	else
 	{
-		if(AC_QUANTITY)
+#if 0
+		if(AC_QUANTITY != 0)
 		{
 			int index = ShmSysConfigAndInfo->SysInfo.AcChargingData[0].Index;
 			ShmOCPP16Data->SetChargingProfile[index].ChargingProfile.ChargingSchedule.ChargingSchedulePeriod = staticACChargingSchedulePeriod;
@@ -1136,7 +1130,7 @@ int InitShareMemory()
 			//ShmOCPP16Data->StopTransaction[index].TransactionData = (struct StructMeterValue *)&staticACTransactionDataForStopTransactionRequest;
 			//ShmOCPP16Data->StopTransaction[index].TransactionData[0].SampledValue = staticACTransactionDataForStopTransactionRequest[0].SampledValue;
 		}
-
+#endif
 		SystemInitial = AC_QUANTITY;
 		DEBUG_INFO("AC ...\n");
 
@@ -1234,7 +1228,7 @@ int ProcessShareMemory()
 
 void CheckSystemValue(void)
 {
-	int meterValueSend[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY]={0};
+	int meterValueSend[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY]={0};
 	int IdleModeCnt = 0;
 	char filenmae[100]={0};
 	char str[100]={0};
@@ -1381,6 +1375,9 @@ void CheckSystemValue(void)
 			clientTime.StopTransaction = time((time_t*)NULL);
 		}
 
+
+		//DEBUG_INFO("ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus=%d\n",ShmSysConfigAndInfo->SysInfo.AcChargingData[0].SystemStatus);
+
 		//==============================================
 		// Charger status report
 		//==============================================
@@ -4481,6 +4478,8 @@ int handleClearChargingProfileRequest(char *uuid, char *payload)
 	int clearflag = FALSE;
 	int chargingProfileIdIsNULL = FALSE;
 	int connectorIsNULL = FALSE;
+	int chargingProfilePurposeIsNULL = FALSE;
+	int stackLevelIsNULL = FALSE;
 	FILE *fptr1, *fptr2;
 	char temp[] = "../Storage/OCPP/ClearChargingProfiletemp.json";
     int n_chargingProfile=0;
@@ -4497,15 +4496,17 @@ int handleClearChargingProfileRequest(char *uuid, char *payload)
 	{
 		chargingProfileIdIsNULL = TRUE;
 	}
-
-	while ((loc != NULL) &&(loc[strlen("id")+2+c] != ',') )
+	else
 	{
-		sstr[c] = loc[strlen("id")+2+c];
-		//printf("i=%d sstr=%c\n",c, sstr[c]);
-		c++;
+		while ((loc != NULL) &&((loc[strlen("id")+2+c] != ',')&& (loc[strlen("id")+2+c] != '}')))
+		{
+			sstr[c] = loc[strlen("id")+2+c];
+			//printf("i=%d sstr=%c\n",c, sstr[c]);
+			c++;
+		}
+		sstr[c] = '\0';
+		chargingProfileIdInt = atoi(sstr);
 	}
-	sstr[c] = '\0';
-	chargingProfileIdInt = atoi(sstr);
 
 	//***connectorId ****/
 	c=0;
@@ -4516,80 +4517,97 @@ int handleClearChargingProfileRequest(char *uuid, char *payload)
 	{
 		connectorIsNULL = TRUE;
 	}
-
-	while ((loc != NULL) &&(loc[strlen("connectorId")+2+c] != ','))
+	else
 	{
-		sstr[c] = loc[strlen("connectorId")+2+c];
-		//printf("i=%d sstr=%c\n",c, sstr[c]);
-		c++;
-	}
-
-	sstr[c] = '\0';
-    connectorIdInt = atoi(sstr);
+		while ((loc != NULL) &&((loc[strlen("connectorId")+2+c] != ',')&&(loc[strlen("connectorId")+2+c] != '}')))
+		{
+			sstr[c] = loc[strlen("connectorId")+2+c];
+			//printf("i=%d sstr=%c\n",c, sstr[c]);
+			c++;
+		}
 
+		sstr[c] = '\0';
+		connectorIdInt = atoi(sstr);
+	}
 
     //***chargingProfilePurpose ****/
     loc = strstr(payload, "chargingProfilePurpose");
 	memset(sstr ,0, sizeof(sstr) );
 	c = 0;
-	while ((loc != NULL) &&(loc[3+strlen("chargingProfilePurpose")+c] != '\"'))
+
+	if(loc == NULL)
 	{
-		sstr[c] = loc[3+strlen("chargingProfilePurpose")+c];
-		c++;
+		chargingProfilePurposeIsNULL = TRUE;
+	}
+	else
+	{
+		while ((loc != NULL) &&(loc[3+strlen("chargingProfilePurpose")+c] != '\"'))
+		{
+			sstr[c] = loc[3+strlen("chargingProfilePurpose")+c];
+			c++;
+		}
+		sstr[c] = '\0';
+		strcpy(chargingProfilePurposeStr, sstr);
 	}
-	sstr[c] = '\0';
-	strcpy(chargingProfilePurposeStr, sstr);
-
 
 	//***stackLevel ****/
 	c=0;
 	loc = strstr(payload, "stackLevel");
 	memset(sstr ,0, sizeof(sstr) );
-	while ((loc != NULL) &&((loc[strlen("stackLevel")+2+c] != '}') && (loc[strlen("stackLevel")+2+c] != ',')))
+
+	if(loc == NULL)
 	{
-		sstr[c] = loc[strlen("stackLevel")+2+c];
-		//printf("i=%d sstr=%c\n",c, sstr[c]);
-		c++;
+		stackLevelIsNULL = TRUE;
+	}
+	else
+	{
+		while ((loc != NULL) &&((loc[strlen("stackLevel")+2+c] != '}') && (loc[strlen("stackLevel")+2+c] != ',')))
+		{
+			sstr[c] = loc[strlen("stackLevel")+2+c];
+			//printf("i=%d sstr=%c\n",c, sstr[c]);
+			c++;
+		}
+		sstr[c] = '\0';
+		stackLevelInt = atoi(sstr);
 	}
-	sstr[c] = '\0';
-	stackLevelInt = atoi(sstr);
 
 	if(connectorIsNULL == FALSE)
 	{
 		switch(connectorIdInt)
 		{
 			case 0:
-				if(strcmp(chargingProfilePurposeStr,"ChargePointMaxProfile")==0)
+
+				if((chargingProfilePurposeIsNULL == TRUE)||((chargingProfilePurposeIsNULL == FALSE)&&(strcmp(chargingProfilePurposeStr,"ChargePointMaxProfile")==0)))
 				{
 					strcpy(fname, ChargePointMaxProfile_JSON);
 				}
-				else
-				{
-					strcpy(fname, TxDefaultProfile_0_JSON);
-				}
+		//		else
+		//		{
+		//			strcpy(fname, TxDefaultProfile_0_JSON);
+		//		}
 
 				break;
 
 			case 1:
-				if(strcmp(chargingProfilePurposeStr,"TxDefaultProfile")==0)
+				if((chargingProfilePurposeIsNULL == TRUE)||((chargingProfilePurposeIsNULL == FALSE)&&(strcmp(chargingProfilePurposeStr,"TxDefaultProfile")==0)))
 				{
 					strcpy(fname, TxDefaultProfile_1_JSON);
 				}
-				else
-				{
-					strcpy(fname, TxProfile_1_JSON);
-				}
+		//		else
+		//		{
+		//			strcpy(fname, TxProfile_1_JSON);
+		//		}
 				break;
 
 			case 2:
-				if(strcmp(chargingProfilePurposeStr,"TxDefaultProfile")==0)
+				if((chargingProfilePurposeIsNULL == TRUE)||((chargingProfilePurposeIsNULL == FALSE)&&(strcmp(chargingProfilePurposeStr,"TxDefaultProfile")==0)))
 				{
 					strcpy(fname, TxDefaultProfile_2_JSON);
 				}
-				else
-				{
-					strcpy(fname, TxProfile_2_JSON);
-				}
+		//		else
+		//		{
+		//			strcpy(fname, TxProfile_2_JSON);
+		//		}
 				break;
 
 			default:
@@ -4644,11 +4662,11 @@ int handleClearChargingProfileRequest(char *uuid, char *payload)
 		fptr2 = fopen(temp, "w+");
 		while(fscanf(fptr1, "%s", word) != EOF)
 		{
-			DEBUG_INFO("word=%s\n",word);
+			//DEBUG_INFO("word=%s\n",word);
 			if(strcmp(word, "chargingProfileId") == 0)
 			{
 				n_chargingProfile = n_chargingProfile + 1;
-				printf("Found\n");
+				DEBUG_INFO("chargingProfileId Found\n");
 			}
 		}
 		rewind(fptr1);
@@ -4709,34 +4727,46 @@ int handleClearChargingProfileRequest(char *uuid, char *payload)
 
 			if(chargingProfileIdIsNULL == FALSE)
 			{
-				DEBUG_INFO("\n OCPP clear 0 !!!\n");
 				if(tempchargingProfileIdInt == chargingProfileIdInt)
 				{
-					DEBUG_INFO("\n OCPP clear 0-1 !!!\n");
+					//DEBUG_INFO("\n OCPP clear 0-1 !!!\n");
 					sprintf(comfirmstr, "%s", ClearChargingProfileStatusStr[ClearChargingProfileStatus_Accepted] );
 					clearflag = TRUE;
-					break;//continue;
+					continue;
 				}
 				else
 				{
-					DEBUG_INFO("\n OCPP clear 0-2 !!!\n");
+					//DEBUG_INFO("\n OCPP clear 0-2 !!!\n");
 					//json_object_array_add(newHeatMap, jsonitem);
 					fprintf(fptr2, sLineWord);//writing data into file
 				}
 			}
 			else
 			{
-				if((connectorIsNULL == FALSE) && (connectorIdInt != 0) && ( connectorIdInt == tempconnectorIdInt) && (tempstackLevelInt == stackLevelInt))
+				if((connectorIsNULL == FALSE) && (connectorIdInt != 0) && ( connectorIdInt == tempconnectorIdInt))
 				{
-					sprintf(comfirmstr, "%s", ClearChargingProfileStatusStr[ClearChargingProfileStatus_Accepted] );
-					clearflag = TRUE;
-					break;//continue;
+					if((stackLevelIsNULL == TRUE)||((stackLevelIsNULL == FALSE)&& (tempstackLevelInt == stackLevelInt)))
+					{
+						sprintf(comfirmstr, "%s", ClearChargingProfileStatusStr[ClearChargingProfileStatus_Accepted] );
+						clearflag = TRUE;
+						continue;
+					}
+
 				}
 				else if((connectorIsNULL == TRUE) && ((tempstackLevelInt == stackLevelInt) || (strcmp(tempchargingProfilePurposeStr, chargingProfilePurposeStr) == 0)))
 				{
-					sprintf(comfirmstr, "%s", ClearChargingProfileStatusStr[ClearChargingProfileStatus_Accepted] );
-					clearflag = TRUE;
-					break;//continue;
+					if((stackLevelIsNULL == FALSE)|| (chargingProfilePurposeIsNULL == FALSE))
+					{
+						if( ((stackLevelIsNULL == FALSE) &&(tempstackLevelInt == stackLevelInt)) ||
+							((chargingProfilePurposeIsNULL == FALSE)&&(strcmp(tempchargingProfilePurposeStr, chargingProfilePurposeStr) == 0)) )
+						{
+							sprintf(comfirmstr, "%s", ClearChargingProfileStatusStr[ClearChargingProfileStatus_Accepted] );
+							clearflag = TRUE;
+							continue;
+						}
+
+					}
+
 				}
 				else
 				{
@@ -9040,6 +9070,7 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
 	DEBUG_INFO("d:%d\n",d);
 	rewind(infile);
 
+	//*检测到文件结�标识返回1,�则返回0。*/
 	if(d == EOF)
 	{
 		DEBUG_INFO("ChargingProfile content is  NULL\n");
@@ -9466,7 +9497,8 @@ int handleUpdateFirmwareRequest(char *uuid, char *payload)
 
 	sendUpdateFirmwareConfirmation(uuid);
 	pthread_create(&t, NULL, UpdateFirmwareProcess, payload);
-	pthread_join(t, NULL); // 等�?�執行�??��?完�?
+	////pthread_join(t, NULL); //
+	pthread_detach(t);
 
 	//sendUpdateFirmwareConfirmation(uuid);
 	ShmOCPP16Data->MsMsg.bits.UpdateFirmwareConf =1;
@@ -9847,6 +9879,7 @@ void handleAuthorizeResponse(char *payload, int gun_index)
 		infile = fopen (filename, "r");
 		outfile = fopen (tempfile, "w");
 
+		//*检测到文件结�标识返回1,�则返回0。*/
 		//DEBUG_INFO("feof(infile) =%d\n",feof(infile));
 		int c;
 		c = fgetc(infile);
@@ -12269,15 +12302,18 @@ int ParseHeader(int sock){
 int httpDownLoadFile(char *location, char *path, char *filename,char *url)
 {
 	char rmFileCmd[100]={0};
+    char FilePath[100]={0};
 	char ftpbuf[200];
 	int systemresult;
 
 	DEBUG_INFO("filename=%s\n",filename);
 	DEBUG_INFO("url=%s\n",url);
-	if((access(filename,F_OK))!=-1)
+	sprintf(FilePath,"../mnt/%s",filename);
+
+	if((access(FilePath,F_OK))!=-1)
 	{
-		DEBUG_INFO("filename=%s exist.\n",filename);
-		sprintf(rmFileCmd,"rm -f %s",filename);
+		DEBUG_INFO("filename=%s exist.\n",FilePath);
+		sprintf(rmFileCmd,"rm -f %s",FilePath);
 		system(rmFileCmd);
 	}
 	memset(ftpbuf, 0, sizeof(ftpbuf));
@@ -12298,6 +12334,7 @@ int httpDownLoadFile(char *location, char *path, char *filename,char *url)
 int ftpDownLoadFile(char *location, char *user, char *password, int port, char *path, char *filename,char *url)
 {
 	char rmFileCmd[100]={0};
+	char FilePath[100]={0};
 	char ftpbuf[200];
 	int systemresult;
 	//char temp[100];
@@ -12311,11 +12348,12 @@ int ftpDownLoadFile(char *location, char *user, char *password, int port, char *
 	IPbuffer = inet_ntoa(*((struct in_addr*)
 				 	 server->h_addr_list[0]));
 #endif
+	sprintf(FilePath,"../mnt/%s",filename);
 
-	if((access(filename,F_OK))!=-1)
+	if((access(FilePath,F_OK))!=-1)
 	{
-		DEBUG_INFO("filename=%s exist.\n",filename);
-		sprintf(rmFileCmd,"rm -f %s",filename);
+		DEBUG_INFO("filename=%s exist.\n",FilePath);
+		sprintf(rmFileCmd,"rm -f %s",FilePath);
 		system(rmFileCmd);
 	}
 
@@ -12563,15 +12601,15 @@ static int deleteIdTagcallback(void *data, int argc, char **argv, char **azColNa
    return 0;
 }
 
-/** sqlite3_exec?„å?è°ƒã€?
+/** sqlite3_exec的回调。
  *
- *  ?‘控?¶å�°?“å�°?¥è¯¢?„ç??œã€?
+ *  �控制�打�查询的结果。
  *
- *  @param in data 传递ç??žè??½æ•°?„æ•°?®ã€?
- *  @param in n_columns sqlite3_exec?§è?结æ??†ä¸­?—ç??°é???
- *  @param in col_values sqlite3_exec?§è?结æ??†ä¸­æ¯�ä??—ç??°æ�®??
- *  @param in col_names sqlite3_exec?§è?结æ??†ä¸­æ¯�ä??—ç??�称??
- *  @return ?¶æ€�ç???
+ *  @param in data 传递给回调函数的数�。
+ *  @param in n_columns sqlite3_exec执行结果集中列的数�。
+ *  @param in col_values sqlite3_exec执行结果集中�一列的数�。
+ *  @param in col_names sqlite3_exec执行结果集中�一列的�称。
+ *  @return 状��。
  */
 int sqlite3_exec_callback(void *data, int n_columns, char **col_values, char **col_names)
 {

+ 20 - 20
EVSE/Projects/define.h

@@ -3006,7 +3006,7 @@ struct StructChargingSchedule
 	int											Duration;
 	unsigned char 								StartSchedule[28];
 	unsigned char 								ChargingRateUnit[4];		//A, W
-	struct StructChargingSchedulePeriod			*ChargingSchedulePeriod;
+	struct StructChargingSchedulePeriod			ChargingSchedulePeriod[10];
 	float 										MinChargingRate;			//0.1;
 };
 struct StructChargingProfile
@@ -3296,7 +3296,7 @@ struct OCPP16Data
 		union
 		{
 			//Operations Initiated by Charge Point
-			unsigned char CpMsgValue[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+			unsigned char CpMsgValue[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 			struct
 			{
 				//CpMsgValue[0]
@@ -3307,7 +3307,7 @@ struct OCPP16Data
 				unsigned char StopTransactionReq:1;	//bit 4,
 				unsigned char StopTransactionConf:1;	//bit 5,
 				unsigned char :2;	//bit 6,7 , reserved
-			} bits[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+			} bits[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 		}CpMsg;
 
 		union
@@ -3331,7 +3331,7 @@ struct OCPP16Data
 		union
 		{
 			//Operations Initiated by Central System
-			unsigned char CsMsgValue[3 * (CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY)];
+			unsigned char CsMsgValue[3 * (CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY)];
 			struct
 			{
 				//CsMsgValue[0]
@@ -3360,7 +3360,7 @@ struct OCPP16Data
 				unsigned char GetCompositeScheduleReq :1;	//bit 4,
 				unsigned char GetCompositeScheduleConf :1;	//bit 5,
 				unsigned char :2;	//bit 6,7
-			} bits[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
+			} bits[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 		}CsMsg;
 
 		union
@@ -3393,30 +3393,30 @@ struct OCPP16Data
 		struct StructBootNotification 				BootNotification;
 		struct StructHeartbeat					Heartbeat;
 		struct StructAuthorize		 			Authorize;
-		struct StructStartTransaction				StartTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructStopTransaction				StopTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructStatusNotification				StatusNotification[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructCancelReservation			CancelReservation[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructChangeAvailability			ChangeAvailability[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+		struct StructStartTransaction				StartTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructStopTransaction				StopTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructStatusNotification				StatusNotification[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructCancelReservation			CancelReservation[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructChangeAvailability			ChangeAvailability[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 		struct StructChangeConfiguration			ChangeConfiguration;
 		struct StructClearCache					ClearCache;
-		struct StructClearChargingProfile			ClearChargingProfile[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructDataTransfer					DataTransfer[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+		struct StructClearChargingProfile			ClearChargingProfile[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructDataTransfer					DataTransfer[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 		struct StructDiagnosticsStatusNotification	DiagnosticsStatusNotification;
 		struct StructFirmwareStatusNotification		FirmwareStatusNotification;
-		struct StructGetCompositeSchedule		GetCompositeSchedule[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+		struct StructGetCompositeSchedule		GetCompositeSchedule[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 		struct StructGetConfiguration				GetConfiguration;
 		struct StructGetDiagnostics				GetDiagnostics;
 		struct StructGetLocalListVersion			GetLocalListVersion;
-		struct StructMeterValues					MeterValues[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructRemoteStartTransaction		RemoteStartTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructRemoteStopTransaction		RemoteStopTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructReserveNow					ReserveNow[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+		struct StructMeterValues					MeterValues[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructRemoteStartTransaction		RemoteStartTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructRemoteStopTransaction		RemoteStopTransaction[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructReserveNow					ReserveNow[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 		struct StructReset						Reset;
 		struct StructSendLocalList				SendLocalList;
-		struct StructSetChargingProfile			SetChargingProfile[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructTriggerMessage				TriggerMessage[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
-		struct StructUnlockConnector			UnlockConnector[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY];
+		struct StructSetChargingProfile			SetChargingProfile[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructTriggerMessage				TriggerMessage[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
+		struct StructUnlockConnector			UnlockConnector[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY];
 		struct StructUpdateFirmware				UpdateFirmware;
 		struct OCPP16ConfigurationTable			ConfigurationTable;
 		struct StructChargingProfile			CHAdeMOChargingProfile[CHAdeMO_QUANTITY];