#include <connectivity.h>
◆ Connectivity()
Fetches the LED pin from config, setups pin mode, setup WS2812 RGBLED, initializes logger.
◆ ~Connectivity()
Connectivity::~Connectivity |
( |
| ) |
|
◆ EnsureConnectivity()
void Connectivity::EnsureConnectivity |
( |
| ) |
|
|
private |
Check if the device is connected, if not, try to connect it.
- Returns
- true : wifi is connected
-
false : failed to connect, device is no longer connected, despite of trying
◆ GetSecLostConnection()
int Connectivity::GetSecLostConnection |
( |
| ) |
|
Return number of seconds of lost connection.
◆ GetWebpageSubmission()
Get the latest submission.
- Returns
- std::tuple<bool, CONFIG_SET::DEVICE_CRED>: bool returning if there is a new submission available, device_cred: new submission
◆ HandleOTA()
void Connectivity::HandleOTA |
( |
| ) |
|
Regular call function for syncing OTA requests.
◆ IsConnected()
bool Connectivity::IsConnected |
( |
| ) |
|
Checks if the device is connected to the WiFi.
- Returns
- true : if connected
-
false : otherwise
◆ StartEnsureConnectivity()
Start ensuring connectivity.
◆ StartHotspot()
void Connectivity::StartHotspot |
( |
| ) |
|
|
private |
Starts wifi hotspot, basically start wifi in soft access point mode.
◆ StartOTA()
void Connectivity::StartOTA |
( |
| ) |
|
◆ StartWebpage()
void Connectivity::StartWebpage |
( |
| ) |
|
Creates a server and starts hosting webpage.
◆ StopEnsuringConnectivity()
void Connectivity::StopEnsuringConnectivity |
( |
| ) |
|
|
private |
Check if the device is connected, if not, try to connect it.
- Returns
- true : wifi is connected
-
false : failed to connect, device is no longer connected, despite of trying
◆ StopHotspot()
void Connectivity::StopHotspot |
( |
| ) |
|
|
private |
◆ StopOTA()
void Connectivity::StopOTA |
( |
| ) |
|
◆ StopWebpage()
void Connectivity::StopWebpage |
( |
| ) |
|
◆ StopWiFi()
void Connectivity::StopWiFi |
( |
| ) |
|
◆ device_cred_
◆ ensure_conn_thread_
std::unique_ptr<std::thread> Connectivity::ensure_conn_thread_ {nullptr} |
|
private |
◆ hotspot_enabled_
bool Connectivity::hotspot_enabled_ = false |
|
private |
◆ is_new_submission_available_
bool Connectivity::is_new_submission_available_ = false |
|
private |
◆ keep_handler_running_
bool Connectivity::keep_handler_running_ = false |
|
private |
◆ logger_
std::shared_ptr<Logging> Connectivity::logger_ |
|
private |
◆ ota_enabled_
bool Connectivity::ota_enabled_ = false |
|
private |
◆ time_last_connected_
◆ webpage_enabled_
bool Connectivity::webpage_enabled_ = false |
|
private |
◆ webpage_server_
std::unique_ptr<AsyncWebServer> Connectivity::webpage_server_ {nullptr} |
|
private |
◆ webpage_submission_mutex_
std::mutex Connectivity::webpage_submission_mutex_ |
|
private |
◆ webpage_submitted_device_cred_
The documentation for this class was generated from the following files: