Browse Source

2022-03-10 / Alston Lin
Actions
1. CCS type supports EVCCID authorization
2. The second OCPP of the PH backend that can be set by configuration
3. 180KW system supports 300A CCS (T/D) and 200A Chademo (K)
4. Add hold time (3s) to wait for OCPP to send unplug msg
5. Fix OCPP cannot throw installed msg
6. Fix OCPP MeterValue's Power.Offer value type
7. Fix OCPP UnlockConnector's msg content
8. Add OCPP's configuration keys for the StartusNotification command. (key : StatusNotificationPeriodically, StatusNotificationInterval)
9. Fix the stop charging by btn's process when start charging with remote start action or EVCCID authorization
10. Modify PSU task control function
11. Added psu error codes and handling of critial errors
12. Keep updating ocpp's error codes
13. Disable Pin115 and Pin116 function for closing detecte CP error
14. Support Chademo output current to 80A (L)
15. Support CCS conector type (V/F for 500A、Y/Z for 150A output current)
16. System Optimization

Files
1. As follow commit history

root 3 years ago
parent
commit
c9f4d0a216

+ 18 - 13
EVSE/Projects/DS60-120/Apps/CheckSystemTask.c

@@ -6,6 +6,11 @@
  */
 
 #include "CheckSystemTask.h"
+#include "Config.h"
+
+#define	TASK_CNT_MAIN		5
+#define TASK_CNT_EV_COMM	2
+#define TASK_CNT_PSU_COMM	2
 
 bool Taskconutstring(char *src, char *taskname)
 {
@@ -67,9 +72,9 @@ unsigned char CheckSystemTask(unsigned char systemPage)
 //	printf("count_psuComm = %d \n", count_psuComm);
 //	printf("*************************** \n");
 
-	if (systemPage == 0x09 || systemPage == 0x0A)
+	if (systemPage == _LCM_FIX || systemPage == _LCM_EMC)
 	{
-		if (count_main < 5 || count_psuComm < 2)
+		if (count_main < TASK_CNT_MAIN || count_psuComm < TASK_CNT_PSU_COMM)
 		{
 			system("killall Module_EventLogging");
 			system("killall Module_PrimaryComm");
@@ -98,7 +103,7 @@ unsigned char CheckSystemTask(unsigned char systemPage)
 			if(system("pidof -s Module_InternalComm > /dev/null") != 0)
 				system("/root/Module_InternalComm &");
 
-			if (count_evComm < 2)
+			if (count_evComm < TASK_CNT_EV_COMM)
 			{
 				system("killall Module_EvComm");
 				sleep(3);
@@ -109,20 +114,20 @@ unsigned char CheckSystemTask(unsigned char systemPage)
 		sleep(2);
 	}
 
-	if (count_main < 5)
-		result = 1;
-	else if (count_evComm < 2)
-		result = 2;
-	else if (count_psuComm < 2)
-		result = 3;
+	if (count_main < TASK_CNT_MAIN)
+		result = _SYSTEM_TASK_LOST_ITEM_MAIN;
+	else if (count_evComm < TASK_CNT_EV_COMM)
+		result = _SYSTEM_TASK_LOST_ITEM_EVCOMM;
+	else if (count_psuComm < TASK_CNT_PSU_COMM)
+		result = _SYSTEM_TASK_LOST_ITEM_PSUCOMM;
 	else if (system("pidof -s Module_EventLogging > /dev/null") != 0)
-		result = 4;
+		result = _SYSTEM_TASK_LOST_ITEM_EVENTLOG;
 	else if (system("pidof -s Module_PrimaryComm > /dev/null") != 0)
-		result = 5;
+		result = _SYSTEM_TASK_LOST_ITEM_PRIMARYCOMM;
 	else if (system("pidof -s Module_LcmControl > /dev/null") != 0)
-		result = 6;
+		result = _SYSTEM_TASK_LOST_ITEM_LCMCONTROL;
 	else if (system("pidof -s Module_InternalComm > /dev/null") != 0)
-		result = 7;
+		result = _SYSTEM_TASK_LOST_ITEM_INTERCOMM;
 
 	return result;
 }

+ 1 - 0
EVSE/Projects/DS60-120/Apps/CheckSystemTask.h

@@ -35,6 +35,7 @@
 #include 	<math.h>
 #include 	<stdbool.h>
 #include 	<dirent.h>
+#include 	"Config.h"
 
 unsigned char CheckSystemTask(unsigned char systemPage);
 

+ 73 - 16
EVSE/Projects/DS60-120/Apps/Config.h

@@ -15,6 +15,8 @@
 typedef unsigned char			byte;
 
 #define TOTAL_QUANTITY_GUN			4				//Max Count
+#define DC_CONNECTOR_COUNT			2
+#define AC_CONNECTOR_COUNT			1
 
 #define GFD_WAIT			0
 #define GFD_PASS			1
@@ -29,6 +31,9 @@ typedef unsigned char			byte;
 #define BOOTTING			0
 #define BOOT_COMPLETE		1
 
+#define	AC_MINIMUM_DUTY			6
+#define	AC_STOP_DUTY			100
+
 enum _AC_SYSTEM_STATUS
 {
 	AC_SYS_NONE = 	0,
@@ -90,6 +95,7 @@ enum _MODULE_PSU_WORK_STEP
 	_WORK_CHARGING 		= 		10,
 
 	_TEST_MODE			=		20,
+	_ALATON_MODE		= 		21,
 
 	_NO_WORKING			= 		254
 };
@@ -156,6 +162,29 @@ enum _LED_INTENSITY_LV
 	_LED_INTENSITY_BRIGHTEST = 2
 };
 
+enum _UPDATE_TYPE
+{
+	_UPDATE_TYPE_CSU_UBOOT 	 	= 0x10000001,
+	_UPDATE_TYPE_CSU_DTB 	 	= 0x10000002,
+	_UPDATE_TYPE_CSU_ZIMAGE 	= 0x10000003,
+	_UPDATE_TYPE_CSU_RFILES 	= 0x10000004,
+	_UPDATE_TYPE_CSU_CONFIG 	= 0x10000005,
+
+	_UPDATE_TYPE_CCS_UBOOT 	 	= 0x10000007,
+	_UPDATE_TYPE_CCS_DTB 		= 0x10000008,
+	_UPDATE_TYPE_CCS_ZIMAGE 	= 0x10000009,
+	_UPDATE_TYPE_CCS_RFILES 	= 0x1000000A,
+
+	_UPDATE_TYPE_DCM_ST407 		= 0x10000006,
+	_UPDATE_TYPE_RELAY_CTR 		= 0x1000000D,
+	_UPDATE_TYPE_FAN_CTR 		= 0x1000000E,
+	_UPDATE_TYPE_AC_WLMOUNT_CTR = 0x20000002,
+	_UPDATE_TYPE_LED_CTR		= 0x10000014,
+
+	_UPDATE_TYPE_CHADEMO 		= 0x1000000B,
+	_UPDATE_TYPE_GBT			= 0x1000000C,
+};
+
 enum _CCS_COMM_PROTOCOL
 {
 	_CCS_COMM_V2GMessage_DIN70121 		= 0x01,
@@ -206,7 +235,7 @@ struct StructMeter
 
 struct MeterInformation
 {
-	struct StructMeter _meter[2];
+	struct StructMeter _meter[DC_CONNECTOR_COUNT];
 	byte isWorking;
 };
 
@@ -250,7 +279,9 @@ enum RELAY_STATUS_ERROR_TYPE
 {
 	RELAY_STATUS_ERROR_NONE = 0,
 	RELAY_STATUS_ERROR_WELDING = 10,
-	RELAY_STATUS_ERROR_DRIVING = 11
+	RELAY_STATUS_ERROR_DRIVING = 11,
+	RELAY_STATUS_ERROR_PARA_WELDING = 12,
+	RELAY_STATUS_ERROR_PARA_DRIVING = 13,
 };
 
 enum START_TRANSATION_STATUS
@@ -274,6 +305,16 @@ enum RESET_4G_STEP
 	RESET_4G_STEP_GPIO_LOW_COMP		= 0x03
 };
 
+enum _CCID_INDEX
+{
+	_CCID_GET 		= 0x01,
+	_CCID_CHECK		= 0x02,
+	_CCID_AUTH		= 0x03,
+	_CCID_AUTHCOMP	= 0x04,
+	_CCID_AUTHFAIL	= 0x05,
+	_CCID_NONE 		= 0xFF,
+};
+
 typedef union
 {
     unsigned int GunErrMessage;
@@ -309,7 +350,9 @@ typedef union
 		unsigned char ChaConnectUCP :1;
 		unsigned char CCSConnectUCP :1;
 		unsigned char GBTConnectUCP :1;
-		unsigned char :5;
+		unsigned char ParallelRelayWeldingFault :1;
+		unsigned char ParallelRelayDrivingFault :1;
+		unsigned char :3;
     }GunBits;
 }GunErr;
 
