12#include "../evt/ksEvent.h"
13#include "../ksComponent.h"
14#include "../misc/ksSimpleTimer.h"
43 } bitflags = {
false,
true,
false};
54 DECLARE_KS_EVENT(onConnected)
55 DECLARE_KS_EVENT(onDisconnected)
A component that manages the WiFi connection.
Definition ksWifiConnector.h:30
misc::ksSimpleTimer wifiIpCheckTimer
Wifi timer - IP check interval.
Definition ksWifiConnector.h:36
bool isConnected() const
Returns whether WiFi is connected or not.
Definition ksWifiConnector.cpp:139
bool gotIpAddress
True if IP address is set.
Definition ksWifiConnector.h:42
bool wasConnected
True if connected in previous loop.
Definition ksWifiConnector.h:40
ksWifiConnector(const char *hostname, bool savePower=true)
Constructs WiFi connector component.
Definition ksWifiConnector.cpp:30
misc::ksSimpleTimer wifiTimeoutTimer
Wifi timer - long timeout in case of issues.
Definition ksWifiConnector.h:34
bool init(ksApplication *app) override
Initializes WiFi connector component.
Definition ksWifiConnector.cpp:79
bool loop(ksApplication *app) override
Handles WiFi connector component loop logic.
Definition ksWifiConnector.cpp:95
void setupMacAddress()
Internal method that generates MAC address for the device.
Definition ksWifiConnector.cpp:53
bool savePower
True to save power.
Definition ksWifiConnector.h:41
virtual ~ksWifiConnector()
Destructos WiFi connector component.
Definition ksWifiConnector.cpp:48
misc::ksSimpleTimer wifiReconnectTimer
Wifi timer - reconnection timeout.
Definition ksWifiConnector.h:35
A class that serves as the base for user-defined applications.
Definition ksApplication.h:44
Base component class.
Definition ksComponent.h:36
A simple timer class that does not rely on component architecture.
Definition ksSimpleTimer.h:27