|
@@ -49,7 +49,6 @@ static char idTagAuthorization[32] = {0};
|
|
|
static int server_sign = FALSE;
|
|
|
int server_pending = FALSE;
|
|
|
static int BootNotificationInterval = 0;
|
|
|
-static int SystemInitial = 0;//= CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY; // System Boot UP
|
|
|
|
|
|
//===============================
|
|
|
// OCPP auth variable
|
|
@@ -3983,7 +3982,6 @@ int ProcessShareMemory()
|
|
|
// DO series
|
|
|
for(int gun_index=0; gun_index<GENERAL_GUN_QUANTITY ; gun_index++)
|
|
|
{
|
|
|
- SystemInitial += 1;
|
|
|
gunTotalNumber += 1;
|
|
|
gunType[gun_index] = GUN_TYPE_DO;
|
|
|
|
|
@@ -4011,7 +4009,6 @@ int ProcessShareMemory()
|
|
|
{
|
|
|
for(int gun_index=0;gun_index<modelnameInfo.GetGunCount;gun_index++)
|
|
|
{
|
|
|
- SystemInitial += 1;
|
|
|
gunTotalNumber += 1;
|
|
|
|
|
|
switch(modelnameInfo.ParsingInfo[gun_index].GunType)
|
|
@@ -4567,7 +4564,7 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus != ChademoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn != ChademoPreviousConnectorPlugIn[index]) )
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus != ChademoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn != ChademoPreviousConnectorPlugIn[index]) )
|
|
|
{
|
|
|
// Sent unplug message for California pricing logic
|
|
|
if((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn == 0))
|
|
@@ -4625,7 +4622,7 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn != CcsPreviousConnectorPlugIn[index]) )//if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]/*PRE_SYS_MODE[gun_index]*/ )
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn != CcsPreviousConnectorPlugIn[index]) )//if(ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus != CcsPreviousSystemStatus[index]/*PRE_SYS_MODE[gun_index]*/ )
|
|
|
{
|
|
|
// Sent unplug message for California pricing logic
|
|
|
if((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn == 0))
|
|
@@ -4683,7 +4680,7 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus != GbPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn != GbPreviousConnectorPlugIn[index]) )
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus != GbPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn != GbPreviousConnectorPlugIn[index]) )
|
|
|
{
|
|
|
// Sent unplug message for California pricing logic
|
|
|
if((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn == 0))
|
|
@@ -4733,7 +4730,7 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
{
|
|
|
- if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus != DoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn != DoPreviousConnectorPlugIn[index]) )
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus != DoPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn != DoPreviousConnectorPlugIn[index]) )
|
|
|
{
|
|
|
// Sent unplug message for California pricing logic
|
|
|
if((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.ConnectorPlugIn == 0))
|
|
@@ -4790,7 +4787,7 @@ void CheckSystemValue(void)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((SystemInitial > 0) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus != AcPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState != AcPreviousConnectorPlugIn[index]) )
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus != AcPreviousSystemStatus[index]) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState != AcPreviousConnectorPlugIn[index]) )
|
|
|
{
|
|
|
// Sent unplug message for California pricing logic
|
|
|
if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_A))
|
|
@@ -4840,9 +4837,6 @@ void CheckSystemValue(void)
|
|
|
)
|
|
|
)
|
|
|
{
|
|
|
- if(SystemInitial > 0)
|
|
|
- SystemInitial -= 1;
|
|
|
-
|
|
|
memcpy(&ShmOCPP16DataPH->StatusNotification[gun_index], &ShmOCPP16DataPH->StatusNotification[gun_index], sizeof(struct StructStatusNotification));
|
|
|
sendStatusNotificationRequest(gun_index);
|
|
|
refreshStartTimer(&clientTime.StatusNotification[gun_index]);
|
|
@@ -13486,7 +13480,8 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
}
|
|
|
|
|
|
// Check invalid limit
|
|
|
- if(strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) != 0)
|
|
|
+ if((strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) != 0) ||
|
|
|
+ ((strcmp((char*)SetProfileReq.ChargingProfile.ChargingProfilePurpose, ChargingProfilePurposeTypeStr[ChargePointMaxProfile]) == 0) && (ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharing != 1)))
|
|
|
{
|
|
|
if(ShmSysConfigAndInfo->SysConfig.ModelName[0] == 'A')
|
|
|
{
|
|
@@ -21060,31 +21055,31 @@ void InitialSystemValue(void)
|
|
|
//Status && ConnectorPlugIn Setting
|
|
|
for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
{
|
|
|
- ChademoPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PreviousSystemStatus;
|
|
|
+ ChademoPreviousSystemStatus[index]= 99; //ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].PreviousSystemStatus;
|
|
|
ChademoPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].ConnectorPlugIn;
|
|
|
}
|
|
|
|
|
|
for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
{
|
|
|
- CcsPreviousSystemStatus[index] = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PreviousSystemStatus;
|
|
|
+ CcsPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].PreviousSystemStatus;
|
|
|
CcsPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].ConnectorPlugIn;
|
|
|
}
|
|
|
|
|
|
for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
{
|
|
|
- GbPreviousSystemStatus[index] = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PreviousSystemStatus;
|
|
|
+ GbPreviousSystemStatus[index] = 99; //ShmSysConfigAndInfo->SysInfo.GbChargingData[index].PreviousSystemStatus;
|
|
|
GbPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.GbChargingData[index].ConnectorPlugIn;
|
|
|
}
|
|
|
|
|
|
for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- AcPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PreviousSystemStatus;
|
|
|
+ AcPreviousSystemStatus[index]= 99; //ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PreviousSystemStatus;
|
|
|
AcPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState;
|
|
|
}
|
|
|
|
|
|
for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
- DoPreviousSystemStatus[index]= ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PreviousSystemStatus;
|
|
|
+ DoPreviousSystemStatus[index]= 99; //ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PreviousSystemStatus;
|
|
|
DoPreviousConnectorPlugIn[index] = ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.PilotState;
|
|
|
}
|
|
|
|
|
@@ -21094,7 +21089,8 @@ void InitialSystemValue(void)
|
|
|
cpinitateMsg.bits[gun_index].StatusNotificationReq = 0;
|
|
|
cpinitateMsg.bits[gun_index].StatusNotificationConf = 0;
|
|
|
//clientTime.MeterValues[gun_index] = time((time_t*)NULL);
|
|
|
- memset(&ShmOCPP16DataPH->StatusNotification[gun_index], 0x00, sizeof(struct StructStatusNotification));
|
|
|
+ //memset(&ShmOCPP16DataPH->StatusNotification[gun_index], 0x00, sizeof(struct StructStatusNotification));
|
|
|
+ memset(&ShmOCPP16DataPH->StatusNotification[gun_index].Status, 0x00, sizeof(ShmOCPP16DataPH->StatusNotification[gun_index].Status));
|
|
|
}
|
|
|
|
|
|
memset( (void *)unknownkey, 0, sizeof(unknownkey));
|