瀏覽代碼

2021-05-14 / Eason Yang
Action :
1. Added : Added presentChargingEnergyUpdate() function into checkStopReason(). For update charging energy.
2. Added : Delay 2 seconds for getting last power consumption value. For synchronize.

File :
1. main.c

Version : D0.51.XX.XXXX.XX

8009 3 年之前
父節點
當前提交
9fe325f229

+ 8 - 0
EVSE/Projects/AW-CCS/Apps/main.c

@@ -3500,6 +3500,8 @@ void checkChargingProfileLimit(uint8_t gun_index)
 
 void checkStopReason(uint8_t gun_index)
 {
+	sleep(4);
+	
 	if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
 	{
 		memset(ShmOCPP16Data->StopTransaction[gun_index].IdTag, 0x00, ARRAY_SIZE(ShmOCPP16Data->StopTransaction[gun_index].IdTag));
@@ -3552,6 +3554,9 @@ void checkStopReason(uint8_t gun_index)
 		DEBUG_INFO("Gun-%d : StopReason [ %s ]...\n.",gun_index,ShmOCPP16Data->StopTransaction[gun_index].StopReason);
 
 		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
+		presentChargedEnergyUpdate(gun_index);
+		DEBUG_INFO("PresentChargedEnergy Gun-[%d] : %.4f \n",gun_index ,ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
+		
 		ShmOCPP16Data->CpMsg.bits[gun_index].StopTransactionReq = ON;
 	}
 	else if(ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
@@ -3616,6 +3621,9 @@ void checkStopReason(uint8_t gun_index)
 		DEBUG_INFO("Gun-%d : StopReason [ %s ]...\n.", gun_index, ShmOCPP20Data->TransactionEvent[gun_index].transactionInfo.stoppedReason);
 
 		ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PowerConsumption = (ShmCharger->gun_info[gun_index].powerConsumptionTotal.power_consumption/10000.0);
+		presentChargedEnergyUpdate(gun_index);
+		DEBUG_INFO("PresentChargedEnergy Gun-[%d] : %.4f \n",gun_index ,ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PresentChargedEnergy);
+		
 		ShmOCPP20Data->CpMsg.bits[gun_index].TransactionEventReq = ON;
 	}
 }

二進制
EVSE/Projects/AW-CCS/Images/FactoryDefaultConfig.bin


二進制
EVSE/Projects/AW-CCS/Images/ramdisk.gz


二進制
EVSE/rootfs/root/Module_Payment