|
@@ -134,6 +134,12 @@ static int SystemInitial = CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY; // Sys
|
|
|
int authenrequest = FALSE;
|
|
|
int authorizeRetryTimes = 0; //number of Retry times
|
|
|
|
|
|
+//===============================
|
|
|
+// OCPP StartTransaction transactionId variables
|
|
|
+//===============================
|
|
|
+static int TransactionId[CHAdeMO_QUANTITY+ CCS_QUANTITY + GB_QUANTITY + AC_QUANTITY]={0};
|
|
|
+
|
|
|
+
|
|
|
//===============================
|
|
|
// OCPP other variables
|
|
|
//===============================
|
|
@@ -818,7 +824,7 @@ static char * UnitOfMeasureStr[] = {
|
|
|
MACROSTR(Percent)
|
|
|
};
|
|
|
|
|
|
-
|
|
|
+#if 0
|
|
|
/*Configuration enum*/
|
|
|
enum CoreProfile {
|
|
|
AllowOfflineTxForUnknownId=0,
|
|
@@ -857,6 +863,7 @@ enum CoreProfile {
|
|
|
WebSocketPingInterval,
|
|
|
_CoreProfile_CNT
|
|
|
};
|
|
|
+#endif
|
|
|
|
|
|
enum LocalAuthListManagementProfile{
|
|
|
LocalAuthListEnabled=0,
|
|
@@ -2582,7 +2589,14 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Context,ReadingContextStr[ReadingContext_Transaction_Begin]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Format,ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Measurand,MeasurandStr[Energy_Active_Export_Interval]);//MeasurandStr[Energy_Active_Export_Interval/*Energy_Reactive_Export_Register*/]);
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Phase,PhaseStr[L1_N]);
|
|
|
+ if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D')
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Phase,PhaseStr[L3_N]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Phase,PhaseStr[L1_N]);
|
|
|
+ }
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Location,LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[0].Unit,UnitOfMeasureStr[UnitOfMeasure_Wh/*UnitOfMeasure_kWh*/]);
|
|
|
|
|
@@ -2617,6 +2631,7 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Phase,PhaseStr[L3_N]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2628,12 +2643,14 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Phase,PhaseStr[L1_N]);
|
|
|
+
|
|
|
}// END FOR AC ELSE
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Context,ReadingContextStr[ReadingContext_Transaction_End]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Format,ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Measurand,MeasurandStr[Current_Export]);
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Phase,PhaseStr[L1_N]);
|
|
|
+ //strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Phase,PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Location,LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[1].Unit,UnitOfMeasureStr[UnitOfMeasure_A]);
|
|
|
|
|
@@ -2665,6 +2682,8 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Phase,PhaseStr[L3_N]);
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2676,12 +2695,14 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Phase,PhaseStr[L1_N]);
|
|
|
+
|
|
|
}// END FOR AC ELSE
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Context,ReadingContextStr[ReadingContext_Transaction_End]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Format,ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Measurand,MeasurandStr[Energy_Active_Export_Interval/*Energy_Reactive_Export_Register*/]);
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Phase,PhaseStr[L1_N]);
|
|
|
+ //strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Phase,PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Location,LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[2].Unit,UnitOfMeasureStr[UnitOfMeasure_Wh/*UnitOfMeasure_kWh*/]);
|
|
|
|
|
@@ -2713,6 +2734,8 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Phase,PhaseStr[L3_N]);
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2724,12 +2747,14 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Phase,PhaseStr[L1_N]);
|
|
|
+
|
|
|
}// END FOR AC ELSE
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Context,ReadingContextStr[ReadingContext_Transaction_End]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Format,ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Measurand,MeasurandStr[Power_Active_Export/*Energy_Reactive_Export_Register*/]);
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Phase,PhaseStr[L1_N]);
|
|
|
+ //strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Phase,PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Location,LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[3].Unit,UnitOfMeasureStr[UnitOfMeasure_kW/*UnitOfMeasure_kWh*/]);
|
|
|
|
|
@@ -2761,6 +2786,7 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Phase,PhaseStr[L3_N]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2772,12 +2798,13 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Phase,PhaseStr[L1_N]);
|
|
|
}// END FOR AC ELSE
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Context,ReadingContextStr[ReadingContext_Transaction_End]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Format,ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Measurand,MeasurandStr[Power_Active_Export/*Energy_Reactive_Export_Register*/]);
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Phase,PhaseStr[L1_N]);
|
|
|
+ //strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Phase,PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Location,LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[4].Unit,UnitOfMeasureStr[UnitOfMeasure_kW/*UnitOfMeasure_kWh*/]);
|
|
|
|
|
@@ -2812,7 +2839,7 @@ int sendStopTransactionRequest(int gun_index)
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[5].Context,ReadingContextStr[ReadingContext_Transaction_End]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[5].Format,ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[5].Measurand,MeasurandStr[SoC/*Energy_Reactive_Export_Register*/]);
|
|
|
- strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[5].Phase,PhaseStr[L1_N]);
|
|
|
+ strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[5].Phase,PhaseStr[L3_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[5].Location,LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->StopTransaction[gun_index].TransactionData[0].SampledValue[5].Unit,UnitOfMeasureStr[UnitOfMeasure_Percent/*UnitOfMeasure_kWh*/]);
|
|
|
|
|
@@ -3023,6 +3050,8 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Phase, PhaseStr[L3_N]);
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -3034,12 +3063,14 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Phase, PhaseStr[L1_N]);
|
|
|
+
|
|
|
}// END FOR AC ELSE
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Context, ReadingContextStr[ReadingContext_Sample_Periodic]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Format, ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Measurand, MeasurandStr[Current_Export]);
|
|
|
- strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Phase, PhaseStr[L1_N]);
|
|
|
+ //strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Phase, PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Location, LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[0].Unit,UnitOfMeasureStr[UnitOfMeasure_A]);
|
|
|
|
|
@@ -3073,6 +3104,8 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
sprintf((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Value, "%.1f" ,ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargedEnergy);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Phase, PhaseStr[L3_N]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -3084,13 +3117,14 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Phase, PhaseStr[L1_N]);
|
|
|
}//END FOR AC ELSE
|
|
|
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Context, ReadingContextStr[ReadingContext_Sample_Periodic]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Format, ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Measurand, MeasurandStr[Energy_Active_Export_Interval]);
|
|
|
- strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Phase, PhaseStr[L1]);
|
|
|
+ //strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Phase, PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Location, LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[1].Unit,UnitOfMeasureStr[UnitOfMeasure_kWh]);
|
|
|
|
|
@@ -3123,6 +3157,8 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
sprintf((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Value, "%.1f" , ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingPower);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Phase, PhaseStr[L3_N]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -3134,13 +3170,15 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Phase, PhaseStr[L1_N]);
|
|
|
+
|
|
|
}// END FOR AC ELSE
|
|
|
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Context, ReadingContextStr[ReadingContext_Sample_Periodic]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Format, ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Measurand, MeasurandStr[Power_Active_Export]);
|
|
|
- strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Phase, PhaseStr[L1_N]);
|
|
|
+ //strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Phase, PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Location, LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[2].Unit,UnitOfMeasureStr[UnitOfMeasure_kW]);
|
|
|
|
|
@@ -3172,6 +3210,8 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
sprintf((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Value, "%.1f" ,ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PresentChargingVoltage );
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Phase, PhaseStr[L3_N]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -3182,13 +3222,15 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
sprintf((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Value, "%.1f" ,ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PresentChargingVoltage );
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Phase, PhaseStr[L1_N]);
|
|
|
}//END FOR AC ELSE
|
|
|
|
|
|
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Context, ReadingContextStr[ReadingContext_Sample_Periodic]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Format, ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Measurand, MeasurandStr[Voltage]);
|
|
|
- strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Phase, PhaseStr[L1_N]);
|
|
|
+ // strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Phase, PhaseStr[L1_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Location, LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[3].Unit,UnitOfMeasureStr[UnitOfMeasure_V]);
|
|
|
|
|
@@ -3226,7 +3268,7 @@ int sendMeterValuesRequest(int gun_index)
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Context, ReadingContextStr[ReadingContext_Sample_Periodic]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Format, ValueFormatStr[Raw]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Measurand, MeasurandStr[SoC]);
|
|
|
- strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Phase, PhaseStr[L1_N]);
|
|
|
+ strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Phase, PhaseStr[L3_N]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Location, LocationStr[Location_Outlet]);
|
|
|
strcpy((char *)ShmOCPP16Data->MeterValues[gun_index].MeterValue[0].SampledValue[4].Unit,UnitOfMeasureStr[UnitOfMeasure_Percent]);
|
|
|
}
|
|
@@ -3547,12 +3589,8 @@ int sendGetCompositeScheduleConfirmation(char *uuid,char *payload, int connector
|
|
|
,ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.StartSchedule
|
|
|
,ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingRateUnit);
|
|
|
|
|
|
-
|
|
|
- //int len = nPeriod;//sizeof(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod)/sizeof(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod[0]);
|
|
|
-
|
|
|
- #if 1 // remove temporally
|
|
|
- int len = nPeriod;//sizeof(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod)/sizeof(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod[0]);
|
|
|
-
|
|
|
+ int len = nPeriod;
|
|
|
+ //Last Period StartPriod is less than diffSeconds
|
|
|
if(ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[len -1].StartPeriod < diffSeconds)
|
|
|
{
|
|
|
|
|
@@ -3573,10 +3611,10 @@ int sendGetCompositeScheduleConfirmation(char *uuid,char *payload, int connector
|
|
|
, ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].Limit
|
|
|
, ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].NumberPhases );
|
|
|
}
|
|
|
- else
|
|
|
+ else if(ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod > diffSeconds)
|
|
|
{
|
|
|
sprintf(message + strlen(message), ",{\"startPeriod\":%d,\"limit\":%.1f,\"numberPhases\":%d}"
|
|
|
- , (((ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod - diffSeconds /*-1*/) <= 0)?(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod):(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod - diffSeconds /*-1*/))
|
|
|
+ , (ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod - diffSeconds /*-1*/)//(((ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod - diffSeconds ) <= 0)?(ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod):(ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod - diffSeconds /*-1*/)) //(((ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod - diffSeconds /*-1*/) <= 0)?(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod):(ShmOCPP16Data->GetCompositeSchedule[0].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].StartPeriod - diffSeconds /*-1*/))
|
|
|
, ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].Limit
|
|
|
, ShmOCPP16Data->GetCompositeSchedule[CompositeScheduleIndex].ResponseChargingSchedule.ChargingSchedulePeriod[idx_sample].NumberPhases );
|
|
|
}
|
|
@@ -3584,17 +3622,12 @@ int sendGetCompositeScheduleConfirmation(char *uuid,char *payload, int connector
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- #endif
|
|
|
-
|
|
|
-
|
|
|
sprintf(message + strlen(message), "]}}]");
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
LWS_Send(message);
|
|
|
-
|
|
|
result = TRUE;
|
|
|
return result;
|
|
|
}
|
|
@@ -4862,11 +4895,9 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
|
|
|
char comfirmstr[20];
|
|
|
//float totallimit =0.0;
|
|
|
float MinChargingRate =0.0;
|
|
|
- double diff_t;
|
|
|
- struct tm tp;
|
|
|
- //int clearflag = FALSE;
|
|
|
- FILE *fptr1;//, *fptr2;
|
|
|
- //char temp[] = "../Storage/OCPP/temp.json";
|
|
|
+ //double diff_t;
|
|
|
+ //struct tm tp;
|
|
|
+ FILE *fptr1;
|
|
|
int c = 0;
|
|
|
//int i = 0;
|
|
|
char * pch;
|
|
@@ -5077,13 +5108,14 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
|
|
|
|
|
|
|
|
|
//
|
|
|
+#if 0
|
|
|
strptime(tempstartScheduleStr, "%Y-%m-%dT%H:%M:%S", &tp);
|
|
|
tp.tm_isdst = -1;
|
|
|
time_t utc = mktime(&tp);
|
|
|
// current time
|
|
|
time_t t = time(NULL);
|
|
|
-
|
|
|
- diff_t = difftime(t, utc);
|
|
|
+#endif
|
|
|
+ //diff_t = difftime(t, utc);
|
|
|
|
|
|
//parsing strings to words
|
|
|
i = 0;
|
|
@@ -5294,14 +5326,15 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
|
|
|
tempminChargingRateFloat = 0.0;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+#if 0
|
|
|
//
|
|
|
strptime(tempstartScheduleStr, "%Y-%m-%dT%H:%M:%S", &tp);
|
|
|
tp.tm_isdst = -1;
|
|
|
time_t utc = mktime(&tp);
|
|
|
// current time
|
|
|
time_t t = time(NULL);
|
|
|
- diff_t = difftime(t, utc);
|
|
|
+ //diff_t = difftime(t, utc);
|
|
|
+#endif
|
|
|
|
|
|
//parsing strings to words
|
|
|
i = 0;
|
|
@@ -5568,15 +5601,17 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
|
|
|
tempminChargingRateFloat = 0.0;
|
|
|
}
|
|
|
|
|
|
+#if 0
|
|
|
//
|
|
|
strptime(tempstartScheduleStr, "%Y-%m-%dT%H:%M:%S", &tp);
|
|
|
tp.tm_isdst = -1;
|
|
|
time_t utc = mktime(&tp);
|
|
|
time_t t = time(NULL);
|
|
|
- diff_t = difftime(t, utc);
|
|
|
+ //diff_t = difftime(t, utc);
|
|
|
+#endif
|
|
|
|
|
|
- DEBUG_INFO("diff_t=%f\n",diff_t);
|
|
|
- DEBUG_INFO(" debug 5 -1\n");
|
|
|
+ //DEBUG_INFO("diff_t=%f\n",diff_t);
|
|
|
+ //DEBUG_INFO(" debug 5 -1\n");
|
|
|
//parsing strings to words
|
|
|
i = 0;
|
|
|
loc = strstr(sLineWord, "chargingSchedulePeriod");
|
|
@@ -5819,12 +5854,14 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
|
|
|
tempminChargingRateFloat = 0.0;
|
|
|
}
|
|
|
|
|
|
+#if 0
|
|
|
//
|
|
|
strptime(tempstartScheduleStr, "%Y-%m-%dT%H:%M:%S", &tp);
|
|
|
tp.tm_isdst = -1;
|
|
|
time_t utc = mktime(&tp);
|
|
|
time_t t = time(NULL);
|
|
|
- diff_t = difftime(t, utc);
|
|
|
+ //diff_t = difftime(t, utc);
|
|
|
+#endif
|
|
|
|
|
|
//DEBUG_INFO("diff_t=%f\n",diff_t);
|
|
|
|
|
@@ -6093,14 +6130,16 @@ int handleGetCompositeScheduleRequest(char *uuid, char *payload)
|
|
|
tempminChargingRateFloat = 0.0;
|
|
|
}
|
|
|
|
|
|
+#if 0
|
|
|
//
|
|
|
strptime(tempstartScheduleStr, "%Y-%m-%dT%H:%M:%S", &tp);
|
|
|
tp.tm_isdst = -1;
|
|
|
time_t utc = mktime(&tp);
|
|
|
time_t t = time(NULL);
|
|
|
- diff_t = difftime(t, utc);
|
|
|
+ //diff_t = difftime(t, utc);
|
|
|
+#endif
|
|
|
|
|
|
- DEBUG_INFO("diff_t=%f\n",diff_t);
|
|
|
+ //DEBUG_INFO("diff_t=%f\n",diff_t);
|
|
|
//parsing strings to words
|
|
|
i = 0;
|
|
|
loc = strstr(sLineWord, "chargingSchedulePeriod");
|
|
@@ -6618,69 +6657,123 @@ void* GetDiagnosticsProcess(void* data)
|
|
|
protocol, user, password, host, &port, path);
|
|
|
}
|
|
|
|
|
|
- if(strcmp(protocol,"ftp")!=0)
|
|
|
+ if((strcmp(protocol,"ftp")!=0)&&(strcmp(protocol,"http")!=0))
|
|
|
{
|
|
|
- DEBUG_INFO("protocol is not ftp!\n");
|
|
|
+ DEBUG_INFO("protocol is not ftp/http ! \n");
|
|
|
sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_UploadFailed]);
|
|
|
goto end;
|
|
|
|
|
|
}
|
|
|
|
|
|
- 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);
|
|
|
|
|
|
- int ftppathlen=strlen(ftppath);
|
|
|
- int i=1;
|
|
|
- char filenametemp[50];
|
|
|
- while(i < ftppathlen)
|
|
|
+ if(strncmp(locationstr,"http", 4) == 0)
|
|
|
{
|
|
|
- int len=ftppathlen-i;
|
|
|
- if(ftppath[len]== 47) // '/' ascll code: 47
|
|
|
- {
|
|
|
- DEBUG_INFO("find '/' all right\n");
|
|
|
- break;
|
|
|
- }
|
|
|
- i=i+1;
|
|
|
+ sscanf(locationstr,"%[^:]:%*2[/]%[^/]/%199[^\n]",
|
|
|
+ protocol, host, path);
|
|
|
|
|
|
- }
|
|
|
+ //sscanf(locationstr,"%[^:]:%*2[/]%[^:]:%[^@]@%[^/]%199[^\n]",
|
|
|
+ // protocol, user, password, host, path);
|
|
|
+ sprintf(ftppath,"/%s", path);
|
|
|
|
|
|
- memset(filenametemp, 0, sizeof(filenametemp));
|
|
|
- strncpy(filenametemp, ftppath+(ftppathlen-i+1), i+1);
|
|
|
- filenametemp[i+1] = 0;
|
|
|
+ DEBUG_INFO("protocol =%s\n",protocol);
|
|
|
|
|
|
+ DEBUG_INFO("host =%s\n",host);
|
|
|
|
|
|
- //httpDownLoadFile(host, ftppath, fname);
|
|
|
- memset(ftpbuf, 0, sizeof(ftpbuf));
|
|
|
+ DEBUG_INFO("path =%s\n",path);
|
|
|
+ DEBUG_INFO("ftppath=%s\n",ftppath);
|
|
|
+ int ftppathlen=strlen(ftppath);
|
|
|
+ int i=1;
|
|
|
+ char filenametemp[50];
|
|
|
+ while(i < ftppathlen)
|
|
|
+ {
|
|
|
+ int len=ftppathlen-i;
|
|
|
+ if(ftppath[len]== 47) // '/' ascll code: 47
|
|
|
+ {
|
|
|
+ DEBUG_INFO("compare '/' all right\n");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ i=i+1;
|
|
|
+ }
|
|
|
|
|
|
- if(port == 0)
|
|
|
- port = 21;
|
|
|
- //isSuccess = httpDownLoadFile(host1, ftppath, filenametemp, "http://evsocket.phihong.com.tw/UploadFiles/SW/C81FBD4A740F69286B276C68B5074373.jar");
|
|
|
+ memset(filenametemp, 0, sizeof(filenametemp));
|
|
|
+ strncpy(filenametemp, ftppath+(ftppathlen-i+1), i+1);
|
|
|
+ filenametemp[i+1] = 0;
|
|
|
+ //sendFirmwareStatusNotificationRequest(FirmwareStatusStr[FirmwareStatus_Downloading]);
|
|
|
|
|
|
|
|
|
- do{
|
|
|
- isSuccess = ftpFile(/*"test.evsocket.phihong.com.cn","phihong","y42j/4cj84",21,"/",fname*/host1, user, password, port, ftppath, fnamePlusPath, fname);
|
|
|
- sleep(retryIntervalInt);
|
|
|
- }while((!isSuccess)&&(retriesInt > 0 && retriesInt --));
|
|
|
+ do{
|
|
|
+ isSuccess = httpUploadFile(host, ftppath, filenametemp, locationstr);
|
|
|
+ sleep(retryIntervalInt);
|
|
|
+ }while((isSuccess == 0)&&(retriesInt > 0 && retriesInt --));
|
|
|
+
|
|
|
+ // isSuccess = httpDownLoadFile(host, ftppath, filenametemp, locationstr);
|
|
|
+
|
|
|
+ if(!isSuccess)
|
|
|
+ {
|
|
|
+ //BulldogUtil.sleepMs(interval*1000);
|
|
|
+ DEBUG_INFO("Diagnostics fail.\n");
|
|
|
+ sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_UploadFailed]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DEBUG_INFO("sendDiagnosticsStatusNotificationRequest Uploaded\n");
|
|
|
+ sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_Uploaded]);
|
|
|
+ //isUpdateRequest = TRUE;
|
|
|
+ }
|
|
|
|
|
|
- if(!isSuccess)
|
|
|
- {
|
|
|
- //BulldogUtil.sleepMs(interval*1000);
|
|
|
- DEBUG_INFO("Diagnostics fail.\n");
|
|
|
- sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_UploadFailed]);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DEBUG_INFO("sendDiagnosticsStatusNotificationRequest Uploaded\n");
|
|
|
- sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_Uploaded]);
|
|
|
- //isUpdateRequest = TRUE;
|
|
|
+ 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);
|
|
|
+
|
|
|
+ int ftppathlen=strlen(ftppath);
|
|
|
+ int i=1;
|
|
|
+ char filenametemp[50];
|
|
|
+ while(i < ftppathlen)
|
|
|
+ {
|
|
|
+ int len=ftppathlen-i;
|
|
|
+ if(ftppath[len]== 47) // '/' ascll code: 47
|
|
|
+ {
|
|
|
+ DEBUG_INFO("find '/' all right\n");
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ i=i+1;
|
|
|
+ }
|
|
|
+
|
|
|
+ memset(filenametemp, 0, sizeof(filenametemp));
|
|
|
+ strncpy(filenametemp, ftppath+(ftppathlen-i+1), i+1);
|
|
|
+ filenametemp[i+1] = 0;
|
|
|
+ memset(ftpbuf, 0, sizeof(ftpbuf));
|
|
|
+
|
|
|
+ if(port == 0)
|
|
|
+ port = 21;
|
|
|
+
|
|
|
+ do{
|
|
|
+ isSuccess = ftpFile(/*"test.evsocket.phihong.com.cn","phihong","y42j/4cj84",21,"/",fname*/host1, user, password, port, ftppath, fnamePlusPath, fname);
|
|
|
+ sleep(retryIntervalInt);
|
|
|
+ }while((!isSuccess)&&(retriesInt > 0 && retriesInt --));
|
|
|
+
|
|
|
+ if(!isSuccess)
|
|
|
+ {
|
|
|
+ //BulldogUtil.sleepMs(interval*1000);
|
|
|
+ DEBUG_INFO("Diagnostics fail.\n");
|
|
|
+ sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_UploadFailed]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DEBUG_INFO("sendDiagnosticsStatusNotificationRequest Uploaded\n");
|
|
|
+ sendDiagnosticsStatusNotificationRequest(DiagnosticsStatusStr[DiagnosticsStatus_Uploaded]);
|
|
|
+ //isUpdateRequest = TRUE;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
end:
|
|
@@ -10385,6 +10478,9 @@ void handleStartTransactionResponse(char *payload, int gun_index)
|
|
|
sstr[c] = '\0';
|
|
|
ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId = atoi(sstr);
|
|
|
transactionIdInt = ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId;
|
|
|
+ TransactionId[gun_index] = transactionIdInt;
|
|
|
+ DEBUG_INFO("gun_index: %d\n", gun_index);
|
|
|
+ DEBUG_INFO("test TransactionId[gun_index]: %d\n", TransactionId[gun_index]);
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf = 1;
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq = 0;
|
|
|
|
|
@@ -10402,7 +10498,7 @@ DEBUG_INFO("transactionId: %d\n", ShmOCPP16Data->StartTransaction[gun_index].Res
|
|
|
|
|
|
}
|
|
|
|
|
|
- DEBUG_INFO("Start Charging ErrorCode=%s\n", ShmOCPP16Data->StatusNotification[gun_index].ErrorCode);
|
|
|
+ //DEBUG_INFO("Start Charging ErrorCode=%s\n", ShmOCPP16Data->StatusNotification[gun_index].ErrorCode);
|
|
|
}
|
|
|
|
|
|
void handleStatusNotificationResponse(char *payload, int gun_index)
|
|
@@ -10575,6 +10671,7 @@ 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;
|
|
|
|
|
|
// MeterValuesAlignedData
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[MeterValuesAlignedData].ItemAccessibility = 1;
|
|
@@ -10620,7 +10717,7 @@ int initialConfigurationTable(void)
|
|
|
// ConnectorPhaseRotation
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemAccessibility = 1;
|
|
|
strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemName, "ConnectorPhaseRotation");
|
|
|
- strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "Unknown" );
|
|
|
+ strcpy((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotation].ItemData, "NotApplicable" );
|
|
|
|
|
|
// ConnectorPhaseRotationMaxLength
|
|
|
ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectorPhaseRotationMaxLength].ItemAccessibility = 0;
|
|
@@ -10980,6 +11077,7 @@ 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;
|
|
|
}
|
|
|
|
|
@@ -11805,6 +11903,7 @@ void processUnkownKey(void)
|
|
|
else
|
|
|
{
|
|
|
sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[MaxEnergyOnInvalidId].ItemData, "%d", atoi(value) );
|
|
|
+ ShmSysConfigAndInfo->SysConfig.OfflineMaxChargeEnergy = atoi(value)/1000;
|
|
|
isSuccess = ConfigurationStatus_Accepted;
|
|
|
}
|
|
|
}
|
|
@@ -12382,6 +12481,53 @@ int ftpDownLoadFile(char *location, char *user, char *password, int port, char *
|
|
|
|
|
|
}
|
|
|
|
|
|
+int httpUploadFile(char *location, char *path, char *filename,char *url)
|
|
|
+{
|
|
|
+ char rmFileCmd[100]={0};
|
|
|
+ char FilePath[100]={0};
|
|
|
+ char ftpbuf[200];
|
|
|
+ int systemresult;
|
|
|
+
|
|
|
+ DEBUG_INFO("filename=%s\n",filename);
|
|
|
+ DEBUG_INFO("url=%s\n",url);
|
|
|
+ sprintf(FilePath,"%s","../mnt/upload_file.txt");
|
|
|
+
|
|
|
+ if((access(FilePath,F_OK))!=-1)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("filename=%s exist.\n",FilePath);
|
|
|
+ sprintf(rmFileCmd,"rm -f %s",FilePath);
|
|
|
+ system(rmFileCmd);
|
|
|
+ }
|
|
|
+
|
|
|
+ FILE *fp = fopen("../mnt/upload_file.txt", "w+");
|
|
|
+
|
|
|
+ if(fp == NULL)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("log is NULL\n");
|
|
|
+ return 0;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ fprintf(fp, "%s\n", url);
|
|
|
+ fprintf(fp, "%s\n", filename);
|
|
|
+ fclose(fp);
|
|
|
+ }
|
|
|
+
|
|
|
+ memset(ftpbuf, 0, sizeof(ftpbuf));
|
|
|
+ sprintf(ftpbuf, "%s","../bin/php-cgi /var/www/ocpp_upload.php");
|
|
|
+ //sprintf(ftpbuf, "ftpput -u %s -p %s %s -P %d %s%s %s",user,password,IPbuffer,21,filename,filename,path);
|
|
|
+ systemresult = system(ftpbuf);
|
|
|
+
|
|
|
+ DEBUG_INFO("systemresult=%d\n",systemresult);
|
|
|
+ if(systemresult != 0)
|
|
|
+ {
|
|
|
+ DEBUG_INFO("http DownLoad error!\n");
|
|
|
+ return FALSE;
|
|
|
+ }
|
|
|
+
|
|
|
+ return TRUE;
|
|
|
+}
|
|
|
+
|
|
|
int ftpFile(char *location, char *user, char *password, int port, char *path, char *fnamePlusPath,char *filename)
|
|
|
{
|
|
|
struct hostent* server;
|
|
@@ -12961,6 +13107,16 @@ void SetHeartBeatWithNOResponse(void)
|
|
|
HeartBeatWithNOResponse = 0;
|
|
|
}
|
|
|
|
|
|
+int GetTransactionId(int gunindex)
|
|
|
+{
|
|
|
+ return TransactionId[gunindex];
|
|
|
+}
|
|
|
+
|
|
|
+void SetTransactionIdZero(int gunindex)
|
|
|
+{
|
|
|
+ TransactionId[gunindex] = 0;
|
|
|
+}
|
|
|
+
|
|
|
int InternetDisconnect(void)
|
|
|
{
|
|
|
//DEBUG_INFO("ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi=%d\n",ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi);
|
|
@@ -14357,7 +14513,7 @@ void GetChargingProfileRequest(int gunindex)
|
|
|
ShmOCPP16Data->SmartChargingProfile[gunindex].ChargingProfileId = TxDefaultProfile_TEMP.ChargingProfileId;
|
|
|
ShmOCPP16Data->SmartChargingProfile[gunindex].TransactionId = 0;
|
|
|
ShmOCPP16Data->SmartChargingProfile[gunindex].StackLevel = TxDefaultProfile_TEMP.StackLevel;
|
|
|
- ShmOCPP16Data->SmartChargingProfile[gunindex].ChargingSchedule.Duration = 86400 ;
|
|
|
+ ShmOCPP16Data->SmartChargingProfile[gunindex].ChargingSchedule.Duration = TxDefaultProfile_TEMP.ChargingSchedule.Duration;
|
|
|
ShmOCPP16Data->SmartChargingProfile[gunindex].ChargingSchedule.MinChargingRate = TxDefaultProfile_TEMP.ChargingSchedule.MinChargingRate;
|
|
|
strcpy((char *)ShmOCPP16Data->SmartChargingProfile[gunindex].ChargingProfileKind, (const char *)TxDefaultProfile_TEMP.ChargingProfileKind );
|
|
|
strcpy((char *)ShmOCPP16Data->SmartChargingProfile[gunindex].ChargingProfilePurpose, (const char *)TxDefaultProfile_TEMP.ChargingProfilePurpose );
|