FastLED 3.10.6
Loading...
Searching...
No Matches
wifi.cpp.hpp
Go to the documentation of this file.
1// IWYU pragma: private
2// src/fl/net/wifi.cpp.hpp
3//
4// Stub implementations for platforms without WiFi support. On WiFi
5// silicon the real implementation is compiled via the platform build
6// chain (platforms/esp/32/net/_build.cpp.hpp). Same split as
7// fl/net/ble.cpp.hpp.
8
9#pragma once
10
11#include "fl/net/wifi.h"
12#include "fl/stl/noexcept.h"
13
14namespace fl {
15namespace net {
16namespace wifi {
17
19 switch (s) {
20 case Status::UNSUPPORTED: return "UNSUPPORTED";
21 case Status::IDLE: return "IDLE";
22 case Status::CONNECTING: return "CONNECTING";
23 case Status::CONNECTED: return "CONNECTED";
24 case Status::FAILED: return "FAILED";
25 case Status::AP_ACTIVE: return "AP_ACTIVE";
26 }
27 return "UNKNOWN";
28}
29
30} // namespace wifi
31} // namespace net
32} // namespace fl
33
34#if !FL_WIFI_AVAILABLE
35
36namespace fl {
37namespace net {
38namespace wifi {
39
40bool connectSta(const char*, const char*) FL_NO_EXCEPT { return false; }
41bool startAp(const char*, const char*, u8) FL_NO_EXCEPT { return false; }
44bool isConnected() FL_NO_EXCEPT { return false; }
47
48} // namespace wifi
49} // namespace net
50} // namespace fl
51
52#endif // !FL_WIFI_AVAILABLE
bool isConnected() FL_NO_EXCEPT
True when the station interface has an IP.
Definition wifi.cpp.hpp:44
const char * toString(Status s) FL_NO_EXCEPT
Human-readable name for a Status value.
Definition wifi.cpp.hpp:18
void stop() FL_NO_EXCEPT
Stop WiFi entirely (STA and AP).
Definition wifi.cpp.hpp:42
bool startAp(const char *, const char *, u8) FL_NO_EXCEPT
Bring up a SoftAP.
Definition wifi.cpp.hpp:41
Status status() FL_NO_EXCEPT
Current connection state.
Definition wifi.cpp.hpp:43
bool connectSta(const char *, const char *) FL_NO_EXCEPT
Start an asynchronous station-mode join.
Definition wifi.cpp.hpp:40
fl::string ipAddress() FL_NO_EXCEPT
Dotted-quad IP of the station interface ("" until connected).
Definition wifi.cpp.hpp:45
Status
Connection state, advanced by the platform's event handlers.
Definition wifi.h:51
@ UNSUPPORTED
No WiFi on this platform (stub build)
Definition wifi.h:52
@ AP_ACTIVE
SoftAP is up (no STA connection)
Definition wifi.h:57
@ CONNECTING
STA join in progress.
Definition wifi.h:54
@ CONNECTED
STA has an IP.
Definition wifi.h:55
@ IDLE
WiFi not started.
Definition wifi.h:53
@ FAILED
STA join gave up (bad credentials / no AP)
Definition wifi.h:56
fl::string apIpAddress() FL_NO_EXCEPT
Dotted-quad IP of the SoftAP interface ("" when AP is down).
Definition wifi.cpp.hpp:46
unsigned char u8
Definition stdint.h:131
InputGamut g FL_NO_EXCEPT
Definition rgbw.h:121
Base definition for an LED controller.
Definition crgb.hpp:179
fl::net::wifi — platform-neutral WiFi connection API (FastLED#3576 Phase 6).