@@ -326,20 +369,22 @@ struct DcCommonInformation
 	byte CcsVersion;
 	// for relay welding/driving check
 	char RelayCheckStatus[6];
-	char GunRelayWeldingOccur[2];
-	char GunRelayDrivingOccur[2];
-	byte ConnectorTemp1[2]; //0x00: -60¢XC  ~  0xFE: 194
-	byte ConnectorTemp2[2]; //0x00: -60¢XC  ~  0xFE: 194
+	char GunRelayWeldingOccur[DC_CONNECTOR_COUNT];
+	char GunRelayDrivingOccur[DC_CONNECTOR_COUNT];
+	char ParaRelayWeldingOccur;
+	char ParaRelayDrivingOccur;
+	byte ConnectorTemp1[DC_CONNECTOR_COUNT]; //0x00: -60¢XC  ~  0xFE: 194
+	byte ConnectorTemp2[DC_CONNECTOR_COUNT]; //0x00: -60¢XC  ~  0xFE: 194
 	// to check the ac contact status with psu communication
 	byte acContactSwitch;
 	byte psuKeepCommunication;
-	byte startTransactionFlag[2];
+	byte startTransactionFlag[DC_CONNECTOR_COUNT];
 
-	GunErr ConnectErrList[2];
-	byte CcsTypeSaved[2];
+	GunErr ConnectErrList[DC_CONNECTOR_COUNT];
+	byte CcsTypeSaved[DC_CONNECTOR_COUNT];
 
 	// Plugit Rack180 : for checking start/stop charging flag
-	byte StartToChargingFlag[2]; // 0 : Stop, 1 : Start by modbus
+	byte StartToChargingFlag[DC_CONNECTOR_COUNT]; // 0 : Stop, 1 : Start by modbus
 	unsigned short LcmFwVersion;
 	byte ShowLogoFlag;
 
@@ -348,16 +393,17 @@ struct DcCommonInformation
 
 	// Billing Data extend
 	byte _hour_index;			//0 ~ 23
-	float energy_time_period[2][24];
+	float energy_time_period[DC_CONNECTOR_COUNT][24];
 
 	// for OCPP Reserved
-	byte _reserved_UserId[2][32];
+	byte _reserved_UserId[DC_CONNECTOR_COUNT][32];
+	byte _reserved_ac_UserId[AC_CONNECTOR_COUNT][32];
 
 	// auto run flag
 	byte _isAutoRunTest;
 
 	// chademo try to communicaton flag (for tesla adapter)
-	struct ChademoTryCommunicationKey _cha_try_communication[2];
+	struct ChademoTryCommunicationKey _cha_try_communication[DC_CONNECTOR_COUNT];
 
 	// if the psu communication timedout, reset the AC contact for 30s
 	struct timespec _psuComm_time;
@@ -366,16 +412,27 @@ struct DcCommonInformation
 	byte evBoardResetFlag;
 
 	// Psu module split by connector
-	int connector[2][12];
+	int connector[DC_CONNECTOR_COUNT][12];
 	byte conn_1_count;
 	byte conn_2_count;
 
 	// Use ccid to obtain authorization
 	byte enObtainAuthorizbyCCID;
-	byte isSendStartTransation[2];
+	byte _CcidAuthProcessStep;
+	byte _authWithCcidFlag[DC_CONNECTOR_COUNT];
 
 	// balance information - for tariff
 	struct BalanceInfo balanceInfo;
+
+	// the hold time before return idle
+	byte _returnIdleHoldFlag[DC_CONNECTOR_COUNT];
+
+	// isPsuError
+	byte _isPsuErrorOccur;
+
+	byte for_alston_test_1;
+	byte for_alston_test_2;
+	byte for_alston_test_3;
 };
 
 #endif /* CONFIG_H_ */

+ 23 - 3
EVSE/Projects/DS60-120/Apps/FactoryConfig.c

@@ -107,11 +107,30 @@ void CustomChange(char *custom)
 		SysConfig.isRFID = 0;
 	}
 	else if (strcmp(custom, "N0") == EQUAL ||
-		strcmp(custom, "N1") == EQUAL)
+				strcmp(custom, "N1") == EQUAL)
 	{
 		// Noodoe (Shell)
 		SysConfig.isAPP = 0;
 	}
+	else if (strcmp(custom, "CL") == EQUAL)
+	{
+		// ChargeLab
+		SysConfig.AuthorisationMode = AUTH_MODE_ENABLE;
+		SysConfig.RfidCardNumEndian = RFID_ENDIAN_BIG;
+		strcpy((char *) SysConfig.OcppServerURL, "wss://ocpp.io");
+		sprintf((char *) SysConfig.ChargeBoxId, "%s%s", SysConfig.ModelName, SysConfig.SerialNumber);
+
+		strcpy((char *) SysConfig.TelecomInterface.TelcomApn, "m2minternet.apn");
+
+		strcpy((char *) SysConfig.AthInterface.WifiSsid, "ChargeLab-EVC");
+		strcpy((char *) SysConfig.AthInterface.WifiPassword, "evc-pwd-default-21");
+
+		SysConfig.OfflinePolicy = _OFFLINE_POLICY_LOCAL_LIST;
+		strcpy((char *)SysConfig.chargePointVendor, "ChargeLab");
+
+		SysConfig.AthInterface.WifiMode = 1;
+		SysConfig.TelecomInterface.TelcomEnabled = 1;
+	}
 }
 
 /**************************************************************************************/
@@ -161,7 +180,7 @@ int main(int argc,char *argv[])
 	strcpy((char *)SysConfig.SystemDateTime, "");
 	SysConfig.AuthorisationMode = AUTH_MODE_ENABLE;
 	SysConfig.DefaultLanguage = 0;
-	SysConfig.RfidCardNumEndian = 0;
+	SysConfig.RfidCardNumEndian = RFID_ENDIAN_LITTLE;
 	SysConfig.AcPlugInTimes = 0;
 	SysConfig.GbPlugInTimes = 0;
 	SysConfig.Ccs1PlugInTime = 0;
@@ -224,11 +243,12 @@ int main(int argc,char *argv[])
 	strcpy((char *)SysConfig.chargePointVendor, "Phihong Technology");
 	//********** Backend **********//
 	SysConfig.BackendConnTimeout = 300; //300 seconds
-	SysConfig.OfflinePolicy = 2;
+	SysConfig.OfflinePolicy = _OFFLINE_POLICY_FREE_CHARGING;
 	SysConfig.OfflineMaxChargeEnergy = 0;
 	SysConfig.OfflineMaxChargeDuration = 0;
 	strcpy((char *) SysConfig.OcppServerURL, "");
 	strcpy((char *) SysConfig.ChargeBoxId, "");
+	strcpy((char *) SysConfig.MaintainServerURL, "wss://ocpp.phihong.com.tw:2013/");
 	SysConfig.LedInfo.Intensity = 2;
 
 	// ********** «È»s¤Æ ********** //

+ 264 - 78
EVSE/Projects/DS60-120/Apps/Module_EvComm.c

@@ -45,6 +45,8 @@
 #define UNPLUG				0
 #define UNDEFINED_TEMP		255
 #define ALLOW_COUNT_MAX		30
+#define VOUT_MIN_VOLTAGE	150
+#define CURR_MIN_CURRENT	0
 
 struct SysConfigAndInfo			*ShmSysConfigAndInfo;
 struct StatusCodeData 			*ShmStatusCodeData;
@@ -59,6 +61,7 @@ struct DcCommonInformation		*ShmDcCommonData;
 byte gun_count;
 int chargingTime[CHAdeMO_QUANTITY + CCS_QUANTITY + GB_QUANTITY];
 byte rtcChkCount = 0;
+bool printLogRecord;
 
 float LogInfo[2][10];
 bool _useOfflineNoCharging = false;
@@ -91,6 +94,7 @@ struct timespec _chk_chademo_permission_timeout[CHAdeMO_QUANTITY + CCS_QUANTITY
 bool chkChademoPermission[2] = { false, false };
 bool chkChademoPermissionSend[2] = { false, false };
 byte SendErrorCount[2] = { 0, 0};
+struct timespec delayToPrintLogTimeout;
 
 unsigned char mask_table[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 };
 
@@ -2875,6 +2879,13 @@ void CANReceiver()
 								PRINTF_FUNC("Conn %d, Plug None Check. (%d) \n", targetGun, frame.data[0]);
 						}
 
+						// for using ccid to authoriz.
+						if (ShmDcCommonData->_authWithCcidFlag[targetGun] == _CCID_AUTHFAIL &&
+								_chargingData[targetGun]->ConnectorPlugIn == UNPLUG)
+						{
+							ShmDcCommonData->_authWithCcidFlag[targetGun] = _CCID_NONE;
+						}
+
 						_chargingData[targetGun]->ConnectorPlugIn = frame.data[0];
 						_chargingData[targetGun]->PilotVoltage = frame.data[1];
 
