Procházet zdrojové kódy

2023-02-23/Jerry Wang
[OCPP 1.6]
Action:
1. Modify logic to make DataTransfer.conf without 'data' field when the status is 'UnknownMessageId'.
2. Add protection for null content SendLocalList message.
3. Add logic to judge abnormal situation(connectorId < 0) when receiving RemoteStartTransaction.req message.
4. Improve ChangeConfiguration logic for boolean type keys.
5. Add threshold limitation on configuration key 'ConnectionTimeOut'.

File:
1. EVSE/Modularization/ocppfiles/MessageHandler.c
--> Action 1-5

Jerry Wang před 2 roky
rodič
revize
e1ec75311b
1 změnil soubory, kde provedl 274 přidání a 150 odebrání
  1. 274 150
      EVSE/Modularization/ocppfiles/MessageHandler.c

+ 274 - 150
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -12270,13 +12270,13 @@ int handleDataTransferRequest(char *uuid, char *payload)
 		else
 		{
 			// Can not find valid message id
-			sprintf(message,"[%d,\"%s\",{\"status\":\"%s\",\"data\":\"vendorId-%s messageId-%s data-%s\"}]",MESSAGE_TYPE_CALLRESULT, uuid, "UnknownMessageId", tempvendorId, tempmessageId, tempdata);
+			sprintf(message,"[%d,\"%s\",{\"status\":\"%s\"}]",MESSAGE_TYPE_CALLRESULT, uuid, "UnknownMessageId");
 		}
 	}
 	else
 	{
 		// Payload is null
-		sprintf(message,"[%d,\"%s\",{\"status\":\"%s\",\"data\":\"{}\"}]",MESSAGE_TYPE_CALLRESULT, uuid, "UnknownMessageId");
+		sprintf(message,"[%d,\"%s\",{\"status\":\"%s\"}]",MESSAGE_TYPE_CALLRESULT, uuid, "UnknownMessageId");
 	}
 
 	LWS_Send(message);
