V3.1.3 - Bug fix not disabling WiFi correctly
This commit is contained in:
parent
3a810d6eea
commit
d30536e939
|
@ -124,8 +124,8 @@
|
|||
#define RX_DATA_TIMOUT 50
|
||||
|
||||
const int FirmwareRevision = 31;
|
||||
const int FirmwareSubRevision = 2;
|
||||
const char* FirmwareDate = "8 Sep 2019";
|
||||
const int FirmwareSubRevision = 3;
|
||||
const char* FirmwareDate = "11 Sep 2019";
|
||||
|
||||
|
||||
#ifdef ESP32
|
||||
|
@ -1647,6 +1647,7 @@ void doStreaming()
|
|||
{
|
||||
#if USE_WIFI == 1
|
||||
|
||||
if(NVstore.getUserSettings().enableWifi) {
|
||||
doWiFiManager();
|
||||
#if USE_OTA == 1
|
||||
DoOTA();
|
||||
|
@ -1658,7 +1659,7 @@ void doStreaming()
|
|||
// most MQTT is managed via callbacks, but need some sundry housekeeping
|
||||
doMQTT();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#endif // USE_WIFI
|
||||
|
||||
|
|
|
@ -144,6 +144,7 @@ bool initWifi(int initpin,const char *failedssid, const char *failedpassword)
|
|||
// call from main sketch loop()
|
||||
void doWiFiManager()
|
||||
{
|
||||
if(NVstore.getUserSettings().enableWifi) {
|
||||
wm.process();
|
||||
|
||||
if(WiFi.status() != WL_CONNECTED) {
|
||||
|
@ -161,7 +162,7 @@ void doWiFiManager()
|
|||
}
|
||||
}
|
||||
else {
|
||||
WifiReconnectHoldoff = millis() + 10000;
|
||||
WifiReconnectHoldoff = millis() + 15000;
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
@ -218,6 +219,7 @@ void doWiFiManager()
|
|||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
void wifiDisable(long rebootDelay)
|
||||
{
|
||||
|
@ -297,19 +299,27 @@ void APstartedCallback(WiFiManager*)
|
|||
|
||||
const char* getWifiAPAddrStr()
|
||||
{
|
||||
if(NVstore.getUserSettings().enableWifi) {
|
||||
IPAddress IPaddr = WiFi.softAPIP(); // use stepping stone - function returns an automatic stack var - LAME!
|
||||
static char APIPaddr[16];
|
||||
sprintf(APIPaddr, "%d.%d.%d.%d", IPaddr[0], IPaddr[1], IPaddr[2], IPaddr[3]);
|
||||
return APIPaddr;
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* getWifiSTAAddrStr()
|
||||
{
|
||||
if(NVstore.getUserSettings().enableWifi) {
|
||||
IPAddress IPaddr = WiFi.localIP(); // use stepping stone - function returns an automatic stack var - LAME!
|
||||
static char STAIPaddr[16];
|
||||
sprintf(STAIPaddr, "%d.%d.%d.%d", IPaddr[0], IPaddr[1], IPaddr[2], IPaddr[3]);
|
||||
return STAIPaddr;
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
const char* getWifiAPMACStr()
|
||||
{
|
||||
|
@ -323,21 +333,32 @@ const char* getWifiSTAMACStr()
|
|||
|
||||
String getSSID()
|
||||
{
|
||||
if(NVstore.getUserSettings().enableWifi) {
|
||||
wifi_config_t conf;
|
||||
esp_wifi_get_config(WIFI_IF_STA, &conf);
|
||||
return String(reinterpret_cast<const char*>(conf.sta.ssid));
|
||||
}
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
bool isWifiConnected()
|
||||
{
|
||||
if(NVstore.getUserSettings().enableWifi)
|
||||
return WiFi.status() == WL_CONNECTED;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isWifiAP()
|
||||
{
|
||||
if(NVstore.getUserSettings().enableWifi) {
|
||||
int mode = WiFi.getMode();
|
||||
return !isSTA && ((mode & WIFI_MODE_AP) != 0);
|
||||
}
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
bool isWifiSTA()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue