浏览代码

[Improve][Modularization][Module_OcppBackend]

2021.05.25 / Folus Wen

Actions:
1. StatusNotification sent out SuspendEVSE if AC charger in terminating mode and CP state is not B.

Files:
1. As follow commit history

Image version: D0.00.XX.XXXX.XX
Image checksum: XXXXXXXX

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 年之前
父节点
当前提交
fe5aea7f62
共有 2 个文件被更改,包括 9 次插入5 次删除
  1. 4 1
      EVSE/Modularization/ocppfiles/MessageHandler.c
  2. 5 4
      EVSE/Projects/AW-CCS/Apps/main.c

+ 4 - 1
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -4306,7 +4306,10 @@ S_FAULT                 =12
 				}
 				else if (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_TERMINATING) // S_TERMINATING   ---> SuspendedEV
 				{
-					currentStatus = SuspendedEV; //OCPP Status: SuspendedEV
+					if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].PilotState == CP_STATE_B))
+						currentStatus = SuspendedEV; 	//OCPP Status: SuspendedEV
+					else
+						currentStatus = SuspendedEVSE;	//OCPP Status: SuspendedEVSE
 				}
 				else if ((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_BOOTING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_MAINTAIN) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_DEBUG) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_UPDATE)) //   ---> Unavailable
 				{

+ 5 - 4
EVSE/Projects/AW-CCS/Apps/main.c

@@ -1209,6 +1209,7 @@ int getReceiptInfo(uint8_t gun_index, char *receiptInfo)
 
 		json_object_object_add(receiptDetail, "hour", json_object_new_int(idxHour));
 		json_object_object_add(receiptDetail, "chargedEnergy", json_object_new_double(ShmCharger->gun_info[gun_index].presentChargedEnergyPeriod[idxHour]));
+		json_object_object_add(receiptDetail, "unitPrice", json_object_new_double(ShmSysConfigAndInfo->SysConfig.BillingData.Fee[idxHour]));
 		json_object_object_add(receiptDetail, "periodPrice", json_object_new_double(ShmCharger->gun_info[gun_index].presentChargedEnergyPeriod[idxHour]*ShmSysConfigAndInfo->SysConfig.BillingData.Fee[idxHour]));
 
 		totalEnergy += ShmCharger->gun_info[gun_index].presentChargedEnergyPeriod[idxHour];
@@ -1447,7 +1448,7 @@ int DB_Update_Record_Buf(sqlite3 *db, int gun_index)
 		}
 		else
 		{
-			DEBUG_INFO( "Delete local charging record buffer successfully\n");
+			//DEBUG_INFO( "Delete local charging record buffer successfully\n");
 		}
 
 		// Insert record buffer
@@ -1458,7 +1459,7 @@ int DB_Update_Record_Buf(sqlite3 *db, int gun_index)
 		}
 		else
 		{
-			DEBUG_INFO( "Insert local charging record buffer successfully\n");
+			//DEBUG_INFO( "Insert local charging record buffer successfully\n");
 		}
 
 		sqlite3_close(db);
@@ -5329,11 +5330,11 @@ int main(void)
 						// Debug information
 						if(DiffTimebWithNow(startTime[gun_index][TMR_IDX_LOGPPRINTOUT]) > TIMEOUT_SPEC_LOGPPRINTOUT)
 						{
-							DEBUG_INFO("===============================================================\n");
+							DEBUG_INFO("==============================================================\n");
 							DEBUG_INFO("ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent: %d \n", ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent);
 							DEBUG_INFO("ShmCharger->gun_info[%d].primaryMcuCp_Pwn_Duty.max_current: %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuCp_Pwn_Duty.max_current);
 							DEBUG_INFO("ShmCharger->gun_info[%d].targetCurrent: %d\n", gun_index, ShmCharger->gun_info[gun_index].targetCurrent);
-							DEBUG_INFO("===============================================================\n");
+							DEBUG_INFO("==============================================================\n");
 							ftime(&startTime[gun_index][TMR_IDX_LOGPPRINTOUT]);
 							
 							getDateTimeString((char*)ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].StopDateTime);