2018-02-26 00:11:31 +00:00
|
|
|
#ifndef WiFiScanner_h
|
|
|
|
#define WiFiScanner_h
|
|
|
|
|
2018-11-11 16:44:29 +00:00
|
|
|
#if defined(ESP8266)
|
|
|
|
#include <ESP8266WiFi.h>
|
|
|
|
#include <ESPAsyncTCP.h>
|
|
|
|
#elif defined(ESP_PLATFORM)
|
|
|
|
#include <WiFi.h>
|
|
|
|
#include <AsyncTCP.h>
|
|
|
|
#endif
|
|
|
|
|
2018-02-26 00:11:31 +00:00
|
|
|
#include <ESPAsyncWebServer.h>
|
|
|
|
#include <ArduinoJson.h>
|
2019-11-30 09:58:28 +00:00
|
|
|
#include <AsyncJson.h>
|
2018-02-26 00:11:31 +00:00
|
|
|
#include <TimeLib.h>
|
2019-05-29 22:48:16 +00:00
|
|
|
#include <SecurityManager.h>
|
2018-02-26 00:11:31 +00:00
|
|
|
|
2018-04-01 09:35:23 +00:00
|
|
|
#define SCAN_NETWORKS_SERVICE_PATH "/rest/scanNetworks"
|
|
|
|
#define LIST_NETWORKS_SERVICE_PATH "/rest/listNetworks"
|
|
|
|
|
2019-04-14 07:52:40 +00:00
|
|
|
#define MAX_WIFI_SCANNER_SIZE 1024
|
|
|
|
|
2018-02-26 00:11:31 +00:00
|
|
|
class WiFiScanner {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2019-09-28 20:29:46 +00:00
|
|
|
WiFiScanner(AsyncWebServer *server, SecurityManager* securityManager);
|
2018-02-26 00:11:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void scanNetworks(AsyncWebServerRequest *request);
|
|
|
|
void listNetworks(AsyncWebServerRequest *request);
|
|
|
|
|
2018-11-11 18:24:59 +00:00
|
|
|
#if defined(ESP8266)
|
|
|
|
uint8_t convertEncryptionType(uint8_t encryptionType);
|
|
|
|
#endif
|
|
|
|
|
2018-02-26 00:11:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // end WiFiScanner_h
|