|
@@ -3617,7 +3617,7 @@ int sendAuthorizeRequest(int gun_index)
|
|
|
//Local Authorize
|
|
|
if((strcmp((const char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[AllowOfflineTxForUnknownId].ItemData , "TRUE")==0) &&(ShmOCPP16Data->OcppConnStatus == 0))
|
|
|
{
|
|
|
- DEBUG_INFO("Allow OfflineTx UnknownId Pass !!!!\n");
|
|
|
+ DEBUG_INFO("Allow OfflineTx UnknownId Pass.\n");
|
|
|
strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ExpiryDate, "");
|
|
|
strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, "");
|
|
|
strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted");
|
|
@@ -3646,23 +3646,25 @@ int sendAuthorizeRequest(int gun_index)
|
|
|
{
|
|
|
if(strcmp(idTagQuery.idTagstr,"") == 0)
|
|
|
{
|
|
|
- DEBUG_INFO("off-line Local Authorization Fail !!!!, Card %s is blank!!!!\n", idTagQuery.idTagstr);
|
|
|
+ DEBUG_INFO("Local Authorization Fail, Card %s is not in local cache and list.\n", ShmSysConfigAndInfo->SysConfig.UserId);
|
|
|
}
|
|
|
-
|
|
|
- if(strcmp(idTagQuery.idTagstatus,"Accepted") != 0)
|
|
|
+ else if(strcmp(idTagQuery.idTagstatus,"Accepted") != 0)
|
|
|
{
|
|
|
- DEBUG_INFO("off-line Local Authorization Fail !!!!, Card %s is not Accepted!!!!\n", idTagQuery.idTagstr);
|
|
|
+ DEBUG_INFO("Local Authorization Fail, Card %s is not Accepted.\n", idTagQuery.idTagstr);
|
|
|
}
|
|
|
|
|
|
- DEBUG_INFO("off-line Local Authorization Fail !!!!\n");
|
|
|
- strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ExpiryDate, idTagQuery.expiryDate);
|
|
|
- strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, idTagQuery.parentIdTag);
|
|
|
- strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Invalid");
|
|
|
- DEBUG_INFO("ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status: %s \n", ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status);
|
|
|
- ShmOCPP16Data->SpMsg.bits.AuthorizeReq = 0;
|
|
|
- ShmOCPP16Data->SpMsg.bits.AuthorizeConf = 1; // inform csu
|
|
|
- authorizeRetryTimes = 0;
|
|
|
- return result;
|
|
|
+ if(!GetOcppConnStatus())
|
|
|
+ {
|
|
|
+ DEBUG_INFO("off-line Local Authorization Fail.\n");
|
|
|
+ strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ExpiryDate, idTagQuery.expiryDate);
|
|
|
+ strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, idTagQuery.parentIdTag);
|
|
|
+ strcpy((char *)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Invalid");
|
|
|
+ DEBUG_INFO("ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status: %s \n", ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status);
|
|
|
+ ShmOCPP16Data->SpMsg.bits.AuthorizeReq = 0;
|
|
|
+ ShmOCPP16Data->SpMsg.bits.AuthorizeConf = 1; // inform csu
|
|
|
+ authorizeRetryTimes = 0;
|
|
|
+ return result;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -18098,6 +18100,7 @@ void InitialSystemValue(void)
|
|
|
cpinitateMsg.bits[gun_index].StatusNotificationConf = 0;
|
|
|
//clientTime.MeterValues[gun_index] = time((time_t*)NULL);
|
|
|
clientTime.StatusNotification[gun_index] = time((time_t*)NULL);
|
|
|
+ memset(&ShmOCPP16Data->StatusNotification[gun_index], 0x00, sizeof(struct StructStatusNotification));
|
|
|
}
|
|
|
|
|
|
memset( (void *)unknownkey, 0, sizeof(unknownkey));
|