@@ -12865,7 +12865,10 @@ int handleRemoteStartRequest(char *uuid, char *payload)
 	{
 		if(json_object_object_get(RemoteStartTransaction, "connectorId") != NULL)
 		{
-			connectorIdInt = json_object_get_int(json_object_object_get(RemoteStartTransaction, "connectorId"));
+			if(json_object_get_int(json_object_object_get(RemoteStartTransaction, "connectorId")) > 0)
+				connectorIdInt = json_object_get_int(json_object_object_get(RemoteStartTransaction, "connectorId"));
+			else
+				connectorIdInt = 0;
 		}
 		else
 		{
@@ -12883,7 +12886,7 @@ int handleRemoteStartRequest(char *uuid, char *payload)
 
 		if(connectorIdInt == 0)
 		{
-			DEBUG_WARN("Connector id shall not equal 0.\n");
+			DEBUG_WARN("Connector id shall not equal to 0 or less than 0.\n");
 			result = FAIL;
 		}
 		else if(json_object_object_get(RemoteStartTransaction, "idTag") == NULL)
@@ -14250,8 +14253,24 @@ int handleSendLocalListRequest(char *uuid, char *payload)
 	if(!is_error(SendLocalList))
 	{
 		// Required data
-		ShmOCPP16Data->SendLocalList.ListVersion = json_object_get_int(json_object_object_get(SendLocalList, "listVersion"));
-		sprintf((char*)ShmOCPP16Data->SendLocalList.UpdateType, "%s", json_object_get_string(json_object_object_get(SendLocalList, "updateType")));
+		if(json_object_object_get(SendLocalList, "listVersion") != NULL)
+			ShmOCPP16Data->SendLocalList.ListVersion = json_object_get_int(json_object_object_get(SendLocalList, "listVersion"));
+		else
+		{
+			DEBUG_WARN("listVersion sould not be NULL!\n");
+			strcpy(comfirmstr, UpdateStatusStr[UpdateStatus_Failed]);
+			goto end;
+		}
+
+
+		if(json_object_object_get(SendLocalList, "updateType") != NULL)
+			sprintf((char*)ShmOCPP16Data->SendLocalList.UpdateType, "%s", json_object_get_string(json_object_object_get(SendLocalList, "updateType")));
+		else
+		{
+			DEBUG_WARN("updateType sould not be NULL!\n");
+			strcpy(comfirmstr, UpdateStatusStr[UpdateStatus_Failed]);
+			goto end;
+		}
 
 		// Optional data
 		if(json_object_object_get(SendLocalList, "localAuthorizationList") != NULL)
@@ -14301,7 +14320,8 @@ int handleSendLocalListRequest(char *uuid, char *payload)
 			memset(ShmOCPP16Data->SendLocalList.LocalAuthorizationList, 0 , sizeof(struct StructLocalAuthorizationList)*1);
 			for(int idx=0;idx<json_object_array_length(json_object_object_get(SendLocalList, "localAuthorizationList"));idx++)
 			{
-				sprintf((char*)ShmOCPP16Data->SendLocalList.LocalAuthorizationList[0].IdTag, "%s", stringtrimspace((char *)json_object_get_string(json_object_object_get(json_object_array_get_idx(json_object_object_get(SendLocalList, "localAuthorizationList"), idx), "idTag"))));
+				if(json_object_object_get(json_object_array_get_idx(json_object_object_get(SendLocalList, "localAuthorizationList"), idx), "idTag") != NULL)
+					sprintf((char*)ShmOCPP16Data->SendLocalList.LocalAuthorizationList[0].IdTag, "%s", stringtrimspace((char *)json_object_get_string(json_object_object_get(json_object_array_get_idx(json_object_object_get(SendLocalList, "localAuthorizationList"), idx), "idTag"))));
 
 				if(json_object_object_get(json_object_array_get_idx(json_object_object_get(SendLocalList, "localAuthorizationList"), idx), "idTagInfo") != NULL)
 				{
@@ -20715,8 +20735,13 @@ int setKeyValue(char *key, char *value)
     		  str[i] = tolower(str[i]);
     		}
 
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AllowOfflineTxForUnknownId].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AllowOfflineTxForUnknownId].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+    			isSuccess = ConfigurationStatus_Accepted;
+			}
+    		else
+    			isSuccess = ConfigurationStatus_Rejected;
     	}
     	else
     	{
@@ -20734,8 +20759,13 @@ int setKeyValue(char *key, char *value)
     		   str[i] = tolower(str[i]);
     		}
 
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizationCacheEnabled].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizationCacheEnabled].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
     		//updateSetting("AuthorizationCacheEnabled",(char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[1].ItemData);
     	}
     	else
@@ -20755,8 +20785,13 @@ int setKeyValue(char *key, char *value)
     			str[i] = tolower(str[i]);
     		}
     		//Charger.AuthorizeRemoteTxRequests = (value.toLowerCase().equals("true")?true:false);
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeRemoteTxRequests].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
     	}
     	else
     	{
@@ -20777,7 +20812,7 @@ int setKeyValue(char *key, char *value)
     		}
     		else
     		{
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[BlinkRepeat].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[BlinkRepeat].ItemData, "%d", atoi(value));
     			isSuccess = ConfigurationStatus_Accepted;
     		}
     	}
@@ -20801,7 +20836,7 @@ int setKeyValue(char *key, char *value)
     			if((atoi(value) == 0) || (atoi(value) >= 5))
     			{
     				//Charger.ClockAlignedDataInterval = Integer.parseInt(value)*1000;
-					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData, "%d", atoi(value) );
+					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ClockAlignedDataInterval].ItemData, "%d", atoi(value));
 					isSuccess = ConfigurationStatus_Accepted;
     			}
     			else
@@ -20825,9 +20860,14 @@ int setKeyValue(char *key, char *value)
     		}
     		else
     		{
-    			//Charger.ConnectionTimeOut = Integer.parseInt(value)*1000;
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemData, "%d", atoi(value));
-    			isSuccess = ConfigurationStatus_Accepted;
+    			if((atoi(value) >= 10) && (atoi(value) <= 3600))
+    			{
+    				//Charger.ConnectionTimeOut = Integer.parseInt(value)*1000;
+					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemData, "%d", atoi(value));
+					isSuccess = ConfigurationStatus_Accepted;
+    			}
+    			else
+    				isSuccess = ConfigurationStatus_Rejected;
     		}
     	}
     	else