@@ -3157,7 +3168,8 @@ void SetPresentChargingOutputPower(struct ChargingInfoData *chargingData_1, stru
 //	if (ShmGBTData->ev[chargingData_1->type_index].PresentMsgFlowStatus == 10)
 //		vol1 = ShmPsuData->PsuGroup[0].GroupTargetOutputVoltage;
 //	else
-		vol1 = chargingData_1->FireChargingVoltage;
+
+	vol1 = chargingData_1->FireChargingVoltage;
 
 	cur1 = (chargingData_1->PresentChargingCurrent * 10);
 
@@ -3183,24 +3195,33 @@ void SetPresentChargingOutputPower(struct ChargingInfoData *chargingData_1, stru
 //	if (ShmGBTData->ev[chargingData_2->type_index].PresentMsgFlowStatus == 10)
 //		vol2 = ShmPsuData->PsuGroup[1].GroupTargetOutputVoltage;
 //	else
-		vol2 = chargingData_2->FireChargingVoltage;
+
+	vol2 = chargingData_2->FireChargingVoltage;
 
 	cur2 = (chargingData_2->PresentChargingCurrent * 10);
 
-	if (
-		(LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] >= vol1 + CHK_VOL_RANGE) || (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] <= vol1 - CHK_VOL_RANGE) ||
-		(LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] >= cur1 + CHK_CUR_RANGE) || (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] <= cur1 - CHK_CUR_RANGE) ||
-		(LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] >= vol2 + CHK_VOL_RANGE) || (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] <= vol2 - CHK_VOL_RANGE) ||
-		(LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] >= cur2 + CHK_CUR_RANGE) || (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] <= cur2 - CHK_CUR_RANGE)
-		)
+	if ((chargingData_1->SystemStatus >= SYS_MODE_PREPARING && chargingData_1->SystemStatus <= SYS_MODE_CHARGING) ||
+			(chargingData_1->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && chargingData_1->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))
 	{
-		PRINTF_FUNC("G1 -> Output Vol = %.1f, Output Cur = %.1f -- G2 -> Output Vol = %.1f, Output Cur = %.1f \n",
-				vol1 / 10, cur1 / 10, vol2 / 10, cur2 / 10);
+		if ((LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] >= vol1 + CHK_VOL_RANGE) || (LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] <= vol1 - CHK_VOL_RANGE) ||
+				(LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] >= cur1 + CHK_CUR_RANGE) || (LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] <= cur1 - CHK_CUR_RANGE))
+		{
+			PRINTF_FUNC("G_0 -> Output Vol = %.1f, Output Cur = %.1f \n", vol1 / 10, cur1 / 10);
+			LogInfo [0] [EV_LOG_NOW_OUTPUT_VOL] = vol1;
+			LogInfo [0] [EV_LOG_NOW_OUTPUT_CUR] = cur1;
+		}
+	}
 
-		LogInfo[0][EV_LOG_NOW_OUTPUT_VOL] = vol1;
-		LogInfo[0][EV_LOG_NOW_OUTPUT_CUR] = cur1;
-		LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] = vol2;
-		LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] = cur2;
+	if ((chargingData_2->SystemStatus >= SYS_MODE_PREPARING && chargingData_2->SystemStatus <= SYS_MODE_CHARGING) ||
+			(chargingData_2->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && chargingData_2->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))
+	{
+		if ((LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] >= vol2 + CHK_VOL_RANGE) || (LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] <= vol2 - CHK_VOL_RANGE) ||
+			(LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] >= cur2 + CHK_CUR_RANGE) || (LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] <= cur2 - CHK_CUR_RANGE))
+		{
+			PRINTF_FUNC("G_1 -> Output Vol = %.1f, Output Cur = %.1f \n", vol2 / 10, cur2 / 10);
+			LogInfo[1][EV_LOG_NOW_OUTPUT_VOL] = vol2;
+			LogInfo[1][EV_LOG_NOW_OUTPUT_CUR] = cur2;
+		}
 	}
 
 	targetCur = chargingData_2->EvBatterytargetCurrent * 10;
@@ -3249,51 +3270,67 @@ void SetPresentChargingOutputCap(struct ChargingInfoData *chargingData_1, struct
 
 	pow1 = chargingData_1->AvailableChargingPower;
 	cur1 = chargingData_1->AvailableChargingCurrent;
-
 	vol = chargingData_1->MaximumChargingVoltage;
-	GetMaxVolAndCurMethod(chargingData_1->Index, &vol, &cur1);
-	GetMaxPowerMethod(chargingData_1->Index, &pow1);
-	if (pow1 <= 0)
-		cur1 = 0;
-	else
+
+	if ((chargingData_1->SystemStatus >= SYS_MODE_PREPARING && chargingData_1->SystemStatus <= SYS_MODE_CHARGING) ||
+			(chargingData_1->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && chargingData_1->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))
 	{
-		if (chargingData_1->SystemStatus == SYS_MODE_CHARGING &&
-				chargingData_1->FireChargingVoltage > 1500)
+		GetMaxVolAndCurMethod(chargingData_1->Index, &vol, &cur1);
+		GetMaxPowerMethod(chargingData_1->Index, &pow1);
+		if (pow1 <= 0)
+			cur1 = 0;
+		else
 		{
-			float maxCur = 0;
-			maxCur = (pow1 * 1000) / chargingData_1->FireChargingVoltage;
-
-			if (maxCur * 10 <= cur1)
+			if (chargingData_1->SystemStatus == SYS_MODE_CHARGING &&
+					chargingData_1->FireChargingVoltage > 1500)
 			{
-				//PRINTF_FUNC("Gun1 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur1);
-				cur1 = maxCur * 10;
+				float maxCur = 0;
+				maxCur = (pow1 * 1000) / chargingData_1->FireChargingVoltage;
+
+				if (maxCur * 10 <= cur1)
+				{
+					//PRINTF_FUNC("Gun1 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur1);
+					cur1 = maxCur * 10;
+				}
 			}
 		}
 	}
+	else
+	{
+		cur1 = chargingData_1->ConnectorMaxCurrent;
+	}
 
 	pow2 = chargingData_2->AvailableChargingPower;
 	cur2 = chargingData_2->AvailableChargingCurrent;
 	vol = chargingData_2->MaximumChargingVoltage;
 
-	GetMaxVolAndCurMethod(chargingData_2->Index, &vol, &cur2);
-	GetMaxPowerMethod(chargingData_2->Index, &pow2);
-	if (pow2 <= 0)
-		cur2 = 0;
-	else
+	if ((chargingData_2->SystemStatus >= SYS_MODE_PREPARING && chargingData_2->SystemStatus <= SYS_MODE_CHARGING) ||
+			(chargingData_2->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && chargingData_2->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1))
 	{
-		if (chargingData_2->SystemStatus == SYS_MODE_CHARGING &&
-				chargingData_2->FireChargingVoltage > 1500)
+		GetMaxVolAndCurMethod(chargingData_2->Index, &vol, &cur2);
+		GetMaxPowerMethod(chargingData_2->Index, &pow2);
+		if (pow2 <= 0)
+			cur2 = 0;
+		else
 		{
-			float maxCur = 0;
-			maxCur = (pow2 * 1000) / chargingData_2->FireChargingVoltage;
-
-			if (maxCur * 10 <= cur2)
+			if (chargingData_2->SystemStatus == SYS_MODE_CHARGING &&
+					chargingData_2->FireChargingVoltage > 1500)
 			{
-				//PRINTF_FUNC("Gun2 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur2);
-				cur2 = maxCur * 10;
+				float maxCur = 0;
+				maxCur = (pow2 * 1000) / chargingData_2->FireChargingVoltage;
+
+				if (maxCur * 10 <= cur2)
+				{
+					//PRINTF_FUNC("Gun2 -> MaxCharging Current = %f, Cap Current = %f \n", (maxCur * 10), cur2);
+					cur2 = maxCur * 10;
+				}
 			}
 		}
 	}
+	else
+	{
+		cur2 = chargingData_2->ConnectorMaxCurrent;
+	}
 
 	if ((LogInfo[0][EV_LOG_OUTPUT_CAP_POW] <= pow1 - 5 || LogInfo[0][EV_LOG_OUTPUT_CAP_POW] >= pow1 + 5) ||
 		(LogInfo[0][EV_LOG_OUTPUT_CAP_CUR] <= cur1 - 5 || LogInfo[0][EV_LOG_OUTPUT_CAP_CUR] >= cur1 + 5) ||
@@ -3339,10 +3376,20 @@ void Initialization()
 		}
 		sleep(1);
 	}
