This section describes the various Wi-Fi compilation options.
The WF_Config module (WF_Config.h/WF_Config.c) is used to control several aspects of the WiFi Driver behavior. Most of the customization of the Wi-Fi module is done from the context of this module.
In WFApi.h there is a block of defines that can be commented out to remove those sections of the Wi-Fi host driver that are not needed by the application. This allows the saving of code and data space.
#define |
Controlling Functions |
WF_USE_SCAN_FUNCTIONS |
Scan API |
WF_USE_TX_POWER_CONTROL_FUNCTIONS |
Tx power control API |
WF_USE_POWER_SAVE_FUNCTIONS |
Power save API |
WF_USE_MULTICAST_FUNCTIONS |
Multicast API |
WF_USE_INDIVIDUAL_SET_GETS |
Affects all get and set functions, except the following: WF_CPSetElements() WF_CPGetElements() WF_CASetElements() WF_CAGetElements() |
WF_USE_GROUP_SET_GETS |
Affects the following functions: WF_CPSetElements() WF_CPGetElements() WF_CASetElements() WF_CAGetElements() |
This definition enables the WF_ASSERT macro in the Wi-Fi driver. Users' codeset is free to use this macro for debugging and customization. The WF_ASSERT macro can be compiled in or out via the WF_DEBUG definition. See the comment above the WF_DEBUG define in WFApi.h for details.
The Wi-Fi driver has a UART console application built in that allows one to type in command lines and has them parsed. If this functionality is not needed than it can be compiled out by commenting out the WF_CONSOLE define.
EZ_CONFIG_STORE is a feature used in Wi-Fi G Demo Board and TCPIP - WiFi EZConfig demo apps. As an example, when the MRF24W is started up as a SoftAP, MRF24W may choose to be redirected to another AP/router. What EZ_CONFIG_STORE does is to store these wireless network configurations (AppConfig) into the NVM (non-volatile memory). When the MRF24W is powered off and up again, these information (AppConfig) will be retrieved from the NVM, such that the user is not required to repeat the process of having to be redirected to the chosen AP/router again. EZ_CONFIG_STORE retains the wireless network configurations (AppConfig) and thereby saving time to reconnect to the chosen AP/router.
When MRF24W is asking to be redirected to the selected AP/router, the following sequences will take place.
1. (CustomHTTPApp.c) In HTTPPostWifiConfig(), the data struct CFGCXT will be copied to data struct AppConfig and then AppConfig.DataValid will be set to 1.
2. (MainDemo.c) AppConfig.DataValid will set CFGCXT.isWifiDoneConfigure to 1 as well and eventually will lead to WFEasyConfigProcess() being triggered.
3. (WFEasyConfig.c) WFEasyConfigProcess() will initiate SaveAppConfig(), which will program AppConfig into the NVM. Then MRF24W enters into hibernate mode and exit hibernate mode to perform connection to the newly selected network.
4. (MainDemo.c) When MRF24W is powered off and on again, InitAppConfig() / InitAppConfig2() will be initialized with AppConfig, retrieved from the internal program flash memory.
5. (MainDemo.c) When the reset button is pressed to return to default factory conditions. RestoreWifiConfig() will be invoked to erase the internal program flash memory (NVMErasePage()) and then perform a Reset().