Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nan_console): Error when NAN Discovery is started more than once (IDFGH-13923) #14762

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion examples/wifi/wifi_aware/nan_console/main/nan_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,10 +235,14 @@ static int wifi_cmd_nan_disc(int argc, char **argv)
nan_cfg.warm_up_sec = nan_args.warmup_time->ival[0];
}

g_nan_netif = esp_netif_create_default_wifi_nan();
if(!g_nan_netif){
g_nan_netif = esp_netif_create_default_wifi_nan();
}

if ((esp_wifi_nan_start(&nan_cfg)) != ESP_OK) {
ESP_LOGI(TAG, "Failed to start NAN");
esp_netif_destroy_default_wifi(g_nan_netif);
entrop1a marked this conversation as resolved.
Show resolved Hide resolved
g_nan_netif = NULL;
return 1;
}
return 0;
Expand All @@ -252,6 +256,7 @@ static int wifi_cmd_nan_disc(int argc, char **argv)
return 1;
}
esp_netif_destroy_default_wifi(g_nan_netif);
g_nan_netif = NULL;
}

return 0;
Expand Down