+
+	GetTimespecFunc(&delayToPrintLogTimeout);
 }
 
 void GetMaxVolAndCurMethod(byte index, float *vol, float *cur)
 {
+//	unsigned short configCurrent = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
+//
+//	if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
+//		configCurrent /= 2;
+//
+//	if (configCurrent != 0 && configCurrent < *cur)
+//		*cur = configCurrent;
+
 	if (_chargingData[index]->ConnectorMaxVoltage != 0 &&
 			_chargingData[index]->ConnectorMaxVoltage <= *vol)
 		*vol = _chargingData[index]->ConnectorMaxVoltage;
@@ -3365,12 +3412,16 @@ void GetMaxPowerMethod(byte index, float *pow)
 	if (maxChargingPow != 0 && maxChargingPow <= *pow)
 		*pow = maxChargingPow;
 
+	if (_chargingData[index]->RealRatingPower * 10 != 0 && _chargingData[index]->RealRatingPower * 10 <= *pow)
+		*pow = _chargingData[index]->RealRatingPower * 10;
+
+	// 100 = (/ 1000 * 10)
 	if (((_chargingData[index]->SystemStatus >= SYS_MODE_PREPARE_FOR_EVSE && _chargingData[index]->SystemStatus <= SYS_MODE_CHARGING) ||
 			(_chargingData[index]->SystemStatus >= SYS_MODE_CCS_PRECHARGE_STEP0 && _chargingData[index]->SystemStatus <= SYS_MODE_CCS_PRECHARGE_STEP1)) &&
-			(_chargingData[index]->ChargingProfilePower / 1000) >= 0 &&
-			(_chargingData[index]->ChargingProfilePower / 1000) <= *pow)
+			(_chargingData[index]->ChargingProfilePower / 100) >= 0 &&
+			(_chargingData[index]->ChargingProfilePower / 100) <= *pow)
 	{
-		*pow = (float)(_chargingData[index]->ChargingProfilePower / 1000) * 10;
+		*pow = (float)(_chargingData[index]->ChargingProfilePower / 100);
 	}
 }
 
@@ -3411,6 +3462,17 @@ byte GetStopChargingReasonByEvse(byte gunIndex, byte *reason)
 		*(reason + 5)  = '1';
 		result = YES;
 	}
+	else if (ShmStatusCodeData->AlarmCode.AlarmEvents.bits.DoorOpen == 0x01)
+	{
+		// 012251
+		*(reason + 0)  = '0';
+		*(reason + 1)  = '1';
+		*(reason + 2)  = '2';
+		*(reason + 3)  = '2';
+		*(reason + 4)  = '5';
+		*(reason + 5)  = '2';
+		result = YES;
+	}
 
 	if (_chargingData[gunIndex]->Type == _Type_Chademo)
 	{
@@ -3447,6 +3509,20 @@ byte GetStopChargingReasonByEvse(byte gunIndex, byte *reason)
 			*(reason + 5) = '4';
 			result = YES;
 		}
