Browse Source

[Improve][Modularization][Module_OcppBackend / Module_OcppBackend20]

2021.04.08 / Folus Wen

Actions:
1. define.h extend IdTag array length.
2. Disable ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy override by OCPP MaxEnergyOnInvalidId key.

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 4 years ago
parent
commit
bb9059c6a3
2 changed files with 13 additions and 17 deletions
  1. 2 6
      EVSE/Modularization/ocppfiles/MessageHandler.c
  2. 11 11
      EVSE/Projects/define.h

+ 2 - 6
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -11638,7 +11638,6 @@ int initialConfigurationTable(void)
 		ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemAccessibility = 1;
 		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemName, "MaxEnergyOnInvalidId");
 		strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData, "0" );
-		ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = 0;
 
 		fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","MaxEnergyOnInvalidId", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData);
 
@@ -12101,7 +12100,6 @@ int initialConfigurationTable(void)
 				{
 					ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
 					sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData, "%d", atoi(valuestr) );
-					ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = atoi(valuestr)/1000;
 				}
 
 				if(strcmp(keystr, "MeterValuesAlignedData") == 0)
@@ -13059,7 +13057,6 @@ void getKeyValue(char *keyReq)
 		   }
 
 		   strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_MaxEnergyOnInvalidId].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData );
-		   ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = atoi((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData)/1000;
 		   isKnowKey = TRUE;
 	   }
 
@@ -14043,9 +14040,8 @@ int setKeyValue(char *key, char *value)
     		}
     		else
     		{
-    			 sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData, "%d", atoi(value) );
-    			 ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = atoi(value)/1000;
-    			 isSuccess = ConfigurationStatus_Accepted;
+    			sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData, "%d", atoi(value) );
+    			isSuccess = ConfigurationStatus_Accepted;
     		}
     	}
     	else

+ 11 - 11
EVSE/Projects/define.h

@@ -3825,12 +3825,12 @@ struct LedModuleData
 struct StructIdTagInfo
 {
 	unsigned char 	ExpiryDate[28];
-	unsigned char 	ParentIdTag[20];
+	unsigned char 	ParentIdTag[21];
 	unsigned char 	Status[16];		//Accepted, Blocked, Expired, Invalid, ConcurrentTx
 };
 struct StructLocalAuthorizationList
 {
-	unsigned char 			IdTag[20];
+	unsigned char 			IdTag[21];
 	struct StructIdTagInfo	IdTagInfo;
 };
 struct StructSampledValue
@@ -3957,13 +3957,13 @@ struct StructHeartbeat
 };
 struct StructAuthorize
 {
-	unsigned char 				IdTag[20];
+	unsigned char 				IdTag[21];
 	struct StructIdTagInfo		ResponseIdTagInfo;
 };
 struct StructStartTransaction
 {
 	int 						ConnectorId;
-	unsigned char 				IdTag[20];
+	unsigned char 				IdTag[21];
 	int 						MeterStart;
 	int 						ReservationId;
 	unsigned char 				Timestamp[28];
@@ -3972,7 +3972,7 @@ struct StructStartTransaction
 };
 struct StructStopTransaction
 {
-	unsigned char 				IdTag[20];
+	unsigned char 				IdTag[21];
 	int 						MeterStop;
 	unsigned char 				Timestamp[28];
 	int 						TransactionId;
@@ -4117,7 +4117,7 @@ struct StructMeterValues
 struct StructRemoteStartTransaction
 {
 	int								ConnectorId;
-	unsigned char 					IdTag[20];
+	unsigned char 					IdTag[21];
 	struct StructChargingProfile	ChargingProfile;
 	unsigned char 					ResponseStatus[10];	//Accepted,	Rejected
 	unsigned char 					guid[37];
@@ -4131,8 +4131,8 @@ struct StructReserveNow
 {
 	int			 		ConnectorId;
 	unsigned char 		ExpiryDate[28];
-	unsigned char 		IdTag[20];
-	unsigned char 		ParentIdTag[20];
+	unsigned char 		IdTag[21];
+	unsigned char 		ParentIdTag[21];
 	int					ReservationId;
 	unsigned char 		ResponseStatus[12];		//Accepted, Faulted, Occupied, Rejected, Unavailable
 	unsigned char 		guid[37];   			//OCPP Server request message uuid
@@ -4529,7 +4529,7 @@ struct DCChargingParametersType
 
 struct AdditionalInfoType
 {
-	unsigned char	additionalIdToken[36];						// Required. This field specifies the additional IdToken.
+	unsigned char	additionalIdToken[37];						// Required. This field specifies the additional IdToken.
 	unsigned char	type[50];									// Required. This defines the type of the additionalIdToken. This is a custom type, so the implementation needs to be agreed upon by all involved parties.
 };
 
@@ -4556,7 +4556,7 @@ struct VPNType
 
 struct GroupIdTokenType
 {
-	unsigned char idToken[36];									// Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
+	unsigned char idToken[37];									// Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
 	unsigned char type[16];										// Required. Enumeration of possible idToken types.
 };
 
@@ -4581,7 +4581,7 @@ struct IdTokenInfoType
 
 struct IdTokenType
 {
-	unsigned char idToken[36];									// Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
+	unsigned char idToken[37];									// Required. IdToken is case insensitive. Might hold the hidden id of an RFID tag, but can for example also contain a UUID.
 	unsigned char	type[16];									// Required. Enumeration of possible idToken types.
 	struct AdditionalInfoType additionalInfo[10];				// Optional. AdditionalInfo can be used to send extra information which can be validated by the CSMS in addition to the regular authorization with IdToken.
 };