瀏覽代碼

2022-04-26/Jerry Wang
Action:
1. Modify the logic that ignore checking limit in handleSetChargingProfile() when the key 'isEnableLocalPowerSharing' value is 1.
2. Fix the problem that sometimes EVSE do not send StatusNotification after reconnecting backend.
3. Delete 'SystemInitial' and related function.

File:
1. EVSE/Modularization/ocppfiles/MessageHandler.c
--> Action 1,2,3
2. EVSE/Modularization/ocppph/MessageHandler.c
--> Action 1,2,3

Jerry Wang 2 年之前
父節點
當前提交
374e2646c3
共有 2 個文件被更改,包括 28 次插入36 次删除
  1. 14 18
      EVSE/Modularization/ocppfiles/MessageHandler.c
  2. 14 18
      EVSE/Modularization/ocppph/MessageHandler.c

+ 14 - 18
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -48,7 +48,6 @@ static char idTagAuthorization[32]	= {0};
 static int server_sign				= FALSE;
 int server_pending 					= FALSE;
 static int BootNotificationInterval = 0;
-static int SystemInitial 			= 0;//= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;	// System Boot UP
 
 //===============================
 // OCPP auth variable
@@ -4465,7 +4464,6 @@ int ProcessShareMemory()
 			// DO series
 			for(int gun_index=0; gun_index<GENERAL_GUN_QUANTITY ; gun_index++)
 			{
-				SystemInitial += 1;
 				gunTotalNumber += 1;
 				gunType[gun_index] = GUN_TYPE_DO;
 
@@ -4493,7 +4491,6 @@ int ProcessShareMemory()
 		{
  			for(int gun_index=0;gun_index<modelnameInfo.GetGunCount;gun_index++)
  			{
-				SystemInitial += 1;
 				gunTotalNumber += 1;
 
  				switch(modelnameInfo.ParsingInfo[gun_index].GunType)
@@ -5047,7 +5044,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus != ChademoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn != ChademoPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus != ChademoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn != ChademoPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn == 0))
@@ -5105,7 +5102,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn != CcsPreviousConnectorPlugIn[index]) )//if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]/*PRE_SYS_MODE[gun_index]*/ )
+					if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn != CcsPreviousConnectorPlugIn[index]) )//if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]/*PRE_SYS_MODE[gun_index]*/ )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn == 0))
@@ -5163,7 +5160,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus != GbPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn != GbPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus != GbPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn != GbPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn == 0))
@@ -5213,7 +5210,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus != DoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn != DoPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus != DoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn != DoPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn == 0))
@@ -5270,7 +5267,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus != AcPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState != AcPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus != AcPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState != AcPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_A))
@@ -5320,9 +5317,6 @@ void CheckSystemValue(void)
 			)
 		  )
 		{
-			if(SystemInitial > 0)
-				SystemInitial -= 1;
-
 			sendStatusNotificationRequest(gun_index);
 			refreshStartTimer(&clientTime.StatusNotification[gun_index]);
 		}
@@ -13981,7 +13975,8 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
 	}
 
 	// Check invalid limit
