|
@@ -1202,15 +1202,6 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
{
|
|
|
fp = fopen(profileFileName, "r");
|
|
|
|
|
|
- for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(maxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
- {
|
|
|
- maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
- maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
- maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
- }
|
|
|
- maxProfile.ChargingProfileId = -1;
|
|
|
- maxProfile.StackLevel = -1;
|
|
|
-
|
|
|
while(getline(&line, &len, fp) != -1)
|
|
|
{
|
|
|
json_object *obj = NULL;
|
|
@@ -1222,7 +1213,7 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "ChargingProfileId")) != maxProfile.ChargingProfileId) &&
|
|
|
+ if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "chargingProfileId")) != maxProfile.ChargingProfileId) &&
|
|
|
(json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "stackLevel")) >= maxProfile.StackLevel)
|
|
|
)
|
|
|
{
|
|
@@ -1246,6 +1237,15 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
|
|
|
if((DiffTimebWithNowSec(tbFrom)>=0) && (DiffTimebWithNowSec(tbTo)<=0))
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(maxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ maxProfile.ChargingProfileId = -1;
|
|
|
+ maxProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(maxProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("MaxProfile found.\n");
|
|
|
else
|
|
@@ -1303,9 +1303,9 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
sprintf((char*)maxProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1352,6 +1352,15 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(maxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ maxProfile.ChargingProfileId = -1;
|
|
|
+ maxProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(maxProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("MaxProfile found.\n");
|
|
|
else
|
|
@@ -1408,9 +1417,9 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
sprintf((char*)maxProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1467,7 +1476,7 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
DEBUG_INFO("Profile valid from: %s\n", maxProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", maxProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", maxProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", maxProfile.ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", maxProfile.ChargingSchedule.Duration);
|
|
@@ -1606,7 +1615,7 @@ void checkChargePointMaxProfile(uint32_t durationReq, struct StructChargingProfi
|
|
|
DEBUG_INFO("Profile valid from: %s\n", maxProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", maxProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", maxProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", compositeProfile->ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", maxProfile.ChargingSchedule.Duration);
|
|
@@ -1736,15 +1745,6 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
{
|
|
|
fp = fopen(profileFileName, "r");
|
|
|
|
|
|
- for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(txProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
- {
|
|
|
- txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
- txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
- txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
- }
|
|
|
- txProfile.ChargingProfileId = -1;
|
|
|
- txProfile.StackLevel = -1;
|
|
|
-
|
|
|
while(getline(&line, &len, fp) != -1)
|
|
|
{
|
|
|
json_object *obj = NULL;
|
|
@@ -1756,7 +1756,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "ChargingProfileId")) != txProfile.ChargingProfileId) &&
|
|
|
+ if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "chargingProfileId")) != txProfile.ChargingProfileId) &&
|
|
|
(json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "stackLevel")) >= txProfile.StackLevel)
|
|
|
)
|
|
|
{
|
|
@@ -1780,6 +1780,15 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
|
|
|
if((DiffTimebWithNowSec(tbFrom)>=0) && (DiffTimebWithNowSec(tbTo)<=0))
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(txProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ txProfile.ChargingProfileId = -1;
|
|
|
+ txProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(txProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("TxProfile found.\n");
|
|
|
else
|
|
@@ -1836,9 +1845,9 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
sprintf((char*)txProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)txProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)txProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1885,6 +1894,15 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(txProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ txProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ txProfile.ChargingProfileId = -1;
|
|
|
+ txProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(txProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("TxProfile found.\n");
|
|
|
else
|
|
@@ -1941,9 +1959,9 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
sprintf((char*)txProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)txProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)txProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2000,7 +2018,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
DEBUG_INFO("Profile valid from: %s\n", txProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", txProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", txProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", txProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", txProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", txProfile.ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", txProfile.ChargingSchedule.Duration);
|
|
@@ -2030,15 +2048,6 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
{
|
|
|
fp = fopen(profileFileName, "r");
|
|
|
|
|
|
- for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
- {
|
|
|
- defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
- defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
- defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
- }
|
|
|
- defaultTxProfile.ChargingProfileId = -1;
|
|
|
- defaultTxProfile.StackLevel = -1;
|
|
|
-
|
|
|
while(getline(&line, &len, fp) != -1)
|
|
|
{
|
|
|
json_object *obj = NULL;
|
|
@@ -2050,7 +2059,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "ChargingProfileId")) != defaultTxProfile.ChargingProfileId) &&
|
|
|
+ if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "chargingProfileId")) != defaultTxProfile.ChargingProfileId) &&
|
|
|
(json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "stackLevel")) >= defaultTxProfile.StackLevel)
|
|
|
)
|
|
|
{
|
|
@@ -2074,6 +2083,15 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
|
|
|
if((DiffTimebWithNowSec(tbFrom)>=0) && (DiffTimebWithNowSec(tbTo)<=0))
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ defaultTxProfile.ChargingProfileId = -1;
|
|
|
+ defaultTxProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(defaultTxProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("TxDefaultProfile found.\n");
|
|
|
else
|
|
@@ -2131,9 +2149,9 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
sprintf((char*)defaultTxProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)defaultTxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)defaultTxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2180,6 +2198,15 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ defaultTxProfile.ChargingProfileId = -1;
|
|
|
+ defaultTxProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(defaultTxProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("TxDefaultProfile found.\n");
|
|
|
else
|
|
@@ -2236,9 +2263,9 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
sprintf((char*)defaultTxProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)defaultTxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)defaultTxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2295,7 +2322,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
DEBUG_INFO("Profile valid from: %s\n", defaultTxProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", defaultTxProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", defaultTxProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", defaultTxProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", defaultTxProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", defaultTxProfile.ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", defaultTxProfile.ChargingSchedule.Duration);
|
|
@@ -2324,15 +2351,6 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
{
|
|
|
fp = fopen(profileFileName, "r");
|
|
|
|
|
|
- for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(maxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
- {
|
|
|
- maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
- maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
- maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
- }
|
|
|
- maxProfile.ChargingProfileId = -1;
|
|
|
- maxProfile.StackLevel = -1;
|
|
|
-
|
|
|
while(getline(&line, &len, fp) != -1)
|
|
|
{
|
|
|
json_object *obj = NULL;
|
|
@@ -2344,7 +2362,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "ChargingProfileId")) != maxProfile.ChargingProfileId) &&
|
|
|
+ if((json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "chargingProfileId")) != maxProfile.ChargingProfileId) &&
|
|
|
(json_object_get_int(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "stackLevel")) >= maxProfile.StackLevel)
|
|
|
)
|
|
|
{
|
|
@@ -2368,6 +2386,15 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
|
|
|
if((DiffTimebWithNowSec(tbFrom)>=0) && (DiffTimebWithNowSec(tbTo)<=0))
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(maxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ maxProfile.ChargingProfileId = -1;
|
|
|
+ maxProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(maxProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("MaxProfile found.\n");
|
|
|
else
|
|
@@ -2425,9 +2452,9 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
sprintf((char*)maxProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2474,6 +2501,15 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
+ for(int idxPeriod=0;idxPeriod<ARRAY_SIZE(maxProfile.ChargingSchedule.ChargingSchedulePeriod);idxPeriod++)
|
|
|
+ {
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].StartPeriod = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].Limit = -1;
|
|
|
+ maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxPeriod].NumberPhases = 3;
|
|
|
+ }
|
|
|
+ maxProfile.ChargingProfileId = -1;
|
|
|
+ maxProfile.StackLevel = -1;
|
|
|
+
|
|
|
if(maxProfile.ChargingProfileId == -1)
|
|
|
DEBUG_INFO("MaxProfile found.\n");
|
|
|
else
|
|
@@ -2530,9 +2566,9 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
sprintf((char*)maxProfile.ValidTo, " ");
|
|
|
}
|
|
|
|
|
|
- if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind") != NULL)
|
|
|
+ if(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind") != NULL)
|
|
|
{
|
|
|
- sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "RecurrencyKind")));
|
|
|
+ sprintf((char*)maxProfile.RecurrencyKind, "%s", json_object_get_string(json_object_object_get(json_object_object_get(obj, "csChargingProfiles"), "recurrencyKind")));
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2589,7 +2625,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
DEBUG_INFO("Profile valid from: %s\n", maxProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", maxProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", maxProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", maxProfile.ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", maxProfile.ChargingSchedule.Duration);
|
|
@@ -2743,7 +2779,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
DEBUG_INFO("Profile valid from: %s\n", txProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", txProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", txProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", txProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", txProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", compositeProfile->ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", txProfile.ChargingSchedule.Duration);
|
|
@@ -2902,7 +2938,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
DEBUG_INFO("Profile valid from: %s\n", defaultTxProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", defaultTxProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", defaultTxProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", defaultTxProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", defaultTxProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", compositeProfile->ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", defaultTxProfile.ChargingSchedule.Duration);
|
|
@@ -3042,7 +3078,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
DEBUG_INFO("Profile valid from: %s\n", maxProfile.ValidFrom);
|
|
|
DEBUG_INFO("Profile valid to: %s\n", maxProfile.ValidTo);
|
|
|
DEBUG_INFO("Profile ChargingProfileKind: %s\n", maxProfile.ChargingProfileKind);
|
|
|
- DEBUG_INFO("Profile RecurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
+ DEBUG_INFO("Profile recurrencyKind: %s\n", maxProfile.RecurrencyKind);
|
|
|
|
|
|
DEBUG_INFO("Profile start schedule: %s\n", compositeProfile->ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Profile schedule duration: %d\n", maxProfile.ChargingSchedule.Duration);
|
|
@@ -3087,6 +3123,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
// TxProfile found, composite schedule based on it
|
|
|
if(txProfile.ChargingProfileId != -1)
|
|
|
{
|
|
|
+ compositeProfile->ChargingSchedule.Duration = txProfile.ChargingSchedule.Duration;
|
|
|
for(int idxTxPeriod=0;idxTxPeriod<limitTx;idxTxPeriod++)
|
|
|
{
|
|
|
if((txProfile.ChargingSchedule.ChargingSchedulePeriod[idxTxPeriod].Limit != -1) &&
|
|
@@ -3148,6 +3185,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
{
|
|
|
if(defaultTxProfile.ChargingProfileId != -1)
|
|
|
{
|
|
|
+ compositeProfile->ChargingSchedule.Duration = (defaultTxProfile.ChargingSchedule.Duration>compositeProfile->ChargingSchedule.Duration)?defaultTxProfile.ChargingSchedule.Duration:compositeProfile->ChargingSchedule.Duration;
|
|
|
for(int idxDefPeriod=0;idxDefPeriod<limitDef;idxDefPeriod++)
|
|
|
{
|
|
|
if((defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod >= (txProfile.ChargingSchedule.ChargingSchedulePeriod[idxTxPeriod].StartPeriod + (txProfile.ChargingSchedule.Duration-defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod))) &&
|
|
@@ -3198,7 +3236,18 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
+ {
|
|
|
+ if(defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod != compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)].StartPeriod)
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx], &defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod],sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ compositePeriodIdx++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)], &defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod],sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ }
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -3222,6 +3271,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
// TxProfile not found but defaultTxProfile found, composite schedule based on it
|
|
|
else if(defaultTxProfile.ChargingProfileId != -1)
|
|
|
{
|
|
|
+ compositeProfile->ChargingSchedule.Duration = defaultTxProfile.ChargingSchedule.Duration;
|
|
|
for(int idxDefPeriod=0;idxDefPeriod<limitDef;idxDefPeriod++)
|
|
|
{
|
|
|
if((defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].Limit != -1) &&
|
|
@@ -3234,16 +3284,14 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
{
|
|
|
if(defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod >= maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod)
|
|
|
{
|
|
|
+ tmpPeriod.StartPeriod = defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod;
|
|
|
+ tmpPeriod.NumberPhases = defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].NumberPhases;
|
|
|
if((maxProfile.ChargingSchedule.Duration > 0))
|
|
|
{
|
|
|
- tmpPeriod.StartPeriod = defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod;
|
|
|
- tmpPeriod.NumberPhases = defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].NumberPhases;
|
|
|
tmpPeriod.Limit = (defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].Limit>maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit?maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit:defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].Limit);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- tmpPeriod.StartPeriod = defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod;
|
|
|
- tmpPeriod.NumberPhases = defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].NumberPhases;
|
|
|
tmpPeriod.Limit = defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].Limit;
|
|
|
}
|
|
|
|
|
@@ -3272,8 +3320,18 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
-
|
|
|
+ {
|
|
|
+ if(defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod].StartPeriod != compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)].StartPeriod)
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx], &defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod],sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ compositePeriodIdx++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)], &defaultTxProfile.ChargingSchedule.ChargingSchedulePeriod[idxDefPeriod],sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ }
|
|
|
break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -3295,50 +3353,76 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
// Fill other period by MaxProfile
|
|
|
if(maxProfile.ChargingProfileId != -1)
|
|
|
{
|
|
|
- for(int idxMaxPeriod=0;idxMaxPeriod<limitMax;idxMaxPeriod++)
|
|
|
+ if(compositePeriodIdx==0)
|
|
|
{
|
|
|
- if((maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit != -1) &&
|
|
|
- (maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod < durationReq) &&
|
|
|
- (maxProfile.ChargingSchedule.Duration > 0))
|
|
|
+ compositeProfile->ChargingSchedule.Duration = maxProfile.ChargingSchedule.Duration;
|
|
|
+ for(int idxMaxPeriod=0;idxMaxPeriod<limitDef;idxMaxPeriod++)
|
|
|
{
|
|
|
- if((maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod >= compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx==0?0:compositePeriodIdx-1].StartPeriod) &&
|
|
|
- (maxProfile.ChargingSchedule.Duration > compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx==0?0:compositePeriodIdx-1].StartPeriod))
|
|
|
+ if((maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit != -1) &&
|
|
|
+ (maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod < durationReq) &&
|
|
|
+ (maxProfile.ChargingSchedule.Duration > 0))
|
|
|
{
|
|
|
- tmpPeriod.StartPeriod = (compositePeriodIdx==0)?0:compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx==0?0:compositePeriodIdx-1].StartPeriod;
|
|
|
- tmpPeriod.NumberPhases = compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx==0?0:compositePeriodIdx-1].NumberPhases;
|
|
|
- tmpPeriod.Limit = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit;
|
|
|
- }
|
|
|
-
|
|
|
- if((compositePeriodIdx > 0 ) && (maxProfile.ChargingSchedule.Duration > compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx==0?0:compositePeriodIdx-1].StartPeriod))
|
|
|
- {
|
|
|
- tmpPeriod.StartPeriod = (maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod>compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].StartPeriod)?maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod:compositeProfile->ChargingSchedule.Duration;
|
|
|
- tmpPeriod.NumberPhases = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].NumberPhases;
|
|
|
- tmpPeriod.Limit = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit;
|
|
|
+ if(maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod != compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)].StartPeriod)
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx], &maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod],sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ compositePeriodIdx++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)], &maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod],sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ }
|
|
|
}
|
|
|
-
|
|
|
- if(tmpPeriod.Limit != -1)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ int lastCompositePeriodIdx = compositePeriodIdx;
|
|
|
+ for(int idxMaxPeriod=0;idxMaxPeriod<limitMax;idxMaxPeriod++)
|
|
|
+ {
|
|
|
+ if((maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit != -1) &&
|
|
|
+ (maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod < durationReq) &&
|
|
|
+ (maxProfile.ChargingSchedule.Duration > 0))
|
|
|
{
|
|
|
- if(tmpPeriod.Limit != compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)].Limit)
|
|
|
+ if((maxProfile.ChargingSchedule.Duration >= compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].StartPeriod))
|
|
|
{
|
|
|
- if(tmpPeriod.StartPeriod != compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)].StartPeriod)
|
|
|
+ if(maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit > compositeProfile->ChargingSchedule.ChargingSchedulePeriod[lastCompositePeriodIdx-1].Limit)
|
|
|
{
|
|
|
- memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx], &tmpPeriod , sizeof(struct StructChargingSchedulePeriod));
|
|
|
- compositePeriodIdx++;
|
|
|
+ tmpPeriod.StartPeriod = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod;
|
|
|
+ tmpPeriod.NumberPhases = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].NumberPhases;
|
|
|
+ tmpPeriod.Limit = compositeProfile->ChargingSchedule.ChargingSchedulePeriod[lastCompositePeriodIdx-1].Limit;
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[(compositePeriodIdx==0?compositePeriodIdx:compositePeriodIdx-1)], &tmpPeriod , sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ tmpPeriod.StartPeriod = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].StartPeriod;
|
|
|
+ tmpPeriod.NumberPhases = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].NumberPhases;
|
|
|
+ tmpPeriod.Limit = maxProfile.ChargingSchedule.ChargingSchedulePeriod[idxMaxPeriod].Limit;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // Delete duplicate period
|
|
|
- if(compositePeriodIdx > 1)
|
|
|
+ if(tmpPeriod.Limit != -1)
|
|
|
{
|
|
|
- if(compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].Limit == compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-2].Limit)
|
|
|
+ if(tmpPeriod.Limit != compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].Limit)
|
|
|
{
|
|
|
- compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].StartPeriod = -1;
|
|
|
- compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].Limit = -1;
|
|
|
- compositePeriodIdx -= 1;
|
|
|
+ if(tmpPeriod.StartPeriod != compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].StartPeriod)
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx], &tmpPeriod , sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ compositePeriodIdx++;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ memcpy(&compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1], &tmpPeriod , sizeof(struct StructChargingSchedulePeriod));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // Delete duplicate period
|
|
|
+ if(compositePeriodIdx > 1)
|
|
|
+ {
|
|
|
+ if(compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].Limit == compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-2].Limit)
|
|
|
+ {
|
|
|
+ compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].StartPeriod = -1;
|
|
|
+ compositeProfile->ChargingSchedule.ChargingSchedulePeriod[compositePeriodIdx-1].Limit = -1;
|
|
|
+ compositePeriodIdx -= 1;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -3346,6 +3430,7 @@ void checkCompositeSchedule(uint8_t connectorId, uint32_t durationReq, struct St
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ compositeProfile->ChargingSchedule.Duration = durationReq;
|
|
|
DEBUG_INFO("Connector-%d composite schedule ready.\n", connectorId);
|
|
|
DEBUG_INFO("Schedule start: %s\n", compositeProfile->ChargingSchedule.StartSchedule);
|
|
|
DEBUG_INFO("Schedule duration: %d\n", compositeProfile->ChargingSchedule.Duration);
|
|
@@ -3470,6 +3555,9 @@ int InitShareMemory()
|
|
|
|
|
|
int ProcessShareMemory()
|
|
|
{
|
|
|
+ int result = PASS;
|
|
|
+ ParsingRatedCur modelnameInfo={0};
|
|
|
+
|
|
|
if(InitShareMemory() == FAIL)
|
|
|
{
|
|
|
DEBUG_ERROR("InitShareMemory NG\n");
|
|
@@ -3478,10 +3566,87 @@ int ProcessShareMemory()
|
|
|
{
|
|
|
ShmStatusCodeData->AlarmCode.AlarmEvents.bits.FailToCreateShareMemory=1;
|
|
|
}
|
|
|
- sleep(5);
|
|
|
- return FAIL;
|
|
|
+
|
|
|
+ result = FAIL;
|
|
|
}
|
|
|
- return PASS;
|
|
|
+
|
|
|
+ // Model name parsing
|
|
|
+ if(RatedCurrentParsing((char*)ShmSysConfigAndInfo->SysConfig.ModelName, &modelnameInfo) != -1)
|
|
|
+ {
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') &&
|
|
|
+ ((ShmSysConfigAndInfo->SysConfig.ModelName[1]=='B') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='K') ||
|
|
|
+ (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='O'))
|
|
|
+ ) // 'D' means DC
|
|
|
+ {
|
|
|
+ // DO series
|
|
|
+ for(int gun_index=0; gun_index<GENERAL_GUN_QUANTITY ; gun_index++)
|
|
|
+ {
|
|
|
+ SystemInitial += 1;
|
|
|
+ gunTotalNumber += 1;
|
|
|
+ gunType[gun_index] = GUN_TYPE_DO;
|
|
|
+
|
|
|
+ switch(modelnameInfo.ParsingInfo[gun_index].GunType)
|
|
|
+ {
|
|
|
+ case Gun_Type_Chademo:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet CHAdeMO\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_CCS_2:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet CCS\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_GB:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet GBT\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_AC:
|
|
|
+ DEBUG_INFO("Gun-%02d type: Cabinet AC\n", gun_index);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ DEBUG_WARN("Gun-%02d type: Cabinet unknown\n", gun_index);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ for(int gun_index=0;gun_index<modelnameInfo.GetGunCount;gun_index++)
|
|
|
+ {
|
|
|
+ SystemInitial += 1;
|
|
|
+ gunTotalNumber += 1;
|
|
|
+
|
|
|
+ switch(modelnameInfo.ParsingInfo[gun_index].GunType)
|
|
|
+ {
|
|
|
+ case Gun_Type_Chademo:
|
|
|
+ gunType[gun_index] = GUN_TYPE_CHAdeMO;
|
|
|
+ DEBUG_INFO("Gun-%02d type: CHAdeMO\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_CCS_2:
|
|
|
+ gunType[gun_index] = GUN_TYPE_CCS;
|
|
|
+ DEBUG_INFO("Gun-%02d type: CCS\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_GB:
|
|
|
+ gunType[gun_index] = GUN_TYPE_GBT;
|
|
|
+ DEBUG_INFO("Gun-%02d type: GBT\n", gun_index);
|
|
|
+ break;
|
|
|
+ case Gun_Type_AC:
|
|
|
+ gunType[gun_index] = GUN_TYPE_AC;
|
|
|
+ DEBUG_INFO("Gun-%02d type: AC\n", gun_index);
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ DEBUG_WARN("Gun-%02d type: Unknown\n", gun_index);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DEBUG_ERROR("Model name parsing fail.\n");
|
|
|
+ result = FAIL;
|
|
|
+ }
|
|
|
+
|
|
|
+ if(result != PASS)sleep(5);
|
|
|
+
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
void CheckSystemValue(void)
|
|
@@ -3827,7 +3992,7 @@ void CheckSystemValue(void)
|
|
|
if((SystemInitial > 0) || (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)
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_COMPLETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_A))
|
|
|
{
|
|
|
uint8_t ts[20];
|
|
|
getNowDatetime(ts);
|
|
@@ -8620,13 +8785,13 @@ int handleChangeConfigurationRequest(char *uuid, char *payload)
|
|
|
|
|
|
sendChangeConfigurationConfirmation(uuid, comfirmstr);
|
|
|
ShmOCPP16DataPH->MsMsg.bits.ChangeConfigurationConf = 1;
|
|
|
- if((strcmp(keystr,"WebSocketPingInterval")==0)&&(strcmp(comfirmstr,"Accepted")==0))
|
|
|
+
|
|
|
+ if((strcmp(keystr,"WebSocketPingInterval")==0) && (strcmp(comfirmstr,"Accepted")==0))
|
|
|
{
|
|
|
ChageWebSocketPingInterval(atoi(valuestr));
|
|
|
}
|
|
|
|
|
|
- if(((strcmp(keystr,"AuthorizationKey")==0) || ((strcmp(keystr,"SecurityProfile")==0))) &&
|
|
|
- (strcmp(keystr,"SecurityProfile")==0)&&(strcmp(comfirmstr,"Accepted")==0))
|
|
|
+ if(((strcmp(keystr,"AuthorizationKey")==0) || (strcmp(keystr,"SecurityProfile")==0)) && (strcmp(comfirmstr,"Accepted")==0))
|
|
|
{
|
|
|
StoreUsrConfigData(&ShmSysConfigAndInfo->SysConfig);
|
|
|
SetOcppConnStatus(FALSE);
|
|
@@ -11993,8 +12158,7 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus) &&
|
|
|
- (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus <= SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
+ if((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus) && (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus <= SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
{
|
|
|
if(SetProfileReq.ConnectorId == ShmOCPP16DataPH->StartTransaction[SetProfileReq.ConnectorId -1].ResponseTransactionId)
|
|
|
{
|
|
@@ -12020,8 +12184,8 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus) &&
|
|
|
- (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus <= SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
+ if(((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus) && (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus <= SYS_MODE_TERMINATING)) ||
|
|
|
+ ((SYS_MODE_CCS_PRECHARGE_STEP0 <= ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus) && (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))) // S_CHARGING
|
|
|
{
|
|
|
if(SetProfileReq.ChargingProfile.TransactionId == ShmOCPP16DataPH->StartTransaction[SetProfileReq.ConnectorId -1].ResponseTransactionId)
|
|
|
{
|
|
@@ -12047,8 +12211,7 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus) &&
|
|
|
- (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus <= SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
+ if((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus) && (ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus <= SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
{
|
|
|
if(SetProfileReq.ChargingProfile.TransactionId == ShmOCPP16DataPH->StartTransaction[SetProfileReq.ConnectorId -1].ResponseTransactionId)
|
|
|
{
|
|
@@ -12067,8 +12230,8 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex)
|
|
|
{
|
|
|
- if((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus) &&
|
|
|
- (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus <= SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
+ if(((SYS_MODE_PREPARING <= ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus) && (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus <= SYS_MODE_TERMINATING)) ||
|
|
|
+ ((SYS_MODE_CCS_PRECHARGE_STEP0 <= ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus) && (ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))) // S_CHARGING
|
|
|
{
|
|
|
if(SetProfileReq.ChargingProfile.TransactionId == ShmOCPP16DataPH->StartTransaction[SetProfileReq.ConnectorId -1].ResponseTransactionId)
|
|
|
{
|
|
@@ -12095,8 +12258,7 @@ int handleSetChargingProfileRequest(char *uuid, char *payload)
|
|
|
{
|
|
|
if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
|
|
|
{
|
|
|
- if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING) ||
|
|
|
- (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
+ if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_TERMINATING)) // S_CHARGING
|
|
|
{
|
|
|
if(SetProfileReq.ChargingProfile.TransactionId == ShmOCPP16DataPH->StartTransaction[SetProfileReq.ConnectorId -1].ResponseTransactionId)
|
|
|
{
|
|
@@ -12562,7 +12724,7 @@ int handleUnlockConnectorRequest(char *uuid, char *payload)
|
|
|
|
|
|
for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|
|
|
{
|
|
|
- if ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex ) && ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].SystemStatus == SYS_MODE_IDLE) ))
|
|
|
+ if ((ShmSysConfigAndInfo->SysInfo.ChademoChargingData[index].Index == tempIndex ))
|
|
|
{
|
|
|
//stop Transaction
|
|
|
ShmOCPP16DataPH->CsMsg.bits[connectorIdInt-1].UnlockConnectorReq = 1;
|
|
@@ -12583,7 +12745,7 @@ int handleUnlockConnectorRequest(char *uuid, char *payload)
|
|
|
|
|
|
for (int index = 0; index < CCS_QUANTITY; index++)
|
|
|
{
|
|
|
- if ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex ) && ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].SystemStatus == SYS_MODE_IDLE) ))
|
|
|
+ if ((ShmSysConfigAndInfo->SysInfo.CcsChargingData[index].Index == tempIndex ))
|
|
|
{
|
|
|
//stop Transaction
|
|
|
ShmOCPP16DataPH->CsMsg.bits[connectorIdInt-1].UnlockConnectorReq = 1;
|
|
@@ -12603,7 +12765,7 @@ int handleUnlockConnectorRequest(char *uuid, char *payload)
|
|
|
|
|
|
for (int index = 0; index < GB_QUANTITY; index++)
|
|
|
{
|
|
|
- if ((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex ) &&((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_CHARGING)||(ShmSysConfigAndInfo->SysInfo.GbChargingData[index].SystemStatus == SYS_MODE_IDLE)))
|
|
|
+ if ((ShmSysConfigAndInfo->SysInfo.GbChargingData[index].Index == tempIndex ))
|
|
|
{
|
|
|
//stop Transaction
|
|
|
ShmOCPP16DataPH->CsMsg.bits[connectorIdInt-1].UnlockConnectorReq = 1;
|
|
@@ -12617,7 +12779,7 @@ int handleUnlockConnectorRequest(char *uuid, char *payload)
|
|
|
|
|
|
for (int index = 0; index < GENERAL_GUN_QUANTITY; index++)
|
|
|
{
|
|
|
- if ((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex ) &&((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_CHARGING)||(ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.SystemStatus == SYS_MODE_IDLE)))
|
|
|
+ if ((ShmSysConfigAndInfo->SysInfo.ConnectorInfo[index].GeneralChargingData.Index == tempIndex ))
|
|
|
{
|
|
|
//stop Transaction
|
|
|
ShmOCPP16DataPH->CsMsg.bits[connectorIdInt-1].UnlockConnectorReq = 1;
|
|
@@ -12638,7 +12800,7 @@ int handleUnlockConnectorRequest(char *uuid, char *payload)
|
|
|
|
|
|
for (int index = 0; index < AC_QUANTITY; index++)
|
|
|
{
|
|
|
- if ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex ) && ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_IDLE) ))
|
|
|
+ if ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex ))
|
|
|
{
|
|
|
ShmOCPP16DataPH->CsMsg.bits[connectorIdInt-1].UnlockConnectorReq = 1;
|
|
|
|
|
@@ -13587,7 +13749,7 @@ int initialConfigurationTable(void)
|
|
|
char sstr[256]={0};
|
|
|
int c = 0;
|
|
|
char *loc;
|
|
|
- int confVersion = 8;
|
|
|
+ int confVersion = 9;
|
|
|
|
|
|
DEBUG_INFO("initialConfigurationTable...version: %d\n", confVersion);
|
|
|
//start_t = clock();
|
|
@@ -13933,6 +14095,13 @@ int initialConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CustomIdleFeeAfterStop", "false", ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData);
|
|
|
|
|
|
+ // SystemUptimeSec
|
|
|
+ ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemName, "SystemUptimeSec");
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemData, "0" );
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","SystemUptimeSec", "true", ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemData);
|
|
|
+
|
|
|
// Configuration Version
|
|
|
ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemAccessibility = 0;
|
|
|
strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemName, "ConfigurationVersion");
|
|
@@ -14338,6 +14507,12 @@ int initialConfigurationTable(void)
|
|
|
sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData, "%s", valuestr);
|
|
|
}
|
|
|
|
|
|
+ if(strcmp(keystr, "SystemUptimeSec") == 0)
|
|
|
+ {
|
|
|
+ ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
|
+ sprintf((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemData, "%d", atoi(valuestr));
|
|
|
+ }
|
|
|
+
|
|
|
if(strcmp(keystr, "ConfigurationVersion") == 0)
|
|
|
{
|
|
|
ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemAccessibility = (strcmp(readonlystr, "true")==0) ? 0 : 1;
|
|
@@ -14797,6 +14972,15 @@ void StoreConfigurationTable(void)
|
|
|
|
|
|
fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","CustomIdleFeeAfterStop", "false", (char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[CustomIdleFeeAfterStop].ItemData);
|
|
|
|
|
|
+ // SystemUptimeSec
|
|
|
+ /*
|
|
|
+ ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemAccessibility = 1;
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemName, "SystemUptimeSec");
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemData, "0" );
|
|
|
+ */
|
|
|
+
|
|
|
+ fprintf(outfile,"{\"key\":\"%s\",\"readonly\":%s,\"value\":\"%s\"}\n","SystemUptimeSec", "true", (char *)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemData);
|
|
|
+
|
|
|
// ConfigurationVersion
|
|
|
/*
|
|
|
ShmOCPP16DataPH->ConfigurationTable.CoreProfile[ConfigurationVersion].ItemAccessibility = 1;
|
|
@@ -15630,6 +15814,36 @@ void getKeyValue(char *keyReq)
|
|
|
isKnowKey = TRUE;
|
|
|
}
|
|
|
|
|
|
+ if(isEmpty || strcmp(keyReq, "SystemUptimeSec") == 0 )
|
|
|
+ {
|
|
|
+ struct sysinfo s_info;
|
|
|
+ int error = sysinfo(&s_info);
|
|
|
+
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->GetConfiguration.Key[GetConfiguration_SystemUptimeSec].Item, "SystemUptimeSec");
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->GetConfiguration.ResponseConfigurationKey[GetConfiguration_SystemUptimeSec].Key, "SystemUptimeSec");
|
|
|
+
|
|
|
+ if(ShmOCPP16DataPH->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemAccessibility == 1)
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->GetConfiguration.ResponseConfigurationKey[GetConfiguration_SystemUptimeSec].ReadOnly, "0"/*"FALSE"*/);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ strcpy((char *)ShmOCPP16DataPH->GetConfiguration.ResponseConfigurationKey[GetConfiguration_SystemUptimeSec].ReadOnly, "1"/*"TRUE"*/);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(error != 0)
|
|
|
+ {
|
|
|
+ DEBUG_WARN("System uptime get error: %d\n", error);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ sprintf((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[SystemUptimeSec].ItemData, "%ld", s_info.uptime);
|
|
|
+ sprintf((char *)ShmOCPP16Data->GetConfiguration.ResponseConfigurationKey[GetConfiguration_SystemUptimeSec].Value, "%ld", s_info.uptime);
|
|
|
+ }
|
|
|
+
|
|
|
+ isKnowKey = TRUE;
|
|
|
+ }
|
|
|
+
|
|
|
if(isEmpty || strcmp(keyReq, "ConfigurationVersion") == 0 )
|
|
|
{
|
|
|
strcpy((char *)ShmOCPP16DataPH->GetConfiguration.Key[GetConfiguration_ConfigurationVersion].Item, "ConfigurationVersion");
|
|
@@ -16733,6 +16947,11 @@ int setKeyValue(char *key, char *value)
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ if(strcmp(key, "SystemUptimeSec") == 0)
|
|
|
+ {
|
|
|
+ isSuccess = NotSupported;
|
|
|
+ }
|
|
|
#if 0
|
|
|
//For OCPP Test Case
|
|
|
if(strcmp(key, "LocalAuthorizationListEnabled") == 0)
|
|
@@ -18632,11 +18851,7 @@ void refreshProcDogTimer()
|
|
|
|
|
|
void InitialSystemValue(void)
|
|
|
{
|
|
|
- int connectorIndex = 0;
|
|
|
- //int valueASCII = 0;
|
|
|
server_cycle_Status = atoi((char*)ShmOCPP16DataPH->ConfigurationTable.CoreProfile[MinimumStatusDuration].ItemData);
|
|
|
- gunTotalNumber=0;
|
|
|
- SystemInitial = 0;
|
|
|
locallistVersion=0;
|
|
|
BootNotificationInterval = 0;
|
|
|
authorizeRetryTimes = 0;
|
|
@@ -18661,98 +18876,6 @@ void InitialSystemValue(void)
|
|
|
memset(CcsPreviousConnectorPlugIn, 0, ARRAY_SIZE(CcsPreviousConnectorPlugIn));
|
|
|
memset(GbPreviousConnectorPlugIn, 0, ARRAY_SIZE(GbPreviousConnectorPlugIn));
|
|
|
memset(AcPreviousConnectorPlugIn, 0, ARRAY_SIZE(AcPreviousConnectorPlugIn));
|
|
|
- memset(gunType, 0, ARRAY_SIZE(gunType));
|
|
|
-
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.ModelName[0]=='D') // 'D' means DC
|
|
|
- {
|
|
|
- if((ShmSysConfigAndInfo->SysConfig.ModelName[1]=='B') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='K') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[1]=='O'))
|
|
|
- {
|
|
|
- // DO series
|
|
|
- for(int index=0; index<GENERAL_GUN_QUANTITY ; index++)
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_DO;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // DM, DW, DS series
|
|
|
- //check connector / socket type (index: 8, 9, 10)
|
|
|
- for(int index=7; index <10 ; index++)
|
|
|
- {
|
|
|
- if(index != 8)
|
|
|
- {
|
|
|
- // DC Connector
|
|
|
- if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'J'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_CHAdeMO;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- else if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'D') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'E') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'F') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'U') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'T') ||
|
|
|
- (ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'V'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_CCS;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- else if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'G'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_GBT;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- else if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] == 'O'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_DO;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- // AC Connector
|
|
|
- if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] > '0') && (ShmSysConfigAndInfo->SysConfig.ModelName[index] <= '9'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_AC;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //DEBUG_INFO("DC ...\n");
|
|
|
- }
|
|
|
- else if (ShmSysConfigAndInfo->SysConfig.ModelName[0]=='A') //'A' means AC
|
|
|
- {
|
|
|
- //check connector / socket type (index: 8, 9, 10)
|
|
|
- for(int index=7; index <10 ; index++)
|
|
|
- {
|
|
|
- if ((ShmSysConfigAndInfo->SysConfig.ModelName[index] > '0') && (ShmSysConfigAndInfo->SysConfig.ModelName[index] <= '9'))
|
|
|
- {
|
|
|
- SystemInitial = SystemInitial + 1;
|
|
|
- gunTotalNumber = gunTotalNumber + 1;
|
|
|
- gunType[connectorIndex] = GUN_TYPE_AC;
|
|
|
- connectorIndex = connectorIndex + 1;
|
|
|
-
|
|
|
- //DEBUG_INFO("AC: %d, %c\n", index, ShmSysConfigAndInfo->SysConfig.ModelName[index]);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
//Status && ConnectorPlugIn Setting
|
|
|
for (int index = 0; index < CHAdeMO_QUANTITY; index++)
|