Skip to content

Commit

Permalink
Disconnect before running WPS and SmartConfig discovery (#1146)
Browse files Browse the repository at this point in the history
  • Loading branch information
xoseperez committed Aug 25, 2018
1 parent 1ebc179 commit cc38f37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/espurna/wifi.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -249,6 +250,7 @@ void _wifiCallback(justwifi_messages_t code, char * parameter) {

_wifi_wps_running = false;
_wifi_smartconfig_running = false;
jw.enableAP(true);

}

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit cc38f37

Please sign in to comment.