Turn the wifi radio power on or off while the device is in client STA operational mode.
WIFI_API int wifi_set_sta_power(bool on_off)
If true the power will be turned on, if false the power will be turned off.
The wifi_set_sta_power() function attempts to set the Wi-Fi radio power. When the device is in an operational mode other than client STA this function fails, errno is set to EBUSY, and the wifi power remains unchanged. Additional restrictions apply to power off requests if, for example, Wi-Fi is the default route for one of the perimeters, or if an application is explicitly bound to the Wi-Fi interface. In such cases the power off request fails and errno is set to EBUSY.
When the function returns successfully in response to a power-on request the device will operate in the client STA mode.
WIFI_SUCCESS upon success, WIFI_FAILURE with errno set otherwise.