/* WIFI MODULE Copyright (C) 2016-2019 by Xose PĂ©rez */ #pragma once #include #include #if LWIP_VERSION_MAJOR == 1 #include #elif LWIP_VERSION_MAJOR >= 2 #include #endif // (HACK) allow us to use internal lwip struct. // esp8266 re-defines enum values from tcp header... include them first #define LWIP_INTERNAL #include #include #undef LWIP_INTERNAL extern "C" { #include #include #include #include // ip_addr_t #include // ERR_x #include // dns_gethostbyname #include // ip4/ip6 helpers }; // ref: https://github.com/me-no-dev/ESPAsyncTCP/pull/115/files#diff-e2e636049095cc1ff920c1bfabf6dcacR8 // This is missing with Core 2.3.0 and is sometimes missing from the build flags. Assume HIGH_BANDWIDTH version. #ifndef TCP_MSS #define TCP_MSS (1460) #endif using wifi_callback_f = void(*)(justwifi_messages_t code, char * parameter); enum class WiFiApMode { Disabled, Enabled, Fallback }; uint8_t wifiState(); void wifiReconnectCheck(); bool wifiConnected(); String getNetwork(); String getIP(); void wifiDebug(); void wifiDebug(WiFiMode_t modes); WiFiApMode wifiApMode(); void wifiStartAP(); void wifiStartSTA(); void wifiDisconnect(); void wifiTurnOff(); void wifiTurnOn(); void wifiStartWPS(); void wifiStartSmartConfig(); void wifiRegister(wifi_callback_f callback); void wifiSetup(); void wifiLoop();