[wifi] Avoid BDK 3.0.78 wifi_event_sta_disconnected_t collision on BK72xx

BDK 3.0.78 (required by LibreTiny for BK7238 support, see
libretiny-eu/libretiny#360) declares wifi_event_sta_disconnected_t in
wlan_defs_pub.h, which collides with the identically named typedef in
LibreTiny's Arduino WiFi API (WiFiEvents.h). Rename the BDK version
across the include so both headers can coexist. ESPHome only uses
bk_wlan_get_link_status from this header and doesn't reference the
renamed type.

The rename is a no-op on BDK 3.0.33 (BK7231T/N) since that version
doesn't declare the typedef.
This commit is contained in:
J. Nick Koston
2026-04-23 04:22:16 -05:00
parent 43a371caab
commit b4206f94bc
@@ -12,7 +12,12 @@
#ifdef USE_BK72XX
extern "C" {
// BDK 3.0.78 (required for BK7238) redeclares wifi_event_sta_disconnected_t,
// which LibreTiny's Arduino WiFi API already defines. ESPHome doesn't use the
// BDK version, so rename it across this include to avoid the collision.
#define wifi_event_sta_disconnected_t bdk_wifi_event_sta_disconnected_t
#include <wlan_ui_pub.h>
#undef wifi_event_sta_disconnected_t
}
#endif