|
@@ -519,6 +519,32 @@ int getStartStop(uint8_t *start, uint8_t *stop)
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+int isOvertNow(uint8_t *start)
|
|
|
+{
|
|
|
+ int result = YES;
|
|
|
+ struct tm tmStart;
|
|
|
+ struct timeb tbStart;
|
|
|
+
|
|
|
+ if((sscanf((char*)start, "%4d-%2d-%2dT%2d:%2d:%2d", &tmStart.tm_year, &tmStart.tm_mon, &tmStart.tm_mday, &tmStart.tm_hour, &tmStart.tm_min, &tmStart.tm_sec) == 6))
|
|
|
+ {
|
|
|
+ //DEBUG_INFO("Start: %d-%d-%d %d:%d:%d\n", tmStart.tm_year, tmStart.tm_mon, tmStart.tm_mday, tmStart.tm_hour, tmStart.tm_min, tmStart.tm_sec);
|
|
|
+
|
|
|
+ tmStart.tm_year -= 1900;
|
|
|
+ tmStart.tm_mon -= 1;
|
|
|
+ tbStart.time = mktime(&tmStart);
|
|
|
+ tbStart.millitm = 0;
|
|
|
+
|
|
|
+ if(DiffTimebWithNowSec(tbStart) <= 0)
|
|
|
+ result = NO;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ DEBUG_WARN("Start date parsing error.\r\n");
|
|
|
+ }
|
|
|
+
|
|
|
+ return result;
|
|
|
+}
|
|
|
+
|
|
|
int getStartSinceRecurring(uint8_t *start, uint8_t *stop, uint8_t isDaily)
|
|
|
{
|
|
|
int result = -1;
|
|
@@ -2830,10 +2856,15 @@ int sendAuthorizeRequest(int gun_index)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- DEBUG_INFO("offline Local Authorization Pass !!!!\n");
|
|
|
+ DEBUG_INFO("offline Local Authorization get result !!!!\n");
|
|
|
strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ExpiryDate, idTagQuery.expiryDate);
|
|
|
strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, (const char *)ShmSysConfigAndInfo->SysConfig.UserId);
|
|
|
- strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, idTagQuery.idTagstatus);
|
|
|
+
|
|
|
+ if(isOvertNow((uint8_t*)&idTagQuery.expiryDate[0]))
|
|
|
+ sprintf((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Expired");
|
|
|
+ else
|
|
|
+ strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, idTagQuery.idTagstatus);
|
|
|
+
|
|
|
DEBUG_INFO("ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status: %s \n", ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status);
|
|
|
result = PASS;
|
|
|
ShmOCPP16Data->SpMsg.bits.AuthorizeReq = 0;
|