It would appear that after setting the WIFI MODE parameter via ifconfig(), as soon as the WiFI interface is brought up then brought back down again, the parameter is lost for some reason.
ifconfig(IF_WIFI0, IFS_WIFI_MODE, 0, IFS_END); // set the wifi mode param to infrastructure
ifconfig(IF_WIFI0, IFS_UP, IFS_END); // bring the interface up
ifconfig(IF_WIFI0, IFS_DOWN, IFS_END); // bring the interface down
ifconfig(IF_WIFI0, IFG_WIFI_MODE, &wifiMode, IFS_END); // read the wifi mode param to var
wifiMode will equal -1 (unknown?) instead of 0 for infrastructure
Shouldn’t the mode be retained, or do I need to set it each time I take the WiFi interface down?
Here’s a GitHub link to a sample program illustrating the issue, as well as a screenshot of the Stdio window which shows what’s happening on my end: