FastLED 3.9.15
Loading...
Searching...
No Matches
network_detector.h
Go to the documentation of this file.
1#pragma once
2
24
25#include "platforms/is_platform.h"
26
27#if defined(FL_IS_ESP32)
28// IWYU pragma: begin_keep
29#include "platforms/esp/32/feature_flags/enabled.h" // ok platform headers
30// IWYU pragma: end_keep
31#endif
32
33// Use the real RMT5 implementation when available; otherwise fall through to
34// the stub below. The real header is itself wrapped in `#if FASTLED_RMT5`, so
35// including it on RMT4-only / non-ESP32 builds is harmless (the class
36// definition simply disappears).
37#if defined(FL_IS_ESP32) && FASTLED_RMT5
38// IWYU pragma: begin_keep
39#include "platforms/esp/32/drivers/rmt/rmt_5/network_detector.h" // ok platform headers
40// IWYU pragma: end_keep
41#define FL_NETWORK_DETECTOR_HAS_REAL_IMPL 1
42#else
43#define FL_NETWORK_DETECTOR_HAS_REAL_IMPL 0
44#endif
45
46#if !FL_NETWORK_DETECTOR_HAS_REAL_IMPL
47
48#include "fl/stl/noexcept.h"
49
50namespace fl {
51namespace net {
52
63 public:
64 static bool isWiFiActive() FL_NOEXCEPT { return false; }
65 static bool isWiFiConnected() FL_NOEXCEPT { return false; }
66 static bool isEthernetActive() FL_NOEXCEPT { return false; }
67 static bool isEthernetConnected() FL_NOEXCEPT { return false; }
68 static bool isBluetoothActive() FL_NOEXCEPT { return false; }
69 static bool isAnyNetworkActive() FL_NOEXCEPT { return false; }
70 static bool isAnyNetworkConnected() FL_NOEXCEPT { return false; }
71
72 private:
76 NetworkDetector &operator=(const NetworkDetector &) FL_NOEXCEPT = delete;
77};
78
79} // namespace net
80} // namespace fl
81
82// Back-compat: the existing channel wait sites and the real RMT5 impl both
83// expose the type as fl::NetworkDetector. Keep that name working in the
84// no-real-impl case via a using alias, so this PR is a pure lint fix with
85// no consumer churn.
86namespace fl {
88} // namespace fl
89
90#endif // !FL_NETWORK_DETECTOR_HAS_REAL_IMPL
static bool isEthernetActive() FL_NOEXCEPT
NetworkDetector() FL_NOEXCEPT=delete
static bool isWiFiConnected() FL_NOEXCEPT
static bool isBluetoothActive() FL_NOEXCEPT
static bool isWiFiActive() FL_NOEXCEPT
static bool isEthernetConnected() FL_NOEXCEPT
static bool isAnyNetworkConnected() FL_NOEXCEPT
static bool isAnyNetworkActive() FL_NOEXCEPT
Stub NetworkDetector for platforms without the real implementation.
::fl::net::NetworkDetector NetworkDetector
Base definition for an LED controller.
Definition crgb.hpp:179
#define FL_NOEXCEPT