Browse Source

2020-02-25/ Eason Yang
1.Change main.c Reason : added checkTask() and synchronize with Platform_CSU3
2.Change Module_InternalComm Reason : Added check rx length logic
Version : V0.14.00.0000.00

8009 5 years ago
parent
commit
32e72ed67c

+ 10 - 2
EVSE/Projects/AW-Regular/Apps/Module_InternalComm.c

@@ -1021,6 +1021,9 @@ unsigned char Config_Serial_Number(unsigned char fd, unsigned char targetAddr, E
 
 	if(len > 6)
 	{
+		if (len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
 		chksum = 0x00;
 		for(int idx=0;idx<(rx[4] | rx[5]<<8);idx++)
 		{
@@ -1057,6 +1060,9 @@ unsigned char Config_Model_Name(unsigned char fd, unsigned char targetAddr, Evse
 
 	if(len > 6)
 	{
+		if (len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
 		chksum = 0x00;
 		for(int idx=0;idx<(rx[4] | rx[5]<<8);idx++)
 		{
@@ -1417,6 +1423,9 @@ unsigned char Config_AC_MaxCurrent_And_CpPwmDuty(unsigned char fd, unsigned char
 
 	if(len > 6)
 	{
+		if(len < 6+(rx[4] | rx[5]<<8))
+			return result;
+
 		chksum = 0x00;
 		for(int idx=0;idx<(rx[4] | rx[5]<<8);idx++)
 		{
@@ -1487,7 +1496,6 @@ unsigned char Update_Abord(unsigned char fd, unsigned char targetAddr)
 		for(int idx = 0;idx<(rx[4] | rx[5]<<8);idx++)
 		{
 			chksum ^= rx[6+idx];
-
 		}
 
 		if((chksum == rx[6+(rx[4] | rx[5]<<8)]) &&
@@ -1562,7 +1570,7 @@ unsigned char Update_Finish(unsigned char fd, unsigned char targetAddr)
 	if(len > 6)
 	{
 		if (len < 6+(rx[4] | rx[5]<<8))
-				return result;
+			return result;
 
 		for(int idx=0;idx<(rx[4] | rx[5]<<8);idx++)
 		{

+ 68 - 1
EVSE/Projects/AW-Regular/Apps/main.c

@@ -1063,7 +1063,7 @@ void get_firmware_version(unsigned char gun_index)
 	strcpy((char*)ShmSysConfigAndInfo->SysInfo.CsuPrimFwRev, ShmCharger->gun_info[gun_index].ver.Version_FW);
 
 	// Get CSU root file system version
-	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "B0.13.00.0000.00");
+	sprintf((char*)ShmSysConfigAndInfo->SysInfo.CsuRootFsFwRev, "V0.14.00.0000.00");
 
 	// Get AC connector type from model name
 	for(uint8_t idx=0;idx<3;idx++)
@@ -1633,6 +1633,68 @@ int getEth0MacAddress()
 	return result;
 }
 
+//==========================================
+// Check task processing
+//==========================================
+void checkTask()
+{
+	if(ShmSysConfigAndInfo->SysConfig.ModelName[10] == 'T')
+	{
+		if(system("pidof -s Module_4g > /dev/null") != 0)
+		{
+			DEBUG_INFO("Module_4g not running, restart it.\r\n");
+			system("/root/Module_4g &");
+		}
+	}
+	else if(ShmSysConfigAndInfo->SysConfig.ModelName[10] == 'W')
+	{
+		if(system("pidof -s Module_Wifi > /dev/null") != 0)
+		{
+			DEBUG_INFO("Module_Wifi not running, restart it.\r\n");
+			system("/root/Module_Wifi &");
+		}
+	}
+
+	if(system("pidof -s Module_EventLogging > /dev/null") != 0)
+	{
+		DEBUG_INFO("Module_EventLogging not running, restart it.\r\n");
+		system("/root/Module_EventLogging &");
+	}
+
+	if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.OcppServerURL,"") != 0)
+	{
+		if(system("pidof -s OcppBackend > /dev/null") != 0)
+		{
+			DEBUG_INFO("OcppBackend not running, restart it.\r\n");
+			system("/root/OcppBackend &");
+		}
+	}
+
+	if(system("pidof -s Module_AlarmDetect > /dev/null") != 0)
+	{
+		DEBUG_INFO("Module_AlarmDetect not running, restart it.\r\n");
+		system("/root/Module_AlarmDetect &");
+	}
+
+	if(system("pidof -s OcppBackend > /dev/null") != 0)
+	{
+		DEBUG_INFO("OcppBackend not running, restart it.\r\n");
+		system("/root/OcppBackend &");
+	}
+
+	if(system("pidof -s Module_InternalComm > /dev/null") != 0)
+	{
+		DEBUG_INFO("Module_InternalComm not running, restart it.\r\n");
+		system("/root/Module_InternalComm &");
+	}
+
+	if(system("pidof -s Module_Speaker > /dev/null") != 0)
+	{
+		DEBUG_INFO("Module_Speaker not running, restart it.\r\n");
+		system("/root/Module_Speaker &");
+	}
+}
+
 //===============================================
 // Main process
 //===============================================
@@ -1677,6 +1739,11 @@ int main(void)
 		//==========================================
 		getEth0MacAddress();
 
+		//==========================================
+		// Check task processing
+		//==========================================
+		checkTask();
+
 		//==========================================
 		// Something need run in Idle mode
 		//==========================================

BIN
EVSE/Projects/AW-Regular/Images/FactoryDefaultConfig.bin


BIN
EVSE/Projects/AW-Regular/Images/MLO


BIN
EVSE/Projects/AW-Regular/Images/ramdisk.gz


BIN
EVSE/Projects/AW-Regular/Images/u-boot.img


BIN
EVSE/Projects/AW-Regular/Images/zImage


BIN
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_vmlinux1


BIN
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.tmp_vmlinux2


+ 1 - 1
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/.version

@@ -1 +1 @@
-396
+397