/******************************************************************************* Function: void WFEnableMRF24WB0MMode(void) Summary: Must be called to configure the MRF24W for operations. Description: Precondition: MACInit must be called first. Parameters: None. Returns: None. Remarks: None. *****************************************************************************/ void WFEnableMRF24WB0MMode(void) { UINT8 buf[1] = {ENABLE_MRF24WB0M}; SendSetParamMsg(PARAM_MRF24WB0M, buf, sizeof(buf)); }
void WFEnableDebugPrint(UINT8 option) { SendSetParamMsg(PARAM_ENABLE_DEBUG_PRINT, &option, sizeof(option)); }
/******************************************************************************* Function: void WF_SetRegionalDomain(UINT8 regionalDomain) Summary: Enables or disables the MRF24W Regional Domain. This function is NOT supported due to FCC requirements, which does not allow programming of the regional domain. Description: MRF24W is programmed with FCC regional domain as default. To cater for other regional domains, use WF_CASetChannelList() to set up specific channels. Precondition: MACInit must be called first. This function must not be called while in a connected state. Parameters: regionalDomain - Value to set the regional domain to Returns: None. Remarks: None. *****************************************************************************/ void WF_SetRegionalDomain(UINT8 regionalDomain) { SendSetParamMsg(PARAM_REGIONAL_DOMAIN, ®ionalDomain, 1); }
/******************************************************************************* Function: void WF_EnableSWMultiCastFilter(void) Summary: Forces the module FW to use software filter instead of hardware filter Description: This function allows the application to configure up to max 16 Multicast Address Filters on the MRF24WG0MA/B. Precondition: MACInit must be called first. Parameters: None. Returns: None. Remarks: None. *****************************************************************************/ void WF_EnableSWMultiCastFilter(void) { UINT8 enable = 1; SendSetParamMsg(PARAM_USE_SW_MULTICAST_FILTER, (UINT8 *)&enable, sizeof(enable)); }
/******************************************************************************* Function: void WF_SetMacAddress(UINT8 *p_mac) Summary: Uses a different MAC address for the MRF24W Description: Directs the MRF24W to use the input MAC address instead of its factory-default MAC address. This function does not overwrite the factory default, which is in FLASH memory – it simply tells the MRF24W to use a different MAC. Precondition: MACInit must be called first. Cannot be called when the MRF24W is in a connected state. Parameters: p_mac - Pointer to 6-byte MAC that will be sent to MRF24W Returns: None. Remarks: None. *****************************************************************************/ void WF_SetMacAddress(UINT8 *p_mac) { SendSetParamMsg(PARAM_MAC_ADDRESS, p_mac, WF_MAC_ADDRESS_LENGTH); }
/******************************************************************************* Function: void WF_SetTxDataConfirm(UINT8 state) Summary: Enables or disables Tx data confirmation management messages. Description: Enables or disables the MRF24W Tx data confirm mgmt message. Data confirms should always be disabled. Precondition: MACInit must be called first. Parameters: state - WF_DISABLED or WF_ENABLED Returns: None. Remarks: None. *****************************************************************************/ void WF_SetTxDataConfirm(UINT8 state) { SendSetParamMsg(PARAM_CONFIRM_DATA_TX_REQ, &state, 1); }
void WFEnableDeferredPowerSave(void) { UINT8 buf[1] = {1}; SendSetParamMsg(PARAM_DEFERRED_POWERSAVE, buf, sizeof(buf)); }
/******************************************************************************* Function: void DRV_WIFI_TxModeSet(uint8_t mode) Summary: Configures 802.11 Tx mode Description: This function sets the MRF24WG Tx mode. <table> mode Description ---- ----------- DRV_WIFI_TXMODE_G_RATES Use all 802.11g rates (default) DRV_WIFI_TXMODE_B_RATES Use only 802.11b rates DRV_WIFI_TXMODE_LEGACY_RATES Use only 1 and 2 mbps rates </table> Parameters: mode - Tx mode value (see description) Returns: None. *****************************************************************************/ void DRV_WIFI_TxModeSet(uint8_t mode) { SendSetParamMsg(PARAM_TX_MODE, (uint8_t *)&mode, 1); }
/******************************************************************************* Function: void DRV_WIFI_SetPSK(uint8_t *p_psk); Summary: Sets the binary WPA PSK code in WPS. Description: This function is used in conjunction with DRV_WIFI_YieldPassphraseToHost(). It sends the binary key to the MRF24WG after the host has converted an ASCII passphrase to a binary key. Parameters: p_psk - pointer to the binary key Returns: None. *****************************************************************************/ void DRV_WIFI_SetPSK(uint8_t *p_psk) { SendSetParamMsg(PARAM_SET_PSK, (uint8_t *)p_psk, 32); }
void WFEnableBroadcastProbeResponse(void) { UINT8 buf[1] = {1}; SendSetParamMsg(PARAM_BROADCAST_PROBE_RESPONSE, buf, sizeof(buf)); }
/******************************************************************************* Function: void DRV_WIFI_YieldPassphraseToHost(void); Summary: Allows host to get WPS WPA-PSK passphrase and convert to binary key. Description: During WPS the MRF24WG will receive a passphrase. That passphrase must be converted to a binary key. The MRF24WG can do this, but it will take 20-30 seconds. The host MCU will be able to convert the passphrase to a binary key much faster. If that is desired, then this function should be called to request the MRF24WG to signal the DRV_WIFI_EVENT_KEY_CALCULATION_REQUEST event when the passphrase is ready. Then the host can retrieve the passphrase (see DRV_WIFI_WPSCredentialsGet()), convert to a binary key (see WF_ConvPassphraseToKey()), and send it back to the MRF24WG via the DRV_WIFI_SetPSK() function. Parameters: None Returns: None. *****************************************************************************/ void YieldPassphraseToHost(void) { uint8_t yield = 1; SendSetParamMsg(PARAM_YIELD_PASSPHRASE_TOHOST, (uint8_t *)&yield, sizeof(yield)); }
/******************************************************************************* Function: void DRV_WIFI_SWMultiCastFilterEnable(void) Summary: Forces the MRF24WG to use software multicast filters instead of hardware multicast filters. Description: This function allows the application to configure up to 16 software multicast address Filters on the MRF24WG0MA/B. Parameters: None. Returns: None. *****************************************************************************/ void DRV_WIFI_SWMultiCastFilterEnable(void) { uint8_t enable = 1; SendSetParamMsg(PARAM_USE_SW_MULTICAST_FILTER, (uint8_t *)&enable, sizeof(enable)); }
/******************************************************************************* Function: void DRV_WIFI_MacAddressSet(uint8_t *p_mac) Summary: Uses a different MAC address for the MRF24W Description: Directs the MRF24W to use the input MAC address instead of its factory-default MAC address. This function does not overwrite the factory default, which is in FLASH memory. Parameters: p_mac - Pointer to 6-byte MAC that will be sent to MRF24WG Returns: None. *****************************************************************************/ void DRV_WIFI_MacAddressSet(uint8_t *p_mac) { SendSetParamMsg(PARAM_MAC_ADDRESS, p_mac, WF_MAC_ADDRESS_LENGTH); }
void WF_SetLinkDownThreshold(UINT8 threshold) { SendSetParamMsg(PARAM_LINK_DOWN_THRESHOLD, &threshold, sizeof(threshold)); }
void WFEnableAggressivePowerSave(void) { UINT8 buf[1] = {1}; SendSetParamMsg(PARAM_AGGRESSIVE_PS, buf, sizeof(buf)); }
/******************************************************************************* Function: WF_SetTxMode(UINT8 mode) Summary: Configures 802.11 Tx mode Description: Configures 802.11 Tx mode Precondition: MACInit must be called first. Parameters: mode -- Tx mode value. Choices are: WF_TXMODE_G_RATES (default) -- will use all 802.11g rates WF_TXMODE_B_RATES -- will only use 802.11b rates WF_TXMODE_LEGACY_RATES -- will only use 1 and 2 mbps rates Returns: None. Remarks: None. *****************************************************************************/ void WF_SetTxMode(UINT8 mode) { SendSetParamMsg(PARAM_TX_MODE, (UINT8 *)&mode, 1); }
/******************************************************************************* Function: void DRV_WIFI_SetLinkDownThreshold(uint8_t threshold) Summary: Sets number of consecutive WiFi Tx failures before link is considered down. Description: This function allows the application to set the number of MRF24W consecutive Tx failures before the connection failure event (DRV_WIFI_LINK_LOST) is reported to the host application. Parameters: threshold -- 0: disabled (default) 1-255: number of consecutive Tx failures before connection failure event is reported Returns: None. Remarks: None. *****************************************************************************/ void DRV_WIFI_SetLinkDownThreshold(uint8_t threshold) { SendSetParamMsg(PARAM_LINK_DOWN_THRESHOLD, &threshold, sizeof(threshold)); }