FastLED 3.10.6
Loading...
Searching...
No Matches
wifi.h File Reference

Detailed Description

fl::net::wifi — platform-neutral WiFi connection API (FastLED#3576 Phase 6).

FastLED previously had no reusable connection manager: the only credential-taking API was OTA-scoped (fl::net::OTA::beginWiFi) and examples hand-rolled esp_wifi_* calls. This header is the fl-level surface for bringing a network interface up so the rest of fl::net (fetch, HTTP server, remote RPC) has something to run on.

All calls are asynchronous and non-blocking: connectSta() starts a join and returns; poll status() / isConnected(). On platforms without WiFi (host builds, WiFi-less MCUs like ESP32-H2) every call is a no-op stub that reports Status::UNSUPPORTED.

Bluetooth connections live in the sibling fl::net::ble API (GATT transport: createTransport / queryStatus).

Definition in file wifi.h.

#include "fl/stl/noexcept.h"
#include "fl/stl/string.h"
#include "fl/stl/int.h"
#include "fl/stl/has_include.h"
#include "platforms/is_platform.h"
+ Include dependency graph for wifi.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  fl
 Base definition for an LED controller.
 
namespace  fl::net
 
namespace  fl::net::wifi
 

Macros

#define FL_WIFI_AVAILABLE   0
 1 when a real WiFi implementation is compiled in; 0 → stubs.
 

Enumerations

enum class  fl::net::wifi::Status : u8 {
  fl::net::wifi::UNSUPPORTED = 0 , fl::net::wifi::IDLE , fl::net::wifi::CONNECTING , fl::net::wifi::CONNECTED ,
  fl::net::wifi::FAILED , fl::net::wifi::AP_ACTIVE
}
 Connection state, advanced by the platform's event handlers. More...
 

Functions

fl::string fl::net::wifi::apIpAddress () FL_NO_EXCEPT
 Dotted-quad IP of the SoftAP interface ("" when AP is down).
 
bool fl::net::wifi::connectSta (const char *ssid, const char *password) FL_NO_EXCEPT
 Start an asynchronous station-mode join.
 
fl::string fl::net::wifi::ipAddress () FL_NO_EXCEPT
 Dotted-quad IP of the station interface ("" until connected).
 
bool fl::net::wifi::isConnected () FL_NO_EXCEPT
 True when the station interface has an IP.
 
bool fl::net::wifi::startAp (const char *ssid, const char *password, u8 channel) FL_NO_EXCEPT
 Bring up a SoftAP.
 
Status fl::net::wifi::status () FL_NO_EXCEPT
 Current connection state.
 
void fl::net::wifi::stop () FL_NO_EXCEPT
 Stop WiFi entirely (STA and AP).
 
const char * fl::net::wifi::toString (Status s) FL_NO_EXCEPT
 Human-readable name for a Status value.