Harden Host AP startup and event lifecycle - #1434
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1434 +/- ##
==========================================
- Coverage 0.40% 0.40% -0.01%
==========================================
Files 20 20
Lines 17176 17239 +63
Branches 11 11
==========================================
Hits 69 69
- Misses 17103 17166 +63
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This pull request hardens the ESP32 Marauder Host AP (SoftAP) startup path and aligns AP-related WiFi event callback registration/unregistration with the AP lifecycle, while also correcting which IP/MAC values are reported when running in AP mode.
Changes:
- Adds explicit SoftAP start-result handling, including failure reporting and cleanup when
WiFi.softAP()fails. - Updates network info reporting to use AP IP/MAC values when in AP mode, and adjusts UI messaging accordingly.
- Introduces explicit register/unregister helpers for WiFi event callbacks and ties them to AP start/stop paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| esp32_marauder/WiFiScan.h | Adds state + helper declarations for managing WiFi event handler registration. |
| esp32_marauder/WiFiScan.cpp | Implements AP-aware network info reporting, SoftAP start failure handling, and lifecycle-managed event handler registration/unregistration. |
| esp32_marauder/MenuFunctions.cpp | Adds a touch acknowledgement helper and surfaces AP start failure feedback in the touch UI flow. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Suppressed comments (2)
esp32_marauder/WiFiScan.cpp:2255
- On SoftAP startup failure, the code stops the AP and clears state but leaves the Arduino WiFi stack in AP mode (since
WiFi.mode(WIFI_MODE_AP)was set earlier). This can keep the radio configured/on unexpectedly and make later mode checks misleading. Consider explicitly turning WiFi off (or restoring the prior mode) on this failure path, consistent withshutdownWiFi()usingWiFi.mode(WIFI_OFF)for cleanup.
this->unregisterWiFiEventHandler();
WiFi.softAPdisconnect(true);
this->connected_network = "";
esp32_marauder/MenuFunctions.cpp:2587
startWiFi()now returnsfalsewhen SoftAP startup fails, but only the touch-keyboard path handles that failure. The HAS_MINI_KB path a few lines above still callswifi_scan_obj.startWiFi(...)without checking the return value and immediately changes menus, which can hide the failure and leave the UI implying the AP started. Consider adding an equivalent acknowledgement/handling for the mini keyboard flow as well (not just the touch flow).
const bool access_point_started = wifi_scan_obj.startWiFi(ssids->get(i).essid, String(passwordBuf));
if (!access_point_started)
waitForTouchAcknowledgement("AP start failed");
|
All 22 firmware matrix builds and the Native Unity tests pass on this head. The remaining red statuses are limited to the repository-wide Codecov policy addressed separately in #1448. |
Summary
WiFi.softAP()result and keep failures visible until acknowledgedTesting