+		else if (ShmSysConfigAndInfo->SysConfig.PhaseLossPolicy == YES &&
+				(ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL1InputUVP == YES ||
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL2InputUVP == YES ||
+						ShmStatusCodeData->AlarmCode.AlarmEvents.bits.SystemL3InputUVP == YES))
+		{
+			// 012203-012204-012205
+			* (reason + 0) = '0';
+			* (reason + 1) = '1';
+			* (reason + 2) = '2';
+			* (reason + 3) = '2';
+			* (reason + 4) = '0';
+			* (reason + 5) = '3';
+			result = YES;
+		}
 	}
 	else if (_chargingData[gunIndex]->Type == _Type_GB)
 	{
@@ -3622,7 +3698,10 @@ void FormatVoltageAndCurrent()
 		{
 			if (_chargingData[_index]->Type == _Type_Chademo)
 			{
-				_chargingData[_index]->ConnectorMaxCurrent = 600;
+				if (_chargingData[_index]->ModelType == 'L')
+					_chargingData[_index]->ConnectorMaxCurrent = 800;
+				else
+					_chargingData[_index]->ConnectorMaxCurrent = 600;
 			}
 			else if (_chargingData[_index]->Type == _Type_CCS)
 			{
@@ -3645,7 +3724,11 @@ void FormatVoltageAndCurrent()
 			}
 			else if (_chargingData[_index]->Type == _Type_CCS)
 			{
-				_chargingData[_index]->ConnectorMaxCurrent = 1200;
+				if (_chargingData [_index]->ModelType == 'Y' ||
+						_chargingData [_index]->ModelType == 'Z')
+					_chargingData [_index]->ConnectorMaxCurrent = 1500;
+				else
+					_chargingData [_index]->ConnectorMaxCurrent = 1200;
 			}
 			else if (_chargingData[_index]->Type == _Type_GB)
 			{
@@ -3656,11 +3739,23 @@ void FormatVoltageAndCurrent()
 		{
 			if (_chargingData[_index]->Type == _Type_Chademo)
 			{
-				_chargingData[_index]->ConnectorMaxCurrent = 1200;
+				if (_chargingData[_index]->ModelType == 'K')
+					_chargingData[_index]->ConnectorMaxCurrent = 2000;
+				else
+					_chargingData[_index]->ConnectorMaxCurrent = 1200;
 			}
 			else if (_chargingData[_index]->Type == _Type_CCS)
 			{
-				_chargingData[_index]->ConnectorMaxCurrent = 2000;
+				if (_chargingData [_index]->ModelType == 'V' ||
+						_chargingData [_index]->ModelType == 'F')
+					_chargingData [_index]->ConnectorMaxCurrent = 5000;
+				if (_chargingData [_index]->ModelType == 'T' ||
+						_chargingData [_index]->ModelType == 'D')
+					_chargingData [_index]->ConnectorMaxCurrent = 3000;
+				else if (_chargingData [_index]->ModelType == 'R')
+					_chargingData [_index]->ConnectorMaxCurrent = 2500;
+				else
+					_chargingData [_index]->ConnectorMaxCurrent = 2000;
 			}
 			else if (_chargingData[_index]->Type == _Type_GB)
 			{
@@ -3797,37 +3892,123 @@ void ConnectorOTP(byte _index)
 
 void OfferCurrentAndPowerRecord(byte _index)
 {
+	// 網頁設定值
 	unsigned short maxCurBuf = ShmSysConfigAndInfo->SysConfig.MaxChargingCurrent * 10;
 	unsigned short maxPowBuf = ShmSysConfigAndInfo->SysConfig.MaxChargingPower * 10;
 
+	//_chargingData[_index]->CurrentOffered = 1200;
+	//_chargingData [_index]->PowerOffered = 300;
+	//{"value":"120","context":"Sample.Periodic","format":"Raw","measurand":"Current.Offered","location":"Outlet","unit":"A"}
+	//{"value":"30000","context":"Sample.Periodic","format":"Raw","measurand":"Power.Offered","location":"Outlet","unit":"W"}
 	if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
 	{
 		maxCurBuf /= 2; maxPowBuf /= 2;
 	}
 
-	if (_chargingData[_index]->ConnectorMaxCurrent > 0)
+	if (_index == 1 && ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf)
 	{
-		if (maxCurBuf == 0)
-			_chargingData[_index]->CurrentOffered = _chargingData[_index]->ConnectorMaxCurrent;
-		else
-			_chargingData[_index]->ConnectorMaxCurrent >= maxCurBuf ?
-					(_chargingData[_index]->CurrentOffered = maxCurBuf) :
-					(_chargingData[_index]->CurrentOffered = _chargingData[_index]->ConnectorMaxCurrent);
+		_chargingData [1]->PowerOffered = _chargingData [0]->PowerOffered;
+		_chargingData [1]->CurrentOffered = _chargingData [0]->CurrentOffered;
 	}
 	else
-		_chargingData[_index]->CurrentOffered = 0;
+	{
+		if (_chargingData[_index]->ConnectorMaxCurrent > 0)
+		{
+			if (maxCurBuf == 0)
+				_chargingData[_index]->CurrentOffered = _chargingData[_index]->ConnectorMaxCurrent;
+			else
+				_chargingData[_index]->ConnectorMaxCurrent >= maxCurBuf ?
+						(_chargingData[_index]->CurrentOffered = maxCurBuf) :
+						(_chargingData[_index]->CurrentOffered = _chargingData[_index]->ConnectorMaxCurrent);
+		}
+		else
+			_chargingData[_index]->CurrentOffered = 0;
 
-	if (ShmPsuData->PsuGroup[_index].GroupAvailablePower > 0)
+		if (ShmPsuData->PsuGroup [_index].GroupAvailablePower > 0)
 		{
 			if (maxPowBuf == 0)
-				_chargingData[_index]->PowerOffered = ShmPsuData->PsuGroup[_index].GroupAvailablePower;
+			{
+				if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
+					_chargingData [_index]->PowerOffered = ShmPsuData->PsuGroup [_index].GroupAvailablePower;
+				else
+					_chargingData [_index]->PowerOffered = ShmPsuData->SystemAvailablePower;
+			}
 			else
-				_chargingData[_index]->ConnectorMaxCurrent >= maxPowBuf ?
-						(_chargingData[_index]->PowerOffered = maxPowBuf) :
-						(_chargingData[_index]->PowerOffered = ShmPsuData->PsuGroup[_index].GroupAvailablePower);
+			{
+				if (ShmSysConfigAndInfo->SysInfo.MainChargingMode == _MAIN_CHARGING_MODE_AVER)
+				{
+					ShmPsuData->PsuGroup[_index].GroupAvailablePower >= maxPowBuf ?
+							(_chargingData [_index]->PowerOffered = maxPowBuf) :
+							(_chargingData [_index]->PowerOffered = ShmPsuData->PsuGroup [_index].GroupAvailablePower);
+				}
+				else
+				{
+					ShmPsuData->SystemAvailablePower >= maxPowBuf ?
+							(_chargingData [_index]->PowerOffered = maxPowBuf) :
+							(_chargingData [_index]->PowerOffered = ShmPsuData->SystemAvailablePower);
+				}
+			}
+		}
+		else
+			_chargingData [_index]->PowerOffered = 0;
+	}
+}
+
+bool IsTimeToPrintLog()
+{
+	bool result = false;
+
+	int _timebuf = GetTimeoutValue(&delayToPrintLogTimeout);
+
+	if (_timebuf < 0)
+		GetTimespecFunc (&delayToPrintLogTimeout);
+	else
+	{
+		if (_timebuf >= 5)
+			result = true;
+	}
+
+	return result;
+}
+
+void InitTimeToPrintLog()
+{
+	GetTimespecFunc (&delayToPrintLogTimeout);
+}
+
+void AuthorizeByCcid(byte _index)
+{
+	if (_chargingData[_index]->Type == _Type_CCS &&
+			_chargingData [_index]->IsAvailable &&
+			ShmDcCommonData->enObtainAuthorizbyCCID &&
+			strcmp ( (char *) _chargingData[_index]->StartUserId, "") == EQUAL)
+	{
+		if (_chargingData [_index]->ConnectorPlugIn)
+		{
+			if (ShmDcCommonData->_authWithCcidFlag [_index] == _CCID_NONE)
+			{
+				if (printLogRecord)
+					PRINTF_FUNC ( "index = %d, Wait for CCID. \n", _index );
+
+				if (strcmp ( (char *) _chargingData [_index]->EVCCID, "" ) == EQUAL)
+				{
+					SendCommunicationOnly ( _index );
+					GetEvccIdReq ( _index, _chargingData [_index]->Evboard_id );
+				}
+				else
+					ShmDcCommonData->_authWithCcidFlag [_index] = _CCID_GET;
+			}
+			else if (ShmDcCommonData->_authWithCcidFlag [_index] == _CCID_AUTHFAIL)
+			{
+				SendStopOnly ( _index );
+				strcpy ( (char *) _chargingData [_index]->EVCCID, "" );
+			}
 		}
 		else
-			_chargingData[_index]->PowerOffered = 0;
+		{
+			SendStopOnly ( _index );
+		}
+	}
 }
 
 int main(int argc, char *argv[])
@@ -3884,6 +4065,8 @@ int main(int argc, char *argv[])
 
 	while(CanFd)
 	{
+		printLogRecord = IsTimeToPrintLog();
+
 		for(byte _index = 0; _index < gun_count; _index++)
 		{
 			byte targetID = _chargingData[_index]->Evboard_id;
@@ -4019,7 +4202,7 @@ int main(int argc, char *argv[])
 							_chargingData[_index]->StopChargeFlag = NO;
 					}
 
-					if (priorityLow == 1)
+					if (priorityLow == 1 || printLogRecord)
 					{
 						_chargingData[_index]->PresentChargedEnergy = 0;
 						_chargingData[_index]->PresentChargingPower = 0;
@@ -4092,9 +4275,14 @@ int main(int argc, char *argv[])
 					break;
 				case SYS_MODE_PREPARE_FOR_EV:
 				{
+					AuthorizeByCcid(_index);
+
 					if (ShmDcCommonData->startTransactionFlag[_index] == START_TRANSATION_STATUS_WAIT)
 						continue;
 
+					if (_chargingData[_index]->Type == _Type_CCS)
+						GetEvccIdReq(_index, _chargingData[_index]->Evboard_id);
+
 					// 開始確認車端是否同意開始充電 : 1.SOC, 2.Target Vol, 3.Target Cur, 4.Charging remaining time
 					GetOutputReq(_index, targetID);
 
@@ -4124,15 +4312,9 @@ int main(int argc, char *argv[])
 						}
 
 						_chargingData[_index]->RealMaxVoltage = maxVol;
-
-						SetChargingPermission(_index, START,
-						_chargingData[_index]->AvailableChargingPower,
-								maxCur,
-								maxVol,
-								targetID);
-
-						if (_chargingData[_index]->Type == _Type_CCS)
-							GetEvccIdReq(_index, _chargingData[_index]->Evboard_id);
+						SetChargingPermission ( _index, START,
+							_chargingData [_index]->AvailableChargingPower,
+							maxCur,  maxVol, targetID );
 
 						// 取得車端電池資訊 : 1.AC or DC ? 2.Total battery cap, 3.Max battery vol, 4.Max battery cur
 						GetEvBatteryInfo(_index, targetID);
@@ -4308,17 +4490,17 @@ int main(int argc, char *argv[])
 					// 設定當前輸出
 					if (gun_count == 1)
 					{
-						if (_chargingData[0]->FireChargingVoltage <= 500)
-							_chargingData[0]->PresentChargingCurrent = 0;
+						if (_chargingData[0]->FireChargingVoltage <= VOUT_MIN_VOLTAGE)
+							_chargingData[0]->PresentChargingCurrent = CURR_MIN_CURRENT;
 
 						SetPresentChargingOutputPower(_chargingData[0], _chargingData[0]);
 					}
 					else if (gun_count == 2)
 					{
-						if (_chargingData[0]->FireChargingVoltage <= 500)
-							_chargingData[0]->PresentChargingCurrent = 0;
-						if (_chargingData[1]->FireChargingVoltage <= 500)
-							_chargingData[1]->PresentChargingCurrent = 0;
+						if (_chargingData[0]->FireChargingVoltage <= VOUT_MIN_VOLTAGE)
+							_chargingData[0]->PresentChargingCurrent = CURR_MIN_CURRENT;
+						if (_chargingData[1]->FireChargingVoltage <= VOUT_MIN_VOLTAGE)
+							_chargingData[1]->PresentChargingCurrent = CURR_MIN_CURRENT;
 
 						SetPresentChargingOutputPower(_chargingData[0], _chargingData[1]);
 					}
@@ -4401,6 +4583,10 @@ int main(int argc, char *argv[])
 					break;
 			}
 		}
+
+		if (printLogRecord)
+			InitTimeToPrintLog();
+
 		priorityLow >= 20 ? priorityLow = 1 : priorityLow++;
 		usleep(45000); //EV 小板通訊 (50 ms)
 	}

+ 4 - 4
EVSE/Projects/DS60-120/Apps/Module_EventLogging.c

@@ -330,7 +330,7 @@ int DB_Network_Insert_Record(sqlite3 *db)
 				ShmSysConfigAndInfo->SysInfo.OcppConnStatus,
 				!ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet,
 				!ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi,
-				!ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi,
+				!ShmStatusCodeData->InfoCode.InfoEvents.bits.ApnDisconnectVia4Gi,
 				ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi,
 				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
 	}
@@ -352,7 +352,7 @@ int DB_Network_Insert_Record(sqlite3 *db)
 				ShmSysConfigAndInfo->SysInfo.OcppConnStatus,
 				!ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet,
 				0,
-				!ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi,
+				!ShmStatusCodeData->InfoCode.InfoEvents.bits.ApnDisconnectVia4Gi,
 				0,
 				ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi);
 	}
@@ -549,7 +549,7 @@ int main(void)
 				(netPreviousStatus.isOcppConnected != ShmSysConfigAndInfo->SysInfo.OcppConnStatus) ||
 				(netPreviousStatus.ethIsInternet != ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet) ||
 				(netPreviousStatus.maln0IsInternet != ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi) ||
-				(netPreviousStatus.ppp0IsInternet != ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi) ||
+				(netPreviousStatus.ppp0IsInternet != ShmStatusCodeData->InfoCode.InfoEvents.bits.ApnDisconnectVia4Gi) ||
 				(netPreviousStatus.rssiWifi != ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi) ||
 				(netPreviousStatus.rssi4g != ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi))
 		{
@@ -559,7 +559,7 @@ int main(void)
 			netPreviousStatus.isOcppConnected = ShmSysConfigAndInfo->SysInfo.OcppConnStatus;
 			netPreviousStatus.ethIsInternet = ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaEthernet;
 			netPreviousStatus.maln0IsInternet = ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi;
-			netPreviousStatus.ppp0IsInternet = ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectVia4Gi;
+			netPreviousStatus.ppp0IsInternet = ShmStatusCodeData->InfoCode.InfoEvents.bits.ApnDisconnectVia4Gi;
 			netPreviousStatus.rssiWifi = ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi;
 			netPreviousStatus.rssi4g = ShmSysConfigAndInfo->SysConfig.TelecomInterface.TelcomRssi;
 		}

