Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
net_timeout.h File Reference

Network timer with wrap around. More...

#include <string.h>
#include <stdbool.h>
#include <limits.h>
#include <zephyr/types.h>
#include <zephyr/sys/slist.h>

Go to the source code of this file.

Data Structures

struct  net_timeout
 Generic struct for handling network timeouts. More...
 

Macros

#define NET_TIMEOUT_MAX_VALUE   ((uint32_t)INT32_MAX)
 Divisor used to support ms resolution timeouts.
 

Functions

void net_timeout_set (struct net_timeout *timeout, uint32_t lifetime, uint32_t now)
 Configure a network timeout structure.
 
int64_t net_timeout_deadline (const struct net_timeout *timeout, int64_t now)
 Return the 64-bit system time at which the timeout will complete.
 
uint32_t net_timeout_remaining (const struct net_timeout *timeout, uint32_t now)
 Calculate the remaining time to the timeout in whole seconds.
 
uint32_t net_timeout_evaluate (struct net_timeout *timeout, uint32_t now)
 Update state to reflect elapsed time and get new delay.
 

Detailed Description

Network timer with wrap around.

Timer that runs longer than about 49 days needs to calculate wraps.