Эх сурвалжийг харах

[Improve][rootfs][udhcpc]

2022.03.25 / Folus Wen

Actions:
1. Add timeout configuration to /etc/resolv.conf

Files:
1. As follow commit history

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

Hardware PWB P/N : XXXXXXX
Hardware Version : XXXXXXX
FolusWen 3 жил өмнө
parent
commit
3d097e6dab

+ 2 - 49
EVSE/Projects/AW-ChargeLab/Apps/Module_ConfigTools.c

@@ -778,7 +778,6 @@ int main(void)
 			printf("\n  start: EVSE start charging request.");
 			printf("\n  stop: EVSE stop charging request.");
 			printf("\n  auth: Authorize request.");
-			printf("\n  ccs: CCS flow status.");
 			printf("\n  alarm: Simulate alarm status.");
 			printf("\n  cancel: return to main menu.");
 			printf("\n **************************************************");
@@ -827,52 +826,6 @@ int main(void)
 				ShmOCPP16Data->SpMsg.bits.AuthorizeReq = ON;
 				DEBUG_INFO("Test authentication by %s.\n", ShmSysConfigAndInfo->SysConfig.UserId);
 			}
-			else if(strcmp(cmd, "ccs") == 0)
-			{
-				memset(cmd, 0x00, ARRAY_SIZE(cmd));
-				printf("\n  Please input gun index(1~2): ");
-				scanf("%s", &cmd[0]);
-
-				if((0 < atoi(cmd)) && (atoi(cmd) < 3))
-				{
-					uint8_t gun_index = atoi(cmd)-1;
-					memset(cmd, 0x00, ARRAY_SIZE(cmd));
-					printf("\n ***** ccs ****************************************");
-					printf("\n  ccs_hs_status: CCS hand shake status.");
-					printf("\n  cancel: return to main menu.");
-					printf("\n **************************************************");
-					printf("\n  Please input operation item: ");
-					scanf("%s", &cmd[0]);
-
-					if(strcmp(cmd, "ccs_hs_status") == 0)
-					{
-						printf("\n ***** ccs_hs_status *******************************");
-						printf("\n  Current ccs_hs_status: %d", ShmCharger->gun_info[gun_index].ccsHandshakeState);
-						printf("\n  1: HANDSHAKE_DUTY_5.");
-						printf("\n  2: HANDSHAKE_DUTY_5_CHECK.");
-						printf("\n  3: HANDSHAKE_CCS.");
-						printf("\n  4: HANDSHAKE_CP_STATE_E.");
-						printf("\n  5: HANDSHAKE_SET_MAX_CURRENT.");
-						printf("\n  6: HANDSHAKE_BS_MODE.");
-						printf("\n  7: HANDSHAKE_HLC_MODE.");
-						printf("\n **************************************************");
-						printf("\n  Please input operation item: ");
-						scanf("%s", &cmd[0]);
-
-						if((0 < atoi(cmd)) && (atoi(cmd) < 9))
-						{
-							ShmCharger->gun_info[gun_index].ccsHandshakeState = atoi(cmd);
-							DEBUG_INFO("Gun-%d CCS hand shake state: %d.\n", gun_index, ShmCharger->gun_info[gun_index].ccsHandshakeState);
-						}
-						else
-							printf("\n  Invalid hand shake state.");
-					}
-				}
-				else
-				{
-					printf("\n  Invalid input gun_index.");
-				}
-			}
 			else if(strcmp(cmd, "alarm") == 0)
 			{
 				memset(cmd, 0x00, ARRAY_SIZE(cmd));
@@ -885,8 +838,8 @@ int main(void)
 
 					while(1)
 					{
-						ShmCharger->gun_info[atoi(cmd)-1].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_VOLTAGE;
-						ShmCharger->gun_info[atoi(cmd)-1].primaryMcuAlarm.InputAlarmCode |= ALARM_L1_OVER_VOLTAGE;
+						ShmCharger->gun_info[atoi(cmd)-1].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_VOLTAGE;
+						ShmCharger->gun_info[atoi(cmd)-1].primaryMcuAlarm.InputAlarmCode |= ALARM_OVER_VOLTAGE;
 					}
 				}
 				else

+ 2 - 49
EVSE/Projects/AW-Regular/Apps/Module_ConfigTools.c

@@ -778,7 +778,6 @@ int main(void)
 			printf("\n  start: EVSE start charging request.");
 			printf("\n  stop: EVSE stop charging request.");
 			printf("\n  auth: Authorize request.");
