|
@@ -34,7 +34,7 @@
|
|
|
#define TIMEOUT_SPEC_POWERSAVING_METER 120
|
|
|
#define TIMEOUT_SPEC_POWERSAVING_LED_STATUS 120
|
|
|
#define TIMEOUT_SPEC_CEHCK_POWER_CONSUMPTION 15
|
|
|
-#define TIMEOUT_SPEC_RESET_WIFI_MODULE 300
|
|
|
+#define TIMEOUT_SPEC_RESET_WIFI_MODULE 180
|
|
|
|
|
|
//==========================
|
|
|
// GPIO constant define
|
|
@@ -2578,23 +2578,53 @@ void InitEthernet()
|
|
|
}
|
|
|
|
|
|
// Reset wifi function
|
|
|
- if((!ShmSysConfigAndInfo->SysInfo.OcppConnStatus) &&
|
|
|
- (ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi == ON) &&
|
|
|
- (ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == 1))
|
|
|
+ if((ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == 1))
|
|
|
{
|
|
|
- if((getDiffSecNow(startTime[0][TMR_IDX_RESET_WIFI]) > TIMEOUT_SPEC_RESET_WIFI_MODULE))
|
|
|
+ if((!ShmSysConfigAndInfo->SysInfo.OcppConnStatus) &&
|
|
|
+ (ShmStatusCodeData->InfoCode.InfoEvents.bits.InternetDisconnectViaWiFi == ON) &&
|
|
|
+ (ShmStatusCodeData->InfoCode.InfoEvents.bits.ApDisconnectViaWiFi == ON))
|
|
|
{
|
|
|
- DEBUG_INFO("Reset wifi power. \n");
|
|
|
- DEBUG_INFO("The wifi interface may not be found. \n");
|
|
|
-
|
|
|
- system("echo 1 > /sys/class/gpio/gpio59/value");
|
|
|
- sleep(3);
|
|
|
- system("echo 0 > /sys/class/gpio/gpio59/value");
|
|
|
+ if((getDiffSecNow(startTime[0][TMR_IDX_RESET_WIFI]) > TIMEOUT_SPEC_RESET_WIFI_MODULE))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("Wifi [Station] mode: Reset wifi power. \n");
|
|
|
+ DEBUG_INFO("The wifi interface may not be found. \n");
|
|
|
+
|
|
|
+ system("echo 1 > /sys/class/gpio/gpio59/value");
|
|
|
+ sleep(3);
|
|
|
+ system("echo 0 > /sys/class/gpio/gpio59/value");
|
|
|
|
|
|
+ refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {}
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if((ShmSysConfigAndInfo->SysConfig.AthInterface.WifiMode == 2))
|
|
|
+ {
|
|
|
+ if((ShmStatusCodeData->InfoCode.InfoEvents.bits.ApDisconnectViaWiFi == ON))
|
|
|
+ {
|
|
|
+ if((getDiffSecNow(startTime[0][TMR_IDX_RESET_WIFI]) > TIMEOUT_SPEC_RESET_WIFI_MODULE))
|
|
|
+ {
|
|
|
+ DEBUG_INFO("Wifi [Access Point] mode: reset wifi power. \n");
|
|
|
+ DEBUG_INFO("The wifi interface may not be found. \n");
|
|
|
+
|
|
|
+ system("echo 1 > /sys/class/gpio/gpio59/value");
|
|
|
+ sleep(3);
|
|
|
+ system("echo 0 > /sys/class/gpio/gpio59/value");
|
|
|
+
|
|
|
+ refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {}
|
|
|
}
|
|
|
else
|
|
|
- {}
|
|
|
+ {
|
|
|
+ refreshStartTimer(&startTime[0][TMR_IDX_RESET_WIFI]);
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|