IFPARAM_WIFI_MODE not retained when interface is brought down

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.

For example:

int wifiMode;

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:



1 Like

Thanks for the report. Fixed in this commit: https://github.com/digidotcom/DCRabbit_10/commit/061cc7f52f5e3bd4d494cce02caa27c63923592c