# IFPARAM\_WIFI\_MODE not retained when interface is brought down

**URL:** <https://forums.digi.com/t/ifparam-wifi-mode-not-retained-when-interface-is-brought-down/18829>\
**Category:** Rabbit Software\
**Tags:** wifi, interface, rcm6650w\
**Created:** [October 21, 2017, 4:51pm UTC](https://forums.digi.com/t/ifparam-wifi-mode-not-retained-when-interface-is-brought-down/18829 "2017-10-21T16:51:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dilbertgod](https://avatars.discourse-cdn.com/v4/letter/d/7993a0/32.png) [@dilbertgod](https://forums.digi.com/u/dilbertgod)\
**Post date:** [October 21, 2017, 4:51pm UTC](https://forums.digi.com/t/ifparam-wifi-mode-not-retained-when-interface-is-brought-down/18829/1 "2017-10-21T16:51:54Z")

</div>

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:

[https://github.com/dilbertgit/dynC\_1072C\_wifi\_mode](https://github.com/dilbertgit/dynC_1072C_wifi_mode)

Thanks

---

<div class="post-metadata">

**Author:** ![TomCollins](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/tomcollins/32/37_2.png) [@TomCollins](https://forums.digi.com/u/TomCollins)\
**Post date:** [October 23, 2017, 4:17pm UTC](https://forums.digi.com/t/ifparam-wifi-mode-not-retained-when-interface-is-brought-down/18829/2 "2017-10-23T16:17:16Z")

</div>

Thanks for the report. Fixed in this commit: [https://github.com/digidotcom/DCRabbit\_10/commit/061cc7f52f5e3bd4d494cce02caa27c63923592c](https://github.com/digidotcom/DCRabbit_10/commit/061cc7f52f5e3bd4d494cce02caa27c63923592c)
