|
@@ -261,9 +261,9 @@ unsigned int isKernelSupportNAT()
|
|
|
//======================================================
|
|
|
void ocpp_process_start()
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
system("/root/OcppBackend &");
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
system("/root/OcppBackend20 &");
|
|
|
}
|
|
|
|
|
@@ -271,11 +271,11 @@ uint8_t ocpp_get_connection_status()
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->OcppConnStatus;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->OcppConnStatus;
|
|
|
}
|
|
@@ -287,14 +287,14 @@ uint16_t ocpp_get_connection_timeout()
|
|
|
{
|
|
|
uint16_t result = (TIMEOUT_SPEC_HANDSHAKING/1000);
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(strcmp((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemData,"") != 0)
|
|
|
{
|
|
|
result = atoi((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[ConnectionTimeOut].ItemData);
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(strcmp((char *)ShmOCPP20Data->ControllerComponentVariable[TxCtrlr_EVConnectionTimeOut].variableAttribute[0].value,"") != 0)
|
|
|
{
|
|
@@ -309,11 +309,11 @@ uint8_t ocpp_get_update_firmware_req()
|
|
|
{
|
|
|
uint8_t result = NO;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->MsMsg.bits.UpdateFirmwareReq;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->MsMsg.bits.UpdateFirmwareReq;
|
|
|
}
|
|
@@ -325,11 +325,11 @@ uint8_t ocpp_get_reset_req()
|
|
|
{
|
|
|
uint8_t result = NO;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->MsMsg.bits.ResetReq;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->MsMsg.bits.ResetReq;
|
|
|
}
|
|
@@ -339,7 +339,7 @@ uint8_t ocpp_get_reset_req()
|
|
|
|
|
|
void ocpp_boot_info_sync()
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP16Data->OcppServerURL, (char*)ShmSysConfigAndInfo->SysConfig.OcppServerURL, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.OcppServerURL));
|
|
|
memcpy((char*)ShmOCPP16Data->ChargeBoxId, (char*)ShmSysConfigAndInfo->SysConfig.ChargeBoxId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.ChargeBoxId));
|
|
@@ -351,7 +351,7 @@ void ocpp_boot_info_sync()
|
|
|
DEBUG_INFO("CpMeterSerialNumber: %s\n",ShmOCPP16Data->BootNotification.CpMeterSerialNumber);
|
|
|
DEBUG_INFO("CpMeterType: %s\n",ShmOCPP16Data->BootNotification.CpMeterType);
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP20Data->OcppServerURL, (char*)ShmSysConfigAndInfo->SysConfig.OcppServerURL, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.OcppServerURL));
|
|
|
memcpy((char*)ShmOCPP20Data->ChargeBoxId, (char*)ShmSysConfigAndInfo->SysConfig.ChargeBoxId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.ChargeBoxId));
|
|
@@ -361,12 +361,12 @@ void ocpp_boot_info_sync()
|
|
|
|
|
|
void ocpp_set_remotestart(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CsMsg.bits[gun_index].RemoteStartTransactionReq != status)
|
|
|
ShmOCPP16Data->CsMsg.bits[gun_index].RemoteStartTransactionReq = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CsMsg.bits[gun_index].RequestStartTransactionReq != status)
|
|
|
ShmOCPP20Data->CsMsg.bits[gun_index].RequestStartTransactionReq = status;
|
|
@@ -375,12 +375,12 @@ void ocpp_set_remotestart(uint8_t gun_index, uint8_t status)
|
|
|
|
|
|
void ocpp_set_remotestop(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CsMsg.bits[gun_index].RemoteStopTransactionReq != status)
|
|
|
ShmOCPP16Data->CsMsg.bits[gun_index].RemoteStopTransactionReq = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CsMsg.bits[gun_index].RequestStopTransactionReq != status)
|
|
|
ShmOCPP20Data->CsMsg.bits[gun_index].RequestStopTransactionReq = status;
|
|
@@ -391,11 +391,11 @@ uint8_t ocpp_get_remotestart(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->CsMsg.bits[gun_index].RemoteStartTransactionReq;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->CsMsg.bits[gun_index].RequestStartTransactionReq;
|
|
|
}
|
|
@@ -405,11 +405,11 @@ uint8_t ocpp_get_remotestart(uint8_t gun_index)
|
|
|
|
|
|
void ocpp_copy_userid_from_remotestart(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
memcpy(ShmSysConfigAndInfo->SysConfig.UserId, ShmOCPP16Data->RemoteStartTransaction[gun_index].IdTag, ARRAY_SIZE(ShmOCPP16Data->RemoteStartTransaction[gun_index].IdTag));
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
memcpy(ShmSysConfigAndInfo->SysConfig.UserId, ShmOCPP20Data->RequestStartTransaction[gun_index].idToken.idToken, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
|
|
|
}
|
|
@@ -419,11 +419,11 @@ uint8_t ocpp_get_remotestop(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->CsMsg.bits[gun_index].RemoteStopTransactionReq;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->CsMsg.bits[gun_index].RequestStopTransactionReq;
|
|
|
}
|
|
@@ -433,7 +433,7 @@ uint8_t ocpp_get_remotestop(uint8_t gun_index)
|
|
|
|
|
|
void ocpp_set_auth_req(uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->SpMsg.bits.AuthorizeReq != status)
|
|
|
{
|
|
@@ -443,7 +443,7 @@ void ocpp_set_auth_req(uint8_t status)
|
|
|
ShmOCPP16Data->SpMsg.bits.AuthorizeReq = status;
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->SpMsg.bits.AuthorizeReq != status)
|
|
|
{
|
|
@@ -459,11 +459,11 @@ uint8_t ocpp_get_auth_req()
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->SpMsg.bits.AuthorizeReq;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->SpMsg.bits.AuthorizeReq;
|
|
|
}
|
|
@@ -473,12 +473,12 @@ uint8_t ocpp_get_auth_req()
|
|
|
|
|
|
void ocpp_set_auth_conf(uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->SpMsg.bits.AuthorizeConf != status)
|
|
|
ShmOCPP16Data->SpMsg.bits.AuthorizeConf = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->SpMsg.bits.AuthorizeConf != status)
|
|
|
ShmOCPP20Data->SpMsg.bits.AuthorizeConf = status;
|
|
@@ -489,11 +489,11 @@ uint8_t ocpp_get_auth_conf()
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->SpMsg.bits.AuthorizeConf;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->SpMsg.bits.AuthorizeConf;
|
|
|
}
|
|
@@ -505,12 +505,12 @@ uint8_t ocpp_get_auth_result()
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0))
|
|
|
result = PASS;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.status, "Accepted")==0))
|
|
|
result = PASS;
|
|
@@ -523,11 +523,11 @@ uint8_t ocpp_get_unlocker_req(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmCharger->gun_info[ShmOCPP16Data->UnlockConnector[gun_index].ConnectorId-1].isUnlockerConnetor;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmCharger->gun_info[ShmOCPP20Data->UnlockConnector[gun_index].connectorId-1].isUnlockerConnetor;
|
|
|
}
|
|
@@ -537,12 +537,12 @@ uint8_t ocpp_get_unlocker_req(uint8_t gun_index)
|
|
|
|
|
|
void ocpp_set_unlocker_req(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmCharger->gun_info[ShmOCPP16Data->UnlockConnector[gun_index].ConnectorId-1].isUnlockerConnetor != status)
|
|
|
ShmCharger->gun_info[ShmOCPP16Data->UnlockConnector[gun_index].ConnectorId-1].isUnlockerConnetor = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmCharger->gun_info[ShmOCPP20Data->UnlockConnector[gun_index].connectorId-1].isUnlockerConnetor != status)
|
|
|
ShmCharger->gun_info[ShmOCPP20Data->UnlockConnector[gun_index].connectorId-1].isUnlockerConnetor = status;
|
|
@@ -551,12 +551,12 @@ void ocpp_set_unlocker_req(uint8_t gun_index, uint8_t status)
|
|
|
|
|
|
void ocpp_set_starttransaction_req(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq != status)
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionReq = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq != status)
|
|
|
ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq = status;
|
|
@@ -565,12 +565,12 @@ void ocpp_set_starttransaction_req(uint8_t gun_index, uint8_t status)
|
|
|
|
|
|
void ocpp_set_starttransaction_conf(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf != status)
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StartTransactionConf = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventConf != status)
|
|
|
ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventConf = status;
|
|
@@ -579,12 +579,12 @@ void ocpp_set_starttransaction_conf(uint8_t gun_index, uint8_t status)
|
|
|
|
|
|
void ocpp_set_stoptransaction_req(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq != status)
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq != status)
|
|
|
ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq = status;
|
|
@@ -593,14 +593,14 @@ void ocpp_set_stoptransaction_req(uint8_t gun_index, uint8_t status)
|
|
|
|
|
|
void ocpp_set_stoptransaction_conf(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionConf != status)
|
|
|
{
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionConf = status;
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventConf != status)
|
|
|
{
|
|
@@ -611,11 +611,11 @@ void ocpp_set_stoptransaction_conf(uint8_t gun_index, uint8_t status)
|
|
|
|
|
|
void ocpp_copy_userid_to_starttransaction(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP16Data->StartTransaction[gun_index].IdTag, (char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ARRAY_SIZE(ShmOCPP16Data->StartTransaction[gun_index].IdTag));
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
memcpy((char*)ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken, (char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId));
|
|
|
}
|
|
@@ -625,11 +625,11 @@ uint8_t ocpp_get_smartcharging_profileId(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = 0;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileId;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->SmartChargingProfile[gun_index].id;
|
|
|
}
|
|
@@ -639,11 +639,11 @@ uint8_t ocpp_get_smartcharging_profileId(uint8_t gun_index)
|
|
|
|
|
|
void ocpp_reset_smartcharging_profileId(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingProfileId = 0;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
ShmOCPP20Data->SmartChargingProfile[gun_index].id = 0;
|
|
|
}
|
|
@@ -653,11 +653,11 @@ uint8_t ocpp_get_profile_req(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq;
|
|
|
}
|
|
@@ -667,12 +667,12 @@ uint8_t ocpp_get_profile_req(uint8_t gun_index)
|
|
|
|
|
|
void ocpp_set_profile_req(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq != status)
|
|
|
ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileReq = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq != status)
|
|
|
ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileReq = status;
|
|
@@ -683,11 +683,11 @@ uint8_t ocpp_get_profile_conf(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileConf;
|
|
|
}
|
|
@@ -697,12 +697,12 @@ uint8_t ocpp_get_profile_conf(uint8_t gun_index)
|
|
|
|
|
|
void ocpp_set_profile_conf(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf != status)
|
|
|
ShmOCPP16Data->CSUMsg.bits[gun_index].ChargingProfileConf = status;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileConf != status)
|
|
|
ShmOCPP20Data->CSUMsg.bits[gun_index].ChargingProfileConf = status;
|
|
@@ -713,12 +713,12 @@ uint8_t ocpp_get_StopTransactionOnEVSideDisconnect()
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(strcmp((char *)ShmOCPP16Data->ConfigurationTable.CoreProfile[StopTransactionOnEVSideDisconnect].ItemData, "TRUE") == 0)
|
|
|
result = ON;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(strcmp((char *)ShmOCPP20Data->ControllerComponentVariable[TxCtrlr_StopTxOnEVSideDisconnect].variableAttribute[0].value, "TRUE") == 0)
|
|
|
result = ON;
|
|
@@ -731,11 +731,11 @@ uint8_t ocpp_get_cancelreservation_req(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
result = ShmOCPP16Data->CsMsg.bits[gun_index].CancelReservationReq;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
result = ShmOCPP20Data->CsMsg.bits[gun_index].CancelReservationReq;
|
|
|
}
|
|
@@ -745,7 +745,7 @@ uint8_t ocpp_get_cancelreservation_req(uint8_t gun_index)
|
|
|
|
|
|
void ocpp_set_cancelreservation_req(uint8_t gun_index, uint8_t status)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CsMsg.bits[gun_index].CancelReservationReq != status)
|
|
|
ShmOCPP16Data->CsMsg.bits[gun_index].CancelReservationReq = status;
|
|
@@ -753,7 +753,7 @@ void ocpp_set_cancelreservation_req(uint8_t gun_index, uint8_t status)
|
|
|
if(ShmOCPP16Data->CsMsg.bits[gun_index].CancelReservationReq == OFF)
|
|
|
ShmOCPP16Data->CsMsg.bits[gun_index].CancelReservationConf = ON;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CsMsg.bits[gun_index].CancelReservationReq != status)
|
|
|
ShmOCPP20Data->CsMsg.bits[gun_index].CancelReservationReq = status;
|
|
@@ -767,12 +767,12 @@ uint8_t ocpp_compare_reserve_id_with_user(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(strcmp((char*)ShmSysConfigAndInfo->SysConfig.UserId, (char*)ShmOCPP16Data->ReserveNow[gun_index].IdTag) == 0)
|
|
|
result = ON;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(strcmp((char*)ShmSysConfigAndInfo->SysConfig.UserId, (char*)ShmOCPP20Data->ReserveNow[gun_index].idToken.idToken) == 0)
|
|
|
result = ON;
|
|
@@ -785,7 +785,7 @@ uint8_t ocpp_compare_reserve_id_with_remote_user(uint8_t gun_index)
|
|
|
{
|
|
|
uint8_t result = OFF;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(strcmp((char*)ShmOCPP16Data->RemoteStartTransaction[gun_index].IdTag, (char*)ShmOCPP16Data->ReserveNow[gun_index].IdTag) == 0)
|
|
|
{
|
|
@@ -793,7 +793,7 @@ uint8_t ocpp_compare_reserve_id_with_remote_user(uint8_t gun_index)
|
|
|
memcpy(ShmSysConfigAndInfo->SysConfig.UserId, ShmOCPP16Data->RemoteStartTransaction[gun_index].IdTag, ARRAY_SIZE(ShmOCPP16Data->RemoteStartTransaction[gun_index].IdTag));
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(strcmp((char*)ShmOCPP20Data->RequestStartTransaction[gun_index].idToken.idToken, (char*)ShmOCPP20Data->ReserveNow[gun_index].idToken.idToken) == 0)
|
|
|
{
|
|
@@ -2588,7 +2588,7 @@ int isReservationExpired(unsigned char gun_index)
|
|
|
struct tm expiredDate;
|
|
|
struct timeb expiredTime;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(sscanf((char*)ShmOCPP16Data->ReserveNow[gun_index].ExpiryDate, "%4d-%2d-%2dT%2d:%2d:%2d", &expiredDate.tm_year, &expiredDate.tm_mon, &expiredDate.tm_mday, &expiredDate.tm_hour, &expiredDate.tm_min, &expiredDate.tm_sec) == 6)
|
|
|
{
|
|
@@ -2608,7 +2608,7 @@ int isReservationExpired(unsigned char gun_index)
|
|
|
result = YES;
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(sscanf((char*)ShmOCPP20Data->ReserveNow[gun_index].expiryDateTime, "%4d-%2d-%2dT%2d:%2d:%2d", &expiredDate.tm_year, &expiredDate.tm_mon, &expiredDate.tm_mday, &expiredDate.tm_hour, &expiredDate.tm_min, &expiredDate.tm_sec) == 6)
|
|
|
{
|
|
@@ -2641,7 +2641,7 @@ int isProfileValid(uint8_t gun_index)
|
|
|
struct tm tmFrom, tmTo;
|
|
|
struct timeb tbFrom, tbTo;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if((sscanf((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ValidFrom, "%4d-%2d-%2dT%2d:%2d:%2d", &tmFrom.tm_year, &tmFrom.tm_mon, &tmFrom.tm_mday, &tmFrom.tm_hour, &tmFrom.tm_min, &tmFrom.tm_sec) == 6) &&
|
|
|
(sscanf((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ValidTo, "%4d-%2d-%2dT%2d:%2d:%2d", &tmTo.tm_year, &tmTo.tm_mon, &tmTo.tm_mday, &tmTo.tm_hour, &tmTo.tm_min, &tmTo.tm_sec) == 6))
|
|
@@ -2666,7 +2666,7 @@ int isProfileValid(uint8_t gun_index)
|
|
|
DEBUG_WARN("ValidFrom or ValidTo date parsing error.\n");
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if((sscanf((char*)ShmOCPP20Data->SmartChargingProfile[gun_index].validFrom, "%4d-%2d-%2dT%2d:%2d:%2d", &tmFrom.tm_year, &tmFrom.tm_mon, &tmFrom.tm_mday, &tmFrom.tm_hour, &tmFrom.tm_min, &tmFrom.tm_sec) == 6) &&
|
|
|
(sscanf((char*)ShmOCPP20Data->SmartChargingProfile[gun_index].validTo, "%4d-%2d-%2dT%2d:%2d:%2d", &tmTo.tm_year, &tmTo.tm_mon, &tmTo.tm_mday, &tmTo.tm_hour, &tmTo.tm_min, &tmTo.tm_sec) == 6))
|
|
@@ -2701,7 +2701,7 @@ int getScheduleStart(int gun_index)
|
|
|
struct tm tmScheduleStart;;
|
|
|
struct timeb tbScheduleStart;
|
|
|
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if((sscanf((char*)ShmOCPP16Data->SmartChargingProfile[gun_index].ChargingSchedule.StartSchedule, "%4d-%2d-%2dT%2d:%2d:%2d", &tmScheduleStart.tm_year, &tmScheduleStart.tm_mon, &tmScheduleStart.tm_mday, &tmScheduleStart.tm_hour, &tmScheduleStart.tm_min, &tmScheduleStart.tm_sec) == 6))
|
|
|
{
|
|
@@ -2718,7 +2718,7 @@ int getScheduleStart(int gun_index)
|
|
|
DEBUG_WARN("Schedule start date parsing error.\n");
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if((sscanf((char*)ShmOCPP20Data->SmartChargingProfile[gun_index].chargingSchedule[0].startSchedule, "%4d-%2d-%2dT%2d:%2d:%2d", &tmScheduleStart.tm_year, &tmScheduleStart.tm_mon, &tmScheduleStart.tm_mday, &tmScheduleStart.tm_hour, &tmScheduleStart.tm_min, &tmScheduleStart.tm_sec) == 6))
|
|
|
{
|
|
@@ -2867,7 +2867,7 @@ void checkTask()
|
|
|
|
|
|
if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") != 0)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(system("pidof -s OcppBackend > /dev/null") != 0)
|
|
|
{
|
|
@@ -2875,7 +2875,7 @@ void checkTask()
|
|
|
ocpp_process_start();
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(system("pidof -s OcppBackend20 > /dev/null") != 0)
|
|
|
{
|
|
@@ -2942,7 +2942,7 @@ void checkConnectionTimeout()
|
|
|
|
|
|
void checkReset()
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->MsMsg.bits.ResetReq)
|
|
|
{
|
|
@@ -2970,7 +2970,7 @@ void checkReset()
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->MsMsg.bits.ResetReq)
|
|
|
{
|
|
@@ -2981,7 +2981,7 @@ void checkReset()
|
|
|
sprintf((char*)ShmOCPP16Data->Reset.ResponseStatus, "Accepted");
|
|
|
ShmOCPP20Data->MsMsg.bits.ResetConf = ON;
|
|
|
|
|
|
- if(strcmp((char*)ShmOCPP20Data->Reset.type, "Hard") == 0)
|
|
|
+ if(strcmp((char*)ShmOCPP20Data->Reset.type, "Immediate") == 0)
|
|
|
{
|
|
|
system("sync");
|
|
|
sleep(5);
|
|
@@ -3002,7 +3002,7 @@ void checkReset()
|
|
|
|
|
|
void checkReservation(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CsMsg.bits[gun_index].ReserveNowReq)
|
|
|
{
|
|
@@ -3016,7 +3016,7 @@ void checkReservation(uint8_t gun_index)
|
|
|
ShmOCPP16Data->CsMsg.bits[gun_index].ReserveNowConf = ON;
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CsMsg.bits[gun_index].ReserveNowReq)
|
|
|
{
|
|
@@ -3034,7 +3034,7 @@ void checkReservation(uint8_t gun_index)
|
|
|
|
|
|
void checkUnlocker(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CsMsg.bits[gun_index].UnlockConnectorReq == ON)
|
|
|
{
|
|
@@ -3046,7 +3046,7 @@ void checkUnlocker(uint8_t gun_index)
|
|
|
ShmCharger->gun_info[ShmOCPP16Data->UnlockConnector[gun_index].ConnectorId-1].isUnlockerConnetor = ON;
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CsMsg.bits[gun_index].UnlockConnectorReq == ON)
|
|
|
{
|
|
@@ -3062,7 +3062,7 @@ void checkUnlocker(uint8_t gun_index)
|
|
|
|
|
|
void checkAvailability(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->CsMsg.bits[gun_index].ChangeAvailabilityReq)
|
|
|
{
|
|
@@ -3080,7 +3080,7 @@ void checkAvailability(uint8_t gun_index)
|
|
|
ShmOCPP16Data->CsMsg.bits[gun_index].ChangeAvailabilityReq = OFF;
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->CsMsg.bits[gun_index].ChangeAvailabilityReq)
|
|
|
{
|
|
@@ -3102,7 +3102,7 @@ void checkAvailability(uint8_t gun_index)
|
|
|
|
|
|
void checkChargingProfileLimit(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if((ocpp_get_smartcharging_profileId(gun_index) > 0) &&
|
|
|
(ocpp_get_profile_req(gun_index) != ON) &&
|
|
@@ -3151,7 +3151,7 @@ void checkChargingProfileLimit(uint8_t gun_index)
|
|
|
ShmCharger->gun_info[gun_index].targetCurrent = ShmCharger->gun_info[gun_index].primaryMcuState.rating_current;
|
|
|
}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if((ocpp_get_smartcharging_profileId(gun_index) > 0) &&
|
|
|
(ocpp_get_profile_req(gun_index) != ON) &&
|
|
@@ -3204,7 +3204,7 @@ void checkChargingProfileLimit(uint8_t gun_index)
|
|
|
|
|
|
void checkStopReason(uint8_t gun_index)
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(ShmOCPP16Data->MsMsg.bits.ResetReq)
|
|
|
{
|
|
@@ -3239,7 +3239,7 @@ void checkStopReason(uint8_t gun_index)
|
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/100);
|
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq = ON;
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(ShmOCPP20Data->MsMsg.bits.ResetReq)
|
|
|
{
|
|
@@ -3278,7 +3278,7 @@ void checkStopReason(uint8_t gun_index)
|
|
|
|
|
|
void checkRemoteUpgradeStatus()
|
|
|
{
|
|
|
- if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
+ if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
|
{
|
|
|
if(strcmp((char*)ShmOCPP16Data->FirmwareStatusNotification.Status, "DownloadFailed")==0)
|
|
|
{
|
|
@@ -3315,7 +3315,7 @@ void checkRemoteUpgradeStatus()
|
|
|
else
|
|
|
{}
|
|
|
}
|
|
|
- else if(ShmSysConfigAndInfo->SysConfig.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
+ else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
|
{
|
|
|
if(strcmp((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "DownloadFailed")==0)
|
|
|
{
|