@@ -20849,7 +20889,7 @@ int setKeyValue(char *key, char *value)
         	else
         	{
         		//Charger.HeartbeatInterval = Integer.parseInt(value)*1000;
-        		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[GetConfigurationMaxKeys].ItemData, "%d", atoi(value) );
+        		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[GetConfigurationMaxKeys].ItemData, "%d", atoi(value));
         		isSuccess = ConfigurationStatus_Accepted;
         	}
 
@@ -20902,7 +20942,7 @@ int setKeyValue(char *key, char *value)
     		}
     		else
     		{
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LightIntensity].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LightIntensity].ItemData, "%d", atoi(value));
     		    isSuccess = ConfigurationStatus_Accepted;
     		}
     	}
@@ -20921,8 +20961,14 @@ int setKeyValue(char *key, char *value)
     		{
     		   str[i] = tolower(str[i]);
     		}
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LocalAuthorizeOffline].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LocalAuthorizeOffline].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
     		//updateSetting("LocalAuthorizeOffline", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LocalAuthorizeOffline].ItemData);
     	}
     	else
@@ -20941,8 +20987,14 @@ int setKeyValue(char *key, char *value)
     		{
     		   str[i] = tolower(str[i]);
     		}
-    	    sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LocalPreAuthorize].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LocalPreAuthorize].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
     	}
     	else
         {
@@ -20962,7 +21014,7 @@ int setKeyValue(char *key, char *value)
     		}
     		else
     		{
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData, "%d", atoi(value));
     			isSuccess = ConfigurationStatus_Accepted;
     		}
     	}
@@ -20977,12 +21029,12 @@ int setKeyValue(char *key, char *value)
     {
     	if(ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValuesAlignedData].ItemAccessibility == 1)
     	{
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValuesAlignedData].ItemData, "%s", value );
+    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValuesAlignedData].ItemData, "%s", value);
     		isSuccess = ConfigurationStatus_Accepted;
     	}
     	else
     	{
-    	   isSuccess = ConfigurationStatus_Rejected;
+    	    isSuccess = ConfigurationStatus_Rejected;
     	}
 
     }
@@ -21015,7 +21067,7 @@ int setKeyValue(char *key, char *value)
     {
     	if(ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValuesSampledData].ItemAccessibility == 1)
     	{
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValuesSampledData].ItemData, "%s", value );
+    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValuesSampledData].ItemData, "%s", value);
     		isSuccess = ConfigurationStatus_Accepted;
     	}
     	else
@@ -21098,7 +21150,7 @@ int setKeyValue(char *key, char *value)
     			else
     			{
     				//Charger.MinimumStatusDuration = Integer.parseInt(value);
-    			    sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemData, "%d", atoi(value) );
+    			    sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemData, "%d", atoi(value));
     			    server_cycle_Status = atoi(value); //StatusNotification Cycle
     			    isSuccess = ConfigurationStatus_Accepted;
     			}
@@ -21123,7 +21175,7 @@ int setKeyValue(char *key, char *value)
       		else
       		{
       			//Charger.ResetRetries = Integer.parseInt(value);
-      			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[NumberOfConnectors].ItemData, "%d", atoi(value) );
+      			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[NumberOfConnectors].ItemData, "%d", atoi(value));
       			isSuccess = ConfigurationStatus_Accepted;
       		}
       	}
@@ -21145,7 +21197,7 @@ int setKeyValue(char *key, char *value)
     		else
     		{
     			//Charger.ResetRetries = Integer.parseInt(value);
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ResetRetries].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ResetRetries].ItemData, "%d", atoi(value));
     			isSuccess = ConfigurationStatus_Accepted;
     		}
     	}
@@ -21167,42 +21219,42 @@ int setKeyValue(char *key, char *value)
 
     		if(strcmp(str, "notapplicable")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "NotApplicable" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "NotApplicable");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else  if(strcmp(str, "unknown")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "Unknown" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "Unknown");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else  if(strcmp(str, "rst")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "RST" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "RST");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else  if(strcmp(str, "rts")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "RTS" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "RTS");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else  if(strcmp(str, "srt")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "SRT" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "SRT");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else  if(strcmp(str, "str")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "STR" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "STR");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else  if(strcmp(str, "trs")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "TRS" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "TRS");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else  if(strcmp(str, "tsr")== 0)
     		{
-			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "TSR" );
+			   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "%s", "TSR");
 			   isSuccess = ConfigurationStatus_Accepted;
     		}
     		else
