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.

43 lines
893 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(SecurityManager* securityManager);
  21. void init(AsyncWebServer *server);
  22. private:
  23. SecurityManager* _securityManager;
  24. void scanNetworks(AsyncWebServerRequest *request);
  25. void listNetworks(AsyncWebServerRequest *request);
  26. #if defined(ESP8266)
  27. uint8_t convertEncryptionType(uint8_t encryptionType);
  28. #endif
  29. };
  30. #endif // end WiFiScanner_h