Selaa lähdekoodia

[Improve][AX80][main]

2022.03.18 / Folus Wen

Actions:
1. Bridge interface restart logic improve.

Files:
1. As follow commit history

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

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 vuotta sitten
vanhempi
commit
6229d90036
1 muutettua tiedostoa jossa 10 lisäystä ja 6 poistoa
  1. 10 6
      EVSE/Projects/AX80/Apps/main.c

+ 10 - 6
EVSE/Projects/AX80/Apps/main.c

@@ -2629,6 +2629,11 @@ void InitEthernet()
 	char tmpbuf[256];
 	unsigned int natInterface = 0;
 
+	// Detele bridge interface
+	system("/sbin/ifconfig uap0 down");
+	system("/sbin/ifconfig br0 down");
+	system("/usr/sbin/brctl delbr br0");
+
 	//Init Eth0 for internet
 	memset(tmpbuf,0,256);
 	sprintf(tmpbuf,"/sbin/ifconfig eth0 %s netmask %s up &",
@@ -2874,15 +2879,14 @@ void InitEthernet()
 			  (access("/sys/class/net/br0/address", F_OK) == -1))
 			{
 				sleep(10);
-				system("/sbin/ifconfig br0 down");
-				system("/usr/sbin/brctl delbr br0");
 				system("/usr/sbin/brctl addbr br0");
-				system("/sbin/ifconfig br0 192.168.10.200 up");
-				system("/usr/sbin/brctl addif br0 uap0");
 				system("/usr/sbin/brctl addif br0 eth0");
+				system("/usr/sbin/brctl addif br0 uap0");
+				system("/sbin/ifconfig br0 192.168.10.200 up");
 				system("/bin/sed -i '/interface/d' /etc/udhcpd.conf");
 				system("/bin/echo 'interface	br0' >> /etc/udhcpd.conf");
-				system("pkill Module_Wifi");
+				system("kill udhcpd");
+				system("/usr/sbin/udhcpd /etc/udhcpd.conf");
 
 				DEBUG_INFO("Bridge uap0 & eth0 for local power sharing by ethernet.\n");
 			}
@@ -4210,7 +4214,7 @@ void checkTask()
 			}
 		}
 
-		if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL,"") != 0)
+		if(strcmp((char *)&ShmSysConfigAndInfo->SysConfig.MaintainServerURL,"") != 0 && !ShmSysConfigAndInfo->SysConfig.isEnableLocalPowerSharging)
 		{
 			if(system("pidof -s OcppBackendPH > /dev/null") != 0)
 			{