main/task_wifi.c

changeset 23
58a328e91881
parent 0
88d965579617
child 24
64078aa15512
--- a/main/task_wifi.c	Thu Nov 07 11:47:15 2019 +0100
+++ b/main/task_wifi.c	Thu Nov 07 15:09:51 2019 +0100
@@ -135,7 +135,9 @@
                     wifi_state->STA_rssi = ap_info.rssi;
                     sprintf(wifi_state->STA_ssid, "%s", ap_info.ssid);
                     xSemaphoreGive(xSemaphoreWiFi);
-                }
+                } else {
+		    ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_STA_CONNECTED");
+		}
                 xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED);
                 xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_STA_DISCONNECTED);
 	    	break;
@@ -152,7 +154,9 @@
                     wifi_state->STA_online = false;
                     wifi_state->STA_rssi = 0;
                     xSemaphoreGive(xSemaphoreWiFi);
-                }
+                } else {
+		    ESP_LOGE(TAG, "wifi_event_handler() lock error WIFI_EVENT_STA_DISCONNECTED");
+		}
                 xEventGroupClearBits(xEventGroupWifi, TASK_WIFI_STA_CONNECTED);
                 xEventGroupSetBits(xEventGroupWifi, TASK_WIFI_STA_DISCONNECTED);
 		break;
@@ -179,6 +183,8 @@
                 snprintf(wifi_state->STA_nm, 16, "%s", ip4addr_ntoa(&event->ip_info.netmask));
                 snprintf(wifi_state->STA_gw, 16, "%s", ip4addr_ntoa(&event->ip_info.gw));
                 xSemaphoreGive(xSemaphoreWiFi);
+	    } else {
+		ESP_LOGE(TAG, "got_ip_event_handler() lock error IP_EVENT_STA_GOT_IP");
 	    }
 	    break;
 
@@ -191,6 +197,8 @@
                 wifi_state->STA_gw[0] = '\0';
                 wifi_state->STA_online = false;
                 xSemaphoreGive(xSemaphoreWiFi);
+            } else {
+                ESP_LOGE(TAG, "got_ip_event_handler() lock error IP_EVENT_STA_LOST_IP");
             }
 	    break;
 

mercurial