added function to enable power saving mode for es_wifi driver (Inventek Systems ISM43362-M3G-L44 )
Fork of DISCO_L475VG_IOT01A_wifi by
Diff: es_wifi.c
- Revision:
- 1:b37920c1ddb9
- Parent:
- 0:c61a93635433
- Child:
- 2:9bbbcd0eff1c
--- a/es_wifi.c Thu Aug 17 15:26:02 2017 +0000 +++ b/es_wifi.c Tue Dec 19 19:29:15 2017 +0000 @@ -845,6 +845,25 @@ } /** + * @brief Enter power save mode. + * @param beacon_int: + * @param sleep_ms: + * @retval Operation Status. + */ + +ES_WIFI_Status_t ES_WIFI_SetPowerSaveMode(ES_WIFIObject_t *Obj, uint8_t beacon_int, uint16_t sleep_ms) +{ + ES_WIFI_Status_t ret; + sprintf((char*)Obj->CmdData,"ZP=2,%d\r", beacon_int); + ret = AT_ExecuteCommand(Obj, Obj->CmdData, Obj->CmdData); + if(ret == ES_WIFI_STATUS_OK) { + sprintf((char*)Obj->CmdData,"ZP=6,%d\r", sleep_ms); + ret = AT_ExecuteCommand(Obj, Obj->CmdData, Obj->CmdData); + } + return ret; +} + +/** * @brief Check whether the module is connected to an access point. * @retval Operation Status. */