浏览代码

[Improve][Modularization][Module_OcppBackend]

2021.01.14 / Folus Wen

Actions:
1. MeterValues add transaction id in SuspendedEv.
2. TempStopTransaction generate after StartTransaction sent.

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 4 年之前
父节点
当前提交
42ce4e9f45
共有 2 个文件被更改,包括 7 次插入3 次删除
  1. 5 2
      EVSE/Modularization/ocppfiles/MessageHandler.c
  2. 2 1
      EVSE/Projects/AW-CCS/Apps/main.c

+ 5 - 2
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -2371,6 +2371,7 @@ void CheckSystemValue(void)
 			sendStartTransactionRequest(gun_index);
 			clientTime.StartTransaction = time((time_t*)NULL);
 			clientTime.MeterValues[gun_index] = time((time_t*)NULL);
+			storeTempStopTransaction(gun_index);
 		}
 
 		//==============================================
@@ -2909,7 +2910,7 @@ void CheckSystemValue(void)
 					// 0: Booting, 1: idle, 2: authorizing, 3: preparing, 4: charging, 5: terminating, 6: alarm, 7: fault
 					if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].Index == tempIndex)
 					{
-						if(ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING)
+						if((ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_CHARGING) || (ShmSysConfigAndInfo->SysInfo.AcChargingData[index].SystemStatus == SYS_MODE_TERMINATING))
 						{
 							reqSampleMeter[gun_index] = 1;
 						}
@@ -4841,7 +4842,9 @@ int sendMeterValuesRequest(int gun_index, ReadingContext dataType)
 	memset(&ShmOCPP16Data->MeterValues[gun_index], 0, sizeof(struct StructMeterValues));
 	//set value
 	ShmOCPP16Data->MeterValues[gun_index].ConnectorId = gun_index + 1; // gun start from 1~
-	ShmOCPP16Data->MeterValues[gun_index].TransactionId = ((strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "Charging") != NULL) ? ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId : -1);
+	ShmOCPP16Data->MeterValues[gun_index].TransactionId = (((strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "Charging") != NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "SuspendedEV") != NULL) || (strstr((char*)ShmOCPP16Data->StatusNotification[gun_index].Status, "SuspendedEVSE") != NULL) )?
+															ShmOCPP16Data->StartTransaction[gun_index].ResponseTransactionId :
+															-1);
 
 	random_uuid(guid);
 

+ 2 - 1
EVSE/Projects/AW-CCS/Apps/main.c

@@ -1027,6 +1027,7 @@ int CreatShareMemory()
    	}
    	memset(ShmCharger,0,sizeof(struct Charger));
 
+   	ShmSysConfigAndInfo->SysInfo.InternetConn = OFF;
     return result;
 }
 
@@ -4878,7 +4879,7 @@ int main(void)
 							}
 						}
 
-						if((((ShmCharger->gun_info[gun_index].chargingMode != CHARGING_MODE_SOCKETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C)) || ((ShmCharger->gun_info[gun_index].chargingMode != CHARGING_MODE_SOCKETE) && ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn)) &&
+						if((((ShmCharger->gun_info[gun_index].chargingMode != CHARGING_MODE_SOCKETE) && (ShmSysConfigAndInfo->SysInfo.AcChargingData[gun_index].PilotState == CP_STATE_C)) || ((ShmCharger->gun_info[gun_index].chargingMode == CHARGING_MODE_SOCKETE) && ShmCharger->gun_info[gun_index].primaryMcuState.socket_e.isSocketEPinOn)) &&
 						   (ShmCharger->gun_info[gun_index].rfidReq != ON) &&
 						   (ShmCharger->gun_info[gun_index].bleConfigData.isRequestStop != ON)  &&
 						   !ocpp_get_remotestop(gun_index) &&