added setting for delayed AP disable
This commit is contained in:
parent
114321c91b
commit
096cb60633
|
|
@ -167,7 +167,8 @@ typedef struct
|
|||
bool bIsDHCPEnabled;
|
||||
bool bIsWiFiEnabled;
|
||||
} Flags1; // Flag structure
|
||||
uint8_t MaxPower;
|
||||
int MaxPower;
|
||||
int AP_disab_time;
|
||||
} wifiSettings;
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -464,12 +464,14 @@ const rest_var_t SystemVariables[] =
|
|||
{ 0, "wifi_enab", &SysConfig.wifiSettings.Flags1.bIsWiFiEnabled, VAR_BOOL, RW, 0, 1 },
|
||||
{ 0, "wifi_isdhcp", &SysConfig.wifiSettings.Flags1.bIsDHCPEnabled, VAR_BOOL, RW, 0, 1 },
|
||||
{ 0, "wifi_power", &SysConfig.wifiSettings.MaxPower, VAR_INT, RW, 0, 80 },
|
||||
{ 0, "wifi_disab_time", &SysConfig.wifiSettings.AP_disab_time, VAR_INT, RW, 0, 60 },
|
||||
{ 0, "wifi_sta_mac", &funct_wifi_sta_mac, VAR_FUNCT, R, 0, 0 },
|
||||
{ 0, "wifi_ap_mac", &funct_wifi_ap_mac, VAR_FUNCT, R, 0, 0 },
|
||||
{ 0, "wifi_stat", &funct_wifi_stat, VAR_FUNCT, R, 0, 0 },
|
||||
{ 0, "wifi_scan", &funct_wifiscan, VAR_FUNCT, R, 0, 0 },
|
||||
{ 0, "wifi_scan_res", &funct_wifiscanres, VAR_FUNCT, R, 0, 0 },
|
||||
{ 0, "wifi_level", &funct_wifi_level, VAR_FUNCT, R, 0, 0 },
|
||||
|
||||
#endif
|
||||
|
||||
#if CONFIG_WEBGUIAPP_GPRS_ENABLE
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ static void ResetSysConfig(SYS_CONFIG *Conf)
|
|||
esp_netif_str_to_ip4(CONFIG_WEBGUIAPP_DNS3_ADDRESS_DEFAULT,
|
||||
(esp_ip4_addr_t*) &Conf->wifiSettings.DNSAddr3);
|
||||
Conf->wifiSettings.MaxPower = 80;
|
||||
Conf->wifiSettings.AP_disab_time = 10;
|
||||
#endif
|
||||
|
||||
#if CONFIG_WEBGUIAPP_ETHERNET_ENABLE
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ static bool isWiFiRunning = false;
|
|||
static bool isWiFiConnected = false;
|
||||
static bool isWiFiGotIp = false;
|
||||
static bool isWiFiFail = false;
|
||||
static int TempAPCounter = WIFI_AP_ONBOOT_TIME;
|
||||
static int TempAPCounter = 0;
|
||||
|
||||
#define DEFAULT_SCAN_LIST_SIZE 20
|
||||
static wifi_ap_record_t ap_info[DEFAULT_SCAN_LIST_SIZE];
|
||||
|
|
@ -508,6 +508,7 @@ static void WiFiControlTask(void *arg)
|
|||
}
|
||||
isWiFiRunning = true;
|
||||
//WiFi in work service
|
||||
TempAPCounter = GetSysConf()->wifiSettings.AP_disab_time * 60;
|
||||
while (isWiFiRunning)
|
||||
{
|
||||
vTaskDelay(pdMS_TO_TICKS(1000));
|
||||
|
|
@ -538,7 +539,7 @@ static void WiFiControlTask(void *arg)
|
|||
if (--TempAPCounter <= 0)
|
||||
{
|
||||
if (GetAPClientsNumber() > 0)
|
||||
TempAPCounter = WIFI_AP_ONBOOT_TIME;
|
||||
TempAPCounter = GetSysConf()->wifiSettings.AP_disab_time * 60;
|
||||
else
|
||||
{
|
||||
WiFiStopAP();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user