|
@@ -8807,7 +8807,7 @@ int sendGetCompositeScheduleConfirmation(char *uuid, char *payload, int connecto
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- sprintf(message,"[%d,\"%s\",{\"status\":\"%s\",\"connectorId\":%d,\"scheduleStart\":\"%s\",\"chargingSchedule\":{\"duration\":%d,\"startSchedule\":\"%s\",\"chargingRateUnit\":\"%s\",\"chargingSchedulePeriod\":[{\"startPeriod\":0,\"limit\":%d,\"numberPhases\":3}]}}]"
|
|
|
+ sprintf(message,"[%d,\"%s\",{\"status\":\"%s\",\"connectorId\":%d,\"scheduleStart\":\"%s\",\"chargingSchedule\":{\"duration\":%d,\"startSchedule\":\"%s\",\"chargingRateUnit\":\"%s\",\"chargingSchedulePeriod\":[{\"startPeriod\":0,\"limit\":%d}]}}]"
|
|
|
,MESSAGE_TYPE_CALLRESULT
|
|
|
,uuid
|
|
|
,payload
|
|
@@ -8816,7 +8816,7 @@ int sendGetCompositeScheduleConfirmation(char *uuid, char *payload, int connecto
|
|
|
,ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.Duration
|
|
|
,ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.StartSchedule
|
|
|
,ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingRateUnit
|
|
|
- ,(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent==0?ShmSysConfigAndInfo->SysConfig.RatingCurrent:ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent));
|
|
|
+ ,ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingRateUnit[0]=='W'?modelnameInfo.ratedPower:(ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent==0?ShmSysConfigAndInfo->SysConfig.RatingCurrent:ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent));
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -13058,7 +13058,7 @@ int handleReserveNowTransactionRequest(char *uuid, char *payload)
|
|
|
int result = FAIL;
|
|
|
int connectorIdInt=0, reservationIdInt=0;
|
|
|
int tempIndex = 0;
|
|
|
- char expiryDatestr[30]={0}, idTagstr[20]={0},parentIdTagstr[20]={0};
|
|
|
+ char expiryDatestr[30]={0}, idTagstr[21]={0},parentIdTagstr[21]={0};
|
|
|
char comfirmstr[20]={0};
|
|
|
char sstr[180]={ 0 },sstrtemp[200]={ 0 };
|
|
|
int c = 0;
|
|
@@ -13739,23 +13739,22 @@ int handleSendLocalListRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
//Local list full update
|
|
|
DEBUG_INFO("Local list full update.\n");
|
|
|
-
|
|
|
+ locallistVersion = 0;
|
|
|
OCPP_getListVerion();
|
|
|
|
|
|
- if(ShmOCPP16Data->SendLocalList.ListVersion < locallistVersion)
|
|
|
+ /*if(ShmOCPP16Data->SendLocalList.ListVersion < locallistVersion)
|
|
|
{
|
|
|
strcpy(comfirmstr, UpdateStatusStr[UpdateStatus_Failed]);
|
|
|
goto end;
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
OCPP_cleanLocalList();
|
|
|
-
|
|
|
}
|
|
|
else if(strcmp((char*)ShmOCPP16Data->SendLocalList.UpdateType, UpdateTypeStr[Differential]) == 0)
|
|
|
{
|
|
|
//Local list different update
|
|
|
DEBUG_INFO("Local list different update.\n");
|
|
|
-
|
|
|
+ locallistVersion = 0;
|
|
|
OCPP_getListVerion();
|
|
|
|
|
|
if(ShmOCPP16Data->SendLocalList.ListVersion < locallistVersion)
|
|
@@ -14365,7 +14364,7 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
goto end;
|
|
|
}
|
|
|
|
|
|
- //------------------------------Satrt: Check Configuration Key "MaxChargingProfilesInstalled" Logic---------------------------------------//
|
|
|
+ //------------------------------Start: Check Configuration Key "MaxChargingProfilesInstalled" Logic---------------------------------------//
|
|
|
{
|
|
|
FILE *fp;
|
|
|
char dataLine[4096]={0};
|
|
@@ -15844,7 +15843,7 @@ int initialConfigurationTable(void)
|
|
|
char sstr[256]={0};
|
|
|
int c = 0;
|
|
|
char *loc;
|
|
|
- int confVersion = 14;
|
|
|
+ int confVersion = 15;
|
|
|
|
|
|
DEBUG_INFO("initialConfigurationTable...version: %d\n", confVersion);
|
|
|
//start_t = clock();
|
|
@@ -16267,6 +16266,27 @@ int initialConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","PreAuthAmount", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[PreAuthAmount].ItemData);
|
|
|
|
|
|
+ // isEnableLocalPowersharing
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemName, "isEnableLocalPowersharing");
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemData, "0" );
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","isEnableLocalPowersharing", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemData);
|
|
|
+
|
|
|
+ // PowerSharingServerIP
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemName, "PowerSharingServerIP");
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData, "" );
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","PowerSharingServerIP", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData);
|
|
|
+
|
|
|
+ // EVCCID_PREFIX
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemName, "EVCCID_PREFIX");
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData, "" );
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","EVCCID_PREFIX", "false", ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData);
|
|
|
+
|
|
|
// Configuration Version
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemAccessibility = 0;
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemName, "ConfigurationVersion");
|
|
@@ -16737,6 +16757,24 @@ int initialConfigurationTable(void)
|
|
|
sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PreAuthAmount].ItemData, "%.2f", atof(valuestr));
|
|
|
}
|
|
|
|
|
|
+ if(strcmp(keystr, "isEnableLocalPowersharing") == 0)
|
|
|
+ {
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemData, "%d", atoi(valuestr));
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strcmp(keystr, "PowerSharingServerIP") == 0)
|
|
|
+ {
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData, "%s",valuestr);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strcmp(keystr, "EVCCID_PREFIX") == 0)
|
|
|
+ {
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData, "%s", valuestr);
|
|
|
+ }
|
|
|
+
|
|
|
if(strcmp(keystr, "ConfigurationVersion") == 0)
|
|
|
{
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
@@ -17296,6 +17334,33 @@ void StoreConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","PreAuthAmount", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PreAuthAmount].ItemData);
|
|
|
|
|
|
+ // isEnableLocalPowersharing
|
|
|
+ /*
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemName, "isEnableLocalPowersharing");
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemData, "0" );
|
|
|
+ */
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","isEnableLocalPowersharing", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemData);
|
|
|
+
|
|
|
+ // PowerSharingServerIP
|
|
|
+ /*
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemName, "PowerSharingServerIP");
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData, "" );
|
|
|
+ */
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","PowerSharingServerIP", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData);
|
|
|
+
|
|
|
+ // EVCCID_PREFIX
|
|
|
+ /*
|
|
|
+ ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemName, "EVCCID_PREFIX");
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData, "" );
|
|
|
+ */
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","EVCCID_PREFIX", "false", (char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData);
|
|
|
+
|
|
|
// ConfigurationVersion
|
|
|
/*
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemAccessibility = 1;
|
|
@@ -18339,6 +18404,60 @@ void getKeyValue(char *keyReq)
|
|
|
isKnowKey = TRUE;
|
|
|
}
|
|
|
|
|
|
+ if(isEmpty || strcmp(keyReq, "isEnableLocalPowersharing") == 0 )
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_isEnableLocalPowersharing].Item, "isEnableLocalPowersharing");
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_isEnableLocalPowersharing].Key, "isEnableLocalPowersharing");
|
|
|
+
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemAccessibility == 1)
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_isEnableLocalPowersharing].ReadOnly, "0"/*"FALSE"*/);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_isEnableLocalPowersharing].ReadOnly, "1"/*"TRUE"*/);
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_isEnableLocalPowersharing].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemData );
|
|
|
+ isKnowKey = TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isEmpty || strcmp(keyReq, "PowerSharingServerIP") == 0 )
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_PowerSharingServerIP].Item, "PowerSharingServerIP");
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_PowerSharingServerIP].Key, "PowerSharingServerIP");
|
|
|
+
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemAccessibility == 1)
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_PowerSharingServerIP].ReadOnly, "0"/*"FALSE"*/);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_PowerSharingServerIP].ReadOnly, "1"/*"TRUE"*/);
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_PowerSharingServerIP].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[PowerSharingServerIP].ItemData );
|
|
|
+ isKnowKey = TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isEmpty || strcmp(keyReq, "EVCCID_PREFIX") == 0 )
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_EVCCID_PREFIX].Item, "EVCCID_PREFIX");
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_EVCCID_PREFIX].Key, "EVCCID_PREFIX");
|
|
|
+
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemAccessibility == 1)
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_EVCCID_PREFIX].ReadOnly, "0"/*"FALSE"*/);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_EVCCID_PREFIX].ReadOnly, "1"/*"TRUE"*/);
|
|
|
+ }
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_EVCCID_PREFIX].Value, (const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData );
|
|
|
+ isKnowKey = TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
if(isEmpty || strcmp(keyReq, "ConfigurationVersion") == 0 )
|
|
|
{
|
|
|
strcpy((char *)ShmOCPP16Data->GetConfiguration.Key[GetConfiguration_ConfigurationVersion].Item, "ConfigurationVersion");
|
|
@@ -19634,6 +19753,61 @@ int setKeyValue(char *key, char *value)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ if(strcmp(key, "isEnableLocalPowersharing") == 0)
|
|
|
+ {
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemAccessibility == 1)
|
|
|
+ {
|
|
|
+ check_ascii = value[0];
|
|
|
+ if( (check_ascii < 48) || (check_ascii > 57) )
|
|
|
+ {
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ if(atoi(value) >= 0)
|
|
|
+ {
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[isEnableLocalPowersharing].ItemData, "%d", atoi(value) );
|
|
|
+ isSuccess = ConfigurationStatus_Accepted;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strcmp(key, "PowerSharingServerIP") == 0)
|
|
|
+ {
|
|
|
+ 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 );
|
|
|
+ isSuccess = ConfigurationStatus_Accepted;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(strcmp(key, "EVCCID_PREFIX") == 0)
|
|
|
+ {
|
|
|
+ if(ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemAccessibility == 1)
|
|
|
+ {
|
|
|
+ strcpy(str, (const char*)value);
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[EVCCID_PREFIX].ItemData, "%s", str );
|
|
|
+ isSuccess = ConfigurationStatus_Accepted;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ isSuccess = ConfigurationStatus_Rejected;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
#if 0
|
|
|
//For OCPP Test Case
|
|
|
if(strcmp(key, "LocalAuthorizationListEnabled") == 0)
|