Esempio n. 1
0
/*******************************************************************************
  Function:	
    void EnsureWFisAwake()

  Summary:
    If PS-Poll is active or the MRF24W is asleep, ensure that it is woken up.

  Description:
    Called by the WiFi driver when it needs to transmit or receive a data or 
    mgmt message. If the application has enabled PS-Poll mode and the WiFi 
    driver has activated PS-Poll mode then this function will deactivate PS-Poll
    mode and wake up the MRF24W.

  Precondition:
  	MACInit must be called first.

  Parameters:
    None.

  Returns:
  	None.
  	
  Remarks:
  	None.
  *****************************************************************************/
void EnsureWFisAwake()
{
    /* if the application desires the MRF24W to be in PS-Poll mode (PS-Poll with DTIM enabled or disabled */
    if ((g_powerSaveState == WF_PS_PS_POLL_DTIM_ENABLED) || (g_powerSaveState == WF_PS_PS_POLL_DTIM_DISABLED)) 
    {
        /* if the WF driver has activated PS-Poll */
        if (g_psPollActive == true)
        {
            /* wake up MRF24W */
            WFConfigureLowPowerMode(WF_LOW_POWER_MODE_OFF);
        }    
            
            // will need to put device back into PS-Poll sleep mode after transaction
            SetSleepNeeded();
    }
}        
Esempio n. 2
0
/*******************************************************************************
  Function:    
    void EnsureWFisAwake()

  Summary:
    If PS-Poll is active or the MRF24W is asleep, ensure that it is woken up.

  Description:
    Called by the WiFi driver when it needs to transmit or receive a data or 
    mgmt message. If the application has enabled PS-Poll mode and the WiFi 
    driver has activated PS-Poll mode then this function will deactivate PS-Poll
    mode and wake up the MRF24W.

  Precondition:
    MACInit must be called first.

  Parameters:
    None.

  Returns:
    None.
      
  Remarks:
    None.
  *****************************************************************************/
void EnsureWFisAwake()
{
    /* if the application desires the MRF24W to be in PS-Poll mode (PS-Poll with DTIM enabled or disabled */
    if ((g_powerSaveState == WF_PS_PS_POLL_DTIM_ENABLED) || (g_powerSaveState == WF_PS_PS_POLL_DTIM_DISABLED)) 
    {
        /* if the WF driver has activated PS-Poll */
        if (g_psPollActive == true)
        {
            /* wake up MRF24W */
            WFConfigureLowPowerMode(WF_LOW_POWER_MODE_OFF);
        }    
            
        // will need to put device back into PS-Poll sleep mode after transaction
        SetSleepNeeded();
        #if defined(TCPIP_STACK_USE_EVENT_NOTIFICATION)
        WifiAsyncSetEventPending(ASYNC_POWER_SAVE_PENDING); // wake up power save task
        #endif
    }
}