Browse Source

Disconnect before running WPS and SmartConfig discovery (#1146)

pull/1158/head
Xose Pérez 5 years ago
parent
commit
cc38f37f10
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      code/espurna/wifi.ino

+ 6
- 0
code/espurna/wifi.ino View File

@ -226,6 +226,7 @@ void _wifiCallback(justwifi_messages_t code, char * parameter) {
if (MESSAGE_WPS_ERROR == code || MESSAGE_SMARTCONFIG_ERROR == code) {
_wifi_wps_running = false;
_wifi_smartconfig_running = false;
jw.enableAP(true);
}
if (MESSAGE_WPS_SUCCESS == code || MESSAGE_SMARTCONFIG_SUCCESS == code) {
@ -249,6 +250,7 @@ void _wifiCallback(justwifi_messages_t code, char * parameter) {
_wifi_wps_running = false;
_wifi_smartconfig_running = false;
jw.enableAP(true);
}
@ -550,12 +552,16 @@ void wifiStartAP() {
#if defined(JUSTWIFI_ENABLE_WPS)
void wifiStartWPS() {
jw.enableAP(false);
jw.disconnect();
jw.startWPS();
}
#endif // defined(JUSTWIFI_ENABLE_WPS)
#if defined(JUSTWIFI_ENABLE_SMARTCONFIG)
void wifiStartSmartConfig() {
jw.enableAP(false);
jw.disconnect();
jw.startSmartConfig();
}
#endif // defined(JUSTWIFI_ENABLE_SMARTCONFIG)


Loading…
Cancel
Save