File diff suppressed because it is too large
+ 565 - 353
EVSE/Projects/DS60-120/Apps/Module_InternalComm.c


+ 1 - 0
EVSE/Projects/DS60-120/Apps/Module_LcmContro.h

@@ -25,6 +25,7 @@
 #include	<ctype.h>
 #include 	<ifaddrs.h>
 #include 	<stdbool.h>
+#include 	<dirent.h>
 #include	"../../define.h"
 
 #define ARRAY_SIZE(A)		(sizeof(A) / sizeof(A[0]))

+ 54 - 51
EVSE/Projects/DS60-120/Apps/Module_LcmControl.c

@@ -224,6 +224,8 @@ void ReadMsgFromLcm(byte *msg, byte readLen)
 						strcpy((char *)ShmSysConfigAndInfo->SysInfo.LcmHwRev, moduleName);
 
 					_currentPage = *(msg + 7);
+//					if (_currentPage != 1 && _currentPage != 5 && _currentPage != 6 && _currentPage != 7 && _currentPage != 8)
+//						printf("_currentPage = %d \n", _currentPage);
 				}
 				break;
 			}
@@ -239,30 +241,6 @@ void ReadMsgFromLcm(byte *msg, byte readLen)
 //				printf("msg = %x \n", *(msg + 8));
 //				printf("msg = %x \n", *(msg + 9));
 			}
-			else if (key == 0x0600)
-			{
-				if (_btn_pressed != *(msg + 8))
-				{
-					if (_btn_pressed == 0x0A)
-						printf("NotPressed \n");
-					else
-						printf("Pressed \n");
-
-					_btn_pressed = *(msg + 8);
-				}
-
-				//printf("msg = %x \n", *(msg + 7));
-			}
-
-//			switch ((unsigned short) (*(msg + 4) << 8) + (unsigned short) *(msg + 5))
-//			{
-//				case BUTTON_GUN_INDEX:
-//				{
-//					// 當前選的槍號
-//					_curGunIndex = (*(msg + 8));
-//				}
-//				break;
-//			}
 		}
 	}
 }
@@ -1363,17 +1341,17 @@ void ProcessPageInfo()
 		case _LCM_WAIT_FOR_PLUG:
 		{
 			FirstPageChanged();
-			bool isCharging = false;
-			for(byte i = 0; i < _totalCount; i++)
-			{
-				if (_chargingInfoData[i]->SystemStatus == SYS_MODE_IDLE ||
-						_chargingInfoData[i]->SystemStatus == SYS_MODE_MAINTAIN ||
-						_chargingInfoData[i]->SystemStatus == SYS_MODE_RESERVATION)
-					continue;
-
-				isCharging = true;
-				break;
-			}
+//			bool isCharging = false;
+//			for(byte i = 0; i < _totalCount; i++)
+//			{
+//				if (_chargingInfoData[i]->SystemStatus == SYS_MODE_IDLE ||
+//						_chargingInfoData[i]->SystemStatus == SYS_MODE_MAINTAIN ||
+//						_chargingInfoData[i]->SystemStatus == SYS_MODE_RESERVATION)
+//					continue;
+//
+//				isCharging = true;
+//				break;
+//			}
 
 			if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE)
 			{
@@ -1383,11 +1361,11 @@ void ProcessPageInfo()
 			else
 				ChangeDisplay2Value(__ret_home_btn, _back_home_btn);
 
-			if (isCharging && ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == NO)
-			{
-				ChangeDisplay2Value(__sel_gun_btn, _sel_gun_btn);
-			}
-			else
+//			if (isCharging && ShmSysConfigAndInfo->SysInfo.IsAlternatvieConf == NO)
+//			{
+//				ChangeDisplay2Value(__sel_gun_btn, _sel_gun_btn);
+//			}
+//			else
 			{
 				ChangeDisplay2Value(__sel_gun_btn, _disappear);
 			}
@@ -1434,8 +1412,10 @@ void ProcessPageInfo()
 						else
 							ChangeChargingEnergyValue(0);
 
-						if (strcmp((char *)ac_chargingInfo[0]->StartUserId, "") == 0 ||
-								ShmSysConfigAndInfo->SysConfig.StopChargingByButton == YES)
+						if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE ||
+								strcmp((char *)ac_chargingInfo[0]->StartUserId, "") == 0 ||
+								ShmSysConfigAndInfo->SysConfig.StopChargingByButton == YES ||
+								ac_chargingInfo[0]->isRemoteStart)
 							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn);
 						else
 							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn_scan);
@@ -1600,8 +1580,11 @@ void ProcessPageInfo()
 						else
 							ChangeChargingEnergyValue(0);
 
-						if (strcmp((char *)_chargingInfoData[i]->StartUserId, "") == 0 ||
-								ShmSysConfigAndInfo->SysConfig.StopChargingByButton == YES)
+						if (ShmSysConfigAndInfo->SysConfig.AuthorisationMode == AUTH_MODE_DISABLE ||
+								strcmp((char *)_chargingInfoData[i]->StartUserId, "") == 0 ||
+								ShmSysConfigAndInfo->SysConfig.StopChargingByButton == YES ||
+								_chargingInfoData[i]->isRemoteStart ||
+								ShmDcCommonData->_authWithCcidFlag [i] == _CCID_AUTHCOMP)
 							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn);
 						else
 							ChangeDisplay2Value(__stop_method_btn, _stop_charging_btn_scan);
@@ -1895,8 +1878,9 @@ void DefaultIconStatus()
 	memcpy(_buf, &ShmSysConfigAndInfo->SysConfig.ModelName[12], 2);
 
 	// N0 : 拓連
-	if (ShmDcCommonData->ShowLogoFlag &&
-			strcmp(_buf, "N0") != EQUAL)
+//	if (ShmDcCommonData->ShowLogoFlag &&
+//			strcmp(_buf, "N0") != EQUAL)
+	if (strcmp(_buf, "N0") != EQUAL)
 	{
 		ChangeDisplay2Value(__phihong_string, _phihong_string_map);
 	}
@@ -1930,17 +1914,32 @@ int main(void)
 
 	Initialization();
 
-	//	ChangeToOtherPage(_LCM_INIT);
+	//	ChangeToOtherPage(_LCM_IDLE);
 	//	ChangeDisplay2Value(__phihong_string, _disappear);
 	//	return -1;
 
 	DefaultIconStatus();
 
-	byte _verShowCount = 3;
+//	int xxx = 3;
+//	while(xxx > 0 && Uart1Fd != -1)
+//	{
+//		if (xxx == 1)
+//		{
+//			printf("---------------------------- \n");
+//			downloadBMP(1, "/tmp/1_idle.bmp");
+//			printf("---------------------------- end \n");
+//			return -1;
+//		}
+//		sleep(1);
+//		xxx--;
+//	}
+//	return -1;
 
+	byte _verShowCount = 3;
 	while(Uart1Fd != -1)
 	{
-		if (strcmp((char *)ShmSysConfigAndInfo->SysInfo.LcmHwRev, moduleName) != 0x00)
+		if (strcmp((char *)ShmSysConfigAndInfo->SysInfo.LcmHwRev, moduleName) != EQUAL ||
+				_verShowCount > 0)
 		{
 			GetDeviceInfoStatus(__lcm_version, 3);
 			GetCurrentPage();
@@ -1951,6 +1950,12 @@ int main(void)
 				PRINTF_FUNC("LCM Version = V.%03d \n", ShmDcCommonData->LcmFwVersion);
 				_verShowCount--;
 			}
+
+			if (ShmDcCommonData->LcmFwVersion >= 2)
+			{
+				ChangeDisplay2Value ( __logo, _logo );
+				ChangeDisplay2Value ( __logo_cmp, _logo_cmp );
+			}
 		}
 		else
 		{
@@ -1974,13 +1979,11 @@ int main(void)
 
 				ChangeWarningFunc();
 			}
-
 			// 頁面資訊處理
 			ProcessPageInfo();
 
 			// 網路 - wifi - 連線訊號處理
 			RefreshConnStatus();
-
 			// 換頁處理
 			GetCurrentPage();
 			ChangeCurPage();

+ 2 - 1
EVSE/Projects/DS60-120/Apps/Module_PrimaryComm.c

