mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-31 07:03:55 +00:00 
			
		
		
		
	Improve WiFi disconnect messages (#857)
* Improve WiFi disconnect messages * Fix * Update wifi_component_esp32.cpp
This commit is contained in:
		| @@ -329,8 +329,12 @@ void WiFiComponent::wifi_event_callback_(system_event_id_t event, system_event_i | |||||||
|       char buf[33]; |       char buf[33]; | ||||||
|       memcpy(buf, it.ssid, it.ssid_len); |       memcpy(buf, it.ssid, it.ssid_len); | ||||||
|       buf[it.ssid_len] = '\0'; |       buf[it.ssid_len] = '\0'; | ||||||
|       ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=" LOG_SECRET("%s") " reason=%s", buf, |       if (it.reason == WIFI_REASON_NO_AP_FOUND) { | ||||||
|                format_mac_addr(it.bssid).c_str(), get_disconnect_reason_str(it.reason)); |         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' reason='Probe Request Unsuccessful'", buf); | ||||||
|  |       } else { | ||||||
|  |         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=" LOG_SECRET("%s") " reason='%s'", buf, | ||||||
|  |                  format_mac_addr(it.bssid).c_str(), get_disconnect_reason_str(it.reason)); | ||||||
|  |       } | ||||||
|       break; |       break; | ||||||
|     } |     } | ||||||
|     case SYSTEM_EVENT_STA_AUTHMODE_CHANGE: { |     case SYSTEM_EVENT_STA_AUTHMODE_CHANGE: { | ||||||
|   | |||||||
| @@ -330,8 +330,12 @@ void WiFiComponent::wifi_event_callback(System_Event_t *event) { | |||||||
|       char buf[33]; |       char buf[33]; | ||||||
|       memcpy(buf, it.ssid, it.ssid_len); |       memcpy(buf, it.ssid, it.ssid_len); | ||||||
|       buf[it.ssid_len] = '\0'; |       buf[it.ssid_len] = '\0'; | ||||||
|       ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=%s reason='%s'", buf, format_mac_addr(it.bssid).c_str(), |       if (it.reason == REASON_NO_AP_FOUND) { | ||||||
|                get_disconnect_reason_str(it.reason)); |         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' reason='Probe Request Unsuccessful'", buf); | ||||||
|  |       } else { | ||||||
|  |         ESP_LOGW(TAG, "Event: Disconnected ssid='%s' bssid=" LOG_SECRET("%s") " reason='%s'", buf, | ||||||
|  |                  format_mac_addr(it.bssid).c_str(), get_disconnect_reason_str(it.reason)); | ||||||
|  |       } | ||||||
|       break; |       break; | ||||||
|     } |     } | ||||||
|     case EVENT_STAMODE_AUTHMODE_CHANGE: { |     case EVENT_STAMODE_AUTHMODE_CHANGE: { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user