Browse Source

Merge branch 'master' into DO360

Wendell 2 years ago
parent
commit
3f107c51fb

+ 18 - 0
EVSE/Modularization/WebService.c

@@ -948,6 +948,8 @@ int main(int argc, char *argv[]) {
 			int WifiMode=0;
 			char *WifiSsid=NULL;
 			char *WifiPassword=NULL;
+			int WifiBroadcastSsid=0;
+			char *WifiTargetBssidMac=NULL;
 			int WifiDhcpServer=0;
 			int WifiDhcpClient=0;
 			char *WifiIpAddress=NULL;
@@ -992,6 +994,16 @@ int main(int argc, char *argv[]) {
 				if (strcmp(WifiSsid, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid) != 0) Wcnt++;
 				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword,WifiPassword);
 			}
+			if( json_object_object_get_ex(jobj, "WifiBroadcastSsid", &val_obj) ) {
+				WifiBroadcastSsid = json_object_get_int(val_obj);
+				if(WifiBroadcastSsid!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid) Wcnt++;
+				ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid=WifiBroadcastSsid;
+			}
+			if( json_object_object_get_ex(jobj, "WifiTargetBssidMac", &val_obj) ) {
+				WifiTargetBssidMac = (char*)json_object_get_string(val_obj);
+				if (strcmp(WifiTargetBssidMac, (char*)ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac) != 0) Wcnt++;
+				strcpy((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac,WifiTargetBssidMac);
+			}
 			if( json_object_object_get_ex(jobj, "WifiDhcpServer", &val_obj) ) {
 				WifiDhcpServer = json_object_get_int(val_obj);
 				if(WifiDhcpServer!=ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer) Wcnt++;
@@ -1850,6 +1862,8 @@ int main(int argc, char *argv[]) {
 		struct json_object *WifiMode;
 		struct json_object *WifiSsid;
 		struct json_object *WifiPassword;
+		struct json_object *WifiBroadcastSsid;
+		struct json_object *WifiTargetBssidMac;
 		struct json_object *WifiRssi;
 		struct json_object *WifiDhcpServer;
 		struct json_object *WifiDhcpClient;
@@ -2536,6 +2550,8 @@ int main(int argc, char *argv[]) {
 		WifiMode = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode);
 		WifiSsid = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiSsid);
 		WifiPassword = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiPassword);
+		WifiBroadcastSsid = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiBroadcastSsid);
+		WifiTargetBssidMac = json_object_new_string((char *)&ShmSysConfigAndInfo->SysConfig.AthInterface.WifiTargetBssidMac);
 		WifiRssi = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiRssi);
 		WifiDhcpServer = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpServer);
 		WifiDhcpClient = json_object_new_int(ShmSysConfigAndInfo->SysConfig.AthInterface.WifiDhcpClient);
@@ -2965,6 +2981,8 @@ int main(int argc, char *argv[]) {
 		json_object_object_add(jobj3,"WifiMode",WifiMode);
 		json_object_object_add(jobj3,"WifiSsid",WifiSsid);
 		json_object_object_add(jobj3,"WifiPassword",WifiPassword);
+		json_object_object_add(jobj3,"WifiBroadcastSsid",WifiBroadcastSsid);
+		json_object_object_add(jobj3,"WifiTargetBssidMac",WifiTargetBssidMac);
 		json_object_object_add(jobj3,"WifiRssi",WifiRssi);
 		json_object_object_add(jobj3,"WifiDhcpServer",WifiDhcpServer);
 		json_object_object_add(jobj3,"WifiDhcpClient",WifiDhcpClient);

+ 3 - 3
EVSE/Modularization/ocppfiles/MessageHandler.c

@@ -10891,19 +10891,19 @@ int handleDataTransferRequest(char *uuid, char *payload)
 
 					if(json_object_object_get(data, "SOC") != NULL)
 					{
-						ShmOCPP16Data->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))].targetSoc = json_object_get_int(json_object_object_get(data, "SOC"));
+						ShmOCPP16Data->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))-1].targetSoc = json_object_get_int(json_object_object_get(data, "SOC"));
 						DEBUG_INFO("ChargeingPreference target soc: %d\n", json_object_get_int(json_object_object_get(data, "SOC")));
 					}
 
 					if(json_object_object_get(data, "Energy") != NULL)
 					{
-						ShmOCPP16Data->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))].targetEnergy = json_object_get_int(json_object_object_get(data, "Energy"));
+						ShmOCPP16Data->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))-1].targetEnergy = json_object_get_int(json_object_object_get(data, "Energy"));
 						DEBUG_INFO("ChargeingPreference target energy: %d KWH\n", json_object_get_int(json_object_object_get(data, "Energy")));
 					}
 
 					if(json_object_object_get(data, "Duration") != NULL)
 					{
-						ShmOCPP16Data->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))].targetDuration = json_object_get_int(json_object_object_get(data, "Duration"));
+						ShmOCPP16Data->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))-1].targetDuration = json_object_get_int(json_object_object_get(data, "Duration"));
 						DEBUG_INFO("ChargeingPreference target duration: %d minutes\n", json_object_get_int(json_object_object_get(data, "Duration")));
 					}
 

