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
|
|
|
|
2024-03-25 05:33:57 -06:00
|
|
|
#if HAS_WIFI && !defined(ARCH_PORTDUINO)
|
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
|
|
|
|
2023-12-02 21:47:52 +01:00
|
|
|
uint8_t getWifiDisconnectReason();
|