@@ -21227,7 +21279,7 @@ int setKeyValue(char *key, char *value)
     		}
     		else
     		{
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotationMaxLength].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotationMaxLength].ItemData, "%d", atoi(value));
     			isSuccess = ConfigurationStatus_Accepted;
     		}
     	}
@@ -21237,57 +21289,67 @@ int setKeyValue(char *key, char *value)
     	}
     }
 
-   if(strcmp(key, "StopTransactionOnEVSideDisconnect") == 0)
-   {
-	   if(ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnEVSideDisconnect].ItemAccessibility == 1)
-	   {
-		   strcpy(str, (const char*)value);
-		   for(int i = 0; str[i]; i++)
-		   {
-		      str[i] = tolower(str[i]);
-		   }
-		   //Charger.StopTransactionOnEVSideDisconnect = (value.toLowerCase().equals("true")?true:false);
-		   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnEVSideDisconnect].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-		   isSuccess = ConfigurationStatus_Accepted;
-	   }
-	   else
-	   {
-	       isSuccess = ConfigurationStatus_Rejected;
-	   }
+    if(strcmp(key, "StopTransactionOnEVSideDisconnect") == 0)
+    {
+	    if(ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnEVSideDisconnect].ItemAccessibility == 1)
+	    {
+		    strcpy(str, (const char*)value);
+		    for(int i = 0; str[i]; i++)
+		    {
+		       str[i] = tolower(str[i]);
+		    }
+		    //Charger.StopTransactionOnEVSideDisconnect = (value.toLowerCase().equals("true")?true:false);
+		    if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnEVSideDisconnect].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
+	    }
+	    else
+	    {
+	        isSuccess = ConfigurationStatus_Rejected;
+	    }
 
-   }
+    }
 
-   if(strcmp(key, "StopTransactionOnInvalidId") == 0)
-   {
-	   if(ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemAccessibility == 1)
-	   {
-		   strcpy(str, (const char*)value);
-		   for(int i = 0; str[i]; i++)
-		   {
-			   str[i] = tolower(str[i]);
-		   }
-		   //Charger.StopTransactionOnInvalidId = (value.toLowerCase().equals("true")?true:false);
-		   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-		   isSuccess = ConfigurationStatus_Accepted;
-	   }
-	   else
-	   {
-		   isSuccess = ConfigurationStatus_Rejected;
-	   }
-   }
+    if(strcmp(key, "StopTransactionOnInvalidId") == 0)
+    {
+	    if(ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemAccessibility == 1)
+	    {
+		    strcpy(str, (const char*)value);
+		    for(int i = 0; str[i]; i++)
+		    {
+			    str[i] = tolower(str[i]);
+		    }
+		    //Charger.StopTransactionOnInvalidId = (value.toLowerCase().equals("true")?true:false);
+		    if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnInvalidId].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
+	    }
+	    else
+	    {
+		    isSuccess = ConfigurationStatus_Rejected;
+	    }
+    }
 
-   if(strcmp(key, "StopTxnAlignedData") == 0)
-   {
-	   if(ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnAlignedData].ItemAccessibility == 1)
-	   {
-		   sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnAlignedData].ItemData, "%s", value );
-		   isSuccess = ConfigurationStatus_Accepted;
-	   }
-	   else
-	   {
-		   isSuccess = ConfigurationStatus_Rejected;
-	   }
-   }
+    if(strcmp(key, "StopTxnAlignedData") == 0)
+    {
+	    if(ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnAlignedData].ItemAccessibility == 1)
+	    {
+		    sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnAlignedData].ItemData, "%s", value);
+		    isSuccess = ConfigurationStatus_Accepted;
+	    }
+	    else
+	    {
+		    isSuccess = ConfigurationStatus_Rejected;
+	    }
+    }
 
     if(strcmp(key, "StopTxnAlignedDataMaxLength") == 0)
     {
@@ -21300,7 +21362,7 @@ int setKeyValue(char *key, char *value)
     		}
     		else
     		{
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnAlignedDataMaxLength].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnAlignedDataMaxLength].ItemData, "%d", atoi(value));
     			isSuccess = ConfigurationStatus_Accepted;
     		}
     	}
