Repository navigation
feat(net): fl::net::wifi connection API + netActivity RPC (#3576 Phase 6) - #3584
Merged
Merged
Conversation
…e 6)
FastLED had no reusable network connection manager: the only
credential-taking API was OTA-scoped (OTA::beginWiFi) and examples
hand-rolled esp_wifi_* calls. This adds the fl-level WiFi connection
surface the rest of fl::net (fetch, HTTP server, remote RPC) runs on,
plus the network-activity RPC for the dual-device bench.
fl::net::wifi (src/fl/net/wifi.h):
- connectSta(ssid, pass): async station join; poll status()/
isConnected(). Event-driven state machine (CONNECTING -> CONNECTED on
GOT_IP; bounded 6-retry reconnect then FAILED).
- startAp(ssid, pass, channel): SoftAP (WPA2 when pass >= 8 chars,
open otherwise); coexists with STA (APSTA).
- stop() / status() / ipAddress() / apIpAddress(); toString(Status).
- FL_WIFI_AVAILABLE: FL_IS_ESP32 && SOC_WIFI_SUPPORTED &&
FL_HAS_INCLUDE(<esp_wifi.h>). Real impl in
platforms/esp/32/net/wifi_esp32.cpp.hpp; every other platform
(host, WiFi-less MCUs like ESP32-H2) gets safe no-op stubs reporting
Status::UNSUPPORTED — same split as fl/net/ble.
- Bluetooth connections remain the existing fl::net::ble GATT
transport API (createTransport/queryStatus).
AutoResearch RPC (dual-device bench prep):
- wifiConnect {ssid,password} / wifiAp {ssid,password,channel} /
wifiStatus / wifiStop — thin wrappers over fl::net::wifi.
- netActivity — NetworkDetector snapshot (wifiActive, wifiConnected,
bluetoothActive, anyNetworkActive/Connected) + wifi status string;
this is the detector the LED drivers consult for deep-yield.
Verified on WROOM bench: netActivity IDLE -> wifiAp (192.168.4.1,
detector flips wifiActive/anyNetworkActive true) -> AP_ACTIVE ->
wifiStop -> IDLE; RMT regression 4/4. Host: 346/346 (new stub-contract
+ toString tests), lint clean. Compile matrix unaffected (H2 keeps
stubs via SOC_WIFI_SUPPORTED gate).
Co-Authored-By: Claude Fable 5 <[email protected]>
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase 6 of #3576: the fl-level WiFi connection API (explicit program goal: "FastLED should implement the APIs for connection for WiFi and Bluetooth") and the network-activity RPC for the dual-device bench.
fl::net::wifi(src/fl/net/wifi.h)connectSta(ssid, pass)— asynchronous station join; pollstatus()/isConnected(). Event-driven state machine: CONNECTING → CONNECTED on GOT_IP, bounded 6-retry reconnect, then FAILED.startAp(ssid, pass, channel)— SoftAP (WPA2 with ≥8-char pass, open otherwise); APSTA coexistence with a station join.stop(),status(),ipAddress(),apIpAddress(),toString(Status).FL_WIFI_AVAILABLE=FL_IS_ESP32 && SOC_WIFI_SUPPORTED && FL_HAS_INCLUDE(<esp_wifi.h>). Real implementation inplatforms/esp/32/net/wifi_esp32.cpp.hpp; all other platforms (host, WiFi-less MCUs like ESP32-H2) get safe no-op stubs reportingStatus::UNSUPPORTED— same real/stub split asfl/net/ble.fl::net::bleGATT transport API already covers create/status/teardown; documented as the BLE counterpart.AutoResearch RPC (dual-device prep)
wifiConnect/wifiAp/wifiStatus/wifiStop+netActivity(NetworkDetector snapshot: wifiActive, wifiConnected, bluetoothActive, anyNetworkActive/Connected — the same detector the LED drivers consult for deep-yield decisions).Verification
netActivityIDLE →wifiApbrings up 192.168.4.1 and flips the detector (wifiActive:true,anyNetworkActive:true) →wifiStatusAP_ACTIVE →wifiStop→ IDLE. RMT regression 4/4.Refs #3576.
🤖 Generated with Claude Code