2020-09-12 21:43:41 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
2022-12-21 13:36:38 +01:00
|
|
|
#include "concurrency/Periodic.h"
|
2023-01-21 14:34:29 +01:00
|
|
|
#include "configuration.h"
|
2020-09-12 21:43:41 -07:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <functional>
|
2020-09-18 10:48:39 -07:00
|
|
|
|
2022-07-31 07:11:47 -05:00
|
|
|
#ifdef ARCH_ESP32
|
2020-09-19 16:38:59 -07:00
|
|
|
#include <WiFi.h>
|
2020-09-18 10:48:39 -07:00
|
|
|
#endif
|
2020-09-12 21:43:41 -07:00
|
|
|
|
2022-12-21 13:36:38 +01:00
|
|
|
extern bool needReconnect;
|
|
|
|
|
extern concurrency::Periodic *wifiReconnect;
|
|
|
|
|
|
2021-08-17 16:58:21 -07:00
|
|
|
/// @return true if wifi is now in use
|
2022-10-25 11:53:22 +02:00
|
|
|
bool initWifi();
|
2021-08-17 16:58:21 -07:00
|
|
|
|
2020-09-14 20:27:49 -07:00
|
|
|
void deinitWifi();
|
2020-09-19 12:54:49 -07:00
|
|
|
|
2020-09-18 18:02:56 -07:00
|
|
|
bool isWifiAvailable();
|
2020-09-14 20:27:49 -07:00
|
|
|
|
2020-09-26 00:01:02 -07:00
|
|
|
uint8_t getWifiDisconnectReason();
|