@@ -21314,7 +21376,7 @@ int setKeyValue(char *key, char *value)
     {
     	if(ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnSampledData].ItemAccessibility == 1)
     	{
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnSampledData].ItemData, "%s", value );
+    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnSampledData].ItemData, "%s", value);
 
     		isSuccess = ConfigurationStatus_Accepted;
     	}
@@ -21335,7 +21397,7 @@ int setKeyValue(char *key, char *value)
     		 }
     		 else
     		 {
-    			 sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnSampledDataMaxLength].ItemData, "%d", atoi(value) );
+    			 sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTxnSampledDataMaxLength].ItemData, "%d", atoi(value));
     			 isSuccess = ConfigurationStatus_Accepted;
     		 }
     	}
@@ -21349,7 +21411,7 @@ int setKeyValue(char *key, char *value)
     {
        	if(ShmOCPP16Data->ConfigurationTable.CoreProfile[SupportedFeatureProfiles].ItemAccessibility == 1)
        	{
-       		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SupportedFeatureProfiles].ItemData, "%s", value );
+       		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SupportedFeatureProfiles].ItemData, "%s", value);
        		isSuccess = ConfigurationStatus_Accepted;
        	}
        	else
@@ -21369,7 +21431,7 @@ int setKeyValue(char *key, char *value)
         	 }
         	 else
         	 {
-        	    sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SupportedFeatureProfilesMaxLength].ItemData, "%d", atoi(value) );
+        	    sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SupportedFeatureProfilesMaxLength].ItemData, "%d", atoi(value));
         	    isSuccess = ConfigurationStatus_Accepted;
 
         	 }
@@ -21392,7 +21454,7 @@ int setKeyValue(char *key, char *value)
     		else
     		{
     			//Charger.TransactionMessageAttempts = Integer.parseInt(value);
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[TransactionMessageAttempts].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[TransactionMessageAttempts].ItemData, "%d", atoi(value));
     			TransactionMessageAttemptsValue = atoi(value);
     			isSuccess = ConfigurationStatus_Accepted;
     		}
@@ -21415,7 +21477,7 @@ int setKeyValue(char *key, char *value)
     		else
     		{
     			//Charger.TransactionMessageRetryInterval = Integer.parseInt(value)*1000;
-    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[TransactionMessageRetryInterval].ItemData, "%d", atoi(value) );
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[TransactionMessageRetryInterval].ItemData, "%d", atoi(value));
     			TransactionMessageRetryIntervalValue = atoi(value);
     			isSuccess = ConfigurationStatus_Accepted;
     		}
@@ -21436,8 +21498,13 @@ int setKeyValue(char *key, char *value)
     		   str[i] = tolower(str[i]);
     		}
     		//Charger.UnlockConnectorOnEVSideDisconnect = (value.toLowerCase().equals("true")?true:false);
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[UnlockConnectorOnEVSideDisconnect].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[UnlockConnectorOnEVSideDisconnect].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
     	}
     	else
         {
@@ -21458,7 +21525,7 @@ int setKeyValue(char *key, char *value)
     		{
     			if((atoi(value) == 0) || (atoi(value) >= 10))
     			{
-    				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[WebSocketPingInterval].ItemData, "%d", atoi(value) );
+    				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[WebSocketPingInterval].ItemData, "%d", atoi(value));
 					isSuccess = ConfigurationStatus_Accepted;
     			}
     			else
@@ -21481,8 +21548,13 @@ int setKeyValue(char *key, char *value)
 			   str[i] = tolower(str[i]);
 			}
 
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[QueueOffLineMeterValues].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-			isSuccess = ConfigurationStatus_Accepted;
+			if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[QueueOffLineMeterValues].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
 		}
 		else
 		{
@@ -21543,7 +21615,7 @@ int setKeyValue(char *key, char *value)
     				   ((check_ascii - 0x30) == 2) ||
     				   (((check_ascii - 0x30) == 3) && (access(CERTIFICATE_CP,F_OK) != -1)))
     				{
-    					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", atoi(value) );
+    					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SecurityProfile].ItemData, "%d", atoi(value));
 						ShmSysConfigAndInfo->SysConfig.OcppSecurityProfile = atoi(value);
 
 						isSuccess = ConfigurationStatus_Accepted;
