FastLED 3.10.6
Loading...
Searching...
No Matches
wifi.h
Go to the documentation of this file.
1
18
19#pragma once
20
21#include "fl/stl/noexcept.h"
22#include "fl/stl/string.h"
23#include "fl/stl/int.h"
24
25#include "fl/stl/has_include.h"
26#include "platforms/is_platform.h"
27
28#ifdef FL_IS_ESP32
29#if FL_HAS_INCLUDE("soc/soc_caps.h")
30// IWYU pragma: begin_keep
31#include "soc/soc_caps.h" // ok platform headers - SOC_WIFI_SUPPORTED for FL_WIFI_AVAILABLE
32// IWYU pragma: end_keep
33#endif
34#endif
35
37#if (defined(FL_IS_ESP32) && defined(SOC_WIFI_SUPPORTED) && SOC_WIFI_SUPPORTED && \
38 FL_HAS_INCLUDE(<esp_wifi.h>)) || \
39 (defined(FL_IS_RP2350) && defined(PICO_CYW43_SUPPORTED) && \
40 FL_HAS_INCLUDE(<WiFi.h>))
41#define FL_WIFI_AVAILABLE 1
42#else
43#define FL_WIFI_AVAILABLE 0
44#endif
45
46namespace fl {
47namespace net {
48namespace wifi {
49
59
61const char* toString(Status s) FL_NO_EXCEPT;
62
69bool connectSta(const char* ssid, const char* password) FL_NO_EXCEPT;
70
74bool startAp(const char* ssid, const char* password, u8 channel) FL_NO_EXCEPT;
75
77void stop() FL_NO_EXCEPT;
78
81
84
86fl::string ipAddress() FL_NO_EXCEPT;
87
90
91} // namespace wifi
92} // namespace net
93} // namespace fl
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