|
@@ -1347,6 +1347,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].component.name, "AlignedDataCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variable.name, "Measurands");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableCharacteristics.maxLimit = 10;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_Measurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
@@ -1384,6 +1385,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].component.name, "AlignedDataCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variable.name, "TxEndedMeasurands");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableCharacteristics.maxLimit = 10;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AlignedDataCtrlr_TxEndedMeasurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
@@ -1488,7 +1490,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].component.name, "AuthCacheCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].variable.name, "Storage");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
|
|
|
- ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].variableCharacteristics.maxLimit = (1024*100);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].variableCharacteristics.maxLimit = (1024*10);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[AuthCacheCtrlr_Storage].variableAttribute[0].value, "TRUE");
|
|
@@ -1721,9 +1723,10 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].component.name, "DisplayMessageCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variable.name, "DisplayMessages");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableCharacteristics.maxLimit = 1;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].value, "%s", "0");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages].variableAttribute[0].value, "%s", "1");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_DisplayMessages]);
|
|
|
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[DisplayMessageCtrlr_SupportedFormats].component.name, "DisplayMessageCtrlr");
|
|
@@ -1787,6 +1790,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Entries].component.name, "LocalAuthListCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Entries].variable.name, "Entries");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Entries].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Entries].variableCharacteristics.maxLimit = 5000;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Entries].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Entries].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Entries].variableAttribute[0].value, "5000");
|
|
@@ -1821,7 +1825,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].component.name, "LocalAuthListCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variable.name, "Storage");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
|
|
|
- ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableCharacteristics.maxLimit = 1024*1024;
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableCharacteristics.maxLimit = (1024*10);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[LocalAuthListCtrlr_Storage].variableAttribute[0].value, "5000");
|
|
@@ -2063,9 +2067,14 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].component.name, "SampledDataCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variable.name, "TxEndedMeasurands");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variableCharacteristics.maxLimit = 10;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variableAttribute[0].value, " ");
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Interval,Power.Active.Import,Voltage,SOC");
|
|
|
+ else
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Interval,Power.Active.Import,Voltage");
|
|
|
+
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedMeasurands]);
|
|
|
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxEndedInterval].component.name, "SampledDataCtrlr");
|
|
@@ -2080,6 +2089,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxStartedMeasurands].component.name, "SampledDataCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxStartedMeasurands].variable.name, "TxStartedMeasurands");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxStartedMeasurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxStartedMeasurands].variableCharacteristics.maxLimit = 10;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxStartedMeasurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxStartedMeasurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxStartedMeasurands].variableAttribute[0].value, " ");
|
|
@@ -2088,9 +2098,13 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].component.name, "SampledDataCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variable.name, "TxUpdatedMeasurands");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_MemberList]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableCharacteristics.maxLimit = 10;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, " ");
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage,SOC");
|
|
|
+ else
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands].variableAttribute[0].value, "Current.Import,Energy.Active.Import.Register,Energy.Active.Import.Interval,Power.Active.Import,Voltage");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedMeasurands]);
|
|
|
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SampledDataCtrlr_TxUpdatedInterval].component.name, "SampledDataCtrlr");
|
|
@@ -2109,7 +2123,7 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_BasicAuthPassword].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_string]);
|
|
|
ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_BasicAuthPassword].variableCharacteristics.maxLimit = 40;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_BasicAuthPassword].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_BasicAuthPassword].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_BasicAuthPassword].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_WriteOnly]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_BasicAuthPassword].variableAttribute[0].value, " ");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_BasicAuthPassword]);
|
|
|
|
|
@@ -2133,8 +2147,9 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].component.name, "SecurityCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].variable.name, "CertificateEntries");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].variableCharacteristics.maxLimit = 1;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries].variableAttribute[0].value, "1");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_CertificateEntries]);
|
|
|
|
|
@@ -2154,6 +2169,15 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_AdditionalRootCertificateCheck].variableAttribute[0].value, "FALSE");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_AdditionalRootCertificateCheck]);
|
|
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].component.name, "SecurityCtrlr");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].variable.name, "MaxCertificateChainSize");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].variableCharacteristics.maxLimit = 10000;
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadOnly]);
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].variableAttribute[0].value, "10000");
|
|
|
+ DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize]);
|
|
|
+
|
|
|
/* SmartChargingCtrlr Required item */
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Enabled].component.name, "SmartChargingCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Enabled].variable.name, "Enabled");
|
|
@@ -2230,9 +2254,10 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].component.name, "SmartChargingCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].variable.name, "Entries");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].variableCharacteristics.dataType, "%s", DataEnumTypeStr[DataEnumType_integer]);
|
|
|
+ ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].variableCharacteristics.maxLimit = 10;
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].variableAttribute[0].type, "%s", AttributeEnumTypeStr[AttributeEnumType_Target]);
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].variableAttribute[0].mutability, "%s", MutabilityEnumTypeStr[MutabilityEnumType_ReadWrite]);
|
|
|
- sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].variableAttribute[0].value, "3");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries].variableAttribute[0].value, "10");
|
|
|
DB_variableSaveToDb(&ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Entries]);
|
|
|
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_LimitChangeSignificance].component.name, "SmartChargingCtrlr");
|
|
@@ -2699,6 +2724,9 @@ int DB_cbVariableIsCreate(void *para, int columnCount, char **columnValue, char
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_AdditionalRootCertificateCheck].component.name, "SecurityCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_AdditionalRootCertificateCheck].variable.name, "AdditionalRootCertificateCheck");
|
|
|
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].component.name, "SecurityCtrlr");
|
|
|
+ sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SecurityCtrlr_MaxCertificateChainSize].variable.name, "MaxCertificateChainSize");
|
|
|
+
|
|
|
/* SmartChargingCtrlr Required item */
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Enabled].component.name, "SmartChargingCtrlr");
|
|
|
sprintf((char*)ShmOCPP20Data->ControllerComponentVariable[SmartChargingCtrlr_Enabled].variable.name, "Enabled");
|
|
@@ -5190,6 +5218,46 @@ void CheckSystemValue(void)
|
|
|
sendAuthorizeRequest(0);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ if(isWebsocketSendable &&
|
|
|
+ (server_sign == TRUE) &&
|
|
|
+ (ShmOCPP20Data->GetMonitoringReport.requestId > 0))
|
|
|
+ {
|
|
|
+ for(uint8_t idxCriterion=0;idxCriterion<ARRAY_SIZE(ShmOCPP20Data->GetMonitoringReport.monitoringCriteria);idxCriterion++)
|
|
|
+ {
|
|
|
+ if(strcmp((char*)ShmOCPP20Data->GetMonitoringReport.monitoringCriteria[idxCriterion], MonitoringCriterionEnumTypeStr[MonitoringCriterionEnumType_ThresholdMonitoring]) == 0)
|
|
|
+ {
|
|
|
+ /*
|
|
|
+ * TODO:
|
|
|
+ * 1. Report component that are ThresholdMonitoring
|
|
|
+ */
|
|
|
+ }
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->GetMonitoringReport.monitoringCriteria[idxCriterion], MonitoringCriterionEnumTypeStr[MonitoringCriterionEnumType_DeltaMonitoring]) == 0)
|
|
|
+ {
|
|
|
+ /*
|
|
|
+ * TODO:
|
|
|
+ * 1. Report component that are DeltaMonitoring
|
|
|
+ */
|
|
|
+ }
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->GetMonitoringReport.monitoringCriteria[idxCriterion], MonitoringCriterionEnumTypeStr[MonitoringCriterionEnumType_PeriodicMonitoring]) == 0)
|
|
|
+ {
|
|
|
+ /*
|
|
|
+ * TODO:
|
|
|
+ * 1. Report component that are PeriodicMonitoring
|
|
|
+ */
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ /*
|
|
|
+ * TODO:
|
|
|
+ * 1. Process unknown criteria condition
|
|
|
+ */
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ ShmOCPP20Data->GetMonitoringReport.requestId = 0;
|
|
|
+ }
|
|
|
+
|
|
|
if(isWebsocketSendable &&
|
|
|
(server_sign == TRUE) &&
|
|
|
(ShmOCPP20Data->GetReport.requestId > 0))
|
|
@@ -5339,15 +5407,24 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
if(strcmp((char*)ShmOCPP20Data->Get15118EVCertificate.action, CertificateActionEnumTypeStr[CertificateActionEnumType_Install]) == 0)
|
|
|
{
|
|
|
-
|
|
|
+ /*
|
|
|
+ * TODO:
|
|
|
+ * 1.
|
|
|
+ */
|
|
|
}
|
|
|
else if(strcmp((char*)ShmOCPP20Data->Get15118EVCertificate.action, CertificateActionEnumTypeStr[CertificateActionEnumType_Update]) == 0)
|
|
|
{
|
|
|
-
|
|
|
+ /*
|
|
|
+ * TODO:
|
|
|
+ * 1.
|
|
|
+ */
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
-
|
|
|
+ /*
|
|
|
+ * TODO:
|
|
|
+ * 1.
|
|
|
+ */
|
|
|
}
|
|
|
|
|
|
sendGet15118EVCertificateRequest();
|
|
@@ -5355,8 +5432,6 @@ void CheckSystemValue(void)
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
-
|
|
|
//===============================
|
|
|
// Each connector operation check
|
|
|
//===============================
|
|
@@ -6006,7 +6081,14 @@ void CheckSystemValue(void)
|
|
|
if(isWebsocketSendable && (server_sign == TRUE) && (ShmOCPP20Data->CsMsg.bits[gun_index].ReserveNowConf == ON))
|
|
|
{
|
|
|
sendReserveNowConfirmation((char *)ShmOCPP20Data->ReserveNow[gun_index].guid, gun_index);
|
|
|
+ }
|
|
|
|
|
|
+ //==========================================
|
|
|
+ // csu trigger ReserveNowConf
|
|
|
+ //==========================================
|
|
|
+ if(isWebsocketSendable && (server_sign == TRUE) && (ShmOCPP20Data->CpMsg.bits[gun_index].ReservationStatusUpdateReq == ON))
|
|
|
+ {
|
|
|
+ sendReservationStatusUpdateRequest(gun_index);
|
|
|
}
|
|
|
|
|
|
//==========================================
|
|
@@ -6016,6 +6098,23 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
sendLogStatusNotificationRequest((char *)ShmOCPP20Data->LogStatusNotification.status);
|
|
|
}
|
|
|
+
|
|
|
+ //==========================================
|
|
|
+ // csu trigger SignCertificateReq
|
|
|
+ //==========================================
|
|
|
+ if(isWebsocketSendable && (server_sign == TRUE) && (ShmOCPP20Data->SpMsg.bits.SignCertificateReq == ON))
|
|
|
+ {
|
|
|
+ if((access("/Storage/OCPP/certCP.csr",F_OK) != -1) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignChargingStationCertificate]) == 0) )
|
|
|
+ {
|
|
|
+ sendSignCertificateRequest(CertificateSignedStatusEnumType_ChargingStationCertificate);
|
|
|
+ }
|
|
|
+ else if((access("/Storage/OCPP/certV2G.csr",F_OK) != -1) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[CertificateSignedStatusEnumType_V2GCertificate]) == 0))
|
|
|
+ {
|
|
|
+ sendSignCertificateRequest(CertificateSignedStatusEnumType_V2GCertificate);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -7904,6 +8003,8 @@ int sendReservationStatusUpdateRequest(int gun_index)
|
|
|
if(hashmap_operation(HASH_OP_ADD, guid, tempdata) == PASS)
|
|
|
{
|
|
|
result = PASS;
|
|
|
+
|
|
|
+ ShmOCPP20Data->CpMsg.bits[gun_index].ReservationStatusUpdateReq = OFF;
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@@ -7935,7 +8036,7 @@ int sendSecurityEventNotificationRequest()
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-int sendSignCertificateRequest()
|
|
|
+int sendSignCertificateRequest(CertificateSigningUseEnumType certType)
|
|
|
{
|
|
|
mtrace();
|
|
|
int result = FAIL;
|
|
@@ -7945,7 +8046,23 @@ int sendSignCertificateRequest()
|
|
|
json_object *SignCertificate = json_object_new_object();
|
|
|
DEBUG_INFO("sendSignCertificateRequest...\n");
|
|
|
|
|
|
+ // Read csr file content
|
|
|
+ memset(ShmOCPP20Data->SignCertificate.csr, 0x00, ARRAY_SIZE(ShmOCPP20Data->SignCertificate.csr));
|
|
|
+ FILE *fp=fopen(((certType == CertificateSignedStatusEnumType_V2GCertificate)?"/Storage/OCPP/certV2G.csr":"/Storage/OCPP/certCP.csr"),"r");
|
|
|
+ char *line = NULL;
|
|
|
+ size_t len = 0;
|
|
|
+ while(getline(&line, &len, fp) != -1)
|
|
|
+ {
|
|
|
+ if((strstr(line, "BEGIN CERTIFICATE REQUEST") == NULL) && (strstr(line, "END CERTIFICATE REQUEST") == NULL))
|
|
|
+ {
|
|
|
+ memcpy(&ShmOCPP20Data->SignCertificate.csr[strlen((char*)ShmOCPP20Data->SignCertificate.csr)], line, (strlen(line)-1));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ fclose(fp);
|
|
|
+
|
|
|
json_object_object_add(SignCertificate, "csr", json_object_new_string((char*)ShmOCPP20Data->SignCertificate.csr));
|
|
|
+
|
|
|
+ sprintf((char*)ShmOCPP20Data->SignCertificate.certificateType, CertificateSigningUseEnumTypeStr[certType]);
|
|
|
json_object_object_add(SignCertificate, "certificateType", json_object_new_string((char*)ShmOCPP20Data->SignCertificate.certificateType));
|
|
|
|
|
|
random_uuid(guid);
|
|
@@ -9096,11 +9213,21 @@ int sendCertificateSignedConfirmation(char *uuid)
|
|
|
int result = FAIL;
|
|
|
char message[4096]={0};
|
|
|
json_object *CertificateSigned = json_object_new_object();
|
|
|
+ json_object *statusInfo = json_object_new_object();
|
|
|
|
|
|
DEBUG_INFO("sendCertificateSignedConfirmation...\n");
|
|
|
|
|
|
json_object_object_add(CertificateSigned, "status", json_object_new_string((char*)ShmOCPP20Data->CertificateSigned.Response_status));
|
|
|
|
|
|
+ if(strlen((char*)ShmOCPP20Data->CertificateSigned.Response_statusInfo.reasonCode) > 0)
|
|
|
+ {
|
|
|
+ json_object_object_add(statusInfo, "reasonCode", json_object_new_string((char*)ShmOCPP20Data->CertificateSigned.Response_statusInfo.reasonCode));
|
|
|
+
|
|
|
+ if(strlen((char*)ShmOCPP20Data->CertificateSigned.Response_statusInfo.additionalInfo) > 0)
|
|
|
+ json_object_object_add(statusInfo, "statadditionalInfous", json_object_new_string((char*)ShmOCPP20Data->CertificateSigned.Response_statusInfo.additionalInfo));
|
|
|
+ }
|
|
|
+ json_object_object_add(CertificateSigned, "statusInfo", statusInfo);
|
|
|
+
|
|
|
sprintf(message,"[%d,\"%s\",%s]"
|
|
|
,MESSAGE_TYPE_CALLRESULT
|
|
|
,uuid
|
|
@@ -9850,7 +9977,7 @@ int sendSetChargingProfileConfirmation(char *uuid, unsigned char gun_index)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-int sendSetDisplayMessageConfirmation(char *uuid)
|
|
|
+int sendSetDisplayMessagesConfirmation(char *uuid)
|
|
|
{
|
|
|
mtrace();
|
|
|
int result = FAIL;
|
|
@@ -10293,18 +10420,7 @@ int handleCertificateSignedRequest(char *uuid, char *payload)
|
|
|
memset(&ShmOCPP20Data->CertificateSigned, 0, sizeof(struct CertificateSigned_20));
|
|
|
memcpy(&ShmOCPP20Data->CertificateSigned.guid, uuid, ARRAY_SIZE(ShmOCPP20Data->CertificateSigned.guid));
|
|
|
// Required data
|
|
|
- if(json_object_array_length(json_object_object_get(CertificateSigned, "certificate")) <= ARRAY_SIZE(ShmOCPP20Data->CertificateSigned.certificate))
|
|
|
- {
|
|
|
- for(int idx=0;idx<json_object_array_length(json_object_object_get(CertificateSigned, "certificate"));idx++)
|
|
|
- {
|
|
|
- sprintf((char*)ShmOCPP20Data->CertificateSigned.certificate[idx], "%s", json_object_get_string(json_object_array_get_idx(json_object_object_get(CertificateSigned, "certificateType"), idx)));
|
|
|
-
|
|
|
- /*
|
|
|
- * TODO:
|
|
|
- * 1. Certificate install response
|
|
|
- */
|
|
|
- }
|
|
|
- }
|
|
|
+ sprintf((char*)ShmOCPP20Data->CertificateSigned.certificateChain, "%s", json_object_get_string(json_object_object_get(CertificateSigned, "certificateChain")));
|
|
|
|
|
|
// Optional data
|
|
|
if(json_object_object_get(CertificateSigned, "certificateType") != NULL)
|
|
@@ -10313,17 +10429,28 @@ int handleCertificateSignedRequest(char *uuid, char *payload)
|
|
|
|
|
|
if(strcmp((char*)ShmOCPP20Data->CertificateSigned.certificateType, CertificateSigningUseEnumTypeStr[CertificateSignedStatusEnumType_ChargingStationCertificate]) == 0)
|
|
|
{
|
|
|
-
|
|
|
+ FILE *fp = fopen("/Storage/OCPP/certCP.crt", "w");
|
|
|
+ fprintf(fp, "%s", ShmOCPP20Data->CertificateSigned.certificateChain);
|
|
|
+ fclose(fp);
|
|
|
}
|
|
|
else if(strcmp((char*)ShmOCPP20Data->CertificateSigned.certificateType, CertificateSigningUseEnumTypeStr[CertificateSignedStatusEnumType_V2GCertificate]) == 0)
|
|
|
{
|
|
|
-
|
|
|
+ FILE *fp = fopen("/Storage/OCPP/certV2G.crt", "w");
|
|
|
+ fprintf(fp, "%s", ShmOCPP20Data->CertificateSigned.certificateChain);
|
|
|
+ fclose(fp);
|
|
|
}
|
|
|
- else
|
|
|
- {
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ FILE *fp = fopen("/Storage/OCPP/certCP.crt", "w");
|
|
|
+ fprintf(fp, "%s", ShmOCPP20Data->CertificateSigned.certificateChain);
|
|
|
+ fclose(fp);
|
|
|
|
|
|
- }
|
|
|
+ fp = fopen("/Storage/OCPP/certV2G.crt", "w");
|
|
|
+ fprintf(fp, "%s", ShmOCPP20Data->CertificateSigned.certificateChain);
|
|
|
+ fclose(fp);
|
|
|
}
|
|
|
+ system("/bin/fsync -d /dev/mtdblock13;/bin/sync &");
|
|
|
|
|
|
strcpy((char*)ShmOCPP20Data->CertificateSigned.Response_status, CertificateSignedStatusEnumTypeStr[CertificateSignedStatusEnumType_Accepted]);
|
|
|
}
|
|
@@ -12089,10 +12216,11 @@ int handleGetDisplayMessagesRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
ShmOCPP20Data->GetDisplayMessages.id[idx] = json_object_get_int(json_object_array_get_idx(json_object_object_get(GetDisplayMessages, "id"), idx));
|
|
|
}
|
|
|
- strcpy((char*)ShmOCPP20Data->GetInstalledCertificateIds.Response_status, GetDisplayMessagesStatusEnumTypeStr[GetDisplayMessagesStatusEnumType_Accepted]);
|
|
|
+ strcpy((char*)ShmOCPP20Data->GetDisplayMessages.Response_status, GetDisplayMessagesStatusEnumTypeStr[GetDisplayMessagesStatusEnumType_Accepted]);
|
|
|
+ ShmOCPP20Data->MsMsg.bits.GetDisplayMessagesReq = ON;
|
|
|
}
|
|
|
else
|
|
|
- strcpy((char*)ShmOCPP20Data->GetInstalledCertificateIds.Response_status, GetDisplayMessagesStatusEnumTypeStr[GetDisplayMessagesStatusEnumType_Unknown]);
|
|
|
+ strcpy((char*)ShmOCPP20Data->GetDisplayMessages.Response_status, GetDisplayMessagesStatusEnumTypeStr[GetDisplayMessagesStatusEnumType_Unknown]);
|
|
|
}
|
|
|
json_object_put(GetDisplayMessages);
|
|
|
|
|
@@ -14406,7 +14534,7 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
-int handleSetDisplayMessageRequest(char *uuid, char *payload)
|
|
|
+int handleSetDisplayMessagesRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
mtrace();
|
|
|
int result = FAIL;
|
|
@@ -14473,9 +14601,9 @@ int handleSetDisplayMessageRequest(char *uuid, char *payload)
|
|
|
json_object_put(SetDisplayMessage);
|
|
|
|
|
|
strcpy((char*)ShmOCPP20Data->SetDisplayMessage.Response_status, DisplayMessageStatusEnumTypeStr[DisplayMessageStatusEnumType_Accepted]);
|
|
|
- sendSetMonitoringBaseConfirmation(uuid);
|
|
|
+ sendSetDisplayMessagesConfirmation(uuid);
|
|
|
|
|
|
- // Anouce CSU there is display request come from server
|
|
|
+ // Announce CSU there is display request come from server
|
|
|
ShmOCPP20Data->MsMsg.bits.SetDisplayMessageReq = ON;
|
|
|
|
|
|
return result;
|
|
@@ -14768,6 +14896,7 @@ int handleSetVariableMonitoringRequest(char *uuid, char *payload)
|
|
|
mtrace();
|
|
|
int result = FAIL;
|
|
|
json_object *SetVariableMonitoring;
|
|
|
+ uint8_t variableQuantity = 0;
|
|
|
|
|
|
DEBUG_INFO("handleSetVariableMonitoringRequest...\n");
|
|
|
SetVariableMonitoring = json_tokener_parse(payload);
|
|
@@ -14778,6 +14907,7 @@ int handleSetVariableMonitoringRequest(char *uuid, char *payload)
|
|
|
// Required data
|
|
|
for(int idx=0;idx<json_object_array_length(json_object_object_get(SetVariableMonitoring, "setMonitoringData"));idx++)
|
|
|
{
|
|
|
+ variableQuantity++;
|
|
|
if(json_object_object_get(json_object_array_get_idx(json_object_object_get(SetVariableMonitoring, "setMonitoringData"), idx), "id") != NULL)
|
|
|
{
|
|
|
ShmOCPP20Data->SetVariableMonitoring.setMonitoringData[idx].id = json_object_get_int(json_object_object_get(json_object_array_get_idx(json_object_object_get(SetVariableMonitoring, "setMonitoringData"), idx), "id"));
|
|
@@ -14787,11 +14917,6 @@ int handleSetVariableMonitoringRequest(char *uuid, char *payload)
|
|
|
if(json_object_object_get(json_object_array_get_idx(json_object_object_get(SetVariableMonitoring, "setMonitoringData"), idx), "value") != NULL)
|
|
|
{
|
|
|
ShmOCPP20Data->SetVariableMonitoring.setMonitoringData[idx].value = json_object_get_double(json_object_object_get(json_object_array_get_idx(json_object_object_get(SetVariableMonitoring, "setMonitoringData"), idx), "value"));
|
|
|
- /*
|
|
|
- * TODO:
|
|
|
- * 1. Check monitor value status
|
|
|
- */
|
|
|
- strcpy((char*)ShmOCPP20Data->SetVariableMonitoring.Response_setMonitoringResult[idx].status, MonitorEnumTypeStr[MonitorEnumType_Delta]);
|
|
|
}
|
|
|
|
|
|
if(json_object_object_get(json_object_array_get_idx(json_object_object_get(SetVariableMonitoring, "setMonitoringData"), idx), "type") != NULL)
|
|
@@ -14853,10 +14978,15 @@ int handleSetVariableMonitoringRequest(char *uuid, char *payload)
|
|
|
|
|
|
memcpy(&ShmOCPP20Data->SetVariableMonitoring.Response_setMonitoringResult[idx].variable , &ShmOCPP20Data->SetVariableMonitoring.setMonitoringData[idx].variable, sizeof(struct VariableType));
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char*)ShmOCPP20Data->SetVariableMonitoring.Response_setMonitoringResult[idx].status, SetMonitoringStatusEnumTypeStr[SetMonitoringStatusEnumType_Accepted]);
|
|
|
}
|
|
|
}
|
|
|
json_object_put(SetVariableMonitoring);
|
|
|
|
|
|
+
|
|
|
+ sendSetVariableMonitoringConfirmation(uuid, variableQuantity);
|
|
|
+
|
|
|
return result;
|
|
|
}
|
|
|
|
|
@@ -14967,7 +15097,6 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
|
|
|
int result = FAIL;
|
|
|
int connectorIdIsNULL = FALSE;
|
|
|
int connectorIdInt =0;
|
|
|
- char requestedMessagestr[40]={0};
|
|
|
json_object *TriggerMessage;
|
|
|
|
|
|
DEBUG_INFO("handleTriggerMessageRequest\n");
|
|
@@ -15002,17 +15131,17 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
|
|
|
|
|
|
if((connectorIdIsNULL == TRUE) || ((connectorIdIsNULL == FALSE) && ((connectorIdInt > 0) && (connectorIdInt <= gunTotalNumber /*(CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY)*/ ))) )
|
|
|
{
|
|
|
- if((strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_BootNotification]) != 0) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_LogStatusNotification]) != 0) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_FirmwareStatusNotification]) != 0 ) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_Heartbeat]) != 0) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_MeterValues]) != 0) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignChargingStationCertificate]) != 0 ) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignV2GCertificate]) != 0 ) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_StatusNotification]) != 0 ) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_TransactionEvent]) != 0 ) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignCombinedCertificate]) != 0 ) &&
|
|
|
- (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_PublishFirmwareStatusNotification]) != 0 ))
|
|
|
+ if((strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_BootNotification]) != 0) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_LogStatusNotification]) != 0) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_FirmwareStatusNotification]) != 0 ) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_Heartbeat]) != 0) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_MeterValues]) != 0) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignChargingStationCertificate]) != 0 ) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignV2GCertificate]) != 0 ) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_StatusNotification]) != 0 ) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_TransactionEvent]) != 0 ) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignCombinedCertificate]) != 0 ) &&
|
|
|
+ (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_PublishFirmwareStatusNotification]) != 0 ))
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP20Data->TriggerMessage.Response_status, "%s",TriggerMessageStatusEnumTypeStr[TriggerMessageStatusEnumType_NotImplemented] );
|
|
|
sendTriggerMessageConfirmation(uuid);
|
|
@@ -15034,7 +15163,7 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
|
|
|
//==========================
|
|
|
// Trigger message
|
|
|
//==========================
|
|
|
- if( strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_FirmwareStatusNotification]) == 0)
|
|
|
+ if( strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_FirmwareStatusNotification]) == 0)
|
|
|
{
|
|
|
if((strlen((char*)ShmOCPP20Data->FirmwareStatusNotification.status) == 0) ||
|
|
|
((FirmwareStatusNotificationStatus != FirmwareStatusEnumType_Downloading) && (FirmwareStatusNotificationStatus != FirmwareStatusEnumType_Downloaded) && (FirmwareStatusNotificationStatus != FirmwareStatusEnumType_Idle) && (FirmwareStatusNotificationStatus != FirmwareStatusEnumType_Installing)))
|
|
@@ -15044,22 +15173,22 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
|
|
|
|
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
}
|
|
|
- else if(strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_LogStatusNotification]) == 0 )
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_LogStatusNotification]) == 0 )
|
|
|
{
|
|
|
if(strlen((char*)ShmOCPP20Data->LogStatusNotification.status) == 0)
|
|
|
sprintf((char*)ShmOCPP20Data->LogStatusNotification.status, "%s", UploadLogStatusEnumTypeStr[UploadLogStatusEnumType_Idle]);
|
|
|
ShmOCPP20Data->SpMsg.bits.LogStatusNotificationReq = ON;
|
|
|
}
|
|
|
- else if(strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_BootNotification]) == 0 )
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_BootNotification]) == 0 )
|
|
|
{
|
|
|
if(DB_updateBootType(BootReasonEnumType_Triggered))
|
|
|
server_sign = FALSE;
|
|
|
}
|
|
|
- else if(strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_Heartbeat]) == 0 )
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_Heartbeat]) == 0 )
|
|
|
{
|
|
|
clientTime.Heartbeat = time((time_t*)NULL) - (ShmOCPP20Data->BootNotification.Response_interval);
|
|
|
}
|
|
|
- else if (strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_MeterValues]) == 0 )
|
|
|
+ else if (strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_MeterValues]) == 0 )
|
|
|
{
|
|
|
if(connectorIdIsNULL == FALSE)
|
|
|
{
|
|
@@ -15078,7 +15207,7 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if(strcmp(requestedMessagestr, MessageTriggerEnumTypeStr[MessageTriggerEnumType_StatusNotification]) == 0 )
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_StatusNotification]) == 0 )
|
|
|
{
|
|
|
if(connectorIdIsNULL == FALSE)
|
|
|
{
|
|
@@ -15093,6 +15222,57 @@ int handleTriggerMessageRequest(char *uuid, char *payload)
|
|
|
cpinitateMsg.bits[idx].StatusNotificationReq = ON;
|
|
|
}
|
|
|
}
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignChargingStationCertificate]) == 0 )
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->SpMsg.bits.SignCertificateReq = ON;
|
|
|
+
|
|
|
+ if(access("/Storage/OCPP/certCP.csr",F_OK) == -1)
|
|
|
+ {
|
|
|
+ system("openssl req -newkey rsa:2048 -out /Storage/OCPP/certCP.csr -nodes -keyout /Storage/OCPP/certCP.key -subj \"/C=TW/ST=Taiwan/L=Taoyuan/O=Phihong Technology/OU=IT/CN=phihong.com\" &");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignV2GCertificate]) == 0 )
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->SpMsg.bits.SignCertificateReq = ON;
|
|
|
+
|
|
|
+ if(access("/Storage/OCPP/certV2G.csr",F_OK) == -1)
|
|
|
+ {
|
|
|
+ system("openssl req -newkey rsa:2048 -out /Storage/OCPP/certV2G.csr -nodes -keyout /Storage/OCPP/certV2G.key -subj \"/C=TW/ST=Taiwan/L=Taoyuan/O=Phihong Technology/OU=IT/CN=phihong.com\" &");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_TransactionEvent]) == 0 )
|
|
|
+ {
|
|
|
+ if(connectorIdIsNULL == FALSE)
|
|
|
+ {
|
|
|
+ if((connectorIdInt > 0) && ((connectorIdInt -1) < gunTotalNumber))
|
|
|
+ {
|
|
|
+ cpinitateMsg.bits[connectorIdInt -1].TransactionEventReq = ON;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for(int idx=0;idx< gunTotalNumber;idx++)
|
|
|
+ cpinitateMsg.bits[idx].TransactionEventReq = ON;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_SignCombinedCertificate]) == 0 )
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->SpMsg.bits.SignCertificateReq = ON;
|
|
|
+
|
|
|
+ if(access("/Storage/OCPP/certCP.csr",F_OK) == -1)
|
|
|
+ {
|
|
|
+ system("openssl req -newkey rsa:2048 -out /Storage/OCPP/certCP.csr -nodes -keyout /Storage/OCPP/certCP.key -subj \"/C=TW/ST=Taiwan/L=Taoyuan/O=Phihong Technology/OU=IT/CN=phihong.com\" &");
|
|
|
+ }
|
|
|
+
|
|
|
+ if(access("/Storage/OCPP/certV2G.csr",F_OK) == -1)
|
|
|
+ {
|
|
|
+ system("openssl req -newkey rsa:2048 -out /Storage/OCPP/certV2G.csr -nodes -keyout /Storage/OCPP/certV2G.key -subj \"/C=TW/ST=Taiwan/L=Taoyuan/O=Phihong Technology/OU=IT/CN=phihong.com\" &");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if(strcmp((char*)ShmOCPP20Data->TriggerMessage.requestedMessage, MessageTriggerEnumTypeStr[MessageTriggerEnumType_PublishFirmwareStatusNotification]) == 0 )
|
|
|
+ {
|
|
|
+ ShmOCPP20Data->MsMsg.bits.PublishFirmwareReq = ON;
|
|
|
+ }
|
|
|
|
|
|
return result;
|
|
|
}
|
|
@@ -15283,9 +15463,9 @@ void *UpdateFirmwareProcess(void *data)
|
|
|
int retriesInt =0, retryIntervalInt=0;
|
|
|
char protocol[10], user[50],password[50],host[50], path[50], ftppath[60],host1[50],path1[20];
|
|
|
int port=0;
|
|
|
- char locationstr[160]={0}, retrieveDatestr[30]={0};
|
|
|
+ char locationstr[512]={0}, retrieveDatestr[36]={0};
|
|
|
int isSuccess = 0;
|
|
|
- char ftpbuf[200];
|
|
|
+ char ftpbuf[512];
|
|
|
char temp[100];
|
|
|
char * pch;
|
|
|
|
|
@@ -15315,17 +15495,25 @@ void *UpdateFirmwareProcess(void *data)
|
|
|
}
|
|
|
json_object_put(UpdateFirmware);
|
|
|
|
|
|
-
|
|
|
memset(ftppath, 0, ARRAY_SIZE(ftppath));
|
|
|
memset(path, 0, ARRAY_SIZE(path));
|
|
|
|
|
|
+ // Wait retrieveData
|
|
|
+ if(strlen(retrieveDatestr) > 10)
|
|
|
+ {
|
|
|
+ sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s", FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_DownloadScheduled]);
|
|
|
+ ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
+ do
|
|
|
+ {
|
|
|
+ sleep(1);
|
|
|
+ }while(!isOvertNow((uint8_t*)retrieveDatestr));
|
|
|
+ }
|
|
|
+
|
|
|
system("rm -f /mnt/*");
|
|
|
if(strncmp(locationstr,"http", 4) == 0)
|
|
|
{
|
|
|
sscanf(locationstr,"%[^:]:%*2[/]%[^/]/%199[^\n]", protocol, host, path);
|
|
|
|
|
|
- //sscanf(locationstr,"%[^:]:%*2[/]%[^:]:%[^@]@%[^/]%199[^\n]",
|
|
|
- // protocol, user, password, host, path);
|
|
|
sprintf(ftppath,"/%s", path);
|
|
|
DEBUG_INFO("locationstr: %s\n", locationstr);
|
|
|
DEBUG_INFO("protocol: %s\n",protocol);
|
|
@@ -15362,21 +15550,24 @@ void *UpdateFirmwareProcess(void *data)
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s", FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_DownloadFailed]);
|
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
- sleep(retryIntervalInt);
|
|
|
+ if(retriesInt>0)sleep(retryIntervalInt);else sleep(1);
|
|
|
+ sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s",FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_Idle]);
|
|
|
+ ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s", FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_Downloaded]);
|
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
}
|
|
|
- }while((isSuccess == 0)&&(retriesInt > 0 && retriesInt --));
|
|
|
+ retriesInt--;
|
|
|
+ }while((isSuccess == 0)&&(retriesInt >= 0));
|
|
|
}
|
|
|
else if(strncmp(locationstr,"ftp", 3) == 0) // ftp
|
|
|
{
|
|
|
memset(ftpbuf, 0, ARRAY_SIZE(ftpbuf));
|
|
|
memset(temp, 0, ARRAY_SIZE(temp));
|
|
|
- //DEBUG_INFO("locationstr=%s\n",locationstr);
|
|
|
- strcpy(ftpbuf, locationstr/*"ftp://ipc_ui:pht2016@ftp.phihong.com.tw/DC/log/DemoDC1_2018-07-13_185011_PSULog.zip"*/ );
|
|
|
+
|
|
|
+ strcpy(ftpbuf, locationstr);
|
|
|
int ftppathlen=strlen(ftpbuf);
|
|
|
int i=1;
|
|
|
char filenametemp[50];
|
|
@@ -15414,16 +15605,6 @@ void *UpdateFirmwareProcess(void *data)
|
|
|
sscanf(host,"%[^/]%s",host1, path1);
|
|
|
sprintf(ftppath,"%s", path1);
|
|
|
|
|
|
- //DEBUG_INFO("protocol =%s\n",protocol);
|
|
|
- //DEBUG_INFO("user =%s\n",user);
|
|
|
- //DEBUG_INFO("password =%s\n",password);
|
|
|
- //DEBUG_INFO("host1 =%s\n",host1);
|
|
|
- //DEBUG_INFO("port =%d\n",port);
|
|
|
- //DEBUG_INFO("path1 =%s\n",path1);
|
|
|
- //DEBUG_INFO("ftppath=%s\n",ftppath);
|
|
|
-
|
|
|
- //ftpFile(host, user, password, port, ftppath, fname);
|
|
|
- //download firmware pthred
|
|
|
if(port == 0)
|
|
|
{
|
|
|
port = 21;
|
|
@@ -15442,7 +15623,9 @@ void *UpdateFirmwareProcess(void *data)
|
|
|
DEBUG_INFO("Update firmware request and download file fail.\n");
|
|
|
sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s", FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_DownloadFailed]);
|
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
- sleep(retryIntervalInt);
|
|
|
+ if(retriesInt>0)sleep(retryIntervalInt);else sleep(1);
|
|
|
+ sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s",FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_Idle]);
|
|
|
+ ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -15450,15 +15633,19 @@ void *UpdateFirmwareProcess(void *data)
|
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
|
|
|
}
|
|
|
- }while((!isSuccess)&&(retriesInt > 0 && retriesInt --));
|
|
|
+ retriesInt--;
|
|
|
+ }while((!isSuccess)&&(retriesInt >= 0));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s", FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_DownloadFailed]);
|
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
+ sleep(1);
|
|
|
+ sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "%s",FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_Idle]);
|
|
|
+ ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
|
}
|
|
|
|
|
|
- ShmOCPP20Data->MsMsg.bits.UpdateFirmwareReq = ON;
|
|
|
+ if(strstr((char*)ShmOCPP20Data->FirmwareStatusNotification.status, FirmwareStatusEnumTypeStr[FirmwareStatusEnumType_Downloaded]) != NULL)ShmOCPP20Data->MsMsg.bits.UpdateFirmwareReq = ON;
|
|
|
pthread_exit(NULL);
|
|
|
|
|
|
}
|
|
@@ -15915,6 +16102,15 @@ void hanldeSignCertificateResponse(char *payload, int gun_index)
|
|
|
// Required data
|
|
|
if(json_object_object_get(SignCertificate,"status") != NULL)
|
|
|
sprintf((char*)ShmOCPP20Data->SignCertificate.Response_status, json_object_get_string(json_object_object_get(SignCertificate,"status")));
|
|
|
+
|
|
|
+ // Optional data
|
|
|
+ if(json_object_object_get(json_object_object_get(SignCertificate,"statusInfo"), "reasonCode") != NULL)
|
|
|
+ {
|
|
|
+ sprintf((char*)ShmOCPP20Data->SignCertificate.Response_statusInfo.reasonCode, json_object_get_string(json_object_object_get(json_object_object_get(SignCertificate,"statusInfo"), "reasonCode")));
|
|
|
+
|
|
|
+ if(json_object_object_get(json_object_object_get(SignCertificate,"statusInfo"), "additionalInfo") != NULL)
|
|
|
+ sprintf((char*)ShmOCPP20Data->SignCertificate.Response_statusInfo.additionalInfo, json_object_get_string(json_object_object_get(json_object_object_get(SignCertificate,"statusInfo"), "additionalInfo")));
|
|
|
+ }
|
|
|
}
|
|
|
json_object_put(SignCertificate);
|
|
|
|