@@ -21585,8 +21657,13 @@ int setKeyValue(char *key, char *value)
 			   str[i] = tolower(str[i]);
 			}
 
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-			isSuccess = ConfigurationStatus_Accepted;
+			if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomDisplayCostAndPrice].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
 		}
 		else
 		{
@@ -21603,8 +21680,14 @@ int setKeyValue(char *key, char *value)
 			{
 			   str[i] = tolower(str[i]);
 			}
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-			isSuccess = ConfigurationStatus_Accepted;
+
+			if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
 		}
 		else
 		{
@@ -21669,10 +21752,14 @@ int setKeyValue(char *key, char *value)
     		  str[i] = tolower(str[i]);
     		}
 
-        	ShmSysConfigAndInfo->SysConfig.AuthorisationMode = ((strcmp(str, "true")==0) ? 1 : 0 );
-        	sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[FreeVend].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-
-        	isSuccess = ConfigurationStatus_Accepted;
+        	if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[FreeVend].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				ShmSysConfigAndInfo->SysConfig.AuthorisationMode = ((strcmp(str, "true")==0) ? 1 : 0);
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
         }
         else
         {
@@ -21688,7 +21775,7 @@ int setKeyValue(char *key, char *value)
 
     		if(strlen(str) <= 20)
     		{
-                sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[FreeVendIdtag].ItemData, "%s", str );
+                sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[FreeVendIdtag].ItemData, "%s", str);
 
 				isSuccess = ConfigurationStatus_Accepted;
     		}
@@ -21709,8 +21796,8 @@ int setKeyValue(char *key, char *value)
         if(ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppServer].ItemAccessibility == 1)
         {
             strcpy(str, (const char*)value);
-            sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppServer].ItemData, "%s", str );
-            sprintf((char *)ShmSysConfigAndInfo->SysConfig.OcppServerURL, "%s", str );
+            sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppServer].ItemData, "%s", str);
+            sprintf((char *)ShmSysConfigAndInfo->SysConfig.OcppServerURL, "%s", str);
 
             isSuccess = ConfigurationStatus_Accepted;
         }
@@ -21725,8 +21812,8 @@ int setKeyValue(char *key, char *value)
         if(ShmOCPP16Data->ConfigurationTable.CoreProfile[MaintainServer].ItemAccessibility == 1)
         {
         	strcpy(str, (const char*)value);
-        	sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaintainServer].ItemData, "%s", str );
-        	sprintf((char *)ShmSysConfigAndInfo->SysConfig.MaintainServerURL, "%s", str );
+        	sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaintainServer].ItemData, "%s", str);
+        	sprintf((char *)ShmSysConfigAndInfo->SysConfig.MaintainServerURL, "%s", str);
 
             isSuccess = ConfigurationStatus_Accepted;
         }
@@ -21746,8 +21833,13 @@ int setKeyValue(char *key, char *value)
 			   str[i] = tolower(str[i]);
 			}
 
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StatusNotificationPeriodically].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE");
-			isSuccess = ConfigurationStatus_Accepted;
+			if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StatusNotificationPeriodically].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
 		}
 		else
 		{
@@ -21768,7 +21860,7 @@ int setKeyValue(char *key, char *value)
 			{
 				if((atoi(value) == 0) || (atoi(value) >= 10))
 				{
-					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StatusNotificationInterval].ItemData, "%d", atoi(value) );
+					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StatusNotificationInterval].ItemData, "%d", atoi(value));
 					isSuccess = ConfigurationStatus_Accepted;
 				}
 				else
@@ -21794,7 +21886,7 @@ int setKeyValue(char *key, char *value)
 			{
 				if(atof(value) >= 0)
 				{
-					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PreAuthAmount].ItemData, "%.2f", atof(value) );
+					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PreAuthAmount].ItemData, "%.2f", atof(value));
 					isSuccess = ConfigurationStatus_Accepted;
 				}
 				else
@@ -21839,8 +21931,8 @@ int setKeyValue(char *key, char *value)
 		if(ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemAccessibility == 1)
 		{
 			strcpy(str, (const char*)value);
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData, "%s", str );
-			sprintf((char *)ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP, "%s", str );
+			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData, "%s", str);
+			sprintf((char *)ShmSysConfigAndInfo->SysConfig.PowerSharingServerIP, "%s", str);
 			isSuccess = ConfigurationStatus_Accepted;
 		}
 		else
