Skip to content

Commit

Permalink
Merge pull request #87 from tonyp7/new-features
Browse files Browse the repository at this point in the history
fixed disconnect not showing in the webapp
  • Loading branch information
tonyp7 authored Jul 13, 2020
2 parents cfdd13a + 25110a5 commit 0864b94
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/wifi_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -1062,16 +1062,17 @@ void wifi_manager( void * pvParameters ){
/* user manually requested a disconnect so the lost connection is a normal event. Clear the flag and restart the AP */
xEventGroupClearBits(wifi_manager_event_group, WIFI_MANAGER_REQUEST_DISCONNECT_BIT);

if(wifi_manager_lock_json_buffer( portMAX_DELAY )){
wifi_manager_generate_ip_info_json( UPDATE_USER_DISCONNECT );
wifi_manager_unlock_json_buffer();
}

/* erase configuration */
if(wifi_manager_config_sta){
memset(wifi_manager_config_sta, 0x00, sizeof(wifi_config_t));
}

/* regenerate json status */
if(wifi_manager_lock_json_buffer( portMAX_DELAY )){
wifi_manager_generate_ip_info_json( UPDATE_USER_DISCONNECT );
wifi_manager_unlock_json_buffer();
}

/* save NVS memory */
wifi_manager_save_sta_config();

Expand Down

0 comments on commit 0864b94

Please sign in to comment.