Jaafar Benabdallah / DISCO_L475VG_IOT01A_wifi

Fork of DISCO_L475VG_IOT01A_wifi by ST

Revision:
1:b37920c1ddb9
Parent:
0:c61a93635433
Child:
2:9bbbcd0eff1c
--- a/wifi.c	Thu Aug 17 15:26:02 2017 +0000
+++ b/wifi.c	Tue Dec 19 19:29:15 2017 +0000
@@ -129,14 +129,27 @@
   {
     if(ES_WIFI_GetNetworkSettings(&EsWifiObj) == ES_WIFI_STATUS_OK)
     {
-       ret = WIFI_STATUS_OK;
+        ret = WIFI_STATUS_OK;
     }
-    
   }
   return ret;
 }
 
 /**
+  * @brief  This function put the es-wifi module in power save mode
+  * @param  beacon_int: beacon interval in sec (typ. 1, 5, 10)
+  * @param  sleep_ms: time in ms spent in sleep mode (typically: 1000ms -> 5000ms)
+  * @retval Operation Status.
+  */
+WIFI_Status_t WIFI_SetPowerSaveMode(uint8_t beacon_int, uint16_t sleep_ms) {
+    WIFI_Status_t ret = WIFI_STATUS_ERROR;
+    if(ES_WIFI_SetPowerSaveMode(&EsWifiObj, beacon_int, sleep_ms) == ES_WIFI_STATUS_OK) {
+        ret = WIFI_STATUS_OK;
+    }
+    return ret;
+}   
+    
+/**
   * @brief  This function retrieves the WiFi interface's MAC address.
   * @retval Operation Status.
   */