lwIP Wiki
Explore
Main Page
All Pages
Community
Interactive Maps
Recent Blog Posts
Wiki Content
Recently Changed Pages
Application API layers
License
TCP
Porting for an OS
Netconn receive timeout
LwIP Wiki
Raw/UDP
LwIP Application Developers Manual
LwIP with or without an operating system
Netconn API
Application API layers
SNMP
Socket API
Initialization for simple lwIP
LwIP IPv4/IPv6 stacks
Blog posts
Bellphin/TCP/IP Listen issue
Johnwilliamhoffman/Missing ACKs using LWIP 1.3.2
Doriano dotsys/RFC (Request for Comment) implemented in LwIP
Cuc0ach1ng/UDP transmit timing query
Kausiknathan/Lwip Stack 2.0.2 Integration with Infineon Aurix TC299 MCAL Source
Ddlawrence/lwIP on the Beaglebone UDP problem
Shahrukhkk/LWIP with NS3
Community
Help
FANDOM
Fan Central
BETA
Games
Anime
Movies
TV
Video
Wikis
Explore Wikis
Community Central
Start a Wiki
Don't have an account?
Register
Sign In
Sign In
Register
lwIP Wiki
91
pages
Explore
Main Page
All Pages
Community
Interactive Maps
Recent Blog Posts
Wiki Content
Recently Changed Pages
Application API layers
License
TCP
Porting for an OS
Netconn receive timeout
LwIP Wiki
Raw/UDP
LwIP Application Developers Manual
LwIP with or without an operating system
Netconn API
Application API layers
SNMP
Socket API
Initialization for simple lwIP
LwIP IPv4/IPv6 stacks
Blog posts
Bellphin/TCP/IP Listen issue
Johnwilliamhoffman/Missing ACKs using LWIP 1.3.2
Doriano dotsys/RFC (Request for Comment) implemented in LwIP
Cuc0ach1ng/UDP transmit timing query
Kausiknathan/Lwip Stack 2.0.2 Integration with Infineon Aurix TC299 MCAL Source
Ddlawrence/lwIP on the Beaglebone UDP problem
Shahrukhkk/LWIP with NS3
Community
Help
Editing
LwIP with or without an operating system
(section)
Back to page
Edit
Edit source
View history
Talk (2)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Pre 1.4.0 === For older versions of lwIP, A simple main loop for a single-threaded system might look like this: while(1) { if(poll_driver(netif) == PACKET_READY) { pbuf = get_packet(netif); ip_input(pbuf, netif); } if (clock() - last_arp_time >= ARP_TMR_INTERVAL * CLOCKTICKS_PER_MS) { etharp_tmr(); last_arp_time = clock(); } if(clock() - last_time >= TCP_TMR_INTERVAL * CLOCKTICKS_PER_MS) { tcp_tmr(); last_time = clock(); } } ATTENTION: Note that CLOCKTICKS_PER_MS is only valid for a hardware timer with at least one tick per millisecond. If you want to use an OS-tick-counter (e.g. one that is incremented every 10ms), you have to adjust the code to: clock() - last_time >= TCP_TMR_INTERVAL / MS_PER_TICK In case you use more than just TCP/IP and ARP, you might need to add more calls to timers. In a multi-threaded system all these timers are called from <code>api/tcpip.c</code>, so this source file is a good place to check if you need to call any more timers (like IP_REASSEMBLY, DHCP, etc.). Hint: Both in <code>api/tcpip.c</code> and the examples above, the timers do not "catch up". That means if one timer tick is delayed (for whatever reason), all following timer ticks will be delayed, too. You should upgrade to the latest release and save yourself a lot of work and bug hunting Continue reading at [[Raw/native API]] and <code>doc/rawapi.txt</code>. Be aware that this doc might be a bit outdated
Summary:
Please note that all contributions to the lwIP Wiki are considered to be released under the CC-BY-SA
Cancel
Editing help
(opens in new window)
Follow on IG
TikTok
Join Fan Lab