-			printf("\n  ccs: CCS flow status.");
 			printf("\n  alarm: Simulate alarm status.");
 			printf("\n  cancel: return to main menu.");
 			printf("\n **************************************************");
@@ -827,52 +826,6 @@ int main(void)
 				ShmOCPP16Data->SpMsg.bits.AuthorizeReq = ON;
 				DEBUG_INFO("Test authentication by %s.\n", ShmSysConfigAndInfo->SysConfig.UserId);
 			}
-			else if(strcmp(cmd, "ccs") == 0)
-			{
-				memset(cmd, 0x00, ARRAY_SIZE(cmd));
-				printf("\n  Please input gun index(1~2): ");
-				scanf("%s", &cmd[0]);
-
-				if((0 < atoi(cmd)) && (atoi(cmd) < 3))
-				{
-					uint8_t gun_index = atoi(cmd)-1;
-					memset(cmd, 0x00, ARRAY_SIZE(cmd));
-					printf("\n ***** ccs ****************************************");
-					printf("\n  ccs_hs_status: CCS hand shake status.");
-					printf("\n  cancel: return to main menu.");
-					printf("\n **************************************************");
-					printf("\n  Please input operation item: ");
-					scanf("%s", &cmd[0]);
-
-					if(strcmp(cmd, "ccs_hs_status") == 0)
-					{
-						printf("\n ***** ccs_hs_status *******************************");
-						printf("\n  Current ccs_hs_status: %d", ShmCharger->gun_info[gun_index].ccsHandshakeState);
-						printf("\n  1: HANDSHAKE_DUTY_5.");
-						printf("\n  2: HANDSHAKE_DUTY_5_CHECK.");
-						printf("\n  3: HANDSHAKE_CCS.");
-						printf("\n  4: HANDSHAKE_CP_STATE_E.");
-						printf("\n  5: HANDSHAKE_SET_MAX_CURRENT.");
-						printf("\n  6: HANDSHAKE_BS_MODE.");
-						printf("\n  7: HANDSHAKE_HLC_MODE.");
-						printf("\n **************************************************");
-						printf("\n  Please input operation item: ");
-						scanf("%s", &cmd[0]);
-
-						if((0 < atoi(cmd)) && (atoi(cmd) < 9))
-						{
-							ShmCharger->gun_info[gun_index].ccsHandshakeState = atoi(cmd);
-							DEBUG_INFO("Gun-%d CCS hand shake state: %d.\n", gun_index, ShmCharger->gun_info[gun_index].ccsHandshakeState);
-						}
-						else
-							printf("\n  Invalid hand shake state.");
-					}
-				}
-				else
-				{
-					printf("\n  Invalid input gun_index.");
-				}
-			}
 			else if(strcmp(cmd, "alarm") == 0)
 			{
 				memset(cmd, 0x00, ARRAY_SIZE(cmd));
@@ -885,8 +838,8 @@ int main(void)
 
 					while(1)
 					{
-						ShmCharger->gun_info[atoi(cmd)-1].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_VOLTAGE;
-						ShmCharger->gun_info[atoi(cmd)-1].primaryMcuAlarm.InputAlarmCode |= ALARM_L1_OVER_VOLTAGE;
+						ShmCharger->gun_info[atoi(cmd)-1].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_VOLTAGE;
+						ShmCharger->gun_info[atoi(cmd)-1].primaryMcuAlarm.InputAlarmCode |= ALARM_OVER_VOLTAGE;
 					}
 				}
 				else

+ 2 - 49
EVSE/Projects/Noodoe/Apps/Module_ConfigTools.c

@@ -778,7 +778,6 @@ int main(void)
 			printf("\n  start: EVSE start charging request.");
 			printf("\n  stop: EVSE stop charging request.");
 			printf("\n  auth: Authorize request.");
-			printf("\n  ccs: CCS flow status.");
 			printf("\n  alarm: Simulate alarm status.");
 			printf("\n  cancel: return to main menu.");
 			printf("\n **************************************************");
@@ -827,52 +826,6 @@ int main(void)
 				ShmOCPP16Data->SpMsg.bits.AuthorizeReq = ON;
 				DEBUG_INFO("Test authentication by %s.\n", ShmSysConfigAndInfo->SysConfig.UserId);
 			}
