Browse Source

Merge branch 'AW-Regular' of https://git.phihong.com.tw:30000/System_Integration/CSU3_AM335x into AW-Regular

8009 5 years ago
parent
commit
62d3c70367

+ 6 - 7
EVSE/Modularization/Module_Wifi.c

@@ -502,7 +502,6 @@ int getLinkQuality()
 	char cmd[256];
 	char buf[512];
 	char tmp[512];
-	char *q[2];
 
 	strcpy(cmd, "/root/iwconfig ");
 	strcat(cmd, Wifi.currentInterface);
@@ -513,13 +512,13 @@ int getLinkQuality()
 	{
 		while(fgets(buf, sizeof(buf), fp) != NULL)
 		{
-			if(strstr(buf, "Quality") > 0)
+			if(strstr(buf, "Signal level") > 0)
 			{
-				sscanf(buf, "%*s%s", tmp);
-				substr(tmp, tmp, strspn(tmp, "Quality="), strlen(buf)-strspn(tmp, "Quality="));
+				sscanf(buf, "%*s%*s%*s%s", tmp);
+
+				substr(tmp, tmp, strspn(tmp, "Signal level="), strlen(buf)-strspn(tmp, "Signal level="));
 
-				split(q,tmp,"/");
-				Wifi.rssi = (atoi(q[0])*100)/atoi(q[1]);
+				Wifi.rssi = atoi(tmp);
 
 				result = PASS;
 			}
@@ -933,7 +932,7 @@ void proc_sta()
 		case STA_STATE_AP_CONNECTED:
 			getInterfaceInfo();
 			getLinkQuality();
-			DEBUG_INFO("Wifi quality: %d\n", Wifi.rssi);
+			DEBUG_INFO("Wifi quality: %d dBm\n", Wifi.rssi);
 			ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi = Wifi.rssi;
 
 			if(isReachableInternet() == PASS)

+ 1 - 1
EVSE/Projects/define.h

@@ -146,7 +146,7 @@ struct SysConfigData
 	unsigned char   		LocalWhiteCard[10][32];		//Max. card quantity is 10
 	unsigned char 			UserId[32];					//the user use this ID to trigger charging event, it can be RFID card number, OCPP IdTag, etc.
 	/**************Network***************/
-	unsigned char 			FtpServer[32];				//the ftp server for Phihong server to do data transimission
+	unsigned char 			FtpServer[256];				//the ftp server for Phihong server to do data transimission
 	struct EthConfigData	Eth0Interface;
 	struct EthConfigData	Eth1Interface;
 	struct WifiConfigData 		AthInterface;

+ 1 - 0
EVSE/rootfs/etc/init.d/rcS

@@ -39,6 +39,7 @@ mount -t jffs2 /dev/mtdblock13 /Storage
 mkdir -p /Storage/EventLog
 mkdir -p /Storage/ChargeLog
 mkdir -p /Storage/SystemLog
+mkdir -p /Storage/OCPP
 mkdir -p /UsbFlash	
 
 #   ---------------------------------------------

+ 1 - 0
EVSE/rootfs/lib/libsqlite3.so.0

@@ -0,0 +1 @@
+libsqlite3.so