I found two reasons for this.
1) sys_wifi.c in SYS_WIFI_CreateSsdiList function
if you make more than a scan, from the second time, g_wifiSrvcScanConfig.pSsidList points to g_scanSsidListString so the list becomes empty
if (g_wifiSrvcScanConfig.pSsidList)
{
memset(g_scanSsidListString, 0, sizeof(g_scanSsidListString));
start = g_wifiSrvcScanConfig.pSsidList;'
I found two reasons for this. 1) sys_wifi.c in SYS_WIFI_CreateSsdiList function if you make more than a scan, from the second time, g_wifiSrvcScanConfig.pSsidList points to g_scanSsidListString so the list becomes empty
if you agree, I have fixed this way
2) wdrv_pic32mzw.c in WDRV_PIC32MZW_WIDProcess if a scan returns an empty list, the scanInProgress flag remains true and a new scansion never starts
if you agree, I have fixed this way
3) if the autoconnect flag isn't set, a manual connection never happens. I have to do like this