@@ -21854,7 +21946,7 @@ int setKeyValue(char *key, char *value)
 		if(ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemAccessibility == 1)
 		{
 			strcpy(str, (const char*)value);
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData, "%s", str );
+			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData, "%s", str);
 			isSuccess = ConfigurationStatus_Accepted;
 		}
 		else
@@ -21873,7 +21965,7 @@ int setKeyValue(char *key, char *value)
 			}
 			else{
 				strcpy(str, (const char*)value);
-				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OffLineMaxChargingPower].ItemData, "%s", str );
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OffLineMaxChargingPower].ItemData, "%s", str);
 				isSuccess = ConfigurationStatus_Accepted;
 			}
 		}
@@ -21892,8 +21984,7 @@ int setKeyValue(char *key, char *value)
 				isSuccess = ConfigurationStatus_Rejected;
 			}
 			else{
-				strcpy(str, (const char*)value);
-				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "%s", str );
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CharingProfileRefreshInterval].ItemData, "%d", atoi(value));
 				isSuccess = ConfigurationStatus_Accepted;
 			}
 		}
@@ -21908,7 +21999,7 @@ int setKeyValue(char *key, char *value)
 		if(ShmOCPP16Data->ConfigurationTable.CoreProfile[CpoName].ItemAccessibility == 1)
 		{
 			strcpy(str, (const char*)value);
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CpoName].ItemData, "%s", str );
+			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[CpoName].ItemData, "%s", str);
 			isSuccess = ConfigurationStatus_Accepted;
 		}
 		else
@@ -21922,7 +22013,7 @@ int setKeyValue(char *key, char *value)
 		if(ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemAccessibility == 1)
 		{
 			strcpy(str, (const char*)value);
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData, "%s", str );
+			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[OcppSoftwareVersion].ItemData, "%s", str);
 			isSuccess = ConfigurationStatus_Accepted;
 		}
 		else
@@ -21940,8 +22031,14 @@ int setKeyValue(char *key, char *value)
 			{
 			  str[i] = tolower(str[i]);
 			}
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthDownloadlinkCertificate].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-			isSuccess = ConfigurationStatus_Accepted;
+
+			if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthDownloadlinkCertificate].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
 		}
 		else
 		{
@@ -21960,7 +22057,7 @@ int setKeyValue(char *key, char *value)
 			}
 			if((strcmp(str, "big")==0) || (strcmp(str, "little")==0))
 			{
-				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[RfidEndianType].ItemData, "%s", str );
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[RfidEndianType].ItemData, "%s", str);
 				ShmSysConfigAndInfo->SysConfig.RfidCardNumEndian = (strcmp(str, "big")==0)?1:0;
 				isSuccess = ConfigurationStatus_Accepted;
 			}
@@ -21977,7 +22074,6 @@ int setKeyValue(char *key, char *value)
 	{
 		if(ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeTimeout].ItemAccessibility == 1)
 		{
-			strcpy(str, (const char*)value);
 			check_ascii = value[0];
 			if((check_ascii < 48) || (check_ascii > 57))
 			{
@@ -21987,7 +22083,7 @@ int setKeyValue(char *key, char *value)
 			{
 				if((atoi(value) >= 10) && (atoi(value) <= 300))
 				{
-					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeTimeout].ItemData, "%s", str );
+					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AuthorizeTimeout].ItemData, "%d", atoi(value));
 					isSuccess = ConfigurationStatus_Accepted;
 				}
 				else
@@ -22011,9 +22107,15 @@ int setKeyValue(char *key, char *value)
 			{
 			  str[i] = tolower(str[i]);
 			}