+ 3 - 3
EVSE/Modularization/ocppph/MessageHandler.c

@@ -10429,19 +10429,19 @@ int handleDataTransferRequest(char *uuid, char *payload)
 
 					if(json_object_object_get(data, "SOC") != NULL)
 					{
-						ShmOCPP16DataPH->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))].targetSoc = json_object_get_int(json_object_object_get(data, "SOC"));
+						ShmOCPP16DataPH->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))-1].targetSoc = json_object_get_int(json_object_object_get(data, "SOC"));
 						DEBUG_INFO("ChargeingPreference target soc: %d\n", json_object_get_int(json_object_object_get(data, "SOC")));
 					}
 
 					if(json_object_object_get(data, "Energy") != NULL)
 					{
-						ShmOCPP16DataPH->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))].targetEnergy = json_object_get_int(json_object_object_get(data, "Energy"));
+						ShmOCPP16DataPH->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))-1].targetEnergy = json_object_get_int(json_object_object_get(data, "Energy"));
 						DEBUG_INFO("ChargeingPreference target energy: %d KWH\n", json_object_get_int(json_object_object_get(data, "Energy")));
 					}
 
 					if(json_object_object_get(data, "Duration") != NULL)
 					{
-						ShmOCPP16DataPH->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))].targetDuration = json_object_get_int(json_object_object_get(data, "Duration"));
+						ShmOCPP16DataPH->SessionTarget[json_object_get_int(json_object_object_get(data, "ConnectorId"))-1].targetDuration = json_object_get_int(json_object_object_get(data, "Duration"));
 						DEBUG_INFO("ChargeingPreference target duration: %d minutes\n", json_object_get_int(json_object_object_get(data, "Duration")));
 					}
 

+ 19 - 3
EVSE/Projects/AW-Regular/Apps/Module_InternalComm.c

@@ -1820,6 +1820,22 @@ int main(void)
 					previous_gun_info[gun_index].legacyRequest.isLegacyRequest = ShmCharger->gun_info[gun_index].legacyRequest.isLegacyRequest;
 				}
 
+				if((previous_gun_info[gun_index].primaryMcuState.relayState.relay_status[0][0] != ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][0]) ||
+				   (previous_gun_info[gun_index].primaryMcuState.relayState.relay_status[0][1] != ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][1]) ||
+				   (previous_gun_info[gun_index].primaryMcuState.relayState.relay_status[0][2] != ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][2]))
+				{
+					DEBUG_INFO("**************************************************\n");
+					DEBUG_INFO("********* High priority polling : Case 2-X *******\n");
+					DEBUG_INFO("**************************************************\n");
+					DEBUG_INFO("MCU-%d set relay status [0][0] : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][0]);
+					DEBUG_INFO("MCU-%d set relay status [0][1] : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][1]);
+					DEBUG_INFO("MCU-%d set relay status [0][2] : %d\n", gun_index, ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][2]);
+					
+					previous_gun_info[gun_index].primaryMcuState.relayState.relay_status[0][0] = ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][0];
+					previous_gun_info[gun_index].primaryMcuState.relayState.relay_status[0][1] = ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][1];
+					previous_gun_info[gun_index].primaryMcuState.relayState.relay_status[0][2] = ShmCharger->gun_info[gun_index].primaryMcuState.relayState.relay_status[0][2];
+				}
+
 				//===============================
 				// Query primary MCU status
 				//===============================
