Cyclic Timers In Network Stack - Infineon AIROC CYW43012 Manual

Low-power system design wi-fi & bluetooth combo chip and psoc 6 mcu
Table of Contents

Advertisement

Low-power system design with AIROC™ Wi-Fi & Bluetooth® combo
chip and PSoC™ 6 MCU
WLAN power optimization techniques
Code Listing 1
Example: Power save handler using WHD APIs in ModusToolbox™
else
{
ERR_INFO(("Wi-Fi interface is not powered on. Failed to configure power-
save mode\n"));
result = CY_RSLT_TYPE_ERROR;
}
return result;
}
3.2.2

Cyclic timers in network stack

Platforms that implement network stacks, such as lightweight TCP/IP stack (lwIP), run periodic timers for
various network-related activities. These timers are used as ticks for network activity such as address
resolution protocol (ARP) cache table expiry and dynamic host configuration protocol (DHCP) lease renewal
timeouts. The period of these timers can vary from 100 ms to 60 s. The host waking up periodically to service
these timers is required for proper functioning. However, if the application desires to suspend these timers
when it does not anticipate any network timeout activity and for a longer stay in low-power modes, there is an
option to suspend and resume the network stack.
This feature is provided as part of the low power assistant middleware helper files. The
API is available in the lpa/helpers/net_activity/network_activity_handler.h file lets you suspend the network
stack for a predefined duration or until an activity is detected, if the network remains inactive within a given
time window. This API function lets you safely suspend the network and resume it whenever any network
activity gets detected.
Figure 5
suspend duration of 5000 ms, network inactivity monitor window of 150 ms, and network inactivity duration of
100 ms.
Scenario 1:
wait_net_suspend()
window and suspends the network. No network activity is detected for the network suspend duration of 5000
ms. Therefore,
wait_net_suspend()
Scenario 2:
wait_net_suspend()
100 ms.
wait_net_suspend()
Scenario 3:
wait_net_suspend()
window and suspends the network. Network activity is detected before the expiry of 5000 ms duration.
Therefore,
wait_net_suspend()
Application note
shows the
wait_net_suspend()
detects no network activity for more than 100 ms within the 150-ms
resumes the network stack after 5000 ms.
detects network activity in the 150-ms window and inactivity is less than
does not suspend the network stack.
detects no network activity for more than 100 ms within the 150-ms
resumes the network stack immediately.
16
wait_net_suspend()
operation in different scenarios with network
002-27910 Rev. *C
2023-05-29

Advertisement

Table of Contents
loading

Table of Contents