iowfehu;gdbjwHJAOPIHO?L

Fork of X_NUCLEO_IDW01M1 by ST

Revision:
7:0fdd186a7d90
Parent:
6:e7a3fca2df10
Child:
8:0f302a13e21b
--- a/Spwf/wifi_interface.c	Mon May 09 10:38:22 2016 +0000
+++ b/Spwf/wifi_interface.c	Wed May 11 06:12:16 2016 +0000
@@ -612,6 +612,11 @@
 WiFi_Status_t wifi_socket_server_open(uint32_t port_number, uint8_t * protocol) 
 {
 WiFi_Status_t status = WiFi_MODULE_SUCCESS;
+
+//Wait till all queued events are executed
+while(!event_empty(&event_buff));
+Wait_For_Sock_Read_To_Complete();
+
 Reset_AT_CMD_Buffer();
 
 /* AT+S.SOCKD=portNo,t<cr> */  
@@ -635,6 +640,11 @@
 WiFi_Status_t wifi_socket_server_close() 
 {
 WiFi_Status_t status = WiFi_MODULE_SUCCESS;
+
+//Wait till all queued events are executed
+while(!event_empty(&event_buff));
+Wait_For_Sock_Read_To_Complete();
+
 Reset_AT_CMD_Buffer();
 
 /* AT+S.SOCKD=portNo,t<cr> */