@@ -1889,7 +1905,7 @@ int main(void)
 				//===============================
 				// Query present output current
 				//===============================
-				if((int)previous_gun_info[gun_index].outputCurrent.L1N_L12[0] != (int)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0])
+				if((abs((int)ShmCharger->gun_info[gun_index].outputCurrent.L1N_L12[0] - (int)previous_gun_info[gun_index].outputCurrent.L1N_L12[0]) >= 2))
 				{
 					DEBUG_INFO("**************************************************\n");
 					DEBUG_INFO("********* High priority polling : Case 5 *********\n");
@@ -1943,7 +1959,7 @@ int main(void)
 				//==========================================================
 				// Low priority polling log print out
 				//==========================================================
-				if((int)previous_gun_info[gun_index].inputVoltage.L1N_L12 != (int)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12)
+				if((abs((int)ShmCharger->gun_info[gun_index].inputVoltage.L1N_L12 - (int)previous_gun_info[gun_index].inputVoltage.L1N_L12) >= 2))
 				{
 					DEBUG_INFO("==================================================\n");
 					DEBUG_INFO("======== Normal priority polling : Case 1 ========\n");
@@ -2128,7 +2144,7 @@ int main(void)
 				}
 				else
 				{
-					DEBUG_WARN("MCU-%d set relay request fail...%d\n", gun_index, failCount[gun_index]);
+					DEBUG_WARN("MCU-%d set permission request fail...%d\n", gun_index, failCount[gun_index]);
 					if(failCount[gun_index]<1000)
 					{
 						failCount[gun_index]++;

+ 19 - 0
EVSE/rootfs/var/www/set_network.php

@@ -206,6 +206,17 @@ img {
 											<label>Password</label>
 											<input type="text" name="WifiPassword" id="WifiPassword" class="form-control" value="<?php echo $obj->{'WifiPassword'};?>">
 										</div>
+										<div class="form-group" id="WifiBroadcastSsidDiv">
+											<label>Wifi Broadcast SSID</label>
+											<select class="form-control" id="WifiBroadcastSsid" name="WifiBroadcastSsid">
+												<option value="0" <?php echo $obj->{'WifiBroadcastSsid'}=="0"?"selected":""?>>hidden</option>
+												<option value="1" <?php echo $obj->{'WifiBroadcastSsid'}=="1"?"selected":""?>>broadcast</option>
+											</select>
+										</div>
+										<div class="form-group" id="WifiTargetBssidMacDiv">
+											<label>Wifi Target Bssid Mac</label>
+											<input type="text" name="WifiTargetBssidMac" id="WifiTargetBssidMac" class="form-control" value="<?php echo $obj->{'WifiTargetBssidMac'};?>">
+										</div>
 										<div class="form-group" id="WifiRssiDiv">
 											<label>RSSI</label>
 											<input type="text" readonly class="form-control" placeholder="<?php echo $obj->{'WifiRssi'};?> dBm">
@@ -387,6 +398,8 @@ img {
 						"&WifiMode=" + document.getElementById("WifiMode").value+
 						"&WifiSsid=" + escape(document.getElementById("WifiSsid").value)+
 						"&WifiPassword=" + escape(document.getElementById("WifiPassword").value)+
+						"&WifiBroadcastSsid=" + document.getElementById("WifiBroadcastSsid").value+
+						"&WifiTargetBssidMac=" + escape(document.getElementById("WifiTargetBssidMac").value)+
 						"&WifiDhcpServer=" + document.getElementById("WifiDhcpServer").value+
 						"&WifiDhcpClient=" + document.getElementById("WifiDhcpClient").value+
 						"&WifiIpAddress=" + document.getElementById("WifiIpAddress").value+
@@ -468,6 +481,8 @@ img {
 			document.getElementById("WifiDhcpClientDiv").style.display="none";
 			document.getElementById("WifiSsidDiv").style.display="none";
 			document.getElementById("WifiPasswordDiv").style.display="none";
+			document.getElementById("WifiBroadcastSsidDiv").style.display="none";
+			document.getElementById("WifiTargetBssidMacDiv").style.display="none";
 			document.getElementById("WifiRssiDiv").style.display="none";
 			document.getElementById("WifiMacAddressDiv").style.display="none";
 			document.getElementById("WifiIpAddressDiv").style.display="none";
@@ -492,6 +507,8 @@ img {
 			document.getElementById("WifiDhcpClientDiv").style.display="block";
 			document.getElementById("WifiSsidDiv").style.display="block";
 			document.getElementById("WifiPasswordDiv").style.display="block";
+			document.getElementById("WifiBroadcastSsidDiv").style.display="none";
+			document.getElementById("WifiTargetBssidMacDiv").style.display="block";
 			document.getElementById("WifiRssiDiv").style.display="block";
 			document.getElementById("WifiMacAddressDiv").style.display="block";
 			document.getElementById("WifiIpAddressDiv").style.display="block";
@@ -513,6 +530,8 @@ img {
 			document.getElementById("WifiDhcpClientDiv").style.display="none";
 			document.getElementById("WifiSsidDiv").style.display="block";
 			document.getElementById("WifiPasswordDiv").style.display="block";
+			document.getElementById("WifiBroadcastSsidDiv").style.display="block";
+			document.getElementById("WifiTargetBssidMacDiv").style.display="none";
 			document.getElementById("WifiRssiDiv").style.display="block";
 			document.getElementById("WifiMacAddressDiv").style.display="block";
 			document.getElementById("WifiIpAddressDiv").style.display="none";

+ 7 - 0
EVSE/rootfs/var/www/set_network_action.php

@@ -21,6 +21,7 @@
 		checkip("TelcomIpAddress");
 		checkValue("Eth0DhcpClient");
 		checkValue("WifiMode");
+		checkValue("WifiBroadcastSsid");
 		checkValue("WifiDhcpServer");
 		checkValue("WifiDhcpClient");
 		checkValue("TelcomEnabled");
@@ -40,6 +41,12 @@
 		if(isset($_REQUEST['WifiMode'])){
 			$json['WifiMode']				= $_REQUEST['WifiMode'];
 		}
+		if(isset($_REQUEST['WifiBroadcastSsid'])){
+			$json['WifiBroadcastSsid']				= $_REQUEST['WifiBroadcastSsid'];
+		}
+		if(isset($_REQUEST['WifiTargetBssidMac'])){
+			$json['WifiTargetBssidMac']				= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['WifiTargetBssidMac'])))));
+		}
 		if(isset($_REQUEST['WifiSsid'])){
 			$json['WifiSsid']				= str_replace("&amp;","&",str_replace("&quot;",'"',str_replace("&#039;","'",str_replace("&lt;","<",str_replace("&gt;",">",$_REQUEST['WifiSsid'])))));
 		}

+ 0 - 1
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.lib.a.cmd

@@ -1 +0,0 @@
-cmd_lib/lib.a := rm -f lib/lib.a; /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-ar rcsD lib/lib.a lib/argv_split.o lib/bug.o lib/chacha20.o lib/cmdline.o lib/ctype.o lib/dec_and_lock.o lib/decompress.o lib/decompress_inflate.o lib/dma-noop.o lib/dump_stack.o lib/earlycpio.o lib/extable.o lib/fdt.o lib/fdt_empty_tree.o lib/fdt_ro.o lib/fdt_rw.o lib/fdt_strerror.o lib/fdt_sw.o lib/fdt_wip.o lib/flex_proportions.o lib/idr.o lib/int_sqrt.o lib/ioremap.o lib/irq_regs.o lib/is_single_threaded.o lib/klist.o lib/kobject.o lib/kobject_uevent.o lib/md5.o lib/nmi_backtrace.o lib/nodemask.o lib/plist.o lib/radix-tree.o lib/ratelimit.o lib/rbtree.o lib/seq_buf.o lib/sha1.o lib/show_mem.o lib/string.o lib/timerqueue.o lib/vsprintf.o lib/win_minmax.o

+ 0 - 1
board-support/linux-4.9.59+gitAUTOINC+a75d8e9305-ga75d8e9305/lib/.libcrc32c.ko.cmd

@@ -1 +0,0 @@
-cmd_lib/libcrc32c.ko := /opt/ti-processor-sdk-linux-am335x-evm-04.02.00.09/linux-devkit/sysroots/x86_64-arago-linux/usr/bin/arm-linux-gnueabihf-ld -EL -r  -T ./scripts/module-common.lds --build-id  -o lib/libcrc32c.ko lib/libcrc32c.o lib/libcrc32c.mod.o ;  true