-			else if(strcmp(cmd, "ccs") == 0)
-			{
-				memset(cmd, 0x00, ARRAY_SIZE(cmd));
-				printf("\n  Please input gun index(1~2): ");
-				scanf("%s", &cmd[0]);
-
-				if((0 < atoi(cmd)) && (atoi(cmd) < 3))
-				{
-					uint8_t gun_index = atoi(cmd)-1;
-					memset(cmd, 0x00, ARRAY_SIZE(cmd));
-					printf("\n ***** ccs ****************************************");
-					printf("\n  ccs_hs_status: CCS hand shake status.");
-					printf("\n  cancel: return to main menu.");
-					printf("\n **************************************************");
-					printf("\n  Please input operation item: ");
-					scanf("%s", &cmd[0]);
-
-					if(strcmp(cmd, "ccs_hs_status") == 0)
-					{
-						printf("\n ***** ccs_hs_status *******************************");
-						printf("\n  Current ccs_hs_status: %d", ShmCharger->gun_info[gun_index].ccsHandshakeState);
-						printf("\n  1: HANDSHAKE_DUTY_5.");
-						printf("\n  2: HANDSHAKE_DUTY_5_CHECK.");
-						printf("\n  3: HANDSHAKE_CCS.");
-						printf("\n  4: HANDSHAKE_CP_STATE_E.");
-						printf("\n  5: HANDSHAKE_SET_MAX_CURRENT.");
-						printf("\n  6: HANDSHAKE_BS_MODE.");
-						printf("\n  7: HANDSHAKE_HLC_MODE.");
-						printf("\n **************************************************");
-						printf("\n  Please input operation item: ");
-						scanf("%s", &cmd[0]);
-
-						if((0 < atoi(cmd)) && (atoi(cmd) < 9))
-						{
-							ShmCharger->gun_info[gun_index].ccsHandshakeState = atoi(cmd);
-							DEBUG_INFO("Gun-%d CCS hand shake state: %d.\n", gun_index, ShmCharger->gun_info[gun_index].ccsHandshakeState);
-						}
-						else
-							printf("\n  Invalid hand shake state.");
-					}
-				}
-				else
-				{
-					printf("\n  Invalid input gun_index.");
-				}
-			}
 			else if(strcmp(cmd, "alarm") == 0)
 			{
 				memset(cmd, 0x00, ARRAY_SIZE(cmd));
@@ -885,8 +838,8 @@ int main(void)
 
 					while(1)
 					{
-						ShmCharger->gun_info[atoi(cmd)-1].systemAlarmCode.SystemAlarmCode |= ALARM_L1_OVER_VOLTAGE;
-						ShmCharger->gun_info[atoi(cmd)-1].primaryMcuAlarm.InputAlarmCode |= ALARM_L1_OVER_VOLTAGE;
+						ShmCharger->gun_info[atoi(cmd)-1].systemAlarmCode.SystemAlarmCode |= ALARM_OVER_VOLTAGE;
+						ShmCharger->gun_info[atoi(cmd)-1].primaryMcuAlarm.InputAlarmCode |= ALARM_OVER_VOLTAGE;
 					}
 				}
 				else

+ 1 - 0
EVSE/rootfs/etc/resolv.conf

@@ -1 +1,2 @@
 nameserver 8.8.8.8
+options timeout:0 attempts:1 rotate single-request-reopen

+ 1 - 0
EVSE/rootfs/root/dhcp_script/eth0.script

@@ -34,6 +34,7 @@ case "$1" in
 		done
 		echo nameserver 8.8.8.8 >> $RESOLV_CONF
 		echo nameserver 180.76.76.76 >> $RESOLV_CONF
+		echo options timeout:0 attempts:1 rotate single-request-reopen >> $RESOLV_CONF
 		;;
 esac
 

+ 1 - 0
EVSE/rootfs/root/dhcp_script/eth1.script

@@ -34,6 +34,7 @@ case "$1" in
 		done
 		echo nameserver 8.8.8.8 >> $RESOLV_CONF
 		echo nameserver 180.76.76.76 >> $RESOLV_CONF
+		echo options timeout:0 attempts:1 rotate single-request-reopen >> $RESOLV_CONF
 		;;
 esac
 

+ 1 - 0
EVSE/rootfs/root/dhcp_script/wifi.script

@@ -34,6 +34,7 @@ case "$1" in
 		done
 		echo nameserver 8.8.8.8 >> $RESOLV_CONF
 		echo nameserver 180.76.76.76 >> $RESOLV_CONF
+		echo options timeout:0 attempts:1 rotate single-request-reopen >> $RESOLV_CONF
 		;;
 esac