-	if(strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) != 0)
+	if((strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) != 0) ||
+	   ((strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) == 0) && (ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing != 1)))
 	{
 		if(ShmSysConfigAndInfo->SysConfig.ModelName[0] == 'A')
 		{
@@ -21833,31 +21828,31 @@ void InitialSystemValue(void)
 	//Status &&  ConnectorPlugIn Setting
 	for (int index = 0; index < CHAdeMO_QUANTITY; index++)
 	{
-		ChademoPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PreviousSystemStatus;
+		ChademoPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PreviousSystemStatus;
 		ChademoPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn;
 	}
 
 	for (int index = 0; index < CCS_QUANTITY; index++)
 	{
-		CcsPreviousSystemStatus[index] = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PreviousSystemStatus;
+		CcsPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PreviousSystemStatus;
 		CcsPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn;
 	}
 
 	for (int index = 0; index < GB_QUANTITY; index++)
 	{
-		GbPreviousSystemStatus[index] = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PreviousSystemStatus;
+		GbPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PreviousSystemStatus;
 		GbPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn;
 	}
 
 	for (int index = 0; index < AC_QUANTITY; index++)
 	{
-		AcPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PreviousSystemStatus;
+		AcPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PreviousSystemStatus;
 		AcPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState;
 	}
 
 	for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
 	{
-		DoPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PreviousSystemStatus;
+		DoPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PreviousSystemStatus;
 		DoPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PilotState;
 	}
 
@@ -21867,7 +21862,8 @@ void InitialSystemValue(void)
 		cpinitateMsg.bits[gun_index].StatusNotificationReq = 0;
 		cpinitateMsg.bits[gun_index].StatusNotificationConf = 0;
 		//clientTime.MeterValues[gun_index] = time((time_t*)NULL);
-		memset(&ShmOCPP16Data->StatusNotification[gun_index], 0x00, sizeof(struct StructStatusNotification));
+		//memset(&ShmOCPP16Data->StatusNotification[gun_index], 0x00, sizeof(struct StructStatusNotification));
+		memset(&ShmOCPP16Data->StatusNotification[gun_index].Status, 0x00, sizeof(ShmOCPP16Data->StatusNotification[gun_index].Status));
 	}
 
 	memset( (void *)unknownkey, 0, sizeof(unknownkey));

+ 14 - 18
EVSE/Modularization/ocppph/MessageHandler.c

@@ -49,7 +49,6 @@ static char idTagAuthorization[32]	= {0};
 static int server_sign				= FALSE;
 int server_pending 					= FALSE;
 static int BootNotificationInterval = 0;
-static int SystemInitial 			= 0;//= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY;	// System Boot UP
 
 //===============================
 // OCPP auth variable
@@ -3983,7 +3982,6 @@ int ProcessShareMemory()
 			// DO series
 			for(int gun_index=0; gun_index<GENERAL_GUN_QUANTITY ; gun_index++)
 			{
-				SystemInitial += 1;
 				gunTotalNumber += 1;
 				gunType[gun_index] = GUN_TYPE_DO;
 
@@ -4011,7 +4009,6 @@ int ProcessShareMemory()
 		{
  			for(int gun_index=0;gun_index<modelnameInfo.GetGunCount;gun_index++)
  			{
-				SystemInitial += 1;
 				gunTotalNumber += 1;
 
  				switch(modelnameInfo.ParsingInfo[gun_index].GunType)
@@ -4567,7 +4564,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus != ChademoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn != ChademoPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus != ChademoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn != ChademoPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn == 0))
@@ -4625,7 +4622,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn != CcsPreviousConnectorPlugIn[index]) )//if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]/*PRE_SYS_MODE[gun_index]*/ )
+					if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn != CcsPreviousConnectorPlugIn[index]) )//if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]/*PRE_SYS_MODE[gun_index]*/ )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn == 0))
@@ -4683,7 +4680,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus != GbPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn != GbPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus != GbPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn != GbPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn == 0))
@@ -4733,7 +4730,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus != DoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn != DoPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus != DoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn != DoPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn == 0))
@@ -4790,7 +4787,7 @@ void CheckSystemValue(void)
 			{
 				if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
 				{
-					if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus != AcPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState != AcPreviousConnectorPlugIn[index]) )
+					if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus != AcPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState != AcPreviousConnectorPlugIn[index]) )
 					{
 						// Sent unplug message for California pricing logic
 						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_A))
@@ -4840,9 +4837,6 @@ void CheckSystemValue(void)
 			)
 		  )
 		{
-			if(SystemInitial > 0)
-				SystemInitial -= 1;
-
 			memcpy(&ShmOCPP16DataPH->StatusNotification[gun_index], &ShmOCPP16DataPH->StatusNotification[gun_index], sizeof(struct StructStatusNotification));
 			sendStatusNotificationRequest(gun_index);
 			refreshStartTimer(&clientTime.StatusNotification[gun_index]);
@@ -13486,7 +13480,8 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
 	}
 
 	// Check invalid limit
-	if(strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) != 0)
+	if((strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) != 0) ||
+	   ((strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) == 0) && (ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing != 1)))
 	{
 		if(ShmSysConfigAndInfo->SysConfig.ModelName[0] == 'A')
 		{
@@ -21060,31 +21055,31 @@ void InitialSystemValue(void)
 	//Status &&  ConnectorPlugIn Setting
 	for (int index = 0; index < CHAdeMO_QUANTITY; index++)
 	{
-		ChademoPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PreviousSystemStatus;
+		ChademoPreviousSystemStatus[index]= 99; //ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PreviousSystemStatus;
 		ChademoPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn;
 	}
 
 	for (int index = 0; index < CCS_QUANTITY; index++)
 	{
-		CcsPreviousSystemStatus[index] = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PreviousSystemStatus;
+		CcsPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PreviousSystemStatus;
 		CcsPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn;
 	}
 
 	for (int index = 0; index < GB_QUANTITY; index++)
 	{
-		GbPreviousSystemStatus[index] = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PreviousSystemStatus;
+		GbPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PreviousSystemStatus;
 		GbPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn;
 	}
 
 	for (int index = 0; index < AC_QUANTITY; index++)
 	{
-		AcPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PreviousSystemStatus;
+		AcPreviousSystemStatus[index]= 99; //ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PreviousSystemStatus;
 		AcPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState;
 	}
 
 	for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
 	{
-		DoPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PreviousSystemStatus;
+		DoPreviousSystemStatus[index]= 99; //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PreviousSystemStatus;
 		DoPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PilotState;
 	}
 
@@ -21094,7 +21089,8 @@ void InitialSystemValue(void)
 		cpinitateMsg.bits[gun_index].StatusNotificationReq = 0;
 		cpinitateMsg.bits[gun_index].StatusNotificationConf = 0;
 		//clientTime.MeterValues[gun_index] = time((time_t*)NULL);
-		memset(&ShmOCPP16DataPH->StatusNotification[gun_index], 0x00, sizeof(struct StructStatusNotification));
+		//memset(&ShmOCPP16DataPH->StatusNotification[gun_index], 0x00, sizeof(struct StructStatusNotification));
+		memset(&ShmOCPP16DataPH->StatusNotification[gun_index].Status, 0x00, sizeof(ShmOCPP16DataPH->StatusNotification[gun_index].Status));
 	}
 
 	memset( (void *)unknownkey, 0, sizeof(unknownkey));