Fork of the excellent esp8266-react - https://github.com/rjwats/esp8266-react
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
838 B

  1. #ifndef WiFiScanner_h
  2. #define WiFiScanner_h
  3. #if defined(ESP8266)
  4. #include <ESP8266WiFi.h>
  5. #include <ESPAsyncTCP.h>
  6. #elif defined(ESP_PLATFORM)
  7. #include <WiFi.h>
  8. #include <AsyncTCP.h>
  9. #endif
  10. #include <ESPAsyncWebServer.h>
  11. #include <ArduinoJson.h>
  12. #include <AsyncArduinoJson6.h>
  13. #include <TimeLib.h>
  14. #include <SecurityManager.h>
  15. #define SCAN_NETWORKS_SERVICE_PATH "/rest/scanNetworks"
  16. #define LIST_NETWORKS_SERVICE_PATH "/rest/listNetworks"
  17. #define MAX_WIFI_SCANNER_SIZE 1024
  18. class WiFiScanner {
  19. public:
  20. WiFiScanner(AsyncWebServer *server, SecurityManager* securityManager);
  21. private:
  22. void scanNetworks(AsyncWebServerRequest *request);
  23. void listNetworks(AsyncWebServerRequest *request);
  24. #if defined(ESP8266)
  25. uint8_t convertEncryptionType(uint8_t encryptionType);
  26. #endif
  27. };
  28. #endif // end WiFiScanner_h