@@ -315,7 +315,8 @@ void GetInputGpioStatus()
 			{
 				if (ShmPrimaryMcuData->InputDet.bits.EmergencyButton == NORMAL &&
 					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PsuFailureAlarm == NORMAL &&
-					ShmPrimaryMcuData->InputDet.bits.DoorOpen  &&
+					ShmStatusCodeData->AlarmCode.AlarmEvents.bits.PsuComminicationErrWithCSU == NORMAL &&
+					ShmPrimaryMcuData->InputDet.bits.DoorOpen == NORMAL &&
 						(ShmDcCommonData->psuKeepCommunication == YES ||
 						gpio_in.AC_Connector == YES))
 				{

File diff suppressed because it is too large
+ 554 - 221
EVSE/Projects/DS60-120/Apps/Module_PsuComm.c


+ 4 - 1
EVSE/Projects/DS60-120/Apps/Module_PsuComm.h

@@ -51,6 +51,8 @@ int preChargingCur;
 float toAverVolPoint;
 byte toAverVolCount;
 
+byte _delayCount;
+
 //int connector_1[12];
 //int connector_2[12];
 //int connector[2][12];
@@ -73,7 +75,8 @@ enum _PSU_CMD_SEQ
 	_PSU_CMD_CAP		= 10,
 	_PSU_CMD_OUTPUT		= 11,
 	_PSU_CMD_IVAILIABLE	= 12,
-	_PSU_CMD_TEMP		= 13
+	_PSU_CMD_TEMP		= 13,
+	_PSU_CMD_GETCOUNT	= 14,
 };
 
 enum _CHARGING_LOG_INDEX

+ 171 - 15
EVSE/Projects/DS60-120/Apps/ReadCmdline.c

@@ -63,6 +63,12 @@ byte _curAutoRunCount = 0;
 byte _usingAutoRun = 0;
 struct timeval _autoTime;
 
+struct timeb 					startChargingTime;
+struct timeb 					endChargingTime;
+int 							_presentChargingTimeBuf;
+int 							chargingTime;
+//struct timeval 					_printf_time;
+
 struct SysConfigAndInfo			*ShmSysConfigAndInfo;
 struct StatusCodeData 			*ShmStatusCodeData;
 struct PrimaryMcuData			*ShmPrimaryMcuData;
@@ -259,18 +265,76 @@ unsigned long GetTimeoutValue(struct timeval _sour_time)
 	return (_end_time.tv_sec - _sour_time.tv_sec);
 }
 
+void PrintConnectorState(byte state)
+{
+	switch(state)
+	{
+		case SYS_MODE_BOOTING: printf("Status = Booting.... \n"); break;
+		case SYS_MODE_IDLE: printf("Status = Idle \n"); break;
+		case SYS_MODE_AUTHORIZING: printf("Status = Authorized \n"); break;
+		case SYS_MODE_MODE_REASSIGN_CHECK: printf("Status = check to change to balance mode \n"); break;
+		case SYS_MODE_REASSIGN: printf("Status = Waiting to change the balance mode \n"); break;
+		case SYS_MODE_PREPARING: printf("Status = Preparing \n"); break;
+		case SYS_MODE_PREPARE_FOR_EV: printf("Status = Waiting for EV side (slac...) \n"); break;
+		case SYS_MODE_PREPARE_FOR_EVSE : printf ( "Status = Waiting for GFD \n" ); break;
+		case SYS_MODE_CHARGING : printf ( "Status = Charging \n" ); break;
+		case SYS_MODE_TERMINATING : printf ( "Status = Terminating \n" ); break;
+		case SYS_MODE_COMPLETE : printf ( "Status = Complete \n" ); break;
+		case SYS_MODE_ALARM : printf ( "Status = Alarm \n" ); break;
+		case SYS_MODE_FAULT : printf ( "Status = Fault \n" ); break;
+		case SYS_MODE_RESERVATION : printf ( "Status = Reserved \n" ); break;
+		case SYS_MODE_MAINTAIN : printf ( "Status = Maintain \n" ); break;
+		case SYS_MODE_CCS_PRECHARGE_STEP0 : printf ( "Status = Precahrge Start \n" ); break;
+		case SYS_MODE_CCS_PRECHARGE_STEP1 : printf ( "Status = Precharge End \n" ); break;
+		case SYS_MODE_UPDATE : printf ( "Status = Updating ....  \n" ); break;
+	}
+}
+
+void PrintChargingMode(byte mode)
+{
+	switch(mode)
+	{
+		case _MAIN_CHARGING_MODE_MAX: printf("Charging mode = Max \n"); break;
+		case _MAIN_CHARGING_MODE_AVER: printf("Charging mode = Balance \n"); break;
+	}
+}
+
+void PrintLcmPageName(byte page)
+{
+	switch(page)
+	{
+		case _LCM_INIT: 			printf ( "LCM Page = Init \n" ); break;
+		case _LCM_IDLE: 			printf ( "LCM Page = Idle \n" ); break;
+		case _LCM_WAIT_FOR_PLUG: 	printf ( "LCM Page = Waiting for plug \n" ); break;
+		case _LCM_PRE_CHARGE: 		printf ( "LCM Page = Precharge \n" ); break;
+		case _LCM_CHARGING: 		printf ( "LCM Page = Charging \n" ); break;
+		case _LCM_COMPLETE: 		printf ( "LCM Page = Complete \n" ); break;
+		case _LCM_FIX: 				printf ( "LCM Page = Fix \n" ); break;
+		case _LCM_EMC: 				printf ( "LCM Page = EMC \n" ); break;
+	}
+}
+
+void PrintAcCpStatus(byte cp)
+{
+	switch(cp)
+	{
+		case AC_SYS_A: printf ( "AC CpStatus = State A \n" ); break;
+		case AC_SYS_B: printf ( "AC CpStatus = State B \n" ); break;
+		case AC_SYS_C: printf ( "AC CpStatus = State C \n" ); break;
+		case AC_SYS_F: printf ( "AC CpStatus = State F \n" ); break;
+	}
+}
+
 void RunStatusProc(char *v1, char *v2)
 {
-	printf("OrderCharging = %d \n", ShmSysConfigAndInfo->SysInfo.OrderCharging);
-	printf("WaitForPlugit = %d \n", ShmSysConfigAndInfo->SysInfo.WaitForPlugit);
 	if (strcmp(v1, "ac") == 0)
 	{
 		if (!FindAcChargingInfoData(0, &ac_chargingInfo[0]))
 		{
 			printf("FindChargingInfoData (AC) false \n");
 		}
-		printf("AC Status = %d \n", ac_chargingInfo[0]->SystemStatus);
-		printf("AC ConnectorPlugIn = %d \n", ac_chargingInfo[0]->ConnectorPlugIn);
+		PrintConnectorState(ac_chargingInfo[0]->SystemStatus);
+		PrintAcCpStatus(ac_chargingInfo[0]->ConnectorPlugIn);
 		return;
 	}
 
@@ -286,16 +350,17 @@ void RunStatusProc(char *v1, char *v2)
 		if (strcmp(v2, "-1") == 0 || strcmp(v2, "") == 0)
 		{
 			// get
-			printf ("index = %x, status = %x (%d)\n", _index, _chargingData[_index]->SystemStatus, _chargingData[_index]->IsAvailable);
-			printf ("SystemTimeoutFlag = %d, PageIndex = %d\n",
-					ShmSysConfigAndInfo->SysInfo.SystemTimeoutFlag, ShmSysConfigAndInfo->SysInfo.PageIndex);
+			PrintConnectorState(_chargingData[_index]->SystemStatus);
+			PrintChargingMode(ShmSysConfigAndInfo->SysInfo.MainChargingMode);
+			PrintLcmPageName(ShmSysConfigAndInfo->SysInfo.PageIndex);
+			printf ("SystemTimeoutFlag = %d\n", ShmSysConfigAndInfo->SysInfo.SystemTimeoutFlag );
 			printf ("SOC = %d \n", _chargingData[_index]->EvBatterySoc);
 			printf ("Maximum battery Voltage = %f \n", _chargingData[_index]->EvBatteryMaxVoltage);
-			printf("Charging mode = %d \n", ShmSysConfigAndInfo->SysInfo.MainChargingMode);
 			printf("maxTemp = %d, temp-I = %d, temp-II = %d \n",
-						_chargingData[_index]->ConnectorTemp - 60,
-						ShmDcCommonData->ConnectorTemp1[_index] - 60,
-						ShmDcCommonData->ConnectorTemp2[_index] - 60);
+				_chargingData[_index]->ConnectorTemp - 60,
+				ShmDcCommonData->ConnectorTemp1[_index] - 60,
+				ShmDcCommonData->ConnectorTemp2[_index] - 60);
+			printf ("index = %x, Available = %d \n", _index, _chargingData[_index]->IsAvailable);
 		}
 		else
 		{
@@ -321,6 +386,9 @@ void RunStatusProc(char *v1, char *v2)
 			ac_chargingInfo[0]->SystemStatus = atoi(v2);
 		}
 	}
+
+	printf("OrderCharging = %d \n", ShmSysConfigAndInfo->SysInfo.OrderCharging);
+	printf("WaitForPlugit = %d \n", ShmSysConfigAndInfo->SysInfo.WaitForPlugit);
 }
 
 void RunCardProc(char *v1, char *v2)