-			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[Enable15118].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE");
-			ShmSysConfigAndInfo->SysConfig.isEnable15118 = (strcmp(str, "true")==0)?1:0;
-			isSuccess = ConfigurationStatus_Accepted;
+
+			if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[Enable15118].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				ShmSysConfigAndInfo->SysConfig.isEnable15118 = (strcmp(str, "true")==0)?1:0;
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
 		}
 		else
 		{
@@ -22032,8 +22134,14 @@ int setKeyValue(char *key, char *value)
     		{
     		  str[i] = tolower(str[i]);
     		}
-        	sprintf((char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-        	isSuccess = ConfigurationStatus_Accepted;
+
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[LocalAuthListEnabled].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
         	//updateSetting("LocalAuthorizationListEnabled", (char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemData);
         }
         else
@@ -22054,8 +22162,14 @@ int setKeyValue(char *key, char *value)
     		{
     		   str[i] = tolower(str[i]);
     		}
-        sprintf((char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
     		//updateSetting("LocalAuthListEnabled", (char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListEnabled].ItemData);
     	}
     	else
@@ -22077,8 +22191,7 @@ int setKeyValue(char *key, char *value)
       		}
       		else
       		{
-
-          		sprintf((char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListMaxLength].ItemData, "%d", atoi(value) );
+          		sprintf((char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[LocalAuthListMaxLength].ItemData, "%d", atoi(value));
           		isSuccess = ConfigurationStatus_Accepted;
       		}
       	}
@@ -22099,8 +22212,7 @@ int setKeyValue(char *key, char *value)
         	}
         	else
         	{
-
-            	sprintf((char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[SendLocalListMaxLength].ItemData, "%d", atoi(value) );
+            	sprintf((char *)ShmOCPP16Data->ConfigurationTable.LocalAuthListManagementProfile[SendLocalListMaxLength].ItemData, "%d", atoi(value));
             	isSuccess = ConfigurationStatus_Accepted;
         	}
         }
@@ -22119,8 +22231,14 @@ int setKeyValue(char *key, char *value)
     		{
     		    str[i] = tolower(str[i]);
     		}
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.ReservationProfile[ReserveConnectorZeroSupported].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-    		isSuccess = ConfigurationStatus_Accepted;
+
+    		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.ReservationProfile[ReserveConnectorZeroSupported].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
     	}
     	else
     	{
@@ -22140,7 +22258,7 @@ int setKeyValue(char *key, char *value)
          	else
          	{
 
-             	sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ChargeProfileMaxStackLevel].ItemData, "%d", atoi(value) );
+             	sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ChargeProfileMaxStackLevel].ItemData, "%d", atoi(value));
              	isSuccess = ConfigurationStatus_Accepted;
          	}
          }
@@ -22154,7 +22272,7 @@ int setKeyValue(char *key, char *value)
     {
     	if(ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ChargingScheduleAllowedChargingRateUnit].ItemAccessibility == 1)
         {
-    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ChargingScheduleAllowedChargingRateUnit].ItemData, "%s", value );
+    		sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ChargingScheduleAllowedChargingRateUnit].ItemData, "%s", value);
          	isSuccess = ConfigurationStatus_Accepted;
         }
         else
@@ -22176,7 +22294,7 @@ int setKeyValue(char *key, char *value)
            	else
            	{
 
-               	sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ChargingScheduleMaxPeriods].ItemData, "%d", atoi(value) );
+               	sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ChargingScheduleMaxPeriods].ItemData, "%d", atoi(value));
                	isSuccess = ConfigurationStatus_Accepted;
            	}
         }
@@ -22195,8 +22313,14 @@ int setKeyValue(char *key, char *value)
        		{
        		    str[i] = tolower(str[i]);
        		}
-       		sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ConnectorSwitch3to1PhaseSupported].ItemData, "%s", (strcmp(str, "true")==0) ?"TRUE":"FALSE" );
-       		isSuccess = ConfigurationStatus_Accepted;
+
+       		if((strcmp(str, "true")==0) || (strcmp(str, "false")==0))
+			{
+				sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[ConnectorSwitch3to1PhaseSupported].ItemData, "%s", (strcmp(str, "true")==0)?"TRUE":"FALSE");
+				isSuccess = ConfigurationStatus_Accepted;
+			}
+			else
+				isSuccess = ConfigurationStatus_Rejected;
        	}
        	else
        	{
@@ -22215,7 +22339,7 @@ int setKeyValue(char *key, char *value)
             }
             else
             {
-                 sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData, "%d", atoi(value) );
+                 sprintf((char *)ShmOCPP16Data->ConfigurationTable.SmartChargingProfile[MaxChargingProfilesInstalled].ItemData, "%d", atoi(value));
                  isSuccess = ConfigurationStatus_Accepted;
             }
        }