feat(control_plane): reduce light standby runtime power
This commit is contained in:
@@ -345,6 +345,8 @@ void platform_wifi_portal_set_behavior_hooks(const platform_wifi_behavior_hooks_
|
||||
esp_err_t platform_wifi_portal_init_defaults(const char *seed_ssid, const char *seed_password);
|
||||
bool platform_wifi_portal_has_saved_credentials(void);
|
||||
bool platform_wifi_portal_sta_is_connected(void);
|
||||
/** Apply standby modem power save, or restore the configured active policy. */
|
||||
esp_err_t platform_wifi_portal_set_light_standby(bool standby);
|
||||
esp_err_t platform_wifi_portal_start_config_ap(const char *ssid_prefix);
|
||||
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,11 @@
|
||||
#include "wifi_portal.h"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "sdkconfig.h"
|
||||
|
||||
#ifndef CONFIG_TQ_WIFI_STA_POWER_SAVE
|
||||
#define CONFIG_TQ_WIFI_STA_POWER_SAVE 0
|
||||
#endif
|
||||
|
||||
static platform_wifi_behavior_hooks_t s_wifi_behavior_hooks;
|
||||
static SemaphoreHandle_t s_wifi_behavior_hooks_mutex;
|
||||
@@ -128,6 +133,13 @@ bool platform_wifi_portal_sta_is_connected(void)
|
||||
return wifi_portal_sta_is_connected();
|
||||
}
|
||||
|
||||
esp_err_t platform_wifi_portal_set_light_standby(bool standby)
|
||||
{
|
||||
wifi_ps_type_t ps_type = standby ? WIFI_PS_MIN_MODEM :
|
||||
(CONFIG_TQ_WIFI_STA_POWER_SAVE ? WIFI_PS_MIN_MODEM : WIFI_PS_NONE);
|
||||
return esp_wifi_set_ps(ps_type);
|
||||
}
|
||||
|
||||
esp_err_t platform_wifi_portal_start_config_ap(const char *ssid_prefix)
|
||||
{
|
||||
return wifi_portal_start_config_ap(ssid_prefix);
|
||||
|
||||
Reference in New Issue
Block a user