Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Power Save

        Here are listed all the functions that implement the Power-Save APIs.

Functions

uint8 m2m_wifi_get_sleep_mode (void)
 Get the current Power save mode. More...
 
sint8 m2m_wifi_request_sleep (uint32 u32SlpReqTime)
 Asynchronous API to place the WINC into sleep mode for a specified period of time. More...
 
sint8 m2m_wifi_set_lsn_int (tstrM2mLsnInt *pstrM2mLsnInt)
 Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods. More...
 
sint8 m2m_wifi_set_power_profile (uint8 u8PwrMode)
 Change the power profile mode
Not implemented in WINC3400 firmware. More...
 
sint8 m2m_wifi_set_sleep_mode (uint8 PsTyp, uint8 BcastEn)
 Set the power saving mode for the WINC3400. More...
 

NMI_API uint8 m2m_wifi_get_sleep_mode ( void  )

Get the current Power save mode.

Synchronous API to retrieve the current power save mode of the WINC.

Returns
The current operating power saving mode.
See Also
tenuPowerSaveModes , m2m_wifi_set_sleep_mode
Returns
The current operating power saving mode. The value will be one of those from the enumerated type tenuPowerSaveModes.
See Also
tenuPowerSaveModes m2m_wifi_set_sleep_mode

References hif_get_sleep_mode().

NMI_API sint8 m2m_wifi_request_sleep ( uint32  u32SlpReqTime)

Asynchronous API to place the WINC into sleep mode for a specified period of time.

Power-save sleep request function, which requests the WINC device to sleep in the currently configured
power save mode, as set using @ref m2m_wifi_set_sleep_mode, for a specific time as defined by the parameter
u32SlpReqTime (measured in milliseconds).
This function should be used when the WINC is running in @ref M2M_PS_MANUAL power save mode only.
A wake up request is automatically performed by the WINC device when any host driver API function, e.g. Wi-Fi or socket operation is called.
Parameters
[in]u32SlpReqTimeRequest sleep time in ms.
The best recommended sleep duration is left to be determined by the application. Taking into account that if the application sends notifications very rarely, sleeping for a long time can be a power-efficient decision. In contrast, applications that are sensitive for long periods of absence can experience performance degradation in the connection if long sleeping times are used.
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
Warning
  • This API is currently unsupported on the WINC3400
See Also
tenuPowerSaveModes m2m_wifi_set_sleep_mode

References hif_get_sleep_mode(), hif_send(), M2M_PS_MANUAL, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_DOZE, NULL, and tstrM2mSlpReqTime::u32SleepTime.

NMI_API sint8 m2m_wifi_set_lsn_int ( tstrM2mLsnInt pstrM2mLsnInt)

Set the Wi-Fi listen interval for power save operation. It is represented in units of AP Beacon periods.

Asynchronous API to set Wi-Fi listen interval for power save operation.

Parameters
[in]pstrM2mLsnIntStructure holding the listen interval configurations.
Returns
The function SHALL return 0 for success and a negative value otherwise.
See Also
tstrM2mLsnInt , m2m_wifi_set_sleep_mode
Precondition
m2m_wifi_set_sleep_mode shall be called first
Warning
The Function called once after initialization.
This is one of the two synchronous power-save setting functions that
allow the host MCU application to tweak the system power consumption. Such tweaking can be done by modifying the
Wi-Fi listen interval. The listen interval is how many beacon periods the station can sleep before it wakes up to receive data buffered in the AP.
It is represented in units of AP beacon periods(100ms).
Warning
The function should be called once after initialization.
Parameters
[in]pstrM2mLsnIntStructure holding the listen interval configuration.
Precondition
The function m2m_wifi_set_sleep_mode shall be called first, to set the power saving mode required.
Returns
The function returns M2M_SUCCESS if the command has been successfully queued to the WINC and a negative value otherwise.
See Also
tstrM2mLsnInt m2m_wifi_set_sleep_mode

References hif_send(), M2M_REQ_GROUP_WIFI, M2M_WIFI_REQ_LSN_INT, and NULL.

NMI_API sint8 m2m_wifi_set_power_profile ( uint8  u8PwrMode)

Change the power profile mode
Not implemented in WINC3400 firmware.

Change the power profile mode.

Parameters
[in]u8PwrModeChange the WINC power profile to different mode PWR_LOW1/PWR_LOW2/PWR_HIGH/PWR_AUTO (tenuM2mPwrMode)
Returns
The function SHALL return M2M_SUCCESS for success and a negative value otherwise.
See Also
tenuM2mPwrMode
Precondition
m2m_wifi_init
Warning
must be called after the initializations and before any connection request and can't be changed in run time,
Parameters
[in]u8PwrModeChange the WINC power profile to different mode based on the enumeration tenuM2mPwrMode.
Not implemented in WINC3400 firmware.
Warning
May only be called after initialization, before any connection request, and may not be used to change the power mode thereafter.
Returns
The function returns M2M_SUCCESS for success and a negative value otherwise.
See Also
tenuM2mPwrMode m2m_wifi_init

References hif_send(), M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SET_POWER_PROFILE, NULL, and tstrM2mPwrMode::u8PwrMode.

NMI_API sint8 m2m_wifi_set_sleep_mode ( uint8  PsTyp,
uint8  BcastEn 
)

Set the power saving mode for the WINC3400.

Synchronous API to set the power-save mode of the WINC.

Parameters
[in]PsTypDesired power saving mode. Supported types are defined in tenuPowerSaveModes.
[in]BcastEnBroadcast reception enable flag. If it is 1, the WINC3400 must be awake each DTIM Beacon for receiving Broadcast traffic. If it is 0, the WINC3400 will not wakeup at the DTIM Beacon, but its wakeup depends only on the the configured Listen Interval.
Returns
The function SHALL return 0 for success and a negative value otherwise.
See Also
tenuPowerSaveModes
Warning
The function called once after initialization.
This is one of the two synchronous power-save setting functions that allow the host MCU application
to tweak the system power consumption. Such tweaking can be done through one of two ways:
- 1) Changing the power save mode, to one of the allowed power save modes (see @ref tenuPowerSaveModes). This is done by setting the first parameter.
- 2) Configuring DTIM monitoring: Configuring beacon monitoring parameters by enabling or disabling the reception of broadcast/multicast data.
     This is done by setting the second parameter.
Parameters
[in]PsTypDesired power saving mode. Supported types are enumerated in tenuPowerSaveModes.
[in]BcastEnBroadcast reception enable flag. If set to 1, the WINC will wake for each DTIM beacon to ensure broadcast traffic can be received. If set to 0, the WINC will not wakeup at the DTIM beacon, ignoring broadcast traffic, instead it will wake every N beacon periods, as per the negotiated Listen Interval.
Warning
The function called once after initialization.
Returns
The function returns M2M_SUCCESS for successful operation and a negative value otherwise.
See Also
tenuPowerSaveModes m2m_wifi_get_sleep_mode m2m_wifi_set_lsn_int

References hif_send(), hif_set_sleep_mode(), M2M_INFO, M2M_REQ_GROUP_WIFI, M2M_SUCCESS, M2M_WIFI_REQ_SLEEP, NULL, tstrM2mPsType::u8BcastEn, and tstrM2mPsType::u8PsType.