|
@@ -520,7 +520,7 @@ int getStartStop(uint8_t *start, uint8_t *stop)
|
|
|
|
|
|
int isOvertNow(uint8_t *start)
|
|
|
{
|
|
|
- int result = YES;
|
|
|
+ int result = NO;
|
|
|
struct tm tmStart;
|
|
|
struct timeb tbStart;
|
|
|
|
|
@@ -535,10 +535,12 @@ int isOvertNow(uint8_t *start)
|
|
|
|
|
|
if(DiffTimebWithNowSec(tbStart) <= 0)
|
|
|
result = NO;
|
|
|
+ else
|
|
|
+ result = YES;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DEBUG_WARN("Start date parsing error.\r\n");
|
|
|
+ DEBUG_WARN("Start date parsing error.\n");
|
|
|
}
|
|
|
|
|
|
return result;
|
|
@@ -3551,42 +3553,42 @@ S_FAULT =12
|
|
|
{
|
|
|
if(ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn == 1) // //0: unplug, 1: Plug-in
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- currentStatus = 0; //OCPP Status: Available
|
|
|
+ currentStatus = Available; //OCPP Status: Available
|
|
|
}
|
|
|
}
|
|
|
else if ( ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus >= SYS_MODE_AUTHORIZING)&&( ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus <= SYS_MODE_PREPARE_FOR_EVSE)) ||
|
|
|
((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0) && ( ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1) )
|
|
|
) //S_PRECHARGE
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
|
|
|
{
|
|
|
- currentStatus = 2; //OCPP Status: Charging
|
|
|
+ currentStatus = Charging; //OCPP Status: Charging
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_COMPLETE) //S_COMPLETE
|
|
|
{
|
|
|
- currentStatus = 5; //OCPP Status: Finishing
|
|
|
+ currentStatus = Finishing; //OCPP Status: Finishing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_TERMINATING) // S_TERMINATING ---> SuspendedEV
|
|
|
{
|
|
|
- currentStatus = 4; //OCPP Status: SuspendedEV
|
|
|
+ currentStatus = SuspendedEV; //OCPP Status: SuspendedEV
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_MAINTAIN)|| (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_DEBUG) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_UPDATE)) // ---> Unavailable
|
|
|
{
|
|
|
- currentStatus = 7; //OCPP Status: Unavailable
|
|
|
+ currentStatus = Unavailable; //OCPP Status: Unavailable
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_FAULT)|| (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_ALARM)) //S_ALARM,S_FAULT ---> Faulted
|
|
|
{
|
|
|
- currentStatus = 8; //OCPP Status: Faulted
|
|
|
+ currentStatus = Faulted; //OCPP Status: Faulted
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_RESERVATION) // ---> Reserved
|
|
|
{
|
|
|
- currentStatus = 6; //OCPP Status: Reserved
|
|
|
+ currentStatus = Reserved; //OCPP Status: Reserved
|
|
|
}
|
|
|
} //end of the same index
|
|
|
}//end of for CHAdeMO_QUANTITY
|
|
@@ -3612,42 +3614,42 @@ S_FAULT =12
|
|
|
|
|
|
if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn == 1) //0: unplug, 1: Plug-in
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- currentStatus = 0; //OCPP Status: Available
|
|
|
+ currentStatus = Available; //OCPP Status: Available
|
|
|
}
|
|
|
}
|
|
|
else if ( ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus >= SYS_MODE_AUTHORIZING)&&( ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus <= SYS_MODE_PREPARE_FOR_EVSE)) ||
|
|
|
((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0) && ( ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1) )
|
|
|
) //S_PRECHARGE
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
|
|
|
{
|
|
|
- currentStatus = 2; //OCPP Status: Charging
|
|
|
+ currentStatus = Charging; //OCPP Status: Charging
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_COMPLETE) //S_COMPLETE
|
|
|
{
|
|
|
- currentStatus = 5; //OCPP Status: Finishing
|
|
|
+ currentStatus = Finishing; //OCPP Status: Finishing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_TERMINATING) //S_TERMINATING ---> SuspendedEV
|
|
|
{
|
|
|
- currentStatus = 4; //OCPP Status: SuspendedEV
|
|
|
+ currentStatus = SuspendedEV; //OCPP Status: SuspendedEV
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_MAINTAIN) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_DEBUG) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_UPDATE)) // ---> Unavailable
|
|
|
{
|
|
|
- currentStatus = 7; //OCPP Status : Unavailable
|
|
|
+ currentStatus = Unavailable; //OCPP Status : Unavailable
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_FAULT) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_ALARM)) //S_ALARM ,S_FAULT ---> Faulted
|
|
|
{
|
|
|
- currentStatus = 8; //OCPP Status: Faulted
|
|
|
+ currentStatus = Faulted; //OCPP Status: Faulted
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_RESERVATION) // ---> Reserved
|
|
|
{
|
|
|
- currentStatus = 6; //OCPP Status: Reserved
|
|
|
+ currentStatus = Reserved; //OCPP Status: Reserved
|
|
|
}
|
|
|
} //end of the same index
|
|
|
} // end of for CCS_QUANTITY
|
|
@@ -3672,42 +3674,42 @@ S_FAULT =12
|
|
|
|
|
|
if(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn == 1) // //0: unplug, 1: Plug-in
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- currentStatus = 0; //OCPP Status: Available
|
|
|
+ currentStatus = Available; //OCPP Status: Available
|
|
|
}
|
|
|
}
|
|
|
else if ( ((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus >= SYS_MODE_AUTHORIZING)&&( ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus <= SYS_MODE_PREPARE_FOR_EVSE)) ||
|
|
|
((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0) && ( ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1) )
|
|
|
) //S_PRECHARGE
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
|
|
|
{
|
|
|
- currentStatus = 2; //OCPP Status: Charging
|
|
|
+ currentStatus = Charging; //OCPP Status: Charging
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_COMPLETE) //S_COMPLETE
|
|
|
{
|
|
|
- currentStatus = 5; //OCPP Status: Finishing
|
|
|
+ currentStatus = Finishing; //OCPP Status: Finishing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_TERMINATING) // S_TERMINATING ---> SuspendedEV
|
|
|
{
|
|
|
- currentStatus = 4; //OCPP Status: SuspendedEV
|
|
|
+ currentStatus = SuspendedEV; //OCPP Status: SuspendedEV
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_MAINTAIN) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_DEBUG) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_UPDATE)) // ---> Unavailable
|
|
|
{
|
|
|
- currentStatus = 7; //OCPP Status: Unavailable
|
|
|
+ currentStatus = Unavailable; //OCPP Status: Unavailable
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_FAULT) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_ALARM)) //S_ALARM ,S_FAULT ---> Faulted
|
|
|
{
|
|
|
- currentStatus = 8; //OCPP Status: Faulted
|
|
|
+ currentStatus = Faulted; //OCPP Status: Faulted
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_RESERVATION) // ---> Reserved
|
|
|
{
|
|
|
- currentStatus = 6; //OCPP Status: Reserved
|
|
|
+ currentStatus = Reserved; //OCPP Status: Reserved
|
|
|
}
|
|
|
} //end of the same index
|
|
|
} // end of for GB_QUANTITY
|
|
@@ -3725,11 +3727,11 @@ S_FAULT =12
|
|
|
|
|
|
if(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn == 1) // //0: unplug, 1: Plug-in
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- currentStatus = 0; //OCPP Status: Available
|
|
|
+ currentStatus = Available; //OCPP Status: Available
|
|
|
}
|
|
|
}
|
|
|
else if ( ((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus >= SYS_MODE_AUTHORIZING) && (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus <= SYS_MODE_PREPARE_FOR_EVSE)) ||
|
|
@@ -3737,31 +3739,31 @@ S_FAULT =12
|
|
|
) //S_PRECHARGE
|
|
|
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_CHARGING) //S_CHARGING
|
|
|
{
|
|
|
- currentStatus = 2; //OCPP Status: Charging
|
|
|
+ currentStatus = Charging; //OCPP Status: Charging
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_COMPLETE) //S_COMPLETE
|
|
|
{
|
|
|
- currentStatus = 5; //OCPP Status: Finishing
|
|
|
+ currentStatus = Finishing; //OCPP Status: Finishing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_TERMINATING) // S_TERMINATING ---> SuspendedEV
|
|
|
{
|
|
|
- currentStatus = 4; //OCPP Status: SuspendedEV
|
|
|
+ currentStatus = SuspendedEV; //OCPP Status: SuspendedEV
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_MAINTAIN) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_DEBUG) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_UPDATE)) // ---> Unavailable
|
|
|
{
|
|
|
- currentStatus = 7; //OCPP Status: Unavailable
|
|
|
+ currentStatus = Unavailable; //OCPP Status: Unavailable
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_FAULT) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_ALARM)) //S_ALARM ,S_FAULT ---> Faulted
|
|
|
{
|
|
|
- currentStatus = 8; //OCPP Status: Faulted
|
|
|
+ currentStatus = Faulted; //OCPP Status: Faulted
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_RESERVATION) // ---> Reserved
|
|
|
{
|
|
|
- currentStatus = 6; //OCPP Status: Reserved
|
|
|
+ currentStatus = Reserved; //OCPP Status: Reserved
|
|
|
}
|
|
|
} //end of the same index
|
|
|
}
|
|
@@ -3785,40 +3787,40 @@ S_FAULT =12
|
|
|
{
|
|
|
if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_B) ||(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_C) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_D))
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- currentStatus = 0; //OCPP Status: Available
|
|
|
+ currentStatus = Available; //OCPP Status: Available
|
|
|
}
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_AUTHORIZING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_PREPARING)) //SYS_MODE_PREPARING
|
|
|
{
|
|
|
- currentStatus = 1; //OCPP Status: Preparing
|
|
|
+ currentStatus = Preparing; //OCPP Status: Preparing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING) //SYS_MODE_CHARGING
|
|
|
{
|
|
|
- currentStatus = 2; //OCPP Status: Charging
|
|
|
+ currentStatus = Charging; //OCPP Status: Charging
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_COMPLETE) //SYS_MODE_COMPLETE
|
|
|
{
|
|
|
- currentStatus = 5; //OCPP Status: Finishing
|
|
|
+ currentStatus = Finishing; //OCPP Status: Finishing
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_TERMINATING) // S_TERMINATING ---> SuspendedEV
|
|
|
{
|
|
|
- currentStatus = 4; //OCPP Status: SuspendedEV
|
|
|
+ currentStatus = SuspendedEV; //OCPP Status: SuspendedEV
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_MAINTAIN)|| (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_DEBUG) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_UPDATE)) // ---> Unavailable
|
|
|
{
|
|
|
- currentStatus = 7; //OCPP Status: Unavailable
|
|
|
+ currentStatus = Unavailable; //OCPP Status: Unavailable
|
|
|
}
|
|
|
else if ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_FAULT) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_ALARM)) //S_ALARM,S_FAULT ---> Faulted
|
|
|
{
|
|
|
- currentStatus = 8; //OCPP Status: Faulted
|
|
|
+ currentStatus = Faulted; //OCPP Status: Faulted
|
|
|
}
|
|
|
else if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_RESERVATION) // ---> Reserved
|
|
|
{
|
|
|
- currentStatus = 6; //OCPP Status: Reserved
|
|
|
+ currentStatus = Reserved; //OCPP Status: Reserved
|
|
|
}
|
|
|
}//end of the same index
|
|
|
|