|
@@ -384,7 +384,7 @@ bool isModelNameMatch = true;
|
|
|
//int rfidFd = -1;
|
|
|
//char* rfidPortName = "/dev/ttyS2";
|
|
|
char* fwVersion = "V1.10.00.0000.00";
|
|
|
-char* subVersion = "02";
|
|
|
+char* subVersion = "03";
|
|
|
|
|
|
sqlite3 *localDb;
|
|
|
bool isDb_ready;
|
|
@@ -6403,6 +6403,19 @@ void TimeOffsetHandler(void)
|
|
|
|
|
|
ShmChargerInfo->CabinetMiscValue.TimeOffset = offset;
|
|
|
|
|
|
+#if 0
|
|
|
+ time_t timep;
|
|
|
+ struct tm *tm;
|
|
|
+ time(&timep);
|
|
|
+ tm = localtime(&timep);
|
|
|
+ LOG_INFO(" NowTime: %d/%02d/%02d %02d:%02d:%02d",
|
|
|
+ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
|
+ timep += (offset * 60);
|
|
|
+ tm = localtime(&timep);
|
|
|
+ LOG_INFO("OffsetTime: %d/%02d/%02d %02d:%02d:%02d",
|
|
|
+ tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday, tm->tm_hour, tm->tm_min, tm->tm_sec);
|
|
|
+#endif
|
|
|
+
|
|
|
for(int i = 0; i < CONNECTOR_QUANTITY; i++)
|
|
|
{
|
|
|
if(ShmSysConfigAndInfo->SysInfo.DispenserInfo.Dispenser[i].ConnectorQuantity > 0)
|
|
@@ -7571,25 +7584,19 @@ bool IsStandbyEnable(void)
|
|
|
|
|
|
if(ShmChargerInfo->Control.CustomerCode == _CUSTOMER_CODE_TCC)
|
|
|
{
|
|
|
- time_t t = time(NULL);
|
|
|
- struct tm *now = localtime(&t);
|
|
|
+ time_t timep;
|
|
|
+ struct tm *tm;
|
|
|
+ time(&timep);
|
|
|
|
|
|
- int timeHour = now->tm_hour + (ShmChargerInfo->CabinetMiscValue.TimeOffset / 60);
|
|
|
- if(timeHour >= 24)
|
|
|
- {
|
|
|
- timeHour -= 24;
|
|
|
- }
|
|
|
- else if(timeHour < 0)
|
|
|
- {
|
|
|
- timeHour += 24;
|
|
|
- }
|
|
|
+ timep += (ShmChargerInfo->CabinetMiscValue.TimeOffset * 60);
|
|
|
+ tm = localtime(&timep);
|
|
|
|
|
|
- if(timeHour >= 0 && timeHour < 8)
|
|
|
+ if(tm->tm_hour >= 0 && tm->tm_hour < 8)
|
|
|
{
|
|
|
if(!_isStandbyEnable)
|
|
|
{
|
|
|
LOG_INFO("[TCC]Customer Enable Standby Function This Time[%02d:%02d:%02d], Offset[%d]",
|
|
|
- now->tm_hour, now->tm_min, now->tm_sec, ShmChargerInfo->CabinetMiscValue.TimeOffset);
|
|
|
+ tm->tm_hour, tm->tm_min, tm->tm_sec, ShmChargerInfo->CabinetMiscValue.TimeOffset);
|
|
|
}
|
|
|
_isStandbyEnable = true;
|
|
|
result = true;
|
|
@@ -7599,7 +7606,7 @@ bool IsStandbyEnable(void)
|
|
|
if(_isStandbyEnable)
|
|
|
{
|
|
|
LOG_INFO("[TCC]Customer Disable Standby Function This Time[%02d:%02d:%02d], Offset[%d]",
|
|
|
- now->tm_hour, now->tm_min, now->tm_sec, ShmChargerInfo->CabinetMiscValue.TimeOffset);
|
|
|
+ tm->tm_hour, tm->tm_min, tm->tm_sec, ShmChargerInfo->CabinetMiscValue.TimeOffset);
|
|
|
}
|
|
|
_isStandbyEnable = false;
|
|
|
result = false;
|
|
@@ -8375,7 +8382,7 @@ void ChkConnectorAction(void)
|
|
|
if(ShmChargerInfo->ConnectorActReq[i].Flag.bits.ChargingCancel)
|
|
|
{
|
|
|
Clean_Ocpp_TcciSerialNo(i);
|
|
|
- LOG_INFO("Gun %d Charging Canceled");
|
|
|
+ LOG_INFO("Gun %d Charging Canceled", i + 1);
|
|
|
ShmChargerInfo->ConnectorActReq[i].Flag.bits.ChargingCancel = false;
|
|
|
}
|
|
|
}
|
|
@@ -9377,6 +9384,7 @@ int main(void)
|
|
|
if(IsAvailableBackToIdle(gun_index) == YES &&
|
|
|
ShmSysConfigAndInfo->SysInfo.ConnectorInfo[gun_index].Parameter.bits.PsuReleasable)
|
|
|
{
|
|
|
+ ReleaseAlarmCode(gun_index);
|
|
|
setChargerMode(gun_index, MODE_IDLE);
|
|
|
}
|
|
|
}
|