|
@@ -819,7 +819,7 @@ uint8_t ocpp_get_auth_result(uint8_t isValidParent, ...)
|
|
DEBUG_INFO("Authorize.ResponseIdTagInfo.ParentIdTag : %s \n", ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag);
|
|
DEBUG_INFO("Authorize.ResponseIdTagInfo.ParentIdTag : %s \n", ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag);
|
|
DEBUG_INFO("StartTransaction[%d].ResponseIdTagInfo.ParentIdTag : %s \n", gun_index ,ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ParentIdTag);
|
|
DEBUG_INFO("StartTransaction[%d].ResponseIdTagInfo.ParentIdTag : %s \n", gun_index ,ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ParentIdTag);
|
|
*/
|
|
*/
|
|
-
|
|
|
|
|
|
+
|
|
if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0) &&
|
|
if((strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.Status, "Accepted")==0) &&
|
|
(strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, (char*)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ParentIdTag)==0))
|
|
(strcmp((char*)ShmOCPP16Data->Authorize.ResponseIdTagInfo.ParentIdTag, (char*)ShmOCPP16Data->StartTransaction[gun_index].ResponseIdTagInfo.ParentIdTag)==0))
|
|
result = PASS;
|
|
result = PASS;
|
|
@@ -833,7 +833,7 @@ uint8_t ocpp_get_auth_result(uint8_t isValidParent, ...)
|
|
DEBUG_INFO("Authorize.Response_idTokenInfo.groupIdToken.idToken : %s \n", ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken);
|
|
DEBUG_INFO("Authorize.Response_idTokenInfo.groupIdToken.idToken : %s \n", ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken);
|
|
DEBUG_INFO("TransactionEvent[%d].Response_idTokenInfo.groupIdToken.idToken : %s \n", gun_index, ShmOCPP20Data->TransactionEvent[gun_index].Response_idTokenInfo.groupIdToken.idToken);
|
|
DEBUG_INFO("TransactionEvent[%d].Response_idTokenInfo.groupIdToken.idToken : %s \n", gun_index, ShmOCPP20Data->TransactionEvent[gun_index].Response_idTokenInfo.groupIdToken.idToken);
|
|
*/
|
|
*/
|
|
-
|
|
|
|
|
|
+
|
|
if((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.status, "Accepted")==0) &&
|
|
if((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.status, "Accepted")==0) &&
|
|
((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken, (char*)ShmOCPP20Data->TransactionEvent[gun_index].Response_idTokenInfo.groupIdToken.idToken) == 0) ||
|
|
((strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken, (char*)ShmOCPP20Data->TransactionEvent[gun_index].Response_idTokenInfo.groupIdToken.idToken) == 0) ||
|
|
(strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken, (char*)ShmOCPP20Data->ControllerComponentVariable[AuthCtrlr_MasterPassGroupId].variableAttribute[0].value) == 0)))
|
|
(strcmp((char*)ShmOCPP20Data->Authorize.Response_idTokenInfo.groupIdToken.idToken, (char*)ShmOCPP20Data->ControllerComponentVariable[AuthCtrlr_MasterPassGroupId].variableAttribute[0].value) == 0)))
|
|
@@ -2372,7 +2372,7 @@ int LoadSysConfigAndInfo(struct SysConfigData *ptr)
|
|
free(buf);
|
|
free(buf);
|
|
|
|
|
|
system("rm -f /mnt/EvseConfig.bin");
|
|
system("rm -f /mnt/EvseConfig.bin");
|
|
-
|
|
|
|
|
|
+
|
|
// SysConfig in flash is empty (0xffffffff)
|
|
// SysConfig in flash is empty (0xffffffff)
|
|
if((strlen((char*)ShmSysConfigAndInfo->SysConfig.ModelName) > ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.ModelName)) ||
|
|
if((strlen((char*)ShmSysConfigAndInfo->SysConfig.ModelName) > ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.ModelName)) ||
|
|
(strlen((char*)ShmSysConfigAndInfo->SysConfig.SerialNumber) > ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber)) ||
|
|
(strlen((char*)ShmSysConfigAndInfo->SysConfig.SerialNumber) > ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.SerialNumber)) ||
|
|
@@ -2418,7 +2418,7 @@ int LoadSysConfigAndInfo(struct SysConfigData *ptr)
|
|
sleep(3);
|
|
sleep(3);
|
|
system("/usr/bin/run_evse_restart.sh");
|
|
system("/usr/bin/run_evse_restart.sh");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
DEBUG_INFO("Load SysConfigData OK\n");
|
|
DEBUG_INFO("Load SysConfigData OK\n");
|
|
|
|
|
|
ShmCharger->isCcsEnable = OFF;
|
|
ShmCharger->isCcsEnable = OFF;
|
|
@@ -2431,9 +2431,9 @@ int LoadSysConfigAndInfo(struct SysConfigData *ptr)
|
|
#ifdef ENABLE_CCS
|
|
#ifdef ENABLE_CCS
|
|
ShmCharger->isCcsEnable = ON;
|
|
ShmCharger->isCcsEnable = ON;
|
|
#endif
|
|
#endif
|
|
-
|
|
|
|
|
|
+
|
|
DEBUG_INFO("Is CCS Enable: %s \n",((ShmCharger->isCcsEnable == ON)?"YES":"NO"));
|
|
DEBUG_INFO("Is CCS Enable: %s \n",((ShmCharger->isCcsEnable == ON)?"YES":"NO"));
|
|
-
|
|
|
|
|
|
+
|
|
RatedCurrentParsing((char*)ShmSysConfigAndInfo->SysConfig.ModelName, &modelnameInfo);
|
|
RatedCurrentParsing((char*)ShmSysConfigAndInfo->SysConfig.ModelName, &modelnameInfo);
|
|
|
|
|
|
return PASS;
|
|
return PASS;
|
|
@@ -3389,8 +3389,8 @@ int isMatchStartUser(unsigned char gun_index)
|
|
// Big endian
|
|
// Big endian
|
|
switch(rfid.snType)
|
|
switch(rfid.snType)
|
|
{
|
|
{
|
|
- case RFID_SN_TYPE_6BYTE:
|
|
|
|
- sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5]);
|
|
|
|
|
|
+ case RFID_SN_TYPE_8BYTE:
|
|
|
|
+ sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6], rfid.currentCard[7]);
|
|
break;
|
|
break;
|
|
case RFID_SN_TYPE_7BYTE:
|
|
case RFID_SN_TYPE_7BYTE:
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
|
|
@@ -3409,8 +3409,8 @@ int isMatchStartUser(unsigned char gun_index)
|
|
// Little endian
|
|
// Little endian
|
|
switch(rfid.snType)
|
|
switch(rfid.snType)
|
|
{
|
|
{
|
|
- case RFID_SN_TYPE_6BYTE:
|
|
|
|
- sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
|
|
|
|
+ case RFID_SN_TYPE_8BYTE:
|
|
|
|
+ sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[7], rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
break;
|
|
break;
|
|
case RFID_SN_TYPE_7BYTE:
|
|
case RFID_SN_TYPE_7BYTE:
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
@@ -3447,8 +3447,8 @@ int isMatchPresentUser()
|
|
// Big endian
|
|
// Big endian
|
|
switch(rfid.snType)
|
|
switch(rfid.snType)
|
|
{
|
|
{
|
|
- case RFID_SN_TYPE_6BYTE:
|
|
|
|
- sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5]);
|
|
|
|
|
|
+ case RFID_SN_TYPE_8BYTE:
|
|
|
|
+ sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6], rfid.currentCard[7]);
|
|
break;
|
|
break;
|
|
case RFID_SN_TYPE_7BYTE:
|
|
case RFID_SN_TYPE_7BYTE:
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
|
|
@@ -3467,8 +3467,8 @@ int isMatchPresentUser()
|
|
// Little endian
|
|
// Little endian
|
|
switch(rfid.snType)
|
|
switch(rfid.snType)
|
|
{
|
|
{
|
|
- case RFID_SN_TYPE_6BYTE:
|
|
|
|
- sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
|
|
|
|
+ case RFID_SN_TYPE_8BYTE:
|
|
|
|
+ sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[7], rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
break;
|
|
break;
|
|
case RFID_SN_TYPE_7BYTE:
|
|
case RFID_SN_TYPE_7BYTE:
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
sprintf((char*)tmpUser, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
@@ -3621,7 +3621,7 @@ void setLedMotion(unsigned char gun_index,unsigned char led_mode)
|
|
// Request on/off set
|
|
// Request on/off set
|
|
//===============================================
|
|
//===============================================
|
|
void setRequest(unsigned char gun_index,unsigned char isOn)
|
|
void setRequest(unsigned char gun_index,unsigned char isOn)
|
|
-{
|
|
|
|
|
|
+{
|
|
if(isOn == ON)
|
|
if(isOn == ON)
|
|
{
|
|
{
|
|
if(ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest == OFF)
|
|
if(ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest == OFF)
|
|
@@ -3652,7 +3652,7 @@ int getRequest(unsigned char gun_index)
|
|
// Relay on/off set
|
|
// Relay on/off set
|
|
//===============================================
|
|
//===============================================
|
|
void setRelay(unsigned char gun_index,unsigned char isOn)
|
|
void setRelay(unsigned char gun_index,unsigned char isOn)
|
|
-{
|
|
|
|
|
|
+{
|
|
if(isOn == ON)
|
|
if(isOn == ON)
|
|
{
|
|
{
|
|
if(ShmCharger->gun_info[gun_index].legacyRequest.isRelayOn == OFF)
|
|
if(ShmCharger->gun_info[gun_index].legacyRequest.isRelayOn == OFF)
|
|
@@ -4717,7 +4717,7 @@ void checkChargingProfileLimit(uint8_t gun_index, uint8_t system_mode)
|
|
void checkStopReason(uint8_t gun_index)
|
|
void checkStopReason(uint8_t gun_index)
|
|
{
|
|
{
|
|
sleep(2);
|
|
sleep(2);
|
|
-
|
|
|
|
|
|
+
|
|
if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
|
|
{
|
|
{
|
|
memset(ShmOCPP16Data->StopTransaction[gun_index].IdTag, 0x00, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
|
|
memset(ShmOCPP16Data->StopTransaction[gun_index].IdTag, 0x00, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
|
|
@@ -4744,7 +4744,7 @@ void checkStopReason(uint8_t gun_index)
|
|
else if(ShmCharger->gun_info[gun_index].rfidReq || ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop)
|
|
else if(ShmCharger->gun_info[gun_index].rfidReq || ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop)
|
|
{
|
|
{
|
|
sprintf((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");
|
|
sprintf((char*)ShmOCPP16Data->StopTransaction[gun_index].StopReason, "Local");
|
|
-
|
|
|
|
|
|
+
|
|
if(!isMatchStartUser(gun_index))
|
|
if(!isMatchStartUser(gun_index))
|
|
{
|
|
{
|
|
memcpy((char*)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (char*)ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
|
|
memcpy((char*)ShmOCPP16Data->StopTransaction[gun_index].IdTag, (char*)ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
|
|
@@ -4772,7 +4772,7 @@ void checkStopReason(uint8_t gun_index)
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
|
|
presentChargedEnergyUpdate(gun_index);
|
|
presentChargedEnergyUpdate(gun_index);
|
|
DEBUG_INFO("Gun-[%d] : PresentChargedEnergy [ %.4f ].\n",gun_index ,ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
|
|
DEBUG_INFO("Gun-[%d] : PresentChargedEnergy [ %.4f ].\n",gun_index ,ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
|
|
-
|
|
|
|
|
|
+
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq = ON;
|
|
ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq = ON;
|
|
}
|
|
}
|
|
else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
|
|
@@ -4801,7 +4801,7 @@ void checkStopReason(uint8_t gun_index)
|
|
else if(ShmCharger->gun_info[gun_index].rfidReq || ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop)
|
|
else if(ShmCharger->gun_info[gun_index].rfidReq || ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop)
|
|
{
|
|
{
|
|
sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "Local");
|
|
sprintf((char*)ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason, "Local");
|
|
-
|
|
|
|
|
|
+
|
|
if(!isMatchStartUser(gun_index))
|
|
if(!isMatchStartUser(gun_index))
|
|
{
|
|
{
|
|
memcpy((char*)ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken, (char*)ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken));
|
|
memcpy((char*)ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken, (char*)ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmOCPP20Data->TransactionEvent[gun_index].idToken.idToken));
|
|
@@ -4835,7 +4835,7 @@ void checkStopReason(uint8_t gun_index)
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
|
|
presentChargedEnergyUpdate(gun_index);
|
|
presentChargedEnergyUpdate(gun_index);
|
|
DEBUG_INFO("Gun-[%d] : PresentChargedEnergy [ %.4f ].\n",gun_index ,ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
|
|
DEBUG_INFO("Gun-[%d] : PresentChargedEnergy [ %.4f ].\n",gun_index ,ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
|
|
-
|
|
|
|
|
|
+
|
|
ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq = ON;
|
|
ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq = ON;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4985,8 +4985,8 @@ void checkRfidAuthrize()
|
|
// Big endian
|
|
// Big endian
|
|
switch(rfid.snType)
|
|
switch(rfid.snType)
|
|
{
|
|
{
|
|
- case RFID_SN_TYPE_6BYTE:
|
|
|
|
- sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5]);
|
|
|
|
|
|
+ case RFID_SN_TYPE_8BYTE:
|
|
|
|
+ sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6], rfid.currentCard[7]);
|
|
break;
|
|
break;
|
|
case RFID_SN_TYPE_7BYTE:
|
|
case RFID_SN_TYPE_7BYTE:
|
|
sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
|
|
sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[0], rfid.currentCard[1], rfid.currentCard[2], rfid.currentCard[3], rfid.currentCard[4], rfid.currentCard[5], rfid.currentCard[6]);
|
|
@@ -5005,8 +5005,8 @@ void checkRfidAuthrize()
|
|
// Little endian
|
|
// Little endian
|
|
switch(rfid.snType)
|
|
switch(rfid.snType)
|
|
{
|
|
{
|
|
- case RFID_SN_TYPE_6BYTE:
|
|
|
|
- sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X", rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
|
|
|
|
+ case RFID_SN_TYPE_8BYTE:
|
|
|
|
+ sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[7], rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
break;
|
|
break;
|
|
case RFID_SN_TYPE_7BYTE:
|
|
case RFID_SN_TYPE_7BYTE:
|
|
sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
sprintf((char*)bufferRFID, "%02X%02X%02X%02X%02X%02X%02X", rfid.currentCard[6], rfid.currentCard[5], rfid.currentCard[4], rfid.currentCard[3], rfid.currentCard[2], rfid.currentCard[1], rfid.currentCard[0]);
|
|
@@ -5055,7 +5055,7 @@ void checkRfidAuthrize()
|
|
ShmCharger->isGetAuthResult = FALSE;
|
|
ShmCharger->isGetAuthResult = FALSE;
|
|
isCheckdResult = FALSE;
|
|
isCheckdResult = FALSE;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
isReadable = FALSE;
|
|
isReadable = FALSE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -5147,7 +5147,7 @@ void checkRfidAuthrize()
|
|
setSpeaker(ON, SPEAKER_SHORT);
|
|
setSpeaker(ON, SPEAKER_SHORT);
|
|
ShmCharger->isAuthrizing = FALSE;
|
|
ShmCharger->isAuthrizing = FALSE;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
isReadable = FALSE;
|
|
isReadable = FALSE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -5173,7 +5173,7 @@ void checkRfidAuthrize()
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
isReadable = TRUE;
|
|
isReadable = TRUE;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -5649,7 +5649,7 @@ int main(void)
|
|
ShmCharger->gun_info[gun_index].isRemoteStartWait = ON;
|
|
ShmCharger->gun_info[gun_index].isRemoteStartWait = ON;
|
|
DEBUG_INFO("Remote start without connector id... \n");
|
|
DEBUG_INFO("Remote start without connector id... \n");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
refreshStartTimer(&startTime[gun_index][TMR_IDX_CLEAN_REMOTE_START_WAIT]);
|
|
refreshStartTimer(&startTime[gun_index][TMR_IDX_CLEAN_REMOTE_START_WAIT]);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
@@ -5773,7 +5773,7 @@ int main(void)
|
|
else
|
|
else
|
|
setChargerMode(gun_index, SYS_MODE_IDLE);
|
|
setChargerMode(gun_index, SYS_MODE_IDLE);
|
|
|
|
|
|
- // The system identifies 1 phase or 3 phases depending on the model name
|
|
|
|
|
|
+ // The system identifies 1 phase or 3 phases depending on the model name
|
|
ShmSysConfigAndInfo->SysConfig.AcPhaseCount = ((ShmSysConfigAndInfo->SysConfig.ModelName[2]=='Y') ||
|
|
ShmSysConfigAndInfo->SysConfig.AcPhaseCount = ((ShmSysConfigAndInfo->SysConfig.ModelName[2]=='Y') ||
|
|
(ShmSysConfigAndInfo->SysConfig.ModelName[2]=='D') ||
|
|
(ShmSysConfigAndInfo->SysConfig.ModelName[2]=='D') ||
|
|
(ShmSysConfigAndInfo->SysConfig.ModelName[2]=='W')
|
|
(ShmSysConfigAndInfo->SysConfig.ModelName[2]=='W')
|
|
@@ -5802,7 +5802,7 @@ int main(void)
|
|
ShmCharger->gun_info[gun_index].targetCurrent = 0xFF;
|
|
ShmCharger->gun_info[gun_index].targetCurrent = 0xFF;
|
|
ocpp_set_unlocker_req(gun_index, OFF);
|
|
ocpp_set_unlocker_req(gun_index, OFF);
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].ReservationId = -1;
|
|
ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].ReservationId = -1;
|
|
-
|
|
|
|
|
|
+
|
|
// Response StopTransactionConf
|
|
// Response StopTransactionConf
|
|
ocpp_set_stoptransaction_conf(gun_index, OFF);
|
|
ocpp_set_stoptransaction_conf(gun_index, OFF);
|
|
memset(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId));
|
|
memset(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, 0x00, ARRAY_SIZE(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId));
|
|
@@ -6119,7 +6119,7 @@ int main(void)
|
|
(!ocpp_get_connection_status() && (isValidLocalWhiteCard() == PASS) && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST)))
|
|
(!ocpp_get_connection_status() && (isValidLocalWhiteCard() == PASS) && (ShmSysConfigAndInfo->SysConfig.OfflinePolicy == OFF_POLICY_LOCALLIST)))
|
|
{
|
|
{
|
|
memcpy((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
|
|
memcpy((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StartUserId, ShmSysConfigAndInfo->SysConfig.UserId, ARRAY_SIZE(ShmSysConfigAndInfo->SysConfig.UserId));
|
|
-
|
|
|
|
|
|
+
|
|
ShmCharger->gun_info[gun_index].resultAuthorization = VALIDATED_RFID;
|
|
ShmCharger->gun_info[gun_index].resultAuthorization = VALIDATED_RFID;
|
|
DEBUG_INFO("Authorize pass [EVCCID].\n");
|
|
DEBUG_INFO("Authorize pass [EVCCID].\n");
|
|
setSpeaker(ON, SPEAKER_SHORT);
|
|
setSpeaker(ON, SPEAKER_SHORT);
|
|
@@ -6185,7 +6185,7 @@ int main(void)
|
|
setRequest(gun_index, ON);
|
|
setRequest(gun_index, ON);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
// If control pilot detect Bx, skip watch dog time out.
|
|
// If control pilot detect Bx, skip watch dog time out.
|
|
if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B) ||
|
|
if((ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_B) ||
|
|
(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C))
|
|
(ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C))
|
|
@@ -6534,9 +6534,9 @@ int main(void)
|
|
{
|
|
{
|
|
DEBUG_INFO("The connector was connected to the EV before.\n");
|
|
DEBUG_INFO("The connector was connected to the EV before.\n");
|
|
//Cancel CCS task negotiating
|
|
//Cancel CCS task negotiating
|
|
- ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;
|
|
|
|
|
|
+ ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;
|
|
ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
- ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;
|
|
|
|
|
|
+ ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;
|
|
}
|
|
}
|
|
|
|
|
|
// Use RFID card to stop handshaking
|
|
// Use RFID card to stop handshaking
|
|
@@ -6544,9 +6544,9 @@ int main(void)
|
|
{
|
|
{
|
|
DEBUG_INFO("Use RFID card to stop handshaking.\n");
|
|
DEBUG_INFO("Use RFID card to stop handshaking.\n");
|
|
//Cancel CCS task negotiating
|
|
//Cancel CCS task negotiating
|
|
- ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;
|
|
|
|
|
|
+ ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;
|
|
ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
- ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;
|
|
|
|
|
|
+ ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -6561,20 +6561,20 @@ int main(void)
|
|
if(getDiffSecNow(startTime[gun_index][TMR_IDX_HANDSHAKING]) > (ShmCharger->timeoutSpec.Present_Timeout_Spec+5))
|
|
if(getDiffSecNow(startTime[gun_index][TMR_IDX_HANDSHAKING]) > (ShmCharger->timeoutSpec.Present_Timeout_Spec+5))
|
|
{
|
|
{
|
|
DEBUG_INFO("Handshaking timeout...\n");
|
|
DEBUG_INFO("Handshaking timeout...\n");
|
|
-
|
|
|
|
|
|
+
|
|
//Cancel CCS task negotiating
|
|
//Cancel CCS task negotiating
|
|
- ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;
|
|
|
|
|
|
+ ShmCharger->gun_info[gun_index].acCcsInfo.ChargingPermission = OFF;
|
|
ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
ShmCharger->gun_info[gun_index].acCcsInfo.EVSENotification = NOTIFICATION_STOP;
|
|
- ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;
|
|
|
|
|
|
+ ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = ON;
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty != CCS_PWM_DUTY_5)
|
|
if((ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty == ON) && ShmCharger->gun_info[gun_index].acCcsInfo.CpSetPWMDuty != CCS_PWM_DUTY_5)
|
|
{
|
|
{
|
|
ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_100;
|
|
ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current = CCS_PWM_DUTY_100;
|
|
- ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = ON;
|
|
|
|
|
|
+ ShmCharger->gun_info[gun_index].mcuFlag.isSetCpPwmDuty = ON;
|
|
ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = OFF;
|
|
ShmCharger->gun_info[gun_index].isCCSWaitChangeDuty = OFF;
|
|
-
|
|
|
|
|
|
+
|
|
setChargerMode(gun_index, SYS_MODE_IDLE);
|
|
setChargerMode(gun_index, SYS_MODE_IDLE);
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
@@ -6854,7 +6854,7 @@ int main(void)
|
|
DEBUG_INFO("==============================================================\n");
|
|
DEBUG_INFO("==============================================================\n");
|
|
*/
|
|
*/
|
|
refreshStartTimer(&startTime[gun_index][TMR_IDX_REFRESH_CHARGING_INFO]);
|
|
refreshStartTimer(&startTime[gun_index][TMR_IDX_REFRESH_CHARGING_INFO]);
|
|
-
|
|
|
|
|
|
+
|
|
getDateTimeString((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StopDateTime);
|
|
getDateTimeString((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StopDateTime);
|
|
DB_Update_Record_Buf(localDb, gun_index);
|
|
DB_Update_Record_Buf(localDb, gun_index);
|
|
}
|
|
}
|
|
@@ -7010,7 +7010,7 @@ int main(void)
|
|
setRequest(gun_index, OFF);
|
|
setRequest(gun_index, OFF);
|
|
sleep(13);
|
|
sleep(13);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if(((ShmCharger->gun_info[gun_index].chargingMode != CHARGING_MODE_SOCKETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)) ||
|
|
if(((ShmCharger->gun_info[gun_index].chargingMode != CHARGING_MODE_SOCKETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_A)) ||
|
|
((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE) && (!ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn)) ||
|
|
((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE) && (!ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn)) ||
|
|
ocpp_get_reset_req())
|
|
ocpp_get_reset_req())
|
|
@@ -7025,7 +7025,7 @@ int main(void)
|
|
DB_Insert_Record(localDb, gun_index);
|
|
DB_Insert_Record(localDb, gun_index);
|
|
setChargerMode(gun_index, SYS_MODE_IDLE);
|
|
setChargerMode(gun_index, SYS_MODE_IDLE);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
break;
|
|
break;
|
|
case SYS_MODE_ALARM:
|
|
case SYS_MODE_ALARM:
|
|
setLedMotion(gun_index,LED_ACTION_ALARM);
|
|
setLedMotion(gun_index,LED_ACTION_ALARM);
|
|
@@ -7161,7 +7161,7 @@ int main(void)
|
|
sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "InstallationFailed");
|
|
sprintf((char*)ShmOCPP20Data->FirmwareStatusNotification.status, "InstallationFailed");
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
ShmOCPP20Data->SpMsg.bits.FirmwareStatusNotificationReq = ON;
|
|
DEBUG_WARN("Firmware upgrade fail.\n");
|
|
DEBUG_WARN("Firmware upgrade fail.\n");
|
|
-
|
|
|
|
|
|
+
|
|
sleep(5);
|
|
sleep(5);
|
|
system("rm -rvf /mnt/* ");
|
|
system("rm -rvf /mnt/* ");
|
|
close(wtdFd);
|
|
close(wtdFd);
|