@@ -468,6 +536,7 @@ void GetFwVerProc(char *v1)
 			printf("FindChargingInfoData (AC) false \n");
 		}
 		printf("AC Version = %s \n", ac_chargingInfo[0]->version);
+		printf("LcmHwRev = %s \n", ShmSysConfigAndInfo->SysInfo.LcmHwRev);
 	}
 }
 
@@ -861,6 +930,13 @@ void GetPsuInformation(char *v1, char *v2, char *v3)
 			_chargingData[0]->EvBatterytargetCurrent = cur;
 		}
 	}
+	else if (strcmp(v1, "force") == 0)
+	{
+		ShmPsuData->Work_Step = _ALATON_MODE;
+		byte id = atof(v2);
+
+		ShmDcCommonData->for_alston_test_1 = id;
+	}
 	printf("*************************************************\n");
 }
 
@@ -1147,6 +1223,55 @@ void AverageCharging(char *g1_vol, char *g1_cur, char *g2_vol, char *g2_cur)
 	}
 }
 
+int DiffTimeb(struct timeb ST, struct timeb ET)
+{
+	//return milli-second
+	unsigned int StartTime,StopTime;
+
+	StartTime=(unsigned int)ST.time;
+	StopTime=(unsigned int)ET.time;
+	//return (StopTime-StartTime)*1000+ET.millitm-ST.millitm;
+	return (StopTime-StartTime);
+}
+
+void CalcPresentChargedDuration(byte gun_index)
+{
+	int _diffTime = 0;
+
+	ftime(&endChargingTime);
+	_diffTime = DiffTimeb(startChargingTime, endChargingTime);
+
+	// below 0 or over 5 sec is abnormal
+	if (_diffTime < 0 ||
+			_diffTime > _chargingData[gun_index]->PresentChargedDuration + 5)
+	{
+		_presentChargingTimeBuf = _chargingData[gun_index]->PresentChargedDuration;
+		ftime(&startChargingTime);
+	}
+	else
+		_chargingData[gun_index]->PresentChargedDuration = _presentChargingTimeBuf + _diffTime;
+}
+
+void CalcPresentChargingPower(byte _index)
+{
+	if (chargingTime == 0 ||
+			chargingTime > _chargingData [_index]->PresentChargedDuration)
+	{
+		chargingTime = _chargingData [_index]->PresentChargedDuration;
+	}
+	else
+	{
+		int passTime = _chargingData [_index]->PresentChargedDuration - chargingTime;
+
+		if (passTime > 0)
+		{
+			float changingPow = (_chargingData [_index]->PresentChargingPower) * passTime / 3600;
+			_chargingData [_index]->PresentChargedEnergy += changingPow;
+			chargingTime = _chargingData [_index]->PresentChargedDuration;
+		}
+	}
+}
+
 void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
 {
 	int _GunIndex;
@@ -1217,6 +1342,7 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         	        printf ("[UnconditionalCharge - SYS_MODE_IDLE]\n");
         	    }
 
+        	    chargingTime = 0;
         	    ShmDcCommonData->StartToChargingFlag[_GunIndex] = 0x01;
                 _chargingData[_GunIndex]->SystemStatus = SYS_MODE_PREPARING;
     		}
@@ -1356,9 +1482,13 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
         	        _chargingData[_GunIndex]->EvBatterySoc = 50;
         	        _chargingData[_GunIndex]->AvailableChargingCurrent = 1000;
 
+        	        ftime(&startChargingTime);
+        	        //gettimeofday(&_printf_time, NULL);
         	        printf ("[UnconditionalCharge - SYS_MODE_CHARGING]\n");
         	    }
 
+				CalcPresentChargedDuration(_GunIndex);
+
         	    if (_usingAutoRun == 0x01)
         	    {
         	    	if (((GetTimeoutValue(_autoTime)) >= AUTORUN_STEP1_TIME_START * 60 && (GetTimeoutValue(_autoTime)) <= AUTORUN_STEP1_TIME_END * 60) ||
@@ -1389,10 +1519,18 @@ void RunUnconditionalChargeIndex1(char *v1, char *v2, char *v3)
     		    _chargingData[_GunIndex]->PresentChargingPower =
     		    		((float)((_chargingData[_GunIndex]->PresentChargingVoltage) * (_chargingData[_GunIndex]->PresentChargingCurrent)) / 1000);
 
+    		    CalcPresentChargingPower(_GunIndex);
+
     		    if (_chargingData[_GunIndex]->GroundFaultStatus == 0x02){
     		         printf ("Charging Ground Fault check Fail (%d)\n",_chargingData[_GunIndex]->GroundFaultStatus);
     		        _chargingData[_GunIndex]->SystemStatus = SYS_MODE_TERMINATING;
     		    }
+
+//    		    if (GetTimeoutValue(_printf_time) >= 3)
+//    		    {
+//    		    	printf("PresentChargedEnergy = %.3f \n", _chargingData [_GunIndex]->PresentChargedEnergy);
+//    		    	gettimeofday(&_printf_time, NULL);
+//    		    }
     		}
     		break;
 
@@ -1734,13 +1872,31 @@ int main(void)
 		else if (strcmp(newString[0], "test") == 0)
 		{
 			if (!FindChargingInfoData(1, &_chargingData[0]))
+			{
+				printf("FindChargingInfoData error\n");
+			}
+
+			// Test Command
+			ShmPsuData->PsuGroup[0].GroupErrorFlag.bits.PsuFailure = YES;
+			ShmPsuData->PsuStopChargeFlag = YES;
+			ShmDcCommonData->_isPsuErrorOccur = YES;
+//			ShmDcCommonData->Customer_SwipToChargingByTime += 10;
+//			printf("Charging Time = %u \n", ShmDcCommonData->Customer_SwipToChargingByTime);
+		}
+		else if (strcmp(newString[0], "ocpp") == 0)
+		{
+			if (ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_16)
+			{
+				if (strlen ( (char *) ShmOCPP16Data->ConfigurationTable.CoreProfile [ConfigurationVersion].ItemData ) > 0)
 				{
-					printf("FindChargingInfoData error\n");
+					printf ( "OCPP Version. = %s",
+							ShmOCPP16Data->ConfigurationTable.CoreProfile [ConfigurationVersion].ItemData );
 				}
+			}
+			else if (ShmSysConfigAndInfo->SysInfo.OcppRunningVer == OCPP_RUNNING_VERSION_20)
+			{
 
-			// Test Command
-			memcpy(_chargingData[1]->EvConnAlarmCode, "023983", 6);
-			ShmStatusCodeData->InfoCode.InfoEvents.bits.Stop_by_EV_with_unknow_reason = YES;
+			}
 		}
 		else if(strcmp(newString[0], "strchg") == 0)
 		{

+ 9 - 2
EVSE/Projects/DS60-120/Apps/internalComm.c

@@ -959,7 +959,7 @@ unsigned char Query_AC_Alarm_Code(unsigned char fd, unsigned char targetAddr, Ac
 
 	if(len > 6)
 	{
-		if (len < 6+(rx[4] | rx[5]<<8))
+		if (len < 6 + (rx[4] | rx[5] << 8) || (rx[4] | rx[5] << 8) < 4)
 			return result;
 
 		for(int idx = 0;idx<(rx[4] | rx[5]<<8);idx++)
@@ -973,6 +973,13 @@ unsigned char Query_AC_Alarm_Code(unsigned char fd, unsigned char targetAddr, Ac
 				(rx[3] == tx[3]))
 		{
 			Ret_Buf->AcAlarmCode = rx[6] + (rx[7] << 8) + (rx[8] << 16) + (rx[9] << 24);
+//			if (Ret_Buf->AcAlarmCode != 0)
+//			{
+//				printf("rx[1] = %x, rx[2] = %x, rx[3] = %x, rx[4] = %x, rx[5] = %x \n",
+//						rx[1], rx[2], rx[3], rx[4], rx[5]);
+//				printf("rx[6] = %x, rx[7] = %x, rx[8] = %x, rx[9] = %x \n",
+//						rx[6], rx[7], rx[8], rx[9]);
+//			}
 			result = PASS;
 		}
 	}
@@ -1003,7 +1010,7 @@ unsigned char Query_Charging_Energy(unsigned char fd, unsigned char targetAddr,
 				(rx[1] == tx[2]) &&
 				(rx[3] == tx[3]))
 		{
-			Ret_Buf->Energy = rx[6] + (rx[7] << 8) + (rx[8] << 16) + (rx[9] << 24);
+			Ret_Buf->Energy = (rx[6] + (rx[7] << 8) + (rx[8] << 16) + (rx[9] << 24));
 			result = PASS;
 		}
 	}

File diff suppressed because it is too large
+ 422 - 182
EVSE/Projects/DS60-120/Apps/main.c


Some files were not shown because too many files changed in this diff