chore: Update esp-wifi-connect version in idf_component.yml and refactor event callback in WifiBoard class

- Bumped esp-wifi-connect version from ~3.0.2 to ~3.1.1 in idf_component.yml.
- Refactored the event callback in WifiBoard to use a string parameter for SSID data, improving clarity and consistency in network event handling.
This commit is contained in:
Terrence
2026-02-15 20:34:46 +08:00
parent 8e34995944
commit 2384275c34
2 changed files with 4 additions and 5 deletions

View File

@@ -59,17 +59,16 @@ void WifiBoard::StartNetwork() {
wifi_manager.Initialize(config);
// Set unified event callback - forward to NetworkEvent with SSID data
wifi_manager.SetEventCallback([this, &wifi_manager](WifiEvent event) {
std::string ssid = wifi_manager.GetSsid();
wifi_manager.SetEventCallback([this](WifiEvent event, const std::string& data) {
switch (event) {
case WifiEvent::Scanning:
OnNetworkEvent(NetworkEvent::Scanning);
break;
case WifiEvent::Connecting:
OnNetworkEvent(NetworkEvent::Connecting, ssid);
OnNetworkEvent(NetworkEvent::Connecting, data);
break;
case WifiEvent::Connected:
OnNetworkEvent(NetworkEvent::Connected, ssid);
OnNetworkEvent(NetworkEvent::Connected, data);
break;
case WifiEvent::Disconnected:
OnNetworkEvent(NetworkEvent::Disconnected);

View File

@@ -19,7 +19,7 @@ dependencies:
waveshare/custom_io_expander_ch32v003: ^1.0.0
espressif/esp_lcd_panel_io_additions: ^1.0.1
78/esp_lcd_nv3023: ~1.0.0
78/esp-wifi-connect: ~3.0.2
78/esp-wifi-connect: ~3.1.1
espressif/esp_audio_effects: ~1.2.1
espressif/esp_audio_codec: ~2.4.1
78/esp-ml307: ~3.6.4