12#include "../evt/ksEvent.h"
13#include "../ksComponent.h"
14#include "../ksSimpleTimer.h"
43 } bitflags = {
false,
true,
false};
64 DECLARE_KS_EVENT(onConnected)
65 DECLARE_KS_EVENT(onDisconnected)
A component that manages WiFi connection.
Definition ksWifiConnector.h:30
ksSimpleTimer wifiReconnectTimer
Wifi timer - reconnection timeout.
Definition ksWifiConnector.h:35
bool isConnected() const
Returns whether WiFi is connected or not.
Definition ksWifiConnector.cpp:159
ksSimpleTimer wifiIpCheckTimer
Wifi timer - IP check interval.
Definition ksWifiConnector.h:36
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:40
bool init(ksApplication *app) override
Initializes WiFi connector component.
Definition ksWifiConnector.cpp:82
bool loop(ksApplication *app) override
Handles WiFi connector component loop logic.
Definition ksWifiConnector.cpp:115
ksSimpleTimer wifiTimeoutTimer
Wifi timer - long timeout in case of issues.
Definition ksWifiConnector.h:34
void setupMacAddress()
Internal method that generates MAC address for the device.
Definition ksWifiConnector.cpp:57
void wifiDisconnectedInternal()
Internal method called on WiFi disconnection.
Definition ksWifiConnector.cpp:110
bool savePower
True to save power.
Definition ksWifiConnector.h:41
void wifiConnectedInternal()
Internal method called on WiFi connection.
Definition ksWifiConnector.cpp:98
virtual ~ksWifiConnector()
Destructos WiFi connector component.
Definition ksWifiConnector.cpp:164
A class that is a base for user-defined application.
Definition ksApplication.h:43
Base component class.
Definition ksComponent.h:51
Simple timer class, without using component architecture.
